input;
$cid = $input->get('cid', array(), 'array');
if (empty($cid)) {
Factory::getApplication()->enqueueMessage(Text::_('COM_JEM_SELECT_ITEM_TO_PUBLISH'), 'notice');
$this->setRedirect(JemHelperRoute::getMyEventsRoute());
return;
}
$model = $this->getModel('myevents');
if (!$model->publish($cid, 1)) {
echo "\n";
}
$total = count($cid);
$msg = $total.' '.Text::_('COM_JEM_EVENT_PUBLISHED');
$this->setRedirect(JemHelperRoute::getMyEventsRoute(), $msg);
}
/**
* Logic for canceling an event and proceed to add a venue
*/
public function unpublish()
{
// Check for request forgeries
Session::checkToken() or jexit('Invalid Token');
$app = Factory::getApplication();
$input = $app->input;
$cid = $input->get('cid', array(), 'array');
if (empty($cid)) {
Factory::getApplication()->enqueueMessage(Text::_('COM_JEM_SELECT_ITEM_TO_UNPUBLISH'), 'notice');
$this->setRedirect(JemHelperRoute::getMyEventsRoute());
return;
}
$model = $this->getModel('myevents');
if (!$model->publish($cid, 0)) {
echo "\n";
}
$total = count($cid);
$msg = $total.' '.Text::_('COM_JEM_EVENT_UNPUBLISHED');
$this->setRedirect(JemHelperRoute::getMyEventsRoute(), $msg);
}
/**
* Logic to trash events
*
* @access public
* @return void
*/
public function trash()
{
// Check for request forgeries
Session::checkToken() or jexit('Invalid Token');
$app = Factory::getApplication();
$input = $app->input;
$cid = $input->get('cid', array(), 'array');
if (empty($cid)) {
Factory::getApplication()->enqueueMessage(Text::_('COM_JEM_SELECT_ITEM_TO_TRASH'), 'notice');
$this->setRedirect(JemHelperRoute::getMyEventsRoute());
return;
}
$model = $this->getModel('myevents');
if (!$model->publish($cid, -2)) {
echo "\n";
}
$total = count($cid);
$msg = $total.' '.Text::_('COM_JEM_EVENT_TRASHED');
$this->setRedirect(JemHelperRoute::getMyEventsRoute(), $msg);
}
}
?>