function isPublic($section) { $hier = navigationmodule::getHierarchy(); while (true) { if ($section->public == 0) { // Not a public section. Check permissions. return false; } else { // Is public. check parents. if ($section->parent <= 0) { // Out of parents, and since we are still checking, we haven't hit a private section. return true; } else { $section = $hier[$section->parent]; } } } }
# not, write to: # # Free Software Foundation, Inc., # 59 Temple Place, # Suite 330, # Boston, MA 02111-1307 USA # # $Id: manage.php,v 1.6 2005/04/06 15:53:34 filetreefrog Exp $ ################################################## if (!defined('PATHOS')) { exit(''); } if (pathos_permissions_checkOnModule('manage', 'navigationmodule')) { pathos_flow_set(SYS_FLOW_PROTECTED, SYS_FLOW_ACTION); $template = new template('navigationmodule', '_manager', $loc); $sections = navigationmodule::getHierarchy(); $last_manage_depth = -1; $last_admin_depth = -1; if ($user && $user->is_acting_admin) { foreach (array_keys($sections) as $id) { $sections[$id]->canManage = 1; $sections[$id]->canManageRank = 1; $sections[$id]->canAdmin = 1; } } else { $thisloc = pathos_core_makelocation('navigationmodule'); foreach (array_keys($sections) as $id) { $thisloc->int = $id; $depth = $sections[$id]->depth; if ($last_manage_depth == -1 && pathos_permissions_check('manage', $thisloc)) { $sections[$id]->canManage = 1;