/** * 构造器 * * @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; }
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}); } } }
} } 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();
function adminRight($adminjob, $admintype) { $temp = $admintype ? $admintype : $adminjob; return adminRightCheck($temp); }
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); } }