- md5
- 95b8fec1b00a4803843ecace1c1e0de5
- sha1
- 122d3eb4ae6944f1aad61236d4efd3e58523e567
- sha256
- c89a5e986ada5cbd8bfe51a10f3079d4d818ab44a9433378eebe7f7ebb2b72f9
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
<?php
/**
* @package Joomla.Plugin
* @subpackage Quickicon.Extensionupdate
*
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Extension\ExtensionHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Plugin\CMSPlugin;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Uri\Uri;
/**
* Joomla! update notification plugin
*
* @since 2.5
*/
class PlgQuickiconExtensionupdate extends CMSPlugin
{
/**
* Load the language file on instantiation.
*
* @var boolean
* @since 3.1
*/
protected $autoloadLanguage = true;
/**
* Application object.
*
* @var \Joomla\CMS\Application\CMSApplication
* @since 3.7.0
*/
protected $app;
/**
* Returns an icon definition for an icon which looks for extensions updates
* via AJAX and displays a notification when such updates are found.
*
* @param string $context The calling context
*
* @return array A list of icon definition associative arrays, consisting of the
* keys link, image, text and access.
*
* @since 2.5
*/
public function onGetIcons($context)
{
if ($context !== $this->params->get('context', 'mod_quickicon') || !$this->app->getIdentity()->authorise('core.manage', 'com_installer'))
{
return array();
}
$token = Session::getFormToken() . '=1';
$options = array(
'url' => Uri::base() . 'index.php?option=com_installer&view=update&task=update.find&' . $token,
'ajaxUrl' => Uri::base() . 'index.php?option=com_installer&view=update&task=update.ajax&' . $token
. '&cache_timeout=3600&eid=0&skip=' . ExtensionHelper::getExtensionRecord('files_joomla')->extension_id,
);
$this->app->getDocument()->addScriptOptions('js-extensions-update', $options);
Text::script('PLG_QUICKICON_EXTENSIONUPDATE_UPTODATE');
Text::script('PLG_QUICKICON_EXTENSIONUPDATE_UPDATEFOUND');
Text::script('PLG_QUICKICON_EXTENSIONUPDATE_UPDATEFOUND_MESSAGE');
Text::script('PLG_QUICKICON_EXTENSIONUPDATE_UPDATEFOUND_BUTTON');
Text::script('PLG_QUICKICON_EXTENSIONUPDATE_ERROR');
Text::script('MESSAGE');
Text::script('ERROR');
Text::script('INFO');
Text::script('WARNING');
HTMLHelper::_('behavior.core');
HTMLHelper::_('script', 'plg_quickicon_extensionupdate/extensionupdatecheck.min.js', array('version' => 'auto', 'relative' => true));
return array(
array(
'link' => 'index.php?option=com_installer&view=update&task=update.find&' . $token,
'image' => 'fa fa-star-o',
'icon' => '',
'text' => Text::_('PLG_QUICKICON_EXTENSIONUPDATE_CHECKING'),
'id' => 'plg_quickicon_extensionupdate',
'group' => 'MOD_QUICKICON_MAINTENANCE'
)
);
}
}
No other release has this exact content. See every version of this file.