/** exdoc * Creates a location object, based off of the three arguments passed, and returns it. * * @internal param \The $mo module component of the location. * * @internal param \The $src source component of the location. * * @internal param \The $int internal component of the location. * @return array * @node Subsystems:expCore */ public static function initializeNavigation() { // $sections = array(); $sections = navigationmodule::levelTemplate(0, 0); return $sections; }
<?php ################################################## # # Copyright (c) 2004-2006 OIC Group, Inc. # Written and Designed by James Hunt # # This file is part of Exponent # # Exponent is free software; you can redistribute # it and/or modify it under the terms of the GNU # General Public License as published by the Free # Software Foundation; either version 2 of the # License, or (at your option) any later version. # # GPL: http://www.gnu.org/licenses/gpl.txt # ################################################## if (!defined('EXPONENT')) { exit(''); } if ($user) { $sections = navigationmodule::levelTemplate(0, 0); $standalones = $db->selectObjects('section', 'parent = -1'); $template = new template('navigationmodule', '_linker'); $template->assign('sections', $sections); $template->assign('standalones', $standalones); $template->assign('haveStandalones', count($standalones)); $template->output(); }
################################################## # # Copyright (c) 2004-2006 OIC Group, Inc. # Written and Designed by James Hunt # # This file is part of Exponent # # Exponent is free software; you can redistribute # it and/or modify it under the terms of the GNU # General Public License as published by the Free # Software Foundation; either version 2 of the # License, or (at your option) any later version. # # GPL: http://www.gnu.org/licenses/gpl.txt # ################################################## if (!defined('EXPONENT')) { exit(''); } if (exponent_permissions_checkOnModule('manage', 'navigationmodule')) { exponent_flow_set(SYS_FLOW_PROTECTED, SYS_FLOW_ACTION); $template = new template('navigationmodule', '_manager', $loc); $template->assign('sections', navigationmodule::levelTemplate(0, 0)); // Templates $tpls = $db->selectObjects('section_template', 'parent=0'); $template->assign('templates', $tpls); $template->output(); } else { echo SITE_403_HTML; }
static function checkForSectionalAdmins($id) { global $db; $section = $db->selectObject('section', 'id=' . $id); $branch = navigationmodule::levelTemplate($id, 0); array_unshift($branch, $section); $allusers = array(); $allgroups = array(); while ($section->parent > 0) { $ploc = expCore::makeLocation('navigationmodule', null, $section); $allusers = array_merge($allusers, $db->selectColumn('userpermission', 'uid', "permission='manage' AND module='navigationmodule' AND internal=" . $section->parent)); $allgroups = array_merge($allgroups, $db->selectColumn('grouppermission', 'gid', "permission='manage' AND module='navigationmodule' AND internal=" . $section->parent)); $section = $db->selectObject('section', 'id=' . $section->parent); } foreach ($branch as $section) { $sloc = expCore::makeLocation('navigationmodule', null, $section->id); // remove any manage permissions for this page and it's children // $db->delete('userpermission', "module='navigationmodule' AND internal=".$section->id); // $db->delete('grouppermission', "module='navigationmodule' AND internal=".$section->id); foreach ($allusers as $uid) { $u = user::getUserById($uid); expPermissions::grant($u, 'manage', $sloc); } foreach ($allgroups as $gid) { $g = group::getGroupById($gid); expPermissions::grantGroup($g, 'manage', $sloc); } } }