示例#1
0
 /**
  * 构造器
  *
  * @global $admin_file
  * @see GetLang
  * @see adminRightCheck
  * @param string $keyword 搜索关键字
  */
 function AdminSearch($keyword)
 {
     global $admin_file;
     require GetLang('purview');
     require GetLang('search');
     foreach ($purview as $key => $value) {
         if (!adminRightCheck($key)) {
             unset($purviewp[$key]);
             unset($search[$key]);
         }
     }
     $this->purview =& $purview;
     $this->lang =& $search;
     $this->keyword = $keyword;
 }
示例#2
0
function creadMenu($array, &$father)
{
    if (!is_array($array)) {
        return;
    }
    foreach ($array as $cate => $left) {
        if (isset(${$cate})) {
            break;
        }
        if (isNavHead($cate)) {
            global ${$cate};
            ${$cate} = new MenuHead($cate, $left['name']);
            creadMenu($left['items'], ${$cate});
            if (${$cate}->haveItems()) {
                addToHead(array('id' => $cate, 'name' => $left['name']));
            }
        } elseif (isMenuLeaf($left)) {
            global ${$cate};
            ${$cate} = new Menu($cate, $left['name']);
            creadMenu($left['items'], ${$cate});
        } elseif (isMenuItem($left)) {
            global $purview;
            $cate = $left;
            if (adminRightCheck($cate)) {
                ${$cate} = new MenuItem($cate, $purview[$cate][0], $purview[$cate][1]);
                diyAddCheck($cate, ${$cate});
                hotAddCheck($cate, ${$cate});
            }
        } else {
            creadMenu($left, $father);
        }
        if (isset(${$cate})) {
            $father->addChild(${$cate});
        }
    }
}
示例#3
0
    }
}
if ($job == 'shortcut') {
    require GetLang('left');
    foreach ($nav_left['mode']['items'] as $key => $value) {
        $nav_left[$key] = $value;
    }
    unset($nav_left['mode']);
    foreach ($nav_left as $cate => $left) {
        foreach ($left['items'] as $key => $value) {
            if (is_array($value)) {
                foreach ($value['items'] as $k => $v) {
                    if (adminRightCheck($v)) {
                        $nav_left[$cate]['items'][$v] = strip_tags($purview[$v][0]);
                    }
                    unset($nav_left[$cate]['items'][$k]);
                }
                unset($nav_left[$cate]['items'][$key]);
            } else {
                if (adminRightCheck($value)) {
                    $nav_left[$cate]['items'][$value] = $purview[$value][0];
                }
                unset($nav_left[$cate]['items'][$key]);
            }
        }
    }
    $poweredby = true;
}
$poweredby || $job == 'desktop' && ($poweredby = true);
require_once PrintEot('admin');
//afooter();
示例#4
0
文件: admin.php 项目: jechiy/PHPWind
function adminRight($adminjob, $admintype)
{
    $temp = $admintype ? $admintype : $adminjob;
    return adminRightCheck($temp);
}
示例#5
0
function secondAndDiy($key, $option, $k = false)
{
    if ($k) {
        $admincheck = adminRightCheck($k);
    } else {
        $admincheck = adminRightCheck($key);
    }
    if ($admincheck) {
        addSecondMenu(getRealKey($key, $k), $option);
        addDiyOpion($key, $option, $k);
    }
}