From: <jon...@us...> - 2012-10-05 14:09:01
|
Revision: 43302 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=43302&view=rev Author: jonnybradley Date: 2012-10-05 14:08:55 +0000 (Fri, 05 Oct 2012) Log Message: ----------- [ENH] areas: Observe areas "share_common" setting in category jail processing by hiding all categs not within the jail Modified Paths: -------------- trunk/lib/categories/categlib.php Modified: trunk/lib/categories/categlib.php =================================================================== --- trunk/lib/categories/categlib.php 2012-10-05 14:03:32 UTC (rev 43301) +++ trunk/lib/categories/categlib.php 2012-10-05 14:08:55 UTC (rev 43302) @@ -747,15 +747,23 @@ if ($considerCategoryFilter) { if ( $jail = $this->get_jail() ) { + $area = array(); + if ($prefs['feature_areas'] === 'y') { + $areaslib = TikiLib::lib('areas'); + $area = $areaslib->getAreaByPerspId($_SESSION['current_perspective']); + } $roots = array_filter((array) $prefs['category_jail_root']); // Skip 0 and other forms of empty $ret = array_filter( $ret, - function ($category) use ($jail, $roots) + function ($category) use ($jail, $roots, $area) { if (in_array($category['categId'], $jail)) { return true; } + if ($area && !$area['share_common']) { + return false; + } if ($category['rootId'] && ! in_array($category['rootId'], $roots)) { return true; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |