コード例 #1
0
 function getLocationHierarchy($loc)
 {
     if ($loc->int == '') {
         return array($loc);
     } else {
         return array($loc, pathos_core_makelocation($loc->mod, $loc->src));
     }
 }
コード例 #2
0
    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;
                $sections[$id]->canManageRank = 0;
                $last_manage_depth = $depth;
            } else {
                if ($depth <= $last_manage_depth) {
                    $last_manage_depth = -1;
                } else {
                    $sections[$id]->canManage = $last_manage_depth == -1 ? 0 : 1;
                    $sections[$id]->canManageRank = $sections[$id]->canManage;
                }
            }