예제 #1
0
 */

// No direct access to this file
defined('_JEXEC') or die('Restricted access');
?>
<?php
if ($this->category->can_submit_doc && $this->params->get('show_submit_document_btn_in_category', 1))
{
	echo '<a class="hasTooltip btn" title="' . JText::_('COM_JUDOWNLOAD_ADD_DOCUMENT') . '" href="' . $this->category->submit_doc_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_JUDOWNLOAD_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::_(JUDownloadHelperRoute::getCategoryRoute($this->category->parent_id)); ?>"
	   title="<?php echo JText::_('COM_JUDOWNLOAD_UP_TO_PARENT_CATEGORY'); ?>">
		<i class="fa fa-chevron-up"></i>
	</a>
<?php
} ?>
예제 #2
0
<?php
/**
 * ------------------------------------------------------------------------
 * JUDownload 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::_(JUDownloadHelperRoute::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>';

?>
예제 #3
0
<?php
/**
 * ------------------------------------------------------------------------
 * JUDownload 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');
?>
<div class="judl-cat clearfix">
	<h2 class="cat-title"><?php echo JText::sprintf('COM_JUDOWNLOAD_LIST_ALL_DOCUMENTS', $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_JUDOWNLOAD_FILTER'); ?>
	</a>
	<a class="btn btn-mini pull-right"
	   href="<?php echo JUDownloadHelperRoute::getCategoryRoute($this->category->id); ?>">
		<i class="fa fa-folder-open"></i> <?php echo JText::_('COM_JUDOWNLOAD_THIS_CATEGORY'); ?>
	</a>
</div>
예제 #4
0
	public static function getBreadcrumbCategory($categoryId)
	{
		
		$app   = JFactory::getApplication();
		$menus = $app->getMenu('site');

		
		$categoryPath = JUDownloadHelper::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 = JUDownloadHelperRoute::findItemId($needles, true);
			}

			if (!$findMenuTreeLevel1)
			{
				
				$pathwayArray[] = JUDownloadFrontHelperBreadcrumb::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 = JUDownloadHelperRoute::getCategoryRoute($categoryPathItem->id, $topCategoryLevelId);
					$pathwayArray[]    = $pathwayItem;
				}
			}
		}

		return $pathwayArray;
	}
예제 #5
0
	<?php
	if (count($this->categories) > 0)
	{
		?>
		<div class="judl-category-list">
			<h2 class="title"><?php echo JText::_('COM_JUDOWNLOAD_CATEGORIES'); ?></h2>
			<ul>
				<?php
				foreach ($this->categories AS $key => $category)
				{
					?>
					<li>

						<a href="<?php

						echo JRoute::_(JUDownloadHelperRoute::getCategoryRoute($category->id)); ?>">
							<?php echo $category->title ?>
						</a>
					</li>
				<?php
				} ?>
			</ul>
		</div>
	<?php
	} ?>

	<?php
	if (count($this->items))
	{
		echo $this->loadTemplate('documents');
	}
예제 #6
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_JUDOWNLOAD_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());
			}

			$isDocumentPublished = JUDownloadFrontHelperDocument::isDocumentPublished($cid[0]);
			if ($isDocumentPublished)
			{
				$mainCategoryId = JUDownloadFrontHelperCategory::getMainCategoryId($cid[0]);
				$this->setRedirect(JRoute::_(JUDownloadHelperRoute::getCategoryRoute($mainCategoryId), false));
			}
			else
			{
				$this->setRedirect($this->getReturnPage());
			}
		}
	}
예제 #7
0
	protected function _prepareDocument()
	{
		$uri = clone JUri::getInstance();
		
		$domain        = $uri->toString(array('scheme', 'host', 'port'));
		$canonicalLink = $domain . JRoute::_(JUDownloadHelperRoute::getCategoryRoute($this->category->id, null, false, $this->_layout), false);
		JUDownloadFrontHelper::setCanonical($canonicalLink);

		
		$this->item = $this->category;
		JUDownloadFrontHelperSeo::seo($this);
	}
예제 #8
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('#__judownload_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);
			$showTotalChildDocs = $params->get('show_total_docs_of_subcat', 0);

			$nestedCategories = null;

			if ($showTotalChildDocs || $showTotalSubCats)
			{
				$nestedCategories = JUDownloadFrontHelperCategory::getCategoriesRecursive($category->id, true, true, true, false, false, true);

				if ($showTotalChildDocs)
				{
					
					$category->total_documents = JUDownloadFrontHelperCategory::getTotalDocumentsInCategory($category->id, $nestedCategories);
				}

				if ($showTotalSubCats)
				{
					
					$category->total_nested_categories = JUDownloadFrontHelperCategory::getTotalSubCategoriesInCategory($category->id, $nestedCategories);
				}
			}

			
			$registry = new JRegistry;
			$registry->loadString($category->images);
			$category->images = $registry->toObject();

			
			$category->link = JRoute::_(JUDownloadHelperRoute::getCategoryRoute($category->id));

			if (!$showEmptyCategory)
			{
				
				if (is_null($nestedCategories))
				{
					$nestedCategories = JUDownloadFrontHelperCategory::getCategoriesRecursive($category->id, true, true, true, false, false, true);
				}

				if (!isset($category->total_nested_categories))
				{
					$category->total_nested_categories = JUDownloadFrontHelperCategory::getTotalSubCategoriesInCategory($category->id, $nestedCategories);
				}
				if (!isset($category->total_documents))
				{
					$category->total_documents = JUDownloadFrontHelperCategory::getTotalDocumentsInCategory($category->id, $nestedCategories);
				}

				if (($category->total_nested_categories > 0) || ($category->total_documents > 0))
				{
					$subCategoriesAfter[] = $category;
				}
			}
			else
			{
				$subCategoriesAfter[] = $category;
			}
		}

		return $subCategoriesAfter;
	}
예제 #9
0
			<?php if ($this->params->get('category_show_image', 1) && !empty($subcategory->images))
			{
				?>
				<div class="subcat-image">
					<a href="<?php JRoute::_(JUDownloadHelperRoute::getCategoryRoute($subcategory->id)); ?>">
						<img
							src="<?php echo JUri::root(true) . '/media/com_judownload/images/category/intro/' . $images->intro_image; ?>"
							style="max-width:<?php echo $this->params->get('category_intro_image_width', 200); ?>px;max-height:<?php echo $this->params->get('category_intro_image_height', 200); ?>px"
							alt="<?php echo $images->intro_image_alt; ?>"
							title="<?php echo $images->intro_image_caption; ?>"/>
					</a>
				</div>
			<?php } ?>

			<div class="subcat-title">
				<a href="<?php echo JRoute::_(JUDownloadHelperRoute::getCategoryRoute($subcategory->id)); ?>"><?php echo $subcategory->title; ?></a>
				<?php
				$totalSubCats = JUDownloadFrontHelper::getTotalInsideCategories($subcategory->id);
				$totalDocs = JUDownloadFrontHelper::getTotalDocumentInCategory($subcategory->id);
				?>
				<span><?php echo "(" . $totalSubCats . " Subcategory /" . $totalDocs . " Document)"; ?></span>
			</div>

			<?php
			if ($this->params->get('show_subcategories_introtext', 1))
			{
				$cat_introtext_limit = (int) $this->params->get('categories_introtext_limit', 1);
				if ($cat_introtext_limit == 1)
				{
					$cat_introtext_limit_char = (int) $this->params->get('categories_introtext_limit_character', 1500);
					$cat_introtext            = JUDownloadFrontHelperString::truncateHtml($subcategory->introtext, $cat_introtext_limit_char);
예제 #10
0
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
?>
<ul>
	<?php
	$parent = $this->parent_id;
	foreach ($this->all_categories AS $key => $category)
	{
		if ($category->parent_id == $parent)
		{
			?>
			<li class="categories-tree">
				<div class="cat-row">
					<i class="fa fa-caret-right"></i>
					<a class="cat-title"
					   href="<?php echo JRoute::_(JUDownloadHelperRoute::getCategoryRoute($category->id, $category->top_cat)); ?>">
						<?php echo $category->title; ?>
					</a>
					<?php
					if ($this->params->get('all_categories_show_total_subcategories', 1) || $this->params->get('all_categories_show_total_documents', 1))
					{
						$totalCatsDocs = array();

						if ($this->params->get('all_categories_show_total_subcategories', 1))
						{
							$totalCatsDocs[]    = '<span class="subcat-count"><span>' . $category->total_nested_categories . '</span> ' . JText::_('COM_JUDOWNLOAD_SUB_CATEGORIES') . '</span>';
						}

						if ($this->params->get('all_categories_show_total_documents', 1))
						{
							$totalCatsDocs[] = '<span class="document-count"><span>' . $category->total_documents . '</span> ' . JText::_('COM_JUDOWNLOAD_DOCUMENTS') . '</span>';