Source for file view.html.php

Documentation is available at view.html.php

  1. <?php
  2. /**
  3.  * @package     Joomla.Site
  4.  * @subpackage  com_contact
  5.  *
  6.  * @copyright   Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
  7.  * @license     GNU General Public License version 2 or later; see LICENSE.txt
  8.  */
  9.  
  10. defined('_JEXEC'or die;
  11.  
  12. /**
  13.  * HTML View class for the Contacts component
  14.  *
  15.  * @package     Joomla.Site
  16.  * @subpackage  com_contact
  17.  * @since       1.5
  18.  */
  19. {
  20.     /**
  21.      * @var    string  The name of the extension for the category
  22.      * @since  3.2
  23.      */
  24.     protected  $extension = 'com_contact';
  25.  
  26.     /**
  27.      * @var    string  Default title to use for page title
  28.      * @since  3.2
  29.      */
  30.     protected  $defaultPageTitle = 'COM_CONTACT_DEFAULT_PAGE_TITLE';
  31.  
  32.     /**
  33.      * @var    string  The name of the view to link individual items to
  34.      * @since  3.2
  35.      */
  36.     protected $viewName = 'contact';
  37.  
  38.     /**
  39.      * Execute and display a template script.
  40.      *
  41.      * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  42.      *
  43.      * @return  mixed  A string if successful, otherwise a Error object.
  44.      */
  45.     public function display($tpl null)
  46.     {
  47.         parent::commonCategoryDisplay();
  48.  
  49.         // Prepare the data.
  50.         // Compute the contact slug.
  51.         foreach ($this->items as $item)
  52.         {
  53.             $item->slug    $item->alias ($item->id.':'.$item->alias$item->id;
  54.             $temp        new JRegistry;
  55.             $temp->loadString($item->params);
  56.             $item->params clone($this->params);
  57.             $item->params->merge($temp);
  58.  
  59.             if ($item->params->get('show_email'0== 1)
  60.             {
  61.                 $item->email_to trim($item->email_to);
  62.  
  63.                 if (!empty($item->email_to&& JMailHelper::isEmailAddress($item->email_to))
  64.                 {
  65.                     $item->email_to JHtml::_('email.cloak'$item->email_to);
  66.                 }
  67.                 else
  68.                 {
  69.                     $item->email_to '';
  70.                 }
  71.             }
  72.         }
  73.  
  74.         return parent::display($tpl);
  75.     }
  76.  
  77.     /**
  78.      * Prepares the document
  79.      *
  80.      * @return  void 
  81.      */
  82.     protected function prepareDocument()
  83.     {
  84.         parent::prepareDocument();
  85.  
  86.         $menu $this->menu;
  87.         $id = (int) @$menu->query['id'];
  88.  
  89.         if ($menu && ($menu->query['option'!= $this->extension || $menu->query['view'== $this->viewName || $id != $this->category->id))
  90.         {
  91.             $path array(array('title' => $this->category->title'link' => ''));
  92.             $category $this->category->getParent();
  93.  
  94.             while (($menu->query['option'!= 'com_contact' || $menu->query['view'== 'contact' || $id != $category->id&& $category->id 1)
  95.             {
  96.                 $path[array('title' => $category->title'link' => ContactHelperRoute::getCategoryRoute($category->id));
  97.                 $category $category->getParent();
  98.             }
  99.  
  100.             $path array_reverse($path);
  101.  
  102.             foreach ($path as $item)
  103.             {
  104.                 $this->pathway->addItem($item['title']$item['link']);
  105.             }
  106.         }
  107.  
  108.         parent::addFeed();
  109.     }
  110. }

Documentation generated on Tue, 19 Nov 2013 15:16:58 +0100 by phpDocumentor 1.4.3