-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheosnotify.php
65 lines (58 loc) · 2.1 KB
/
eosnotify.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
/**
* @package Joomla.Plugin
* @subpackage Quickicon.eosnotify
*
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Joomla! udpate notification plugin
* @since 2.5
*/
class PlgQuickiconEosnotify extends JPlugin
{
/**
* Constructor
*
* @param object &$subject The object to observe
* @param array $config An optional associative array of configuration settings.
* Recognized key values include 'name', 'group', 'params', 'language'
* (this list is not meant to be comprehensive).
*
* @since 2.5
*/
public function __construct(&$subject, $config = array())
{
parent::__construct($subject, $config);
$this->loadLanguage();
}
/**
* 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)
{
$text = JText::_('PLG_EOSNOTIFY_SUPPORT_ENDING');
if(date('Ymd')>='20150101')
$text = JText::_('PLG_EOSNOTIFY_SUPPORT_ENDED');
if (JAdministratorHelper::findOption() == 'com_cpanel') {
$messtext = '<div style="background-color:#FFCFCF; font-size:16px; font-weight:bold; margin-bottom: 10px; padding: 10px; border-radius: 10px;">' . $text . ' ' . JText::_('PLG_EOSNOTIFY_CLICK_FOR_INFORMATION_WITH_LINK') . '</div>';
echo("<script>document.getElementById('system-message-container').innerHTML = '" . $messtext . "';</script>");
}
return array(array(
'link' => 'http://docs.joomla.org/Why_Migrate',
'image' => JURI::root() . 'plugins/quickicon/eosnotify/stop15.png',
'text' => '<span style="color:red;">' . $text . '<br />' . JText::_('PLG_EOSNOTIFY_CLICK_FOR_INFORMATION') . '.</span>',
'id' => 'plg_quickicon_eos'
));
}
}