Current Path :
/
home
/
develito
/
httpdocs
/
components
/
com_abook-
/
views
/
tags
/
Or
Select Your Path :
Upload File :
New :
File
Dir
/home/develito/httpdocs/components/com_abook-/views/tags/view.html.php
<?php // No direct access defined('_JEXEC') or die; jimport('joomla.application.component.view'); jimport('joomla.mail.helper'); class AbookViewTags extends JViewLegacy { protected $state; protected $items; function display($tpl = null) { $app = JFactory::getApplication(); //$params = $app->getParams(); // Get some data from the models $state = $this->get('State'); $items = $this->get('Items'); $params = $state->params; $document = JFactory::getDocument(); $document->setTitle( $params->get( 'page_title' )); $document->addStyleSheet('components/com_abook/assets/css/style.css'); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } // Compute the item slug. for ($i = 0, $n = count($items); $i < $n; $i++) { $item = &$items[$i]; $item->slug = $item->alias ? ($item->id.':'.$item->alias) : $item->id; foreach ($item->tags as $tag) { $tag->slug= $tag->alias ? ($tag->id.':'.$tag->alias) : $tag->id; } } $this->assignRef('state', $state); $this->assignRef('items', $items); $this->assignRef('params', $params); $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_ABOOK_DEFAULT_PAGE_TITLE')); } $title = $this->params->get('page_title', ''); if (empty($title)) { $title = htmlspecialchars_decode($app->getCfg('sitename')); } elseif ($app->getCfg('sitename_pagetitles', 0)) { $title = JText::sprintf('JPAGETITLE', htmlspecialchars_decode($app->getCfg('sitename')), $title); } $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')); } if ($app->getCfg('MetaTitle') == '1') { $this->document->setMetaData($title, 'tags'); } } }