Ejemplo n.º 1
0
	protected function getAllAssignedCatIds()
	{
		$cats_assignment = $this->params->get('categories_assignment', array());
		$rootCatId       = JUDownloadFrontHelperCategory::getRootCategory()->id;
		$allAssignedCats = array();
		if (count($cats_assignment))
		{
			foreach ($cats_assignment AS $cat_id)
			{
				$recursiveCatIds = JUDownloadFrontHelperCategory::getCategoryIdsRecursive($cat_id);
				array_unshift($recursiveCatIds, $cat_id);
				$allAssignedCats = array_merge($allAssignedCats, $recursiveCatIds);
			}
			
			array_unshift($allAssignedCats, $rootCatId);
		}

		return $allAssignedCats;
	}
Ejemplo n.º 2
0
	public static function getAccessibleCategoryIds()
	{
		$storeId = md5(__CLASS__ . '::AccessibleCategoryIds');
		if (!isset(self::$cache[$storeId]))
		{
			
			$catIdArray = JUDownloadFrontHelperCategory::getCategoryIdsRecursive(1);
			
			array_unshift($catIdArray, 1);
			self::$cache[$storeId] = $catIdArray;
		}

		return self::$cache[$storeId];
	}