예제 #1
0
 /**
  * This method is called when the Quick Icons module is constructing its set
  * of icons. You can return an array which defines a single icon and it will
  * be rendered right after the stock Quick Icons.
  *
  * @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)
 {
     //Load helper methods
     require_once JPATH_ADMINISTRATOR . '/components/com_playjoomupdate/helpers/playjoomupdate.php';
     require_once JPATH_ADMINISTRATOR . '/components/com_playjoomupdate/helpers/pjversion.php';
     // Define the Joomla version if not already defined.
     if (!defined('PJVERSION')) {
         $jversion = new PJVersion();
         define('PJVERSION', $jversion->getShortVersion());
     }
     if (!class_exists('InstallerHelper')) {
         require_once JPATH_ADMINISTRATOR . '/components/com_installer/helpers/installer.php';
     }
     $this->UpdateConf = InstallerHelper::getConfig('Update', JPATH_ADMINISTRATOR . '/components/com_playjoomupdate/playjoomupdate.conf.php');
     $PJ_Extension_ID = $this->UpdateConf->get('PJUpdate_extension_id');
     if ($context != $this->params->get('context', 'mod_pj_quickicon') || !JFactory::getUser()->authorise('core.manage', 'com_installer')) {
         return;
     }
     JHtml::_('jquery.framework');
     $cur_template = JFactory::getApplication()->getTemplate();
     $url = JUri::base() . 'index.php?option=com_playjoomupdate';
     $ajax_url = JUri::base() . 'index.php?option=com_installer&view=update&task=update.ajax';
     $script = array();
     $script[] = 'var plg_quickicon_playjoomupdate_url = \'' . $url . '\';';
     $script[] = 'var plg_quickicon_playjoomupdate_ajax_url = \'' . $ajax_url . '\';';
     $script[] = 'var plg_quickicon_playjoomupdatecheck_pjversion = \'' . PJVERSION . '\'';
     $script[] = 'var plg_quickicon_playjoomupdatecheck_pjextensionid = \'' . $PJ_Extension_ID . '\'';
     $script[] = 'var plg_quickicon_playjoomupdate_text = {' . '"UPTODATE" : "' . JText::_('PLG_QUICKICON_JOOMLAUPDATE_UPTODATE', true) . '",' . '"UPDATEFOUND": "' . JText::_('PLG_QUICKICON_JOOMLAUPDATE_UPDATEFOUND', true) . '",' . '"UPDATEFOUND_MESSAGE": "' . JText::_('PLG_QUICKICON_JOOMLAUPDATE_UPDATEFOUND_MESSAGE', true) . '",' . '"UPDATEFOUND_BUTTON": "' . JText::_('PLG_QUICKICON_JOOMLAUPDATE_UPDATEFOUND_BUTTON', true) . '",' . '"ERROR": "' . JText::_('PLG_QUICKICON_JOOMLAUPDATE_ERROR', true) . '",' . '};';
     $script[] = 'var plg_quickicon_playjoomupdate_img = {' . '"UPTODATE" : "' . JUri::base(true) . '/templates/' . $cur_template . '/images/header/icon-48-jupdate-uptodate.png",' . '"UPDATEFOUND": "' . JUri::base(true) . '/templates/' . $cur_template . '/images/header/icon-48-jupdate-updatefound.png",' . '"ERROR": "' . JUri::base(true) . '/templates/' . $cur_template . '/images/header/icon-48-deny.png",' . '};';
     //load javascripts
     $document = JFactory::getDocument();
     $document->addScriptDeclaration(implode("\n", $script));
     $document->addScript(JURI::root(true) . '/plugins/quickicon/playjoomupdate/js/pj_update_checker.js', 'text/javascript', true, false);
     return array(array('link' => 'index.php?option=com_playjoomupdate', 'image' => 'fa fa-download', 'icon' => 'header/icon-48-download.png', 'text' => JText::_('PLG_QUICKICON_JOOMLAUPDATE_CHECKING'), 'id' => 'plg_quickicon_joomlaupdate', 'group' => 'MOD_QUICKICON_MAINTENANCE'));
 }
예제 #2
0
 * PlayJoom and the basic package Joomla! is free software. This version may have been modified pursuant to the
 * GNU General Public License, and as distributed it includes or is derivative
 * of works licensed under the GNU General Public License or other free or open
 * source software licenses. See COPYRIGHT.php for copyright notices and details.
 *
 * @package PlayJoom.Admin
 * @subpackage main.playjoomupdate
 * @link http://playjoom.teglo.info
 * @copyright Copyright (C) 2010-2013 by www.teglo.info. All rights reserved.
 * @license	GNU/GPL, see LICENSE.php
 * @PlayJoomUpdate Component
 * @date $Date$
 * @revision $Revision$
 * @author $Author$
 * @headurl $HeadURL$
 */
defined('_JEXEC') or die;
if (!JFactory::getUser()->authorise('core.manage', 'com_playjoomupdate')) {
    return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
}
//Load helper methods
require_once JPATH_COMPONENT . '/helpers/playjoomupdate.php';
require_once JPATH_COMPONENT . '/helpers/pjversion.php';
// Define the Joomla version if not already defined.
if (!defined('PJVERSION')) {
    $jversion = new PJVersion();
    define('PJVERSION', $jversion->getShortVersion());
}
$controller = JControllerLegacy::getInstance('playjoomupdate');
$controller->execute(JFactory::getApplication()->input->get('task'));
$controller->redirect();