Esempio n. 1
0
 /**
  * Publish one or more entries
  *
  * @return     void
  */
 public function publishTask()
 {
     // Incoming
     $ids = Request::getVar('id', array());
     if (!is_array($ids)) {
         $ids = array();
     }
     // Make sure we have an ID
     if (empty($ids)) {
         App::redirect(Route::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller, false));
         return;
     }
     // Instantiate an event object
     $event = new Event($this->database);
     // Loop through the IDs and publish the event
     foreach ($ids as $id) {
         $event->publish($id);
     }
     // Redirect
     App::redirect(Route::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller, false), Lang::txt('COM_EVENTS_CAL_LANG_PUBLISHED'));
 }