Skip to content

Commit

Permalink
Merge pull request #42 from renekreijveld/Extensionupdate
Browse files Browse the repository at this point in the history
[imp] Move extensionupdater markup to JLayouts
  • Loading branch information
phproberto committed Jun 1, 2014
2 parents c659259 + 80c471a commit f9d11d4
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 11 deletions.
29 changes: 29 additions & 0 deletions layouts/plugins/quickicon/extensionupdate/default.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @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('JPATH_BASE') or die;

extract($displayData);

/**
* Variables
* ---------------------
* $ajax_url : (string) The url of the ajax call to be executed
*/

JHtml::_('jquery.framework');

$script = "var plg_quickicon_extensionupdate_ajax_url = '$ajaxUrl';\n";
$script .= 'var plg_quickicon_extensionupdate_text = {"UPTODATE" : "'
. JText::_('PLG_QUICKICON_EXTENSIONUPDATE_UPTODATE', true) . '", "UPDATEFOUND": "'
. JText::_('PLG_QUICKICON_EXTENSIONUPDATE_UPDATEFOUND', true) . '", "ERROR": "'
. JText::_('PLG_QUICKICON_EXTENSIONUPDATE_ERROR', true) . "\"};\n";
$document = JFactory::getDocument();
$document->addScriptDeclaration($script);
JHtml::_('script', 'plg_quickicon_extensionupdate/extensionupdatecheck.js', false, true);
16 changes: 5 additions & 11 deletions plugins/quickicon/extensionupdate/extensionupdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,11 @@ public function onGetIcons($context)
return;
}

JHtml::_('jquery.framework');

$ajax_url = JUri::base() . 'index.php?option=com_installer&view=update&task=update.ajax';
$script = "var plg_quickicon_extensionupdate_ajax_url = '$ajax_url';\n";
$script .= 'var plg_quickicon_extensionupdate_text = {"UPTODATE" : "'
. JText::_('PLG_QUICKICON_EXTENSIONUPDATE_UPTODATE', true) . '", "UPDATEFOUND": "'
. JText::_('PLG_QUICKICON_EXTENSIONUPDATE_UPDATEFOUND', true) . '", "ERROR": "'
. JText::_('PLG_QUICKICON_EXTENSIONUPDATE_ERROR', true) . "\"};\n";
$document = JFactory::getDocument();
$document->addScriptDeclaration($script);
JHtml::_('script', 'plg_quickicon_extensionupdate/extensionupdatecheck.js', false, true);
$this->getRenderer('default')->render(
array(
'ajaxUrl' => JUri::base() . 'index.php?option=com_installer&view=update&task=update.ajax'
)
);

return array(
array(
Expand Down

0 comments on commit f9d11d4

Please sign in to comment.