- md5
- 2d456746da28cdd60e00f2bdea1267ff
- sha1
- 14b471e510653b41cb35cd11b2de132559eab274
- sha256
- b25d45cde1452b1edbeec6d2d117bc01e71ea6c1d9d695a406e2134121ab7895
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
<?php
/**
* @package Joomla.Administrator
* @subpackage com_checkin
*
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\Component\Checkin\Administrator\Controller;
defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Controller\BaseController;
use Joomla\CMS\Session\Session;
/**
* Checkin Controller
*
* @since 1.6
*/
class DisplayController extends BaseController
{
/**
* The default view.
*
* @var string
* @since 1.6
*/
protected $default_view = 'checkin';
/**
* Method to display a view.
*
* @param boolean $cachable If true, the view output will be cached
* @param array $urlparams An array of safe URL parameters and their variable types, for valid values see {@link \JFilterInput::clean()}.
*
* @return static A \JControllerLegacy object to support chaining.
*/
public function display($cachable = false, $urlparams = array())
{
// Load the submenu.
$this->addSubmenu($this->input->getWord('option', 'com_checkin'));
return parent::display();
}
/**
* Check in a list of items.
*
* @return void
*/
public function checkin()
{
// Check for request forgeries
Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
$ids = $this->input->get('cid', array(), 'array');
if (empty($ids))
{
$this->app->enqueueMessage(Text::_('JLIB_HTML_PLEASE_MAKE_A_SELECTION_FROM_THE_LIST'), 'warning');
}
else
{
// Get the model.
/** @var \Joomla\Component\Checkin\Administrator\Model\CheckinModel $model */
$model = $this->getModel('Checkin');
// Checked in the items.
$this->setMessage(Text::plural('COM_CHECKIN_N_ITEMS_CHECKED_IN', $model->checkin($ids)));
}
$this->setRedirect('index.php?option=com_checkin');
}
/**
* Configure the Linkbar.
*
* @param string $vName The name of the active view.
*
* @return void
*
* @since 1.6
*/
protected function addSubmenu($vName)
{
\JHtmlSidebar::addEntry(
Text::_('JGLOBAL_SUBMENU_CHECKIN'),
'index.php?option=com_checkin',
$vName == 'com_checkin'
);
\JHtmlSidebar::addEntry(
Text::_('JGLOBAL_SUBMENU_CLEAR_CACHE'),
'index.php?option=com_cache',
$vName == 'cache'
);
\JHtmlSidebar::addEntry(
Text::_('JGLOBAL_SUBMENU_PURGE_EXPIRED_CACHE'),
'index.php?option=com_cache&view=purge',
$vName == 'purge'
);
}
}
No other release has this exact content. See every version of this file.