Server : Apache/2.4.18 (Ubuntu) System : Linux canvaswebdesign 3.13.0-71-generic #114-Ubuntu SMP Tue Dec 1 02:34:22 UTC 2015 x86_64 User : oppastar ( 1041) PHP Version : 7.0.33-0ubuntu0.16.04.15 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, Directory : /var/www/andreassugianto.com/public_html/templates/andreas/html/com_content/form/ |
Upload File : |
<?php /** * @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * HTML Article View class for the Content component * * @package Joomla.Site * @subpackage com_content * @since 1.5 */ class ContentViewForm extends JViewLegacy { protected $form; protected $item; protected $return_page; protected $state; public function display($tpl = null) { // Initialise variables. $app = JFactory::getApplication(); $user = JFactory::getUser(); // Get model data. $this->state = $this->get('State'); $this->item = $this->get('Item'); $this->form = $this->get('Form'); $this->return_page = $this->get('ReturnPage'); if (empty($this->item->id)) { $authorised = $user->authorise('core.create', 'com_content') || (count($user->getAuthorisedCategories('com_content', 'core.create'))); } else { $authorised = $this->item->params->get('access-edit'); } if ($authorised !== true) { JError::raiseError(403, JText::_('JERROR_ALERTNOAUTHOR')); return false; } if (!empty($this->item) && isset($this->item->id)) { $this->item->images = json_decode($this->item->images); $this->item->urls = json_decode($this->item->urls); $tmp = new stdClass; $tmp->images = $this->item->images; $tmp->urls = $this->item->urls; $this->form->bind($tmp); } // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseWarning(500, implode("\n", $errors)); return false; } // Create a shortcut to the parameters. $params = &$this->state->params; //Escape strings for HTML output $this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx')); $this->params = $params; $this->user = $user; if ($params->get('enable_category') == 1) { $this->form->setFieldAttribute('catid', 'default', $params->get('catid', 1)); $this->form->setFieldAttribute('catid', 'readonly', 'true'); } $this->_prepareDocument(); parent::display($tpl); } /** * Prepares the document */ protected function _prepareDocument() { $app = JFactory::getApplication(); $menus = $app->getMenu(); $pathway = $app->getPathway(); $title = null; // Because the application sets a default page title, // we need to get it from the menu item itself $menu = $menus->getActive(); if ($menu) { $this->params->def('page_heading', $this->params->get('page_title', $menu->title)); } else { $this->params->def('page_heading', JText::_('COM_CONTENT_FORM_EDIT_ARTICLE')); } $title = $this->params->def('page_title', JText::_('COM_CONTENT_FORM_EDIT_ARTICLE')); if ($app->getCfg('sitename_pagetitles', 0) == 1) { $title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title); } elseif ($app->getCfg('sitename_pagetitles', 0) == 2) { $title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename')); } $this->document->setTitle($title); $pathway = $app->getPathWay(); $pathway->addItem($title, ''); if ($this->params->get('menu-meta_description')) { $this->document->setDescription($this->params->get('menu-meta_description')); } if ($this->params->get('menu-meta_keywords')) { $this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords')); } if ($this->params->get('robots')) { $this->document->setMetadata('robots', $this->params->get('robots')); } } }