Source for file extensionupdate.php

Documentation is available at extensionupdate.php

  1. <?php
  2. /**
  3.  * @package     Joomla.Plugin
  4.  * @subpackage  Quickicon.Extensionupdate
  5.  *
  6.  * @copyright   Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
  7.  * @license     GNU General Public License version 2 or later; see LICENSE.txt
  8.  */
  9.  
  10. defined('_JEXEC'or die;
  11.  
  12. /**
  13.  * Joomla! udpate notification plugin
  14.  *
  15.  * @package     Joomla.Plugin
  16.  * @subpackage  Quickicon.Extensionupdate
  17.  * @since       2.5
  18.  */
  19. {
  20.     /**
  21.      * Load the language file on instantiation.
  22.      *
  23.      * @var    boolean 
  24.      * @since  3.1
  25.      */
  26.     protected $autoloadLanguage = true;
  27.  
  28.     /**
  29.      * Returns an icon definition for an icon which looks for extensions updates
  30.      * via AJAX and displays a notification when such updates are found.
  31.      *
  32.      * @param   string  $context  The calling context
  33.      *
  34.      * @return  array  A list of icon definition associative arrays, consisting of the
  35.      *                  keys link, image, text and access.
  36.      *
  37.      * @since   2.5
  38.      */
  39.     public function onGetIcons($context)
  40.     {
  41.         if ($context != $this->params->get('context''mod_quickicon'|| !JFactory::getUser()->authorise('core.manage''com_installer'))
  42.         {
  43.             return;
  44.         }
  45.  
  46.         JHtml::_('jquery.framework');
  47.  
  48.         $ajax_url JUri::base().'index.php?option=com_installer&view=update&task=update.ajax';
  49.         $script "var plg_quickicon_extensionupdate_ajax_url = '$ajax_url';\n";
  50.         $script .= 'var plg_quickicon_extensionupdate_text = {"UPTODATE" : "'.
  51.             JText::_('PLG_QUICKICON_EXTENSIONUPDATE_UPTODATE'true).'", "UPDATEFOUND": "'.
  52.             JText::_('PLG_QUICKICON_EXTENSIONUPDATE_UPDATEFOUND'true).'", "ERROR": "'.
  53.             JText::_('PLG_QUICKICON_EXTENSIONUPDATE_ERROR'true)."\"};\n";
  54.         $document JFactory::getDocument();
  55.         $document->addScriptDeclaration($script);
  56.         JHtml::_('script''plg_quickicon_extensionupdate/extensionupdatecheck.js'falsetrue);
  57.  
  58.         return array(
  59.             array(
  60.                 'link' => 'index.php?option=com_installer&view=update',
  61.                 'image' => 'asterisk',
  62.                 'icon' => 'header/icon-48-extension.png',
  63.                 'text' => JText::_('PLG_QUICKICON_EXTENSIONUPDATE_CHECKING'),
  64.                 'id' => 'plg_quickicon_extensionupdate',
  65.                 'group' => 'MOD_QUICKICON_MAINTENANCE'
  66.             )
  67.         );
  68.     }
  69. }

Documentation generated on Tue, 19 Nov 2013 15:02:46 +0100 by phpDocumentor 1.4.3