コード例 #1
0
ファイル: ajax.php プロジェクト: vazahat/dudex
 public function removeAttachment()
 {
     if (empty($_GET['actionId'])) {
         throw new Redirect404Exception();
     }
     $actionId = (int) $_GET['actionId'];
     $dto = $this->service->findActionById($actionId);
     $data = json_decode($dto->data, true);
     if ($data['attachment']['oembed']['type'] == 'photo') {
         OW::getEventManager()->call('base.attachment_delete_image', array('url' => $data['attachment']['oembed']['url']));
     }
     unset($data['attachment']);
     $dto->data = json_encode($data);
     $this->service->saveAction($dto);
     exit;
 }
コード例 #2
0
ファイル: ajax.php プロジェクト: jorgemunoz8807/havanabook
 public function removeAttachment()
 {
     if (empty($_GET['actionId'])) {
         throw new Redirect404Exception();
     }
     $actionId = (int) $_GET['actionId'];
     $dto = $this->service->findActionById($actionId);
     $data = json_decode($dto->data, true);
     if (!empty($data['attachmentId'])) {
         BOL_AttachmentService::getInstance()->deleteAttachmentByBundle("newsfeed", $data['attachmentId']);
     }
     unset($data['attachment']);
     $dto->data = json_encode($data);
     $this->service->saveAction($dto);
     exit;
 }