PK R!]U: view.json.phpnu &1i * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * View to edit a template style. * * @since 1.6 */ class TemplatesViewStyle extends JViewLegacy { /** * The JObject (on success, false on failure) * * @var JObject */ protected $item; /** * The form object * * @var JForm */ protected $form; /** * The model state * * @var JObject */ protected $state; /** * Execute and display a template script. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise an Error object. * * @since 1.6 */ public function display($tpl = null) { try { $this->item = $this->get('Item'); } catch (Exception $e) { $app = JFactory::getApplication(); $app->enqueueMessage($e->getMessage(), 'error'); return false; } $paramsList = $this->item->getProperties(); unset($paramsList['xml']); $paramsList = json_encode($paramsList); return $paramsList; } } PK R!]vJ) view.html.phpnu &1i authorise('core.edit', 'com_slideshowck') || (count($user->getAuthorisedCategories('com_slideshowck', 'core.edit')))); if ($authorised !== true) { throw new Exception(\Joomla\CMS\Language\Text::_('JERROR_ALERTNOAUTHOR'), 403); return false; } // dislay the page title \Joomla\CMS\Toolbar\ToolbarHelper::title(\Joomla\CMS\Language\Text::_('COM_SLIDESHOWCK') . ' - ' . \Joomla\CMS\Language\Text::_('CK_EDITION'), 'logo_slideshowck_large.png'); // load the styles helper and the interface require_once JPATH_SITE . '/administrator/components/com_slideshowck/helpers/ckstyles.php'; require_once(JPATH_SITE . '/administrator/components/com_slideshowck/helpers/ckinterface.php'); $this->interface = new \Slideshowck\CKInterface(); $this->item = $this->get('Item'); $this->input->set('tmpl', 'component'); $this->input->set('layout', 'modal'); parent::display(); } /** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { SlideshowckHelper::loadCkbox(); \Joomla\CMS\Factory::getApplication()->input->set('hidemainmenu', true); $user = \Joomla\CMS\Factory::getUser(); $userId = $user->get('id'); $isNew = ($this->item->id == 0); $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $userId); $state = $this->get('State'); $canDo = SlideshowckHelper::getActions(); // For new records, check the create permission. if ($isNew && $user->authorise('core.create', 'com_slideshowck')) { \Joomla\CMS\Toolbar\ToolbarHelper::apply('style.apply'); \Joomla\CMS\Toolbar\ToolbarHelper::save('style.save'); // \Joomla\CMS\Toolbar\ToolbarHelper::save2new('page.save2new'); \Joomla\CMS\Toolbar\ToolbarHelper::cancel('style.cancel'); } else { // Can't save the record if it's checked out. if (!$checkedOut) { // Since it's an existing record, check the edit permission, or fall back to edit own if the owner. if ($canDo->get('core.edit') || ($canDo->get('core.edit.own') && $this->item->created_by == $userId)) { \Joomla\CMS\Toolbar\ToolbarHelper::apply('style.apply'); \Joomla\CMS\Toolbar\ToolbarHelper::save('style.save'); // \Joomla\CMS\Toolbar\ToolbarHelper::custom('style.restore', 'archive', 'archive', 'CK_RESTORE', false); // We can save this record, but check the create permission to see if we can return to make a new one. if ($canDo->get('core.create')) { // \Joomla\CMS\Toolbar\ToolbarHelper::save2new('page.save2new'); } } } // If checked out, we can still save if ($canDo->get('core.create')) { // \Joomla\CMS\Toolbar\ToolbarHelper::save2copy('page.save2copy'); } \Joomla\CMS\Toolbar\ToolbarHelper::cancel('style.cancel', 'JTOOLBAR_CLOSE'); } } } PK R!]!w w tmpl/edit.phpnu &1i * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html'); JHtml::_('behavior.formvalidator'); JHtml::_('behavior.keepalive'); JHtml::_('formbehavior.chosen', 'select'); $user = JFactory::getUser(); JFactory::getDocument()->addScriptDeclaration(" Joomla.submitbutton = function(task) { if (task == 'style.cancel' || document.formvalidator.isValid(document.getElementById('style-form'))) { Joomla.submitform(task, document.getElementById('style-form')); } }; "); ?>
PK R!]ld" " tmpl/edit_options.phpnu &1i * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Load chosen.css JHtml::_('formbehavior.chosen', 'select'); ?> 'collapse0')); $fieldSets = $this->form->getFieldsets('params'); $i = 0; foreach ($fieldSets as $name => $fieldSet) : $label = !empty($fieldSet->label) ? $fieldSet->label : 'COM_TEMPLATES_' . $name . '_FIELDSET_LABEL'; echo JHtml::_('bootstrap.addSlide', 'templatestyleOptions', JText::_($label), 'collapse' . ($i++)); if (isset($fieldSet->description) && trim($fieldSet->description)) : echo '' . $this->escape(JText::_($fieldSet->description)) . '
'; endif; ?> form->getFieldset($name) as $field) : ?>
' . \Joomla\CMS\Language\Text::_('SLIDESHOWCK_ONLY_PRO') . '';
echo $html
?>