Файловый менеджер - Редактировать - /home/lmsyaran/public_html/administrator/components/com_notifly/views/template/view.html.php
Назад
<?php /** * @package Joomla.Administrator * @subpackage com_notifly * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * View to edit an template. * * @since 1.6 */ class NotiflyViewTemplate extends JViewLegacy { /** * The JForm object * * @var JForm */ protected $form; /** * The active item * * @var object */ protected $item; /** * The model state * * @var object */ protected $state; /** * The actions the user is authorised to perform * * @var JObject */ protected $canDo; /** * The sidebar markup * * @var string */ protected $sidebar; /** * 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) { if ($this->getLayout() == 'pagebreak') { return parent::display($tpl); } $this->form = $this->get('Form'); $this->item = $this->get('Item'); $this->state = $this->get('State'); $this->canDo = JHelperContent::getActions('com_notifly', 'template', $this->item->id); // Check for errors. if (count($errors = $this->get('Errors'))) { throw new Exception(implode("\n", $errors), 500); } // If we are forcing a language in modal (used for associations). if ($this->getLayout() === 'modal' && $forcedLanguage = JFactory::getApplication()->input->get('forcedLanguage', '', 'cmd')) { // Set the language field to the forcedLanguage and disable changing it. $this->form->setValue('language', null, $forcedLanguage); $this->form->setFieldAttribute('language', 'readonly', 'true'); // Only allow to select categories with All language or with the forced language. $this->form->setFieldAttribute('catid', 'language', '*,' . $forcedLanguage); // Only allow to select tags with All language or with the forced language. $this->form->setFieldAttribute('tags', 'language', '*,' . $forcedLanguage); } NotiflyHelper::addSubmenu('templates'); $this->addToolbar(); $this->sidebar = JHtmlSidebar::render(); return parent::display($tpl); } /** * Add the page title and toolbar. * * @return void * * @since 1.6 */ protected function addToolbar() { JFactory::getApplication()->input->set('hidemainmenu', true); $user = JFactory::getUser(); $userId = $user->id; $isNew = ($this->item->id == 0); $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $userId); // Built the actions for new and existing records. $canDo = $this->canDo; JToolbarHelper::title( JText::_('COM_NOTIFLY_PAGE_EDIT_TEMPLATE'), 'pencil-2 template-add' ); // For new records, check the create permission. if ($isNew && (count($user->getAuthorisedCategories('com_notifly', 'core.create')) > 0)) { JToolbarHelper::apply('template.apply'); JToolbarHelper::save('template.save'); JToolbarHelper::save2new('template.save2new'); JToolbarHelper::cancel('template.cancel'); } else { // Since it's an existing record, check the edit permission, or fall back to edit own if the owner. $itemEditable = $canDo->get('core.edit') || ($canDo->get('core.edit.own') && $this->item->created_by == $userId); // Can't save the record if it's checked out and editable if (!$checkedOut && $itemEditable) { JToolbarHelper::apply('template.apply'); JToolbarHelper::save('template.save'); // 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')) // { // JToolbarHelper::save2new('template.save2new'); // } } // If checked out, we can still save // if ($canDo->get('core.create')) // { // JToolbarHelper::save2copy('template.save2copy'); // } if (JComponentHelper::isEnabled('com_notifly') && $this->state->params->get('save_history', 0) && $itemEditable) { JToolbarHelper::versions('com_notifly.template', $this->item->id); } JToolbarHelper::cancel('template.cancel', 'JTOOLBAR_CLOSE'); } JToolbarHelper::divider(); JToolbarHelper::help('JHELP_CONTENT_TEMPLATE_MANAGER_EDIT'); } }
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка