Exemplo n.º 1
0
 public static function getBreadcrumbCategory($categoryId)
 {
     $app = JFactory::getApplication();
     $menus = $app->getMenu('site');
     $categoryPath = JUDirectoryHelper::getCategoryPath($categoryId);
     $pathwayArray = array();
     if (!empty($categoryPath)) {
         if (!isset($categoryPath[1])) {
             $findMenuTreeLevel1 = false;
         } else {
             $topCategoryLevelId = $categoryPath[1]->id;
             $needles = array('tree' => array((int) $topCategoryLevelId));
             $findMenuTreeLevel1 = JUDirectoryHelperRoute::findItemId($needles, true);
         }
         if (!$findMenuTreeLevel1) {
             $pathwayArray[] = JUDirectoryFrontHelperBreadcrumb::getRootPathway();
             array_shift($categoryPath);
         } else {
             $menuTreeLevel1 = $menus->getItem($findMenuTreeLevel1);
             $pathwayItem = new stdClass();
             $pathwayItem->name = html_entity_decode($menuTreeLevel1->title, ENT_COMPAT, 'UTF-8');
             $pathwayItem->link = JRoute::_($menuTreeLevel1->link);
             $pathwayArray[] = $pathwayItem;
             array_shift($categoryPath);
             array_shift($categoryPath);
         }
         if (!empty($categoryPath)) {
             foreach ($categoryPath as $categoryPathItem) {
                 $pathwayItem = new stdClass();
                 $pathwayItem->name = html_entity_decode($categoryPathItem->title, ENT_COMPAT, 'UTF-8');
                 $pathwayItem->link = JUDirectoryHelperRoute::getCategoryRoute($categoryPathItem->id, $topCategoryLevelId);
                 $pathwayArray[] = $pathwayItem;
             }
         }
     }
     return $pathwayArray;
 }
Exemplo n.º 2
0
 categories-col-<?php 
        echo $indexColumn + 1;
        ?>
 col-md-<?php 
        echo $this->subcategory_bootstrap_columns[$indexColumn];
        ?>
">



			<div class="panel panel-default">
                             
				<div class="panel-heading category-title">

				<h2 class="blue_text cat-tittle">	<a href="<?php 
        echo JRoute::_(JUDirectoryHelperRoute::getCategoryRoute($category->id));
        ?>
">





 <?php 
        $paramsArray12 = array();
        $paramsArray12 = json_decode($category->images, true);
        $paramsArray12['detail_image'];
        if ($paramsArray12['detail_image'] != '') {
            ?>
					<img src="./media/com_judirectory/images/category/detail/<?php 
            echo $paramsArray12['detail_image'];
Exemplo n.º 3
0
    echo '<a class="hasTooltip btn" title="' . JText::_('COM_JUDIRECTORY_ADD_LISTING') . '" href="' . $this->category->submit_listing_link . '"><i class="fa fa-file-o"></i></a>';
}
if ($this->show_feed) {
    ?>
	<a class="hasTooltip btn" href="<?php 
    echo $this->rss_link;
    ?>
"
	   title="<?php 
    echo JText::_('COM_JUDIRECTORY_SUBSCRIBE_TO_THIS_RSS_FEED');
    ?>
">
		<i class="fa fa-rss"></i>
	</a>
<?php 
}
if ($this->category->id != 1) {
    ?>
	<a class="hasTooltip btn"
	   href="<?php 
    echo JRoute::_(JUDirectoryHelperRoute::getCategoryRoute($this->category->parent_id));
    ?>
"
	   title="<?php 
    echo JText::_('COM_JUDIRECTORY_UP_TO_PARENT_CATEGORY');
    ?>
">
		<i class="fa fa-chevron-up"></i>
	</a>
<?php 
}
Exemplo n.º 4
0
 protected function _prepareDocument()
 {
     $uri = clone JUri::getInstance();
     $domain = $uri->toString(array('scheme', 'host', 'port'));
     $canonicalLink = $domain . JRoute::_(JUDirectoryHelperRoute::getCategoryRoute($this->category->id, null, false, $this->_layout), false);
     JUDirectoryFrontHelper::setCanonical($canonicalLink);
     $this->item = $this->category;
     JUDirectoryFrontHelperSeo::seo($this);
 }
Exemplo n.º 5
0
 * @author         JoomUltra Co., Ltd
 * @website        http://www.joomultra.com
 * @----------------------------------------------------------------------@
 */
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
?>
<div class="judir-cat clearfix">
	<h2 class="cat-title"><?php 
echo JText::sprintf('COM_JUDIRECTORY_LIST_ALL_LISTINGS', $this->category->title);
?>
</h2>
</div>

<div class="clearfix">
	<a class="btn btn-primary btn-mini pull-left" href="#"
	   onclick="javascript:jQuery('.filter-form').slideToggle('300'); return false;">
		<i class="fa fa-filter"></i> <?php 
echo JText::_('COM_JUDIRECTORY_FILTER');
?>
	</a>
	<a class="btn btn-mini pull-right"
	   href="<?php 
echo JUDirectoryHelperRoute::getCategoryRoute($this->category->id);
?>
">
		<i class="fa fa-folder-open"></i> <?php 
echo JText::_('COM_JUDIRECTORY_THIS_CATEGORY');
?>
	</a>
</div>
Exemplo n.º 6
0
<?php

/**
 * ------------------------------------------------------------------------
 * JUDirectory for Joomla 2.5, 3.x
 * ------------------------------------------------------------------------
 *
 * @copyright      Copyright (C) 2010-2015 JoomUltra Co., Ltd. All Rights Reserved.
 * @license        GNU General Public License version 2 or later; see LICENSE.txt
 * @author         JoomUltra Co., Ltd
 * @website        http://www.joomultra.com
 * @----------------------------------------------------------------------@
 */
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
$html = array();
foreach ($value as $category) {
    $html[] = '<a href="' . JRoute::_(JUDirectoryHelperRoute::getCategoryRoute($category->id)) . '">' . $category->title . '</a>';
}
$this->setAttribute("style", "display: inline;", "output");
echo '<div ' . $this->getAttribute(null, null, "output") . '>';
echo implode("<span>, </span>", $html);
echo '</div>';
Exemplo n.º 7
0
 public function getSubCategories($parentId, $ordering = 'title', $direction = 'ASC')
 {
     $params = $this->getState('params');
     $showEmptyCategory = $params->get('show_empty_subcategory', 1);
     $user = JFactory::getUser();
     $levels = $user->getAuthorisedViewLevels();
     $levelsStr = implode(',', $levels);
     $db = JFactory::getDbo();
     $nullDate = $db->getNullDate();
     $nowDate = JFactory::getDate()->toSql();
     $query = $db->getQuery(true);
     $query->select('*');
     $query->from('#__judirectory_categories');
     $query->where('parent_id=' . $parentId);
     $query->where('published = 1');
     $query->where('(publish_up = ' . $db->quote($nullDate) . ' OR publish_up <= ' . $db->quote($nowDate) . ')');
     $query->where('(publish_down = ' . $db->quote($nullDate) . ' OR publish_down >= ' . $db->quote($nowDate) . ')');
     $query->where('access IN (' . $levelsStr . ')');
     $app = JFactory::getApplication();
     $tag = JFactory::getLanguage()->getTag();
     if ($app->getLanguageFilter()) {
         $query->where('language IN (' . $db->quote($tag) . ',' . $db->quote('*') . ',' . $db->quote('') . ')');
     }
     $query->order($ordering . ' ' . $direction);
     $db->setQuery($query);
     $subCategoriesBefore = $db->loadObjectList();
     $subCategoriesAfter = array();
     foreach ($subCategoriesBefore as $category) {
         $showTotalSubCats = $params->get('show_total_subcats_of_subcat', 0);
         $showTotalChildListings = $params->get('show_total_listings_of_subcat', 0);
         $nestedCategories = null;
         if ($showTotalChildListings || $showTotalSubCats) {
             $nestedCategories = JUDirectoryFrontHelperCategory::getCategoriesRecursive($category->id, true, true, true, false, false, true);
             if ($showTotalChildListings) {
                 $category->total_listings = JUDirectoryFrontHelperCategory::getTotalListingsInCategory($category->id, $nestedCategories);
             }
             if ($showTotalSubCats) {
                 $category->total_nested_categories = JUDirectoryFrontHelperCategory::getTotalSubCategoriesInCategory($category->id, $nestedCategories);
             }
         }
         $registry = new JRegistry();
         $registry->loadString($category->images);
         $category->images = $registry->toObject();
         $category->link = JRoute::_(JUDirectoryHelperRoute::getCategoryRoute($category->id));
         if (!$showEmptyCategory) {
             if (is_null($nestedCategories)) {
                 $nestedCategories = JUDirectoryFrontHelperCategory::getCategoriesRecursive($category->id, true, true, true, false, false, true);
             }
             if (!isset($category->total_nested_categories)) {
                 $category->total_nested_categories = JUDirectoryFrontHelperCategory::getTotalSubCategoriesInCategory($category->id, $nestedCategories);
             }
             if (!isset($category->total_listings)) {
                 $category->total_listings = JUDirectoryFrontHelperCategory::getTotalListingsInCategory($category->id, $nestedCategories);
             }
             if ($category->total_nested_categories > 0 || $category->total_listings > 0) {
                 $subCategoriesAfter[] = $category;
             }
         } else {
             $subCategoriesAfter[] = $category;
         }
     }
     return $subCategoriesAfter;
 }
Exemplo n.º 8
0
 public function delete()
 {
     JSession::checkToken('get') or die(JText::_('JINVALID_TOKEN'));
     $cid = JFactory::getApplication()->input->get('id', array(), 'array');
     if (!is_array($cid) || count($cid) < 1) {
         JError::raiseWarning(500, JText::_('COM_JUDIRECTORY_NO_ITEM_SELECTED'));
         $this->setRedirect($this->getReturnPage());
     } else {
         $model = $this->getModel();
         jimport('joomla.utilities.arrayhelper');
         JArrayHelper::toInteger($cid);
         if ($model->delete($cid)) {
             $this->setMessage(JText::plural($this->text_prefix . '_N_ITEMS_DELETED', count($cid)));
         } else {
             $this->setMessage($model->getError());
         }
         $isListingPublished = JUDirectoryFrontHelperListing::isListingPublished($cid[0]);
         if ($isListingPublished) {
             $mainCategoryId = JUDirectoryFrontHelperCategory::getMainCategoryId($cid[0]);
             $this->setRedirect(JRoute::_(JUDirectoryHelperRoute::getCategoryRoute($mainCategoryId), false));
         } else {
             $this->setRedirect($this->getReturnPage());
         }
     }
 }