示例#1
0
 public function edit()
 {
     Hook::listen('conent_edit_begin');
     $ContentModel = ContentModel::getInstance($this->mid);
     $ContentInputModel = new ContentInputModel($this->mid);
     $data = $ContentInputModel->get();
     if ($data == false) {
         $this->error = $ContentInputModel->error;
         return false;
     }
     if ($ContentModel->create($data)) {
         if ($result = $ContentModel->save($data)) {
             //修改上传表Upload中本次上传文件状态
             $this->alterUploadTable();
             //修改tag标签数据
             $this->alterTag($data['aid']);
             //内容静态
             $this->createHtml($data['aid']);
             //生成栏目静态
             $this->createCategoryHtml($this->cid);
             Hook::listen('content_edit_end');
             return true;
         }
     } else {
         $this->error = $ContentModel->error;
         return false;
     }
 }
示例#2
0
 public function edit()
 {
     Hook::listen('CONTENT_EDIT_BEGIN');
     $ContentModel = ContentModel::getInstance($this->mid);
     $ContentInputModel = new ContentInputModel($this->mid);
     $data = $ContentInputModel->get();
     if ($data == false) {
         $this->error = $ContentInputModel->error;
         return false;
     }
     if ($ContentModel->create($data)) {
         if ($result = $ContentModel->save($data)) {
             //修改tag标签数据
             $this->alterTag($data['aid']);
             //内容静态
             $this->html->content($this->mid, $data['aid']);
             //上下关联文章
             $this->html->relation_content($this->mid, $data['aid']);
             //生成本栏目
             $this->html->relation_category($this->cid);
             //生成父级栏目
             $this->html->parent_category($this->cid);
             //生成首页
             $this->html->index();
             Hook::listen('CONTENT_EDIT_END');
             return true;
         }
     } else {
         $this->error = $ContentModel->error;
         return false;
     }
 }
示例#3
0
 public function edit()
 {
     Hook::listen('CONTENT_EDIT_BEGIN');
     $ContentModel = ContentModel::getInstance($this->mid);
     $ContentInputModel = new ContentInputModel($this->mid);
     $data = $ContentInputModel->get();
     if ($data == false) {
         $this->error = $ContentInputModel->error;
         return false;
     }
     if ($ContentModel->create($data)) {
         if ($result = $ContentModel->save($data)) {
             //修改tag标签数据
             $this->alterTag($data['aid']);
             Hook::listen('CONTENT_EDIT_END');
             return true;
         }
     } else {
         $this->error = $ContentModel->error;
         return false;
     }
 }
示例#4
0
文件: Content.class.php 项目: jyht/v5
 public function edit($data)
 {
     $ContentModel = ContentModel::getInstance($this->_mid);
     if (!isset($this->_model[$this->_mid])) {
         $this->error('模型不存在');
     }
     $ContentInputModel = new ContentInputModel($this->_mid);
     $editData = $ContentInputModel->get($data);
     if ($editData == false) {
         $this->error = $ContentInputModel->error;
         return false;
     }
     if ($ContentModel->create($editData)) {
         $result = $ContentModel->save($editData);
         $aid = $result[$ContentModel->table];
         $this->editTagData($data['aid']);
         M('upload')->where(array('uid' => $_SESSION['uid']))->save(array('state' => 1));
         return $aid;
     } else {
         $this->error = $ContentModel->error;
         return false;
     }
 }