[ Index ]

PHP Cross Reference of Joomla 2.5.4 DE

title

Body

[close]

/administrator/components/com_checkin/ -> controller.php (source)

   1  <?php
   2  /**
   3   * @package        Joomla.Administrator
   4   * @subpackage    com_checkin
   5   * @copyright    Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
   6   * @license        GNU General Public License version 2 or later; see LICENSE.txt
   7   */
   8  
   9  // Check to ensure this file is included in Joomla!
  10  defined('_JEXEC') or die;
  11  
  12  jimport('joomla.application.component.controller');
  13  
  14  /**
  15   * Checkin Controller
  16   *
  17   * @package        Joomla.Administrator
  18   * @subpackage    com_checkin
  19   * @since 1.6
  20   */
  21  class CheckinController extends JController
  22  {
  23  	public function display($cachable = false, $urlparams = false)
  24      {
  25          // Load the submenu.
  26          $this->addSubmenu(JRequest::getWord('option', 'com_checkin'));
  27  
  28          parent::display();
  29  
  30          return $this;
  31      }
  32  
  33  	public function checkin()
  34      {
  35          // Check for request forgeries
  36          JSession::checkToken() or jexit(JText::_('JInvalid_Token'));
  37  
  38          // Initialise variables.
  39          $ids    = JRequest::getVar('cid', array(), '', 'array');
  40  
  41          if (empty($ids)) {
  42              JError::raiseWarning(500, JText::_('JLIB_HTML_PLEASE_MAKE_A_SELECTION_FROM_THE_LIST'));
  43          }
  44          else {
  45              // Get the model.
  46              $model = $this->getModel();
  47  
  48              // Checked in the items.
  49              $this->setMessage(JText::plural('COM_CHECKIN_N_ITEMS_CHECKED_IN', $model->checkin($ids)));
  50          }
  51  
  52          $this->setRedirect('index.php?option=com_checkin');
  53      }
  54  
  55      /**
  56       * Configure the Linkbar.
  57       *
  58       * @param    string    The name of the active view.
  59       *
  60       * @return    void
  61       * @since    1.6
  62       */
  63  	protected function addSubmenu($vName)
  64      {
  65          JSubMenuHelper::addEntry(
  66              JText::_('JGLOBAL_SUBMENU_CHECKIN'),
  67              'index.php?option=com_checkin',
  68              $vName == 'com_checkin'
  69          );
  70  
  71          JSubMenuHelper::addEntry(
  72              JText::_('JGLOBAL_SUBMENU_CLEAR_CACHE'),
  73              'index.php?option=com_cache',
  74              $vName == 'cache'
  75          );
  76          JSubMenuHelper::addEntry(
  77              JText::_('JGLOBAL_SUBMENU_PURGE_EXPIRED_CACHE'),
  78              'index.php?option=com_cache&view=purge',
  79              $vName == 'purge'
  80          );
  81  
  82      }
  83  
  84  }


Generated: Tue Apr 3 11:40:28 2012 Cross-referenced by PHPXref 0.7.1