AdminController::checkin - ItemsController::checkin

Created Diff never expires
4 removals
27 lines
19 additions
42 lines
public function checkin()
public function checkin()
{
{
// Check for request forgeries.
// Check for request forgeries.
$this->checkToken();
$this->checkToken();


$ids = $this->input->post->get('cid', array(), 'array');
$ids = $this->input->post->get('cid', array(), 'array');


$model = $this->getModel();
$model = $this->getModel();
$return = $model->checkin($ids);
$return = $model->checkin($ids);


if ($return === false)
if ($return === false)
{
{
// Checkin failed.
// Checkin failed.
$message = Text::sprintf('JLIB_APPLICATION_ERROR_CHECKIN_FAILED', $model->getError());
$message = Text::sprintf('JLIB_APPLICATION_ERROR_CHECKIN_FAILED', $model->getError());
$this->setRedirect(Route::_('index.php?option=' . $this->option . '&view=' . $this->view_list, false), $message, 'error');
$this->setRedirect(
Route::_(
'index.php?option=' . $this->option . '&view=' . $this->view_list
. '&menutype=' . $this->app->getUserState('com_menus.items.menutype'),
false
),
$message,
'error'
);


return false;
return false;
}
}
else
else
{
{
// Checkin succeeded.
// Checkin succeeded.
$message = Text::plural($this->text_prefix . '_N_ITEMS_CHECKED_IN', count($ids));
$message = Text::plural($this->text_prefix . '_N_ITEMS_CHECKED_IN', count($ids));
$this->setRedirect(Route::_('index.php?option=' . $this->option . '&view=' . $this->view_list, false), $message);
$this->setRedirect(
Route::_(
'index.php?option=' . $this->option . '&view=' . $this->view_list
. '&menutype=' . $this->app->getUserState('com_menus.items.menutype'),
false
),
$message
);


return true;
return true;
}
}
}
}