示例#1
0
文件: Edit.php 项目: phpsource/idno
 function postContent()
 {
     $this->gatekeeper();
     $new = false;
     if (!empty($this->arguments)) {
         $object = \IdnoPlugins\Status\Status::getByID($this->arguments[0]);
     }
     if (empty($object)) {
         $object = new \IdnoPlugins\Status\Status();
     }
     if ($object->saveDataFromInput($this)) {
         $this->forward($object->getURL());
     }
 }
示例#2
0
 function postContent()
 {
     $this->createGatekeeper();
     $new = false;
     if (!empty($this->arguments)) {
         $object = \IdnoPlugins\Status\Status::getByID($this->arguments[0]);
     }
     if (empty($object)) {
         $object = \IdnoPlugins\Status\Status::factory();
     }
     if ($object->saveDataFromInput()) {
         $forward = $this->getInput('forward-to', $object->getDisplayURL());
         $this->forward($forward);
     }
 }
示例#3
0
 function postContent()
 {
     $this->createGatekeeper();
     $new = false;
     if (!empty($this->arguments)) {
         $object = \IdnoPlugins\Status\Status::getByID($this->arguments[0]);
     }
     if (empty($object)) {
         $object = \IdnoPlugins\Status\Status::factory();
     }
     if ($object->saveDataFromInput($this)) {
         //$this->forward($object->getDisplayURL());
         $this->forward(\Idno\Core\site()->config()->getDisplayURL() . 'content/all/');
     }
 }
示例#4
0
文件: Delete.php 项目: sintoris/Known
 function postContent()
 {
     $this->createGatekeeper();
     if (!empty($this->arguments)) {
         $object = \IdnoPlugins\Status\Status::getByID($this->arguments[0]);
     }
     if (empty($object)) {
         $this->forward();
     }
     if (!$object->canEdit()) {
         $this->setResponse(403);
         \Idno\Core\Idno::site()->session()->addErrorMessage("You don't have permission to perform this task.");
         $this->forward();
     }
     if ($object->delete()) {
         \Idno\Core\Idno::site()->session()->addMessage('Your status update was deleted.');
     } else {
         \Idno\Core\Idno::site()->session()->addErrorMessage("We couldn't delete " . $object->getTitle() . ".");
     }
     $this->forward($_SERVER['HTTP_REFERER']);
 }