Current Path :
/
home
/
develito
/
www
/
components
/
com_raforms
/
views
/
categories
/
Or
Select Your Path :
Upload File :
New :
File
Dir
/home/develito/www/components/com_raforms/views/categories/view.html.php
<?php /* ------------------------------------------------------------------------ # com_raforms - rootArea Forms # ------------------------------------------------------------------------ # author Markus Döhla # copyright Copyright (C) 2012 rootarea.de. All Rights Reserved. # @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL # @license - Please read policy about plugins development in administrator/components/com_raforms/license-plugins.txt carefully # @license - Additional EULA on www.rootarea.de DOES NOT apply to ANY lite packages # Websites: http://www.rootarea.de # Technical Support: Forum - http://www.rootarea.de/en/forum ------------------------------------------------------------------------- */ // No direct access defined('_JEXEC') or die; jimport('joomla.application.component.view'); class RAformsViewCategories extends JViewLegacy { protected $state = null; protected $item = null; protected $items = null; protected $pagination = null; public $_context = 'com_raform.categories'; function display($tpl = null) { $app = JFactory::getApplication(); $params = $app->getParams(); // Get view and set it if child categories are selected $this->formView = $app->getUserStateFromRequest($this->_context . '.form-view', 'form-view', 'fform'); $app->setUserState($this->_context . '.form-view', $this->formView); // Initialise variables $state = $this->get('State'); $items = $this->get('Items'); $parent = $this->get('Parent'); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseWarning(500, implode("\n", $errors)); return false; } if ($items === false) { return JError::raiseError(404, JText::_('JGLOBAL_CATEGORY_NOT_FOUND')); } if ($parent == false) { return JError::raiseError(404, JText::_('JGLOBAL_CATEGORY_NOT_FOUND')); } $params = &$state->params; $items = array($parent->id => $items); //Escape strings for HTML output $this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx')); $this->assign('maxLevelcat', $params->get('maxLevelcat', -1)); $this->assignRef('params', $params); $this->assignRef('parent', $parent); $this->assignRef('items', $items); $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->def('page_title', $menu->title)); } else { $this->params->def('page_heading', JText::_('COM_CONTACT_DEFAULT_PAGE_TITLE')); } $title = $this->params->get('page_title', ''); if (empty($title)) { $title = $app->getCfg('sitename'); } elseif ($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); 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')); } } }