Example #1
0
 /**
  * Prepares the document
  *
  * @return  void
  */
 protected function prepareDocument()
 {
     parent::prepareDocument();
     $menu = $this->menu;
     $id = (int) @$menu->query['id'];
     if ($menu && ($menu->query['option'] != $this->extension || $menu->query['view'] == $this->viewName || $id != $this->category->id)) {
         $path = array(array('title' => $this->category->title, 'link' => ''));
         $category = $this->category->getParent();
         while (($menu->query['option'] != 'com_proveedor' || $menu->query['view'] == 'proveedor' || $id != $category->id) && $category->id > 1) {
             $path[] = array('title' => $category->title, 'link' => ProveedorHelperRoute::getCategoryRoute($category->id));
             $category = $category->getParent();
         }
         $path = array_reverse($path);
         foreach ($path as $item) {
             $this->pathway->addItem($item['title'], $item['link']);
         }
     }
     parent::addFeed();
 }
	<?php 
        if ($this->params->get('show_empty_categories') || $child->numitems || count($child->getChildren())) {
            if (!isset($this->children[$this->category->id][$id + 1])) {
                $class = ' class="last"';
            }
            ?>
	<li<?php 
            echo $class;
            ?>
>
		<?php 
            $class = '';
            ?>
			<h4 class="item-title">
				<a href="<?php 
            echo JRoute::_(ProveedorHelperRoute::getCategoryRoute($child->id));
            ?>
">
				<?php 
            echo $this->escape($child->title);
            ?>
				</a>

				<?php 
            if ($this->params->get('show_cat_items') == 1) {
                ?>
					<span class="badge badge-info pull-right" title="<?php 
                echo JText::_('COM_PROVEEDOR_CAT_NUM');
                ?>
"><?php 
                echo $child->numitems;
		<?php 
        if ($this->params->get('show_empty_categories_cat') || $item->numitems || count($item->getChildren())) {
            if (!isset($this->items[$this->parent->id][$id + 1])) {
                $class = ' class="last"';
            }
            ?>
			<div <?php 
            echo $class;
            ?>
 >
			<?php 
            $class = '';
            ?>
				<h3 class="page-header item-title">
					<a href="<?php 
            echo JRoute::_(ProveedorHelperRoute::getCategoryRoute($item->id));
            ?>
">
					<?php 
            echo $this->escape($item->title);
            ?>
</a>
					<?php 
            if ($this->params->get('show_cat_items_cat') == 1) {
                ?>
						<span class="badge badge-info tip hasTooltip" title="<?php 
                echo JHtml::tooltipText('COM_PROVEEDOR_NUM_ITEMS');
                ?>
">
							<?php 
                echo $item->numitems;
Example #4
0
 /**
  * Prepares the document
  *
  * @return  void
  */
 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_PROVEEDOR_DEFAULT_PAGE_TITLE'));
     }
     $title = $this->params->get('page_title', '');
     $id = (int) @$menu->query['id'];
     // If the menu item does not concern this proveedor
     if ($menu && ($menu->query['option'] != 'com_proveedor' || $menu->query['view'] != 'proveedor' || $id != $this->item->id)) {
         // If this is not a single proveedor menu item, set the page title to the proveedor title
         if ($this->item->name) {
             $title = $this->item->name;
         }
         $path = array(array('title' => $this->proveedor->name, 'link' => ''));
         $category = JCategories::getInstance('Proveedor')->get($this->proveedor->catid);
         while ($category && ($menu->query['option'] != 'com_proveedor' || $menu->query['view'] == 'proveedor' || $id != $category->id) && $category->id > 1) {
             $path[] = array('title' => $category->title, 'link' => ProveedorHelperRoute::getCategoryRoute($this->proveedor->catid));
             $category = $category->getParent();
         }
         $path = array_reverse($path);
         foreach ($path as $item) {
             $pathway->addItem($item['title'], $item['link']);
         }
     }
     if (empty($title)) {
         $title = $app->get('sitename');
     } elseif ($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'));
     }
     if (empty($title)) {
         $title = $this->item->name;
     }
     $this->document->setTitle($title);
     if ($this->item->metadesc) {
         $this->document->setDescription($this->item->metadesc);
     } elseif ($this->params->get('menu-meta_description')) {
         $this->document->setDescription($this->params->get('menu-meta_description'));
     }
     if ($this->item->metakey) {
         $this->document->setMetadata('keywords', $this->item->metakey);
     } elseif ($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'));
     }
     $mdata = $this->item->metadata->toArray();
     foreach ($mdata as $k => $v) {
         if ($v) {
             $this->document->setMetadata($k, $v);
         }
     }
 }