Пример #1
0
 private function _addChild()
 {
     if ($this->_isPost()) {
         $_POST['status'] = $_POST['status'] ? 1 : 0;
         if ($this->_modelMenu->add($_POST)) {
             $this->_utilMsg->showMsg(false);
         } else {
             $this->_utilMsg->showMsg('添加失败,可能已经有相同的标识', -2);
         }
     } else {
         $this->_helpSqlSearch->set_tableName($this->_modelMenu->tName());
         $this->_helpSqlSearch->set_conditions('parent_id=0');
         $sql = $this->_helpSqlSearch->createSql();
         $mainList = $this->_modelMenu->select($sql);
         $mainList = $this->_modelMenu->getTtwoArrConvertOneArr($mainList, 'Id', 'name');
         $this->_view->assign('mainList', $mainList);
         $this->_utilMsg->createNavBar();
         $this->_view->set_tpl(array('body' => 'Menu/AddChild.html'));
         $this->_view->display();
     }
 }