[ Index ]

PHP Cross Reference of Joomla 1.5.26 DE

title

Body

[close]

/administrator/components/com_cpanel/ -> admin.cpanel.php (source)

   1  <?php
   2  /**
   3  * @version        $Id: admin.cpanel.php 18130 2010-07-14 11:21:35Z louis $
   4  * @package        Joomla
   5  * @subpackage    Admin
   6  * @copyright    Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
   7  * @license        GNU/GPL, see LICENSE.php
   8  * Joomla! is free software. This version may have been modified pursuant
   9  * to the GNU General Public License, and as distributed it includes or
  10  * is derivative of works licensed under the GNU General Public License or
  11  * other free or open source software licenses.
  12  * See COPYRIGHT.php for copyright notices and details.
  13  */
  14  
  15  // no direct access
  16  defined( '_JEXEC' ) or die( 'Restricted access' );
  17  require_once( JApplicationHelper::getPath( 'admin_html' ) );
  18  
  19  switch (JRequest::getCmd('task'))
  20  {
  21      default:
  22      {
  23          // Check to see if the mootools upgrade plugin is enabled.
  24          if (!JPluginHelper::getPlugin('system', 'mtupgrade')) {
  25  
  26              // Only do the mtupgrade plugin check once per session.
  27              $app = &JFactory::getApplication();
  28              if (!$app->getUserState('com_cpanel.mtupgrade.checked')) {
  29  
  30                  // If it is not enabled, let's check to see if it is even installed.
  31                  $db = &JFactory::getDBO();
  32                  $db->setQuery(
  33                      'SELECT id' .
  34                      ' FROM #__plugins' .
  35                      ' WHERE folder = "system"' .
  36                      ' AND element = "mtupgrade"'
  37                  );
  38                  $exists = (bool) $db->loadResult();
  39  
  40                  // If it is not installed, install it as disabled and raise a notice.
  41                  if (!$exists) {
  42                      $plg = & JTable::getInstance('plugin');
  43                      $plg->name = 'System - Mootools Upgrade';
  44                      $plg->ordering = 0;
  45                      $plg->folder = 'system';
  46                      $plg->iscore = 0;
  47                      $plg->access = 0;
  48                      $plg->client_id = 0;
  49                      $plg->element = 'mtupgrade';
  50                      $plg->published = 0;
  51  
  52                      // If unable to store the plugin, raise a notice.
  53                      if (!$plg->store()) {
  54                          JError::raiseNotice(500, $plg->getError() /*JText::sprintf('Unable to auto-install the Mootools Upgrade plugin.', $plg->getError())*/);
  55                      }
  56                      // Show a message stating that the plugin is now available.
  57                      else {
  58                          //$app->enqueueMessage(JText::_('Mootools Upgrade plugin available.'));
  59                      }
  60                  }
  61  
  62                  // Set the mtupgrade plugin checked flag for the session.
  63                  $app->setUserState('com_cpanel.mtupgrade.checked', true);
  64              }
  65  
  66  
  67          }
  68  
  69          //set the component specific template file in the request
  70          JRequest::setVar('tmpl', 'cpanel');
  71          HTML_cpanel::display();
  72      }    break;
  73  }


Generated: Wed Mar 28 15:54:07 2012 Cross-referenced by PHPXref 0.7.1