if ($this->bCheckLogin) { // 当前用户 $aCookie = Util_Cookie::get(Yaf_G::getConf('authkey', 'cookie')); if (empty($aCookie)) { return $this->redirect('/admin/login'); } $this->aCurrUser = $aCookie; // 当前城市 $this->iCurrCityID = Util_Cookie::get('city'); if (empty($this->iCurrCityID)) { $this->iCurrCityID = $this->aCurrUser['iCityID']; } $this->aCurrCity = Model_City::getDetail($this->iCurrCityID); } $this->assign('sStaticRoot', 'http://' . Yaf_G::getConf('static', 'domain')); } /** * 执行Action后的操作 * * @see Yaf_Controller::actionAfter() */ public function actionAfter() { if ($this->autoRender() == true) { if (!empty($this->aCurrUser)) { $this->assign('aCurrUser', $this->aCurrUser);
/** * 菜单列表 */ public function listAction() { $aTree = Model_Menu::getTree(); $this->assign('aTree', $aTree); $this->assign('aColor', array('', 'success', 'warning', 'danger', 'info', 'active')); }