/** * 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(); }
/** * Method to get the associations for a given item * * @param integer $id Id of the item * @param string $view Name of the view * * @return array Array of associations for the item * * @since 3.0 */ public static function getAssociations($id = 0, $view = null) { jimport('helper.route', JPATH_COMPONENT_SITE); $app = JFactory::getApplication(); $jinput = $app->input; $view = is_null($view) ? $jinput->get('view') : $view; $id = empty($id) ? $jinput->getInt('id') : $id; if ($view == 'proveedor') { if ($id) { $associations = JLanguageAssociations::getAssociations('com_proveedor', '#__proveedor_details', 'com_proveedor.item', $id); $return = array(); foreach ($associations as $tag => $item) { $return[$tag] = ProveedorHelperRoute::getProveedorRoute($item->id, (int) $item->catid, $item->language); } return $return; } } if ($view == 'category' || $view == 'categories') { return self::getCategoryAssociations($id, 'com_proveedor'); } return array(); }
<?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;
"> <td> <a href="javascript:void(0)" onclick="if (window.parent) window.parent.<?php echo $this->escape($function); ?> ('<?php echo $item->id; ?> ', '<?php echo $this->escape(addslashes($item->name)); ?> ', '<?php echo $this->escape($item->catid); ?> ', null, '<?php echo $this->escape(ProveedorHelperRoute::getProveedorRoute($item->id, $item->catid, $item->language)); ?> ', '<?php echo $this->escape($lang); ?> ', null);"> <?php echo $this->escape($item->name); ?> </a> </td> <td align="center"> <?php if (!empty($item->linked_user)) { ?> <?php
<?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;
<?php if ($this->params->get('show_fax_headings') and !empty($item->fax)) { ?> <?php echo JTEXT::sprintf('COM_PROVEEDOR_FAX_NUMBER', $item->fax); ?> <br /> <?php } ?> </span> <p> <div class="list-title"> <a href="<?php echo JRoute::_(ProveedorHelperRoute::getProveedorRoute($item->slug, $item->catid)); ?> "> <?php echo $item->name; ?> </a> <?php if ($this->items[$i]->published == 0) { ?> <span class="label label-warning"><?php echo JText::_('JUNPUBLISHED'); ?> </span> <?php }
/** * 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); } } }