Current Path :
/
home
/
develito
/
www
/
components
/
com_dpattachments
/
views
/
form
/
Or
Select Your Path :
Upload File :
New :
File
Dir
/home/develito/www/components/com_dpattachments/views/form/view.html.php
<?php /** * @package DPAttachments * @author Digital Peak http://www.digital-peak.com * @copyright Copyright (C) 2012 - 2020 Digital Peak. All rights reserved. * @license http://www.gnu.org/licenses/gpl.html GNU/GPL */ defined('_JEXEC') or die(); class DPAttachmentsViewForm extends JViewLegacy { protected $form; protected $item; protected $return_page; protected $state; public function display($tpl = null) { $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 = false; } else { $authorised = $this->item->params->get('access-edit'); } if ($authorised !== true) { JError::raiseError(403, JText::_('JERROR_ALERTNOAUTHOR')); return false; } $this->item->tags = new JHelperTags(); if (!empty($this->item->id)) { $this->item->tags->getItemTags('com_dpattachments.attachment.', $this->item->id); } // 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; $this->form->setFieldAttribute('tags', 'mode', 'nested'); $this->_prepareDocument(); parent::display($tpl); } 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_DPATTACHMENTS_FORM_EDIT_ATTACHMENT')); } $title = $this->params->def('page_title', JText::_('COM_DPATTACHMENTS_FORM_EDIT_ATTACHMENT')); if ($app->getCfg('sitename_pagetitles', 0) == 1) { $title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title); } else if ($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')); } } }