Server IP : 195.201.23.43 / Your IP : 18.222.21.82 Web Server : Apache System : Linux webserver2.vercom.be 5.4.0-192-generic #212-Ubuntu SMP Fri Jul 5 09:47:39 UTC 2024 x86_64 User : kdecoratie ( 1041) PHP Version : 7.1.33-63+ubuntu20.04.1+deb.sury.org+1 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_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/kdecoratie/public_html/components/com_content/views/form/ |
Upload File : |
<?php /** * @package Joomla.Site * @subpackage com_content * * @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * HTML Article View class for the Content component * * @since 1.5 */ class ContentViewForm extends JViewLegacy { protected $form; protected $item; protected $return_page; protected $state; /** * Should we show a captcha form for the submission of the article? * * @var bool * @since 3.7.0 */ protected $captchaEnabled = false; /** * 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. */ public function display($tpl = null) { $user = JFactory::getUser(); $app = JFactory::getApplication(); // 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)) { $catid = $this->state->params->get('catid'); if ($this->state->params->get('enable_category') == 1 && $catid) { $authorised = $user->authorise('core.create', 'com_content.category.' . $catid); } else { $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) { $app->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'), 'error'); $app->setHeader('status', 403, true); return false; } $this->item->tags = new JHelperTags; if (!empty($this->item->id)) { $this->item->tags->getItemTags('com_content.article', $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; // Override global params with article specific params $this->params->merge($this->item->params); $this->user = $user; // Propose current language as default when creating new article if (empty($this->item->id) && JLanguageMultilang::isEnabled()) { $lang = JFactory::getLanguage()->getTag(); $this->form->setFieldAttribute('language', 'default', $lang); } $captchaSet = $params->get('captcha', JFactory::getApplication()->get('captcha', '0')); foreach (JPluginHelper::getPlugin('captcha') as $plugin) { if ($captchaSet === $plugin->name) { $this->captchaEnabled = true; break; } } $this->_prepareDocument(); parent::display($tpl); } /** * Prepares the document * * @return void */ protected function _prepareDocument() { $app = JFactory::getApplication(); $menus = $app->getMenu(); $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->get('sitename_pagetitles', 0) == 1) { $title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title); } elseif ($app->get('sitename_pagetitles', 0) == 2) { $title = JText::sprintf('JPAGETITLE', $title, $app->get('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')); } } }Private