public function run() { if ($this->tids) { Wind::import('SRV:forum.srv.operation.PwDeleteTopic'); Wind::import('SRV:forum.srv.dataSource.PwFetchTopicByTid'); $service2 = new PwDeleteTopic(new PwFetchTopicByTid($this->tids), $this->srv->user); $service2->setRecycle(true)->setIsDeductCredit($this->isDeductCredit)->setReason($this->_reason)->execute(); Wekit::load('log.srv.PwLogService')->addThreadManageLog($this->srv->user, 'delete', $this->srv->getData(), $this->_reason); } }
public function run($ids) { if ($this->record) { Wind::import('SRV:forum.srv.operation.PwDeleteTopic'); Wind::import('SRV:forum.srv.dataSource.PwFetchTopicByTid'); $srv = new PwDeleteTopic(new PwFetchTopicByTid($this->record), $this->srv->user); $srv->setIsDeleteFresh(false)->setIsDeductCredit($this->srv->isDeductCredit)->execute(); //帖子产生的新鲜事删除,日志记录为“删除帖子”类型的日志 Wekit::load('log.srv.PwLogService')->addThreadManageLog($this->srv->user, 'delete', $srv->data, ''); } }
public function doDeleteTopicAction() { $tids = $this->getInput('tids'); if (!$tids) { $this->showError('operate.select'); } Wind::import('SRV:forum.srv.operation.PwDeleteTopic'); Wind::import('SRV:forum.srv.dataSource.PwFetchTopicByTid'); $srv = new PwDeleteTopic(new PwFetchTopicByTid($tids), new PwUserBo($this->adminUser->getUid())); $srv->execute(); $this->showMessage('删除成功了'); }
public function doDeleteThreadAction() { $tid = $this->getInput('tid'); if (empty($tid)) { $this->showError('operate.select'); } !is_array($tid) && ($tid = array($tid)); Wind::import('SRV:forum.srv.operation.PwDeleteTopic'); Wind::import('SRV:forum.srv.dataSource.PwFetchTopicByTid'); $deleteTopic = new PwDeleteTopic(new PwFetchTopicByTid($tid), new PwUserBo($this->loginUser->uid)); $deleteTopic->setIsDeductCredit(1)->execute(); $this->showMessage('success'); }
/** * 删除主题 */ public function doDeleteTopicAction() { $tids = $this->getInput('tids'); Wind::import('SRV:forum.srv.operation.PwDeleteTopic'); Wind::import('SRV:forum.srv.dataSource.PwFetchTopicByTid'); $srv = new PwDeleteTopic(new PwFetchTopicByTid($tids), $this->loginUser); $srv->execute(); $this->showMessage('删除成功了'); }
public function run($ids) { $srv = new PwDeleteTopic(new PwFetchTopicByFid($ids), $this->srv->user); $srv->setRecycle(false)->execute(); }
public function deletethreadAction() { list($tids, $isDeductCredit) = $this->getInput(array('tids', 'isDeductCredit')); if (!is_array($tids) || !count($tids)) { $this->showError('operate.select'); } $service = new PwDeleteTopic(new PwFetchTopicByTid($tids), new PwUserBo($this->loginUser->uid)); $service->setRecycle(true)->setIsDeductCredit((bool) $isDeductCredit)->execute(); $this->showMessage('operate.success'); }
/** * 删除帖子 * * @param array $param * @return boolean */ private function _delThreads() { Wind::import('SRV:forum.srv.operation.PwDeleteTopic'); $right = $this->getRight(); $banUids = array_keys($this->getBanUsers()); //【用户禁止帖子删除】 //删除当前主题帖子 当禁止非楼主时,不能删除当前主题 if (1 == $this->delete['current'] && 1 === $right['delCurrentThread'] && !array_diff($banUids, $this->threadCreatedUids)) { Wind::import('SRV:forum.srv.dataSource.PwFetchTopicByTid'); //【用户禁止帖子删除】-根据帖子ID列表删除帖子到回收站 $service = new PwDeleteTopic(new PwFetchTopicByTid($this->tids), $this->loginUser); $service->setRecycle(true)->setIsDeductCredit(true)->execute(); } if (1 == $this->delete['site'] && 1 === $right['delSiteThread']) { Wind::import('SRV:forum.srv.dataSource.PwFetchTopicByUid'); //【用户禁止帖子删除】-并且按照用户ID列表删除帖子到回收站 $service = new PwDeleteTopic(new PwFetchTopicByUid($banUids), $this->loginUser); $service->setRecycle(true)->setIsDeductCredit(true)->execute(); } elseif (1 == $this->delete['forum'] && 1 === $right['delForumThread']) { Wind::import('SRV:forum.srv.dataSource.PwFetchTopicByFidAndUids'); //【用户禁止帖子删除】-并且按照用户ID列表+版块ID删除帖子到回收站 foreach ($this->srv->getFids() as $fid) { $service = new PwDeleteTopic(new PwFetchTopicByFidAndUids($fid, $banUids), $this->loginUser); $service->setRecycle(true)->setIsDeductCredit(true)->execute(); } } return true; }
public function run($uid) { $operator = new PwDeleteTopic(new PwGetTopicByUid($uid), $this->operator); $operator->execute(); }