/**
* Check in of one or more records.
*
* @return boolean True on success
*
* @since 1.6
*/
public function checkin()
{
// Check for request forgeries.
$this->checkToken();
$ids = (array) $this->input->post->get('cid', array(), 'int');
// Remove zero values resulting from input filter
$ids = array_filter($ids);
$model = $this->getModel();
$return = $model->checkin($ids);
if ($return === false) {
// Checkin failed.
$message = Text::sprintf('JLIB_APPLICATION_ERROR_CHECKIN_FAILED', $model->getError());
$this->setRedirect(Route::_('index.php?option=' . $this->option . '&view=' . $this->view_list . $this->getRedirectToListAppend(), false), $message, 'error');
return false;
} else {
// Checkin succeeded.
$message = Text::plural($this->text_prefix . '_N_ITEMS_CHECKED_IN', \count($ids));
$this->setRedirect(Route::_('index.php?option=' . $this->option . '&view=' . $this->view_list . $this->getRedirectToListAppend(), false), $message);
return true;
}
}