Пример #1
0
 /**
  * Publish slide item
  *
  * @param int $id
  * @param string $redirect
  * @param bool $log
  * @return \Phalcon\Http\ResponseInterface
  */
 public function publishAction($id = null, $redirect = null, $log = true)
 {
     $redirect = '/admin/slide/';
     if ($id) {
         $id = intval($id);
         $ids[] = $id;
     } else {
         $ids = $this->request->getPost('ids');
         ZArrayHelper::toInteger($ids);
     }
     if (count($ids)) {
         /**
          * @var SlideShowItems $slideShow
          */
         $slideShow = SlideShowItems::findFirst(['conditions' => 'slide_show_item_id = ?0', 'bind' => [$ids[0]]]);
         if ($slideShow) {
             $redirect = '/admin/slide/manage-slide/slide/' . $slideShow->slide_show_id;
         }
     }
     parent::publishAction($id, $redirect, $log);
     return $this->response->redirect($redirect);
 }
Пример #2
0
 /**
  * Publish action
  *
  * @param int $id
  * @param string $redirect
  * @param bool $log
  */
 public function publishAction($id = null, $redirect = null, $log = true)
 {
     parent::publishAction($id, $redirect, false);
 }