当前位置: 首页>>代码示例>>PHP>>正文


PHP InstallerHelper::getConfig方法代码示例

本文整理汇总了PHP中InstallerHelper::getConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP InstallerHelper::getConfig方法的具体用法?PHP InstallerHelper::getConfig怎么用?PHP InstallerHelper::getConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在InstallerHelper的用法示例。


在下文中一共展示了InstallerHelper::getConfig方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: onGetIcons

 /**
  * 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'));
 }
开发者ID:TFToto,项目名称:playjoom-builds,代码行数:47,代码来源:playjoomupdate.php

示例2: __construct

 /**
  * Constructor.
  *
  * @param   array  $config  An optional associative array of configuration settings.
  *
  * @see     JController
  * @since   1.6
  */
 public function __construct($config = array())
 {
     if (empty($config['filter_fields'])) {
         $config['filter_fields'] = array('name', 'client_id', 'type', 'folder', 'extension_id', 'update_id', 'update_site_id');
     }
     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');
     parent::__construct($config);
 }
开发者ID:TFToto,项目名称:playjoom-builds,代码行数:19,代码来源:update.php


注:本文中的InstallerHelper::getConfig方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。