예제 #1
0
 private function _editChild()
 {
     if ($this->_isPost()) {
         $_POST['status'] = $_POST['status'] ? 1 : 0;
         if ($this->_modelMenu->update(array('parent_id' => $_POST['parent_id'], 'value' => $_POST['value'], 'name' => $_POST['name'], 'status' => $_POST['status']), "Id={$_POST['Id']}")) {
             $this->_utilMsg->showMsg('更改成功', 1, Tools::url(CONTROL, ACTION));
         } else {
             $this->_utilMsg->showMsg('更改失败,可能已经有相同的标识', -2);
         }
     } else {
         $mainList = $this->_modelMenu->findByMainList();
         $mainList = $this->_modelMenu->getTtwoArrConvertOneArr($mainList, 'Id', 'value');
         $this->_view->assign('id', $_GET['Id']);
         $this->_view->assign('defaultParentId', $_GET['parent_id']);
         $this->_view->assign('mainList', $mainList);
         $this->_view->assign('data', $this->_modelMenu->findById($_GET['Id']));
         $this->_utilMsg->createNavBar();
         $this->_view->set_tpl(array('body' => 'Menu/EditChild.html'));
         $this->_view->display();
     }
 }