Пример #1
0
 /**
  * @descrpition 修改
  */
 public function edit()
 {
     if (Request::getRequest('dosubmit', 'str')) {
         $jumpUrl = '/admin.php/friendlink/edit/id-' . $this->param['id'];
         $fields = array();
         $fields['name'] = Request::getRequest('name', 'str');
         $fields['url'] = Request::getRequest('url', 'str');
         $fields['nofollow'] = Request::getRequest('nofollow', 'int');
         if (empty($fields['name'])) {
             View::showAdminErrorMessage($jumpUrl, '未填写完成');
         }
         $result = FriendLinkBusiness::editFriendLink($this->param['id'], $fields);
         if ($result) {
             View::showAdminMessage('/admin.php/friendlink/lists', '添加成功');
         } else {
             View::showAdminErrorMessage($jumpUrl, '添加失败');
         }
     }
     $friendLink = FriendLinkBusiness::getFriendLink($this->param['id']);
     View::assign('friendLink', $friendLink);
     View::showAdminTpl('friend_link_edit');
 }