first commit
This commit is contained in:
@@ -0,0 +1,107 @@
|
||||
<?php
|
||||
/**
|
||||
* @package quantummanager
|
||||
* @author Dmitry Tsymbal <cymbal@delo-design.ru>
|
||||
* @copyright Copyright © 2019 Delo Design & NorrNext. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see license.txt
|
||||
* @link https://www.norrnext.com
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Uri\Uri;
|
||||
|
||||
/**
|
||||
* Class JFormFieldQuantumbase
|
||||
*/
|
||||
class JFormFieldQuantumbase extends JFormField
|
||||
{
|
||||
|
||||
/**
|
||||
* @var array
|
||||
* @since version
|
||||
*/
|
||||
private $addLayouts = [];
|
||||
|
||||
|
||||
/**
|
||||
* JFormFieldQuantumbase constructor.
|
||||
*
|
||||
* @param null $form
|
||||
*/
|
||||
public function __construct($form = null)
|
||||
{
|
||||
JLoader::register('QuantummanagerHelper', JPATH_SITE . '/administrator/components/com_quantummanager/helpers/quantummanager.php');
|
||||
JLoader::register('QuantummanagerLibs', JPATH_SITE . '/administrator/components/com_quantummanager/helpers/quantumlibs.php');
|
||||
|
||||
parent::__construct($form);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function getLayoutData()
|
||||
{
|
||||
$scopes = QuantummanagerHelper::getAllScope();
|
||||
|
||||
if (empty($this->element))
|
||||
{
|
||||
$this->element = [
|
||||
'name' => '',
|
||||
'label' => ''
|
||||
];
|
||||
}
|
||||
|
||||
$urlFull = Uri::root(false);
|
||||
$urlBase = Uri::root(true);
|
||||
$urlRoot = $urlMedia = $urlFull;
|
||||
|
||||
if (substr($urlBase, -1) !== '/')
|
||||
{
|
||||
$urlBase .= '/';
|
||||
}
|
||||
|
||||
if (Factory::getApplication()->isClient('administrator'))
|
||||
{
|
||||
$urlFull .= 'administrator/';
|
||||
$urlBase .= 'administrator/';
|
||||
}
|
||||
|
||||
return array_merge(parent::getLayoutData(),
|
||||
[
|
||||
'cssClass' => $this->cssClass,
|
||||
'urlFull' => $urlFull,
|
||||
'urlBase' => $urlBase,
|
||||
'urlRoot' => $urlRoot,
|
||||
'urlMedia' => $urlMedia,
|
||||
'scopes' => $scopes,
|
||||
'isJoomla4' => QuantummanagerHelper::isJoomla4() ? '1' : '0',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Allow to override renderer include paths in child fields
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @since 3.5
|
||||
*/
|
||||
protected function getLayoutPaths()
|
||||
{
|
||||
return array_merge(parent::getLayoutPaths(), $this->addLayouts, [
|
||||
JPATH_ROOT . '/administrator/components/com_quantummanager/layouts/fields',
|
||||
JPATH_ROOT . '/layouts/joomla/form',
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
public function addCustomLayoutsPath($layouts)
|
||||
{
|
||||
$this->addLayouts = array_merge($this->addLayouts, $layouts);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
<?php
|
||||
/**
|
||||
* @package quantummanager
|
||||
* @author Dmitry Tsymbal <cymbal@delo-design.ru>
|
||||
* @copyright Copyright © 2019 Delo Design & NorrNext. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see license.txt
|
||||
* @link https://www.norrnext.com
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Filter\OutputFilter;
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Layout\FileLayout;
|
||||
|
||||
JLoader::register('JFormFieldQuantumbase', __DIR__ . DIRECTORY_SEPARATOR . 'quantumbase.php');
|
||||
|
||||
/**
|
||||
* Class JFormFieldQuantumcodemirror
|
||||
*/
|
||||
class JFormFieldQuantumcodemirror extends JFormField
|
||||
{
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'Quantumcodemirror';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $layout = 'quantumcodemirror';
|
||||
|
||||
|
||||
/**
|
||||
* Allow to override renderer include paths in child fields
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @since 3.5
|
||||
*/
|
||||
protected function getLayoutPaths()
|
||||
{
|
||||
return [
|
||||
JPATH_ROOT . '/administrator/components/com_quantummanager/layouts/fields',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function getLayoutData()
|
||||
{
|
||||
return array_merge(parent::getLayoutData(),
|
||||
[
|
||||
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public function getInput()
|
||||
{
|
||||
try {
|
||||
|
||||
$doc = Factory::getDocument();
|
||||
$this->__set('standalone', $this->getAttribute('standalone', true));
|
||||
|
||||
JLoader::register('QuantummanagerHelper', JPATH_SITE . '/administrator/components/com_quantummanager/helpers/quantummanager.php');
|
||||
QuantummanagerHelper::includeScriptHead();
|
||||
|
||||
HTMLHelper::_('stylesheet', 'com_quantummanager/main.css', [
|
||||
'version' => filemtime(__FILE__),
|
||||
'relative' => true
|
||||
]);
|
||||
|
||||
HTMLHelper::_('stylesheet', 'com_quantummanager/quantumcodemirror.css', [
|
||||
'version' => filemtime(__FILE__),
|
||||
'relative' => true
|
||||
]);
|
||||
|
||||
HTMLHelper::_('script', 'com_quantummanager/main.js', [
|
||||
'version' => filemtime(__FILE__),
|
||||
'relative' => true
|
||||
]);
|
||||
|
||||
|
||||
HTMLHelper::_('script', 'com_quantummanager/utils.js', [
|
||||
'version' => filemtime(__FILE__),
|
||||
'relative' => true
|
||||
]);
|
||||
|
||||
HTMLHelper::_('script', 'com_quantummanager/quantumcodemirror.js', [
|
||||
'version' => filemtime(__FILE__),
|
||||
'relative' => true
|
||||
]);
|
||||
|
||||
|
||||
$doc->addStyleSheet('/media/editors/codemirror/lib/codemirror.min.css');
|
||||
$doc->addStyleSheet('/media/editors/codemirror/theme/elegant.css');
|
||||
$doc->addScript('/media/editors/codemirror/lib/codemirror.min.js');
|
||||
$doc->addScript('/media/editors/codemirror/mode/javascript/javascript.min.js');
|
||||
|
||||
|
||||
$field = parent::getInput();
|
||||
|
||||
if($this->standalone)
|
||||
{
|
||||
$filemanager = new FileLayout( 'fieldstandalone', JPATH_ROOT . '/administrator/components/com_quantummanager/layouts');
|
||||
return $filemanager->render(['field' => $field]);
|
||||
}
|
||||
|
||||
return $field;
|
||||
}
|
||||
catch (Exception $e) {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,158 @@
|
||||
<?php
|
||||
/**
|
||||
* @package quantummanager
|
||||
* @author Dmitry Tsymbal <cymbal@delo-design.ru>
|
||||
* @copyright Copyright © 2019 Delo Design & NorrNext. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see license.txt
|
||||
* @link https://www.norrnext.com
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Component\ComponentHelper;
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Layout\FileLayout;
|
||||
|
||||
JLoader::register('JFormFieldQuantumbase', __DIR__ . DIRECTORY_SEPARATOR . 'quantumbase.php');
|
||||
|
||||
/**
|
||||
* Class JFormFieldQuantumCombine
|
||||
*/
|
||||
class JFormFieldQuantumCombine extends JFormFieldQuantumbase
|
||||
{
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'QuantumCombine';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $layout = 'quantumcombine';
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @since version
|
||||
*/
|
||||
public function getInput()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
QuantummanagerLibs::includeScriptHead();
|
||||
|
||||
$componentParams = ComponentHelper::getParams('com_quantummanager');
|
||||
|
||||
if (empty($this->fields))
|
||||
{
|
||||
$this->__set('fields', $this->getAttribute('fields', true));
|
||||
}
|
||||
|
||||
if (!empty($this->fields))
|
||||
{
|
||||
|
||||
|
||||
if (file_exists(JPATH_ROOT . '/media/com_quantummanager/css/' . $this->layout . '.css'))
|
||||
{
|
||||
HTMLHelper::_('stylesheet', 'com_quantummanager/' . $this->layout . '.css', [
|
||||
'version' => filemtime(__FILE__),
|
||||
'relative' => true
|
||||
]);
|
||||
}
|
||||
|
||||
if (file_exists(JPATH_ROOT . '/media/com_quantummanager/js/' . $this->layout . '.js'))
|
||||
{
|
||||
HTMLHelper::_('script', 'com_quantummanager/' . $this->layout . '.js', [
|
||||
'version' => filemtime(__FILE__),
|
||||
'relative' => true,
|
||||
'defer' => 'defer'
|
||||
]);
|
||||
}
|
||||
|
||||
JLoader::register('QuantummanagerHelper', JPATH_SITE . '/administrator/components/com_quantummanager/helpers/quantummanager.php');
|
||||
QuantummanagerHelper::loadLang();
|
||||
|
||||
QuantummanagerLibs::includes([
|
||||
'utils',
|
||||
'split'
|
||||
]);
|
||||
|
||||
HTMLHelper::_('script', 'com_quantummanager/combine.js', [
|
||||
'version' => filemtime(__FILE__),
|
||||
'relative' => true
|
||||
]);
|
||||
|
||||
$fields = json_decode($this->fields, JSON_OBJECT_AS_ARRAY);
|
||||
$htmlFields = [
|
||||
'top' => '',
|
||||
'container-top' => '',
|
||||
'left' => '',
|
||||
'center' => '',
|
||||
'right' => '',
|
||||
'container-bottom' => '',
|
||||
'bottom' => '',
|
||||
'container-bottom-fixed' => '',
|
||||
];
|
||||
|
||||
foreach ($fields as $field => $options)
|
||||
{
|
||||
$position = 'center';
|
||||
$classField = 'JFormField' . ucfirst($field);
|
||||
|
||||
JLoader::register($classField, JPATH_ROOT . '/administrator/components/com_quantummanager/fields/' . $field . '.php');
|
||||
|
||||
$optionsForField = $options;
|
||||
$optionsForField = array_merge($optionsForField, [
|
||||
'standalone' => false
|
||||
]);
|
||||
|
||||
$dataAttributes = array_map(static function ($value, $key) {
|
||||
return $key . '="' . $value . '"';
|
||||
}, array_values($optionsForField), array_keys($optionsForField));
|
||||
|
||||
|
||||
if (isset($optionsForField['position']))
|
||||
{
|
||||
$position = $optionsForField['position'];
|
||||
}
|
||||
|
||||
if (!isset($htmlFields[$position]))
|
||||
{
|
||||
$htmlFields[$position] = '';
|
||||
}
|
||||
|
||||
$fieldObject = new $classField;
|
||||
$fieldObject->setup(new SimpleXMLElement('<field name="" type="' . $field . '" ' . implode(' ', $dataAttributes) . ' />'), '');
|
||||
$htmlFields[$position] .= $fieldObject->getInput();
|
||||
|
||||
}
|
||||
|
||||
if ((int) $componentParams->get('review', 1))
|
||||
{
|
||||
$htmlFields['container-bottom-fixed'] .= (new FileLayout('jedreview', JPATH_ROOT . '/administrator/components/com_quantummanager/layouts'))->render();
|
||||
}
|
||||
|
||||
|
||||
$filemanager = new FileLayout($this->layout, JPATH_ROOT . '/administrator/components/com_quantummanager/layouts');
|
||||
$filemanager->addIncludePaths($this->getLayoutPaths());
|
||||
|
||||
return $filemanager->render(array_merge($this->getLayoutData(), $htmlFields));
|
||||
|
||||
}
|
||||
|
||||
return '';
|
||||
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
echo $e->getMessage();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
/**
|
||||
* @package quantummanager
|
||||
* @author Dmitry Tsymbal <cymbal@delo-design.ru>
|
||||
* @copyright Copyright © 2019 Delo Design & NorrNext. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see license.txt
|
||||
* @link https://www.norrnext.com
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Filter\OutputFilter;
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Layout\FileLayout;
|
||||
use Joomla\CMS\Uri\Uri;
|
||||
|
||||
JLoader::register('JFormFieldQuantumtreecatalogs', JPATH_ROOT . DIRECTORY_SEPARATOR . implode(DIRECTORY_SEPARATOR, ['administrator', 'components', 'com_quantummanager', 'fields', 'quantumtreecatalogs.php']));
|
||||
|
||||
JFormHelper::loadFieldClass('text');
|
||||
|
||||
/**
|
||||
* Class JFormFieldQuantumconfigpath
|
||||
*/
|
||||
class JFormFieldQuantumconfigpath extends JFormFieldText
|
||||
{
|
||||
|
||||
/**
|
||||
* @var string
|
||||
* @since version
|
||||
*/
|
||||
public $type = 'QuantumConfigpath';
|
||||
|
||||
/**
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @since version
|
||||
*/
|
||||
public function getInput()
|
||||
{
|
||||
|
||||
HTMLHelper::_('stylesheet', 'com_quantummanager/configfields.css', [
|
||||
'version' => filemtime(__FILE__),
|
||||
'relative' => true
|
||||
]);
|
||||
|
||||
$this->__set('prefix', $this->getAttribute('prefix', Uri::root()));
|
||||
|
||||
$html = parent::getInput();
|
||||
$html = "<div class='quantumconfig-quantumconfigpath-inputs'><span>" . $this->prefix . "</span>" . $html . "</div>";
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
/**
|
||||
* @package quantummanager
|
||||
* @author Dmitry Tsymbal <cymbal@delo-design.ru>
|
||||
* @copyright Copyright © 2019 Delo Design & NorrNext. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see license.txt
|
||||
* @link https://www.norrnext.com
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Filter\OutputFilter;
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Layout\FileLayout;
|
||||
use Joomla\CMS\Uri\Uri;
|
||||
|
||||
JFormHelper::loadFieldClass('text');
|
||||
|
||||
/**
|
||||
* Class JFormFieldQuantumconfigscopetitle
|
||||
*/
|
||||
class JFormFieldQuantumconfigscopetitle extends JFormFieldText
|
||||
{
|
||||
|
||||
/**
|
||||
* @var string
|
||||
* @since version
|
||||
*/
|
||||
public $type = 'QuantumconfigScopeTitle';
|
||||
|
||||
/**
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @since version
|
||||
*/
|
||||
public function getInput()
|
||||
{
|
||||
$id = $this->form->getData()->get('id');
|
||||
$this->value = Text::_('COM_QUANTUMMANAGER_SCOPE_' . mb_strtoupper($id));
|
||||
return parent::getInput();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
<?php
|
||||
/**
|
||||
* @package quantummanager
|
||||
* @author Dmitry Tsymbal <cymbal@delo-design.ru>
|
||||
* @copyright Copyright © 2019 Delo Design & NorrNext. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see license.txt
|
||||
* @link https://www.norrnext.com
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Component\ComponentHelper;
|
||||
use Joomla\CMS\Filter\OutputFilter;
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Layout\FileLayout;
|
||||
|
||||
JLoader::register('JFormFieldQuantumbase', __DIR__ . DIRECTORY_SEPARATOR . 'quantumbase.php');
|
||||
|
||||
/**
|
||||
* Class JFormFieldQuantumcropperjs
|
||||
*/
|
||||
class JFormFieldQuantumcropperjs extends JFormField
|
||||
{
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'Quantumcropperjs';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $layout = 'quantumcropperjs';
|
||||
|
||||
|
||||
/**
|
||||
* Allow to override renderer include paths in child fields
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @since 3.5
|
||||
*/
|
||||
protected function getLayoutPaths()
|
||||
{
|
||||
return array_merge(parent::getLayoutPaths(), [
|
||||
JPATH_ROOT . '/administrator/components/com_quantummanager/layouts/fields',
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function getLayoutData()
|
||||
{
|
||||
JLoader::register('QuantummanagerHelperImage', JPATH_ROOT . '/administrator/components/com_quantummanager/helpers/image.php');
|
||||
$driver = (new QuantummanagerHelperImage)->getNameDriver();
|
||||
|
||||
$values_default = [
|
||||
'compression' => QuantummanagerHelper::getParamsComponentValue('compression', 90),
|
||||
'sharpen' => QuantummanagerHelper::getParamsComponentValue('sharpen', 0),
|
||||
'brightness' => QuantummanagerHelper::getParamsComponentValue('brightness', 0),
|
||||
'blur' => QuantummanagerHelper::getParamsComponentValue('blur', 0),
|
||||
];
|
||||
|
||||
return array_merge(parent::getLayoutData(),
|
||||
[
|
||||
'paramsComponents' => ComponentHelper::getParams('com_quantummanager'),
|
||||
'cssClass' => $this->cssClass,
|
||||
'driver' => $driver,
|
||||
'values_default' => $values_default
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public function getInput()
|
||||
{
|
||||
try {
|
||||
|
||||
|
||||
$this->__set('standalone', $this->getAttribute('standalone', true));
|
||||
$this->__set('cssClass', $this->getAttribute('cssClass', ''));
|
||||
|
||||
JLoader::register('QuantummanagerHelper', JPATH_SITE . '/administrator/components/com_quantummanager/helpers/quantummanager.php');
|
||||
JLoader::register('QuantummanagerLibs', JPATH_SITE . '/administrator/components/com_quantummanager/helpers/quantumlibs.php');
|
||||
|
||||
QuantummanagerLibs::includeScriptHead();
|
||||
QuantummanagerLibs::includes([
|
||||
'core',
|
||||
'utils',
|
||||
'imageEditor',
|
||||
|
||||
]);
|
||||
|
||||
|
||||
HTMLHelper::_('stylesheet', 'com_quantummanager/quantumcropperjs.css', [
|
||||
'version' => filemtime(__FILE__),
|
||||
'relative' => true
|
||||
]);
|
||||
|
||||
HTMLHelper::_('script', 'com_quantummanager/quantumcropperjs.js', [
|
||||
'version' => filemtime(__FILE__),
|
||||
'relative' => true
|
||||
]);
|
||||
|
||||
|
||||
$field = parent::getInput();
|
||||
|
||||
if($this->standalone)
|
||||
{
|
||||
$filemanager = new FileLayout( 'fieldstandalone', JPATH_ROOT . '/administrator/components/com_quantummanager/layouts');
|
||||
return $filemanager->render(['field' => $field]);
|
||||
}
|
||||
|
||||
return $field;
|
||||
}
|
||||
catch (Exception $e) {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
<?php
|
||||
/**
|
||||
* @package quantummanager
|
||||
* @author Dmitry Tsymbal <cymbal@delo-design.ru>
|
||||
* @copyright Copyright © 2019 Delo Design & NorrNext. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see license.txt
|
||||
* @link https://www.norrnext.com
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Filter\OutputFilter;
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Layout\FileLayout;
|
||||
|
||||
JLoader::register('JFormFieldQuantumbase', __DIR__ . DIRECTORY_SEPARATOR . 'quantumbase.php');
|
||||
|
||||
/**
|
||||
* Class JFormFieldQuantumpexels
|
||||
*/
|
||||
class JFormFieldQuantumpexels extends JFormField
|
||||
{
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'QuantumPexels';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $layout = 'quantumpexels';
|
||||
|
||||
|
||||
/**
|
||||
* Allow to override renderer include paths in child fields
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @since 3.5
|
||||
*/
|
||||
protected function getLayoutPaths()
|
||||
{
|
||||
return array_merge(parent::getLayoutPaths(), [
|
||||
JPATH_ROOT . '/administrator/components/com_quantummanager/layouts/fields',
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function getLayoutData()
|
||||
{
|
||||
return array_merge(parent::getLayoutData(),
|
||||
[
|
||||
'cssClass' => $this->cssClass,
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public function getInput()
|
||||
{
|
||||
try {
|
||||
|
||||
$this->__set('standalone', $this->getAttribute('standalone', true));
|
||||
$this->__set('cssClass', $this->getAttribute('cssClass', ''));
|
||||
|
||||
JLoader::register('QuantummanagerHelper', JPATH_SITE . '/administrator/components/com_quantummanager/helpers/quantummanager.php');
|
||||
JLoader::register('QuantummanagerLibs', JPATH_SITE . '/administrator/components/com_quantummanager/helpers/quantumlibs.php');
|
||||
|
||||
QuantummanagerLibs::includeScriptHead();
|
||||
QuantummanagerLibs::includes([
|
||||
'core',
|
||||
'utils',
|
||||
'dynamicGrid',
|
||||
]);
|
||||
|
||||
|
||||
HTMLHelper::_('stylesheet', 'com_quantummanager/quantumpexels.css', [
|
||||
'version' => filemtime(__FILE__),
|
||||
'relative' => true
|
||||
]);
|
||||
|
||||
HTMLHelper::_('script', 'com_quantummanager/quantumpexels.js', [
|
||||
'version' => filemtime(__FILE__),
|
||||
'relative' => true
|
||||
]);
|
||||
|
||||
|
||||
$field = parent::getInput();
|
||||
|
||||
if($this->standalone)
|
||||
{
|
||||
$filemanager = new FileLayout( 'fieldstandalone', JPATH_ROOT . '/administrator/components/com_quantummanager/layouts');
|
||||
return $filemanager->render(['field' => $field]);
|
||||
}
|
||||
|
||||
return $field;
|
||||
}
|
||||
catch (Exception $e) {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
<?php
|
||||
/**
|
||||
* @package quantummanager
|
||||
* @author Dmitry Tsymbal <cymbal@delo-design.ru>
|
||||
* @copyright Copyright © 2019 Delo Design & NorrNext. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see license.txt
|
||||
* @link https://www.norrnext.com
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Filter\OutputFilter;
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Layout\FileLayout;
|
||||
|
||||
JLoader::register('JFormFieldQuantumbase', __DIR__ . DIRECTORY_SEPARATOR . 'quantumbase.php');
|
||||
|
||||
/**
|
||||
* Class JFormFieldQuantumpixabay
|
||||
*/
|
||||
class JFormFieldQuantumpixabay extends JFormField
|
||||
{
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'QuantumPixabay';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $layout = 'quantumpixabay';
|
||||
|
||||
|
||||
/**
|
||||
* Allow to override renderer include paths in child fields
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @since 3.5
|
||||
*/
|
||||
protected function getLayoutPaths()
|
||||
{
|
||||
return array_merge(parent::getLayoutPaths(), [
|
||||
JPATH_ROOT . '/administrator/components/com_quantummanager/layouts/fields',
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function getLayoutData()
|
||||
{
|
||||
return array_merge(parent::getLayoutData(),
|
||||
[
|
||||
'cssClass' => $this->cssClass,
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public function getInput()
|
||||
{
|
||||
try {
|
||||
|
||||
$this->__set('standalone', $this->getAttribute('standalone', true));
|
||||
$this->__set('cssClass', $this->getAttribute('cssClass', ''));
|
||||
|
||||
JLoader::register('QuantummanagerHelper', JPATH_SITE . '/administrator/components/com_quantummanager/helpers/quantummanager.php');
|
||||
JLoader::register('QuantummanagerLibs', JPATH_SITE . '/administrator/components/com_quantummanager/helpers/quantumlibs.php');
|
||||
|
||||
QuantummanagerLibs::includeScriptHead();
|
||||
QuantummanagerLibs::includes([
|
||||
'core',
|
||||
'utils',
|
||||
'dynamicGrid',
|
||||
]);
|
||||
|
||||
|
||||
HTMLHelper::_('stylesheet', 'com_quantummanager/quantumpixabay.css', [
|
||||
'version' => filemtime(__FILE__),
|
||||
'relative' => true
|
||||
]);
|
||||
|
||||
HTMLHelper::_('script', 'com_quantummanager/quantumpixabay.js', [
|
||||
'version' => filemtime(__FILE__),
|
||||
'relative' => true
|
||||
]);
|
||||
|
||||
$field = parent::getInput();
|
||||
|
||||
if($this->standalone)
|
||||
{
|
||||
$filemanager = new FileLayout( 'fieldstandalone', JPATH_ROOT . '/administrator/components/com_quantummanager/layouts');
|
||||
return $filemanager->render(['field' => $field]);
|
||||
}
|
||||
|
||||
return $field;
|
||||
}
|
||||
catch (Exception $e) {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* @package quantummanager
|
||||
*
|
||||
* @author Cymbal <cymbal@delo-design.ru>
|
||||
* @copyright Copyright (C) 2019 "Delo Design". All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
* @link https://delo-design.ru
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
@@ -0,0 +1,111 @@
|
||||
<?php
|
||||
/**
|
||||
* @package quantummanager
|
||||
* @author Dmitry Tsymbal <cymbal@delo-design.ru>
|
||||
* @copyright Copyright © 2019 Delo Design & NorrNext. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see license.txt
|
||||
* @link https://www.norrnext.com
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Filter\OutputFilter;
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Layout\FileLayout;
|
||||
|
||||
JLoader::register('JFormFieldQuantumbase', __DIR__ . DIRECTORY_SEPARATOR . 'quantumbase.php');
|
||||
|
||||
/**
|
||||
* Class JFormFieldQuantumtoolbar
|
||||
*/
|
||||
class JFormFieldQuantumtoolbar extends JFormField
|
||||
{
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'QuantumToolbar';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $layout = 'quantumtoolbar';
|
||||
|
||||
|
||||
/**
|
||||
* Allow to override renderer include paths in child fields
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @since 3.5
|
||||
*/
|
||||
protected function getLayoutPaths()
|
||||
{
|
||||
return array_merge(parent::getLayoutPaths(), [
|
||||
JPATH_ROOT . '/administrator/components/com_quantummanager/layouts/fields',
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function getLayoutData()
|
||||
{
|
||||
return array_merge(parent::getLayoutData(),
|
||||
[
|
||||
'buttons' => explode(',', $this->buttons),
|
||||
'buttonsBun' => explode(',', $this->buttonsBun),
|
||||
'cssClass' => $this->cssClass,
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public function getInput()
|
||||
{
|
||||
try {
|
||||
|
||||
$this->__set('standalone', $this->getAttribute('standalone', true));
|
||||
$this->__set('buttons', $this->getAttribute('buttons', 'all'));
|
||||
$this->__set('buttonsBun', $this->getAttribute('buttonsBun', ','));
|
||||
$this->__set('cssClass', $this->getAttribute('cssClass', ''));
|
||||
|
||||
JLoader::register('QuantummanagerHelper', JPATH_SITE . '/administrator/components/com_quantummanager/helpers/quantummanager.php');
|
||||
JLoader::register('QuantummanagerLibs', JPATH_SITE . '/administrator/components/com_quantummanager/helpers/quantumlibs.php');
|
||||
|
||||
QuantummanagerLibs::includeScriptHead();
|
||||
QuantummanagerLibs::includes([
|
||||
'core',
|
||||
'utils',
|
||||
]);
|
||||
|
||||
|
||||
HTMLHelper::_('stylesheet', 'com_quantummanager/quantumtoolbar.css', [
|
||||
'version' => filemtime(__FILE__),
|
||||
'relative' => true
|
||||
]);
|
||||
|
||||
HTMLHelper::_('script', 'com_quantummanager/quantumtoolbar.js', [
|
||||
'version' => filemtime(__FILE__),
|
||||
'relative' => true
|
||||
]);
|
||||
|
||||
$field = parent::getInput();
|
||||
|
||||
if($this->standalone)
|
||||
{
|
||||
$filemanager = new FileLayout( 'fieldstandalone', JPATH_ROOT . '/administrator/components/com_quantummanager/layouts');
|
||||
return $filemanager->render(['field' => $field]);
|
||||
}
|
||||
|
||||
return $field;
|
||||
}
|
||||
catch (Exception $e) {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
<?php
|
||||
/**
|
||||
* @package quantummanager
|
||||
* @author Dmitry Tsymbal <cymbal@delo-design.ru>
|
||||
* @copyright Copyright © 2019 Delo Design & NorrNext. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see license.txt
|
||||
* @link https://www.norrnext.com
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Layout\FileLayout;
|
||||
use Joomla\CMS\Uri\Uri;
|
||||
|
||||
JLoader::register('JFormFieldQuantumbase', __DIR__ . DIRECTORY_SEPARATOR . 'quantumbase.php');
|
||||
|
||||
/**
|
||||
* Class JFormFieldQuantumtreecatalogs
|
||||
*/
|
||||
class JFormFieldQuantumtreecatalogs extends JFormField
|
||||
{
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'QuantumTreeCatalogs';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $layout = 'quantumtreecatalogs';
|
||||
|
||||
|
||||
/**
|
||||
* Allow to override renderer include paths in child fields
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @since 3.5
|
||||
*/
|
||||
protected function getLayoutPaths()
|
||||
{
|
||||
$path = JPATH_ROOT . '/administrator/components/com_quantummanager/layouts/fields';
|
||||
|
||||
if($this->standalone)
|
||||
{
|
||||
if(file_exists($path . '/single/' . $this->layout . '.php'))
|
||||
{
|
||||
$path .= '/single';
|
||||
}
|
||||
}
|
||||
|
||||
return array_merge(parent::getLayoutPaths(), [
|
||||
$path,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function getLayoutData()
|
||||
{
|
||||
return array_merge(parent::getLayoutData(),
|
||||
[
|
||||
'urlFull' => Uri::root(false),
|
||||
'urlBase' => Uri::root(true),
|
||||
'directory' => $this->directory,
|
||||
'cssClass' => $this->cssClass,
|
||||
'scope' => $this->scope,
|
||||
'other' => '',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public function getInput()
|
||||
{
|
||||
try {
|
||||
|
||||
$this->__set('standalone', $this->getAttribute('standalone', true));
|
||||
$this->__set('cssClass', $this->getAttribute('cssClass', ''));
|
||||
$this->directory = $this->getAttribute('directory', 'root');
|
||||
|
||||
JLoader::register('QuantummanagerHelper', JPATH_SITE . '/administrator/components/com_quantummanager/helpers/quantummanager.php');
|
||||
JLoader::register('QuantummanagerLibs', JPATH_SITE . '/administrator/components/com_quantummanager/helpers/quantumlibs.php');
|
||||
|
||||
QuantummanagerLibs::includeScriptHead();
|
||||
QuantummanagerLibs::includes([
|
||||
'core',
|
||||
'utils',
|
||||
'alert',
|
||||
]);
|
||||
|
||||
|
||||
HTMLHelper::_('stylesheet', 'com_quantummanager/quantumtreecatalogs.css', [
|
||||
'version' => filemtime(__FILE__),
|
||||
'relative' => true
|
||||
]);
|
||||
|
||||
HTMLHelper::_('script', 'com_quantummanager/quantumtreecatalogs.js', [
|
||||
'version' => filemtime(__FILE__),
|
||||
'relative' => true
|
||||
]);
|
||||
|
||||
$field = parent::getInput();
|
||||
|
||||
if($this->standalone)
|
||||
{
|
||||
$filemanager = new FileLayout( 'fieldstandalone', JPATH_ROOT . '/administrator/components/com_quantummanager/layouts');
|
||||
return $filemanager->render(array_merge($this->getLayoutData(), ['field' => $field]));
|
||||
}
|
||||
|
||||
return $field;
|
||||
}
|
||||
catch (Exception $e) {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
<?php
|
||||
/**
|
||||
* @package quantummanager
|
||||
* @author Dmitry Tsymbal <cymbal@delo-design.ru>
|
||||
* @copyright Copyright © 2019 Delo Design & NorrNext. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see license.txt
|
||||
* @link https://www.norrnext.com
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Filter\OutputFilter;
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Layout\FileLayout;
|
||||
|
||||
JLoader::register('JFormFieldQuantumbase', __DIR__ . DIRECTORY_SEPARATOR . 'quantumbase.php');
|
||||
|
||||
/**
|
||||
* Class JFormFieldQuantumunsplash
|
||||
*/
|
||||
class JFormFieldQuantumunsplash extends JFormField
|
||||
{
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'QuantumUnsplash';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $layout = 'quantumunsplash';
|
||||
|
||||
|
||||
/**
|
||||
* Allow to override renderer include paths in child fields
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @since 3.5
|
||||
*/
|
||||
protected function getLayoutPaths()
|
||||
{
|
||||
return array_merge(parent::getLayoutPaths(), [
|
||||
JPATH_ROOT . '/administrator/components/com_quantummanager/layouts/fields',
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function getLayoutData()
|
||||
{
|
||||
return array_merge(parent::getLayoutData(),
|
||||
[
|
||||
'cssClass' => $this->cssClass,
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public function getInput()
|
||||
{
|
||||
try {
|
||||
|
||||
$this->__set('standalone', $this->getAttribute('standalone', true));
|
||||
$this->__set('cssClass', $this->getAttribute('cssClass', ''));
|
||||
|
||||
JLoader::register('QuantummanagerHelper', JPATH_SITE . '/administrator/components/com_quantummanager/helpers/quantummanager.php');
|
||||
JLoader::register('QuantummanagerLibs', JPATH_SITE . '/administrator/components/com_quantummanager/helpers/quantumlibs.php');
|
||||
|
||||
QuantummanagerLibs::includeScriptHead();
|
||||
QuantummanagerLibs::includes([
|
||||
'core',
|
||||
'utils',
|
||||
'dynamicGrid',
|
||||
]);
|
||||
|
||||
|
||||
HTMLHelper::_('stylesheet', 'com_quantummanager/quantumunsplash.css', [
|
||||
'version' => filemtime(__FILE__),
|
||||
'relative' => true
|
||||
]);
|
||||
|
||||
HTMLHelper::_('script', 'com_quantummanager/quantumunsplash.js', [
|
||||
'version' => filemtime(__FILE__),
|
||||
'relative' => true
|
||||
]);
|
||||
|
||||
|
||||
$field = parent::getInput();
|
||||
|
||||
if($this->standalone)
|
||||
{
|
||||
$filemanager = new FileLayout( 'fieldstandalone', JPATH_ROOT . '/administrator/components/com_quantummanager/layouts');
|
||||
return $filemanager->render(['field' => $field]);
|
||||
}
|
||||
|
||||
return $field;
|
||||
}
|
||||
catch (Exception $e) {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
<?php
|
||||
/**
|
||||
* @package quantummanager
|
||||
* @author Dmitry Tsymbal <cymbal@delo-design.ru>
|
||||
* @copyright Copyright © 2019 Delo Design & NorrNext. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see license.txt
|
||||
* @link https://www.norrnext.com
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Layout\FileLayout;
|
||||
|
||||
JLoader::register('JFormFieldQuantumbase', __DIR__ . DIRECTORY_SEPARATOR . 'quantumbase.php');
|
||||
|
||||
/**
|
||||
* Class JFormFieldQuantumUpload
|
||||
*/
|
||||
class JFormFieldQuantumupload extends JFormFieldQuantumbase
|
||||
{
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'QuantumUpload';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
* @since version
|
||||
*/
|
||||
protected $layout = 'quantumupload';
|
||||
|
||||
/**
|
||||
* Allow to override renderer include paths in child fields
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @since 3.5
|
||||
*/
|
||||
protected function getLayoutPaths()
|
||||
{
|
||||
$renderer = new FileLayout('default');
|
||||
$renderer->getDefaultIncludePaths();
|
||||
|
||||
return array_merge(parent::getLayoutPaths(), [
|
||||
JPATH_ROOT . '/administrator/components/com_quantummanager/layouts/fields'
|
||||
], $renderer->getDefaultIncludePaths());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function getLayoutData()
|
||||
{
|
||||
|
||||
return array_merge(parent::getLayoutData(),
|
||||
[
|
||||
'scope' => $this->scope,
|
||||
'directory' => $this->directory,
|
||||
'dropAreaHidden' => $this->dropAreaHidden,
|
||||
'maxsize' => $this->maxsize,
|
||||
'maxsizeServer' => $this->maxsizeServer,
|
||||
'cssClass' => $this->cssClass,
|
||||
'other' => '',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
public function getInput()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
JLoader::register('QuantummanagerHelper', JPATH_SITE . '/administrator/components/com_quantummanager/helpers/quantummanager.php');
|
||||
JLoader::register('QuantummanagerLibs', JPATH_SITE . '/administrator/components/com_quantummanager/helpers/quantumlibs.php');
|
||||
|
||||
$this->__set('standalone', $this->getAttribute('standalone', true));
|
||||
$this->__set('cssClass', $this->getAttribute('cssClass', ''));
|
||||
$this->__set('maxsize', $this->getAttribute('maxsize', QuantummanagerHelper::getParamsComponentValue('maxsize', 2)));
|
||||
$this->__set('maxsizeServer', QuantummanagerHelper::fileUploadMaxSize());
|
||||
$this->directory = isset($this->directory) ? $this->directory : $this->getAttribute('directory', 'images');
|
||||
$this->scope = isset($this->scope) ? $this->scope : $this->getAttribute('scope', 'images');
|
||||
$this->dropAreaHidden = isset($this->dropAreaHidden) ? $this->dropAreaHidden : $this->getAttribute('dropAreaHidden', QuantummanagerHelper::getParamsComponentValue('dropareahidden', 0));
|
||||
|
||||
QuantummanagerHelper::loadLang();
|
||||
QuantummanagerLibs::includeScriptHead();
|
||||
QuantummanagerLibs::includes([
|
||||
'core',
|
||||
'utils',
|
||||
]);
|
||||
|
||||
|
||||
HTMLHelper::_('stylesheet', 'com_quantummanager/quantumupload.css', [
|
||||
'version' => filemtime(__FILE__),
|
||||
'relative' => true
|
||||
]);
|
||||
|
||||
HTMLHelper::_('script', 'com_quantummanager/quantumupload.js', [
|
||||
'version' => filemtime(__FILE__),
|
||||
'relative' => true
|
||||
]);
|
||||
|
||||
$field = parent::getInput();
|
||||
|
||||
if ($this->standalone)
|
||||
{
|
||||
$filemanager = new FileLayout('fieldstandalone', JPATH_ROOT . '/administrator/components/com_quantummanager/layouts');
|
||||
|
||||
return $filemanager->render(array_merge($this->getLayoutData(), ['field' => $field]));
|
||||
}
|
||||
|
||||
return $field;
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
echo $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
<?php
|
||||
/**
|
||||
* @package quantummanager
|
||||
* @author Dmitry Tsymbal <cymbal@delo-design.ru>
|
||||
* @copyright Copyright © 2019 Delo Design & NorrNext. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see license.txt
|
||||
* @link https://www.norrnext.com
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Layout\FileLayout;
|
||||
|
||||
JLoader::register('JFormFieldQuantumbase', __DIR__ . DIRECTORY_SEPARATOR . 'quantumbase.php');
|
||||
|
||||
/**
|
||||
* Class JFormFieldQuantumviewfiles
|
||||
*/
|
||||
class JFormFieldQuantumviewfiles extends JFormField
|
||||
{
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'QuantumViewfiles';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $layout = 'quantumviewfiles';
|
||||
|
||||
|
||||
public function __construct($form = null)
|
||||
{
|
||||
JLoader::register('QuantummanagerHelper', JPATH_SITE . '/administrator/components/com_quantummanager/helpers/quantummanager.php');
|
||||
JLoader::register('QuantummanagerLibs', JPATH_SITE . '/administrator/components/com_quantummanager/helpers/quantumlibs.php');
|
||||
parent::__construct($form);
|
||||
}
|
||||
|
||||
/**
|
||||
* Allow to override renderer include paths in child fields
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @since 3.5
|
||||
*/
|
||||
protected function getLayoutPaths()
|
||||
{
|
||||
return array_merge(parent::getLayoutPaths(), [
|
||||
JPATH_ROOT . '/administrator/components/com_quantummanager/layouts/fields',
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function getLayoutData()
|
||||
{
|
||||
|
||||
return array_merge(parent::getLayoutData(),
|
||||
[
|
||||
'directory' => $this->directory,
|
||||
'onlyfiles' => $this->onlyfiles,
|
||||
'metafile' => $this->metafile,
|
||||
'watermark' => $this->watermark,
|
||||
'help' => $this->help,
|
||||
'folderdblclick' => $this->folderdblclick,
|
||||
'previewsfolder' => $this->previewsfolder,
|
||||
'previewsfolderopen' => $this->previewsfolderopen,
|
||||
'previewslist' => $this->previewslist,
|
||||
'hash' => md5(QuantummanagerHelper::preparePath($this->directory)),
|
||||
'cssClass' => $this->cssClass,
|
||||
'quantumVersion' => QuantummanagerHelper::getVersion(),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @since version
|
||||
*/
|
||||
public function getInput()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
$this->__set('standalone', $this->getAttribute('standalone', true));
|
||||
$this->__set('cssClass', $this->getAttribute('cssClass', ''));
|
||||
$this->__set('metafile', $this->getAttribute('metafile', '1'));
|
||||
$this->__set('watermark', $this->getAttribute('watermark', '0'));
|
||||
$this->__set('folderdblclick', $this->getAttribute('folderdblclick', QuantummanagerHelper::getParamsComponentValue('folderdblclick', '0')));
|
||||
$this->__set('help', $this->getAttribute('help', '1'));
|
||||
$this->__set('previewsfolder', $this->getAttribute('previewsfolderopen', QuantummanagerHelper::getParamsComponentValue('previewsfolder', '1')));
|
||||
$this->__set('previewsfolderopen', $this->getAttribute('previewsfolderopen', QuantummanagerHelper::getParamsComponentValue('previewsfolderopen', '1')));
|
||||
$this->__set('previewslist', $this->getAttribute('previewslist', QuantummanagerHelper::getParamsComponentValue('previewslist', [])));
|
||||
$this->directory = $this->getAttribute('directory', 'images');
|
||||
$this->onlyfiles = $this->getAttribute('onlyfiles', '0');
|
||||
|
||||
QuantummanagerLibs::includeScriptHead();
|
||||
QuantummanagerLibs::includes([
|
||||
'core',
|
||||
'utils',
|
||||
'alert',
|
||||
'contextmenu',
|
||||
'clipboard',
|
||||
'notify',
|
||||
'lazyload',
|
||||
'dragSelect',
|
||||
]);
|
||||
|
||||
|
||||
HTMLHelper::_('stylesheet', 'com_quantummanager/quantumviewfiles.css', [
|
||||
'version' => filemtime(__FILE__),
|
||||
'relative' => true
|
||||
]);
|
||||
|
||||
HTMLHelper::_('script', 'com_quantummanager/quantumviewfiles.js', [
|
||||
'version' => filemtime(__FILE__),
|
||||
'relative' => true
|
||||
]);
|
||||
|
||||
|
||||
$field = parent::getInput();
|
||||
|
||||
if ($this->standalone)
|
||||
{
|
||||
$filemanager = new FileLayout('fieldstandalone', JPATH_ROOT . '/administrator/components/com_quantummanager/layouts');
|
||||
|
||||
return $filemanager->render(['field' => $field]);
|
||||
}
|
||||
|
||||
return $field;
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
echo $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user