本文整理汇总了PHP中JPlugin::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP JPlugin::__construct方法的具体用法?PHP JPlugin::__construct怎么用?PHP JPlugin::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JPlugin
的用法示例。
在下文中一共展示了JPlugin::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* 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.0
*/
public function __construct(&$subject, $config = array())
{
parent::__construct($subject, $config);
// Load default helper file or use the plugin helper file
$this->loadRedpaymentHelper();
$this->paymentHelper->paymentName = $this->paymentName;
}
示例2: array
function plgHikashopMassaction_category(&$subject, $config)
{
parent::__construct($subject, $config);
$this->massaction = hikashop_get('class.massaction');
$this->massaction->datecolumns = array('category_created', 'category_modified');
$this->category = hikashop_get('class.category');
}
示例3: array
function __construct(&$subject, $config)
{
parent::__construct($subject, $config);
$config = array_merge($config, array('ppName' => 'epaydk', 'ppKey' => 'PLG_PAYMENT_EPAYDK_TITLE', 'ppImage' => ''));
//Define Payment Status codes in eway And Respective Alias in Framework
$this->responseStatus = array('C' => 'C', 'ERROR' => 'E');
}
示例4: JVersion
function __construct(&$subject, $config)
{
$this->loadLanguage('plg_content_sige', JPATH_ADMINISTRATOR);
$version = new JVersion();
if($version->PRODUCT == 'Joomla!' AND $version->RELEASE != '2.5')
{
JError::raiseWarning(100, JText::_('PLG_CONTENT_SIGE_NEEDJ25'));
return;
}
parent::__construct($subject, $config);
if(isset($_SESSION["sigcount"]))
{
unset($_SESSION["sigcount"]);
}
if(isset($_SESSION["sigcountarticles"]))
{
unset($_SESSION["sigcountarticles"]);
}
$this->_absolute_path = JPATH_SITE;
$this->_live_site = JURI::base();
if(substr($this->_live_site, -1) == "/")
{
$this->_live_site = substr($this->_live_site, 0, -1);
}
$this->_params = array();
}
示例5: plgSystemmyApiOpenGraph
function plgSystemmyApiOpenGraph(&$subject, $config){
parent::__construct($subject, $config);
if(!class_exists('plgSystemmyApiConnect')) return;
$cache = & JFactory::getCache('plgSystemmyApiOpenGraph - FB Admins query');
$cache->setCaching( 1 );
$config =& JFactory::getConfig();
$connect_plugin =& JPluginHelper::getPlugin('system', 'myApiConnect');
$connect_params = new JParameter( $connect_plugin->params );
$plugin =& JPluginHelper::getPlugin('system', 'myApiOpenGraph');
$plugin_params = new JParameter( $plugin->params );
$db_admins = $cache->call( array( 'plgSystemmyApiOpenGraph', 'getFbAdmins'));
$param_admins = ($plugin_params->get('fbadmins') != '') ? explode(',',$plugin_params->get('fbadmins')) : array();
$admins = array_merge($db_admins,$param_admins);
$ogptags_default = array();
$ogptags_default['og:title'] = $config->getValue( 'config.sitename' );
$ogptags_default['og:type'] = 'website';
$ogptags_default['og:url'] = JURI::getInstance()->toString();
$ogptags_default['og:site_name'] = $config->getValue( 'config.sitename' );
$ogptags_default['fb:app_id'] = $connect_params->get('appId');
$ogptags_default['fb:admins'] = implode(',',$admins);
if($plugin_params->get('ogimage') != '' && $plugin_params->get('ogimage') != -1) $ogptags_default['og:image'] = JURI::base().'images/'.$plugin_params->get('ogimage');
if($plugin_params->get('fbpageid') != '') $ogptags_default['fb:page_id'] = $plugin_params->get('fbpageid');
plgSystemmyApiOpenGraph::setTags($ogptags_default);
}
示例6: __construct
/**
* Constructor
*
* @access protected
* @param object $subject The object to observe
* @param array $config An array that holds the plugin configuration
*
*/
public function __construct(&$subject, $config)
{
parent::__construct($subject, $config);
if (isset($config['layout'])) {
$this->layout = str_replace('_:', '', $config['layout']);
}
}
示例7: __construct
public function __construct(&$subject, $config)
{
parent::__construct($subject, $config);
$this->loadLanguage();
$this->_jqpath = '';
$this->_jquipath = '';
$this->_jquicsspath = '';
$this->_jqnoconflictpath = '';
$this->_jqmigratepath = '';
$this->_supplement_scripts = array();
$this->_supplement_stylesheets = array();
$this->_showreport = false;
$this->_verbose_array = array();
$this->_usejQuery = false;
$this->_usejQueryUI = false;
//$this->_usejQueryfromJoomla = false;
//$this->_usejQueryUIfromJoomla = false;
$this->_enabled = true;
$this->_timeafterroute = 0;
$this->_timebeforerender = 0;
$this->_timeafterrender = 0;
$this->_jquery_loaded_by_template = false;
$this->_jqueryui_loaded_by_template = false;
$this->_bootstrap_loaded_by_template = false;
$this->_back_compat_path = false;
}
示例8: JVersion
function __construct(& $subject, $config) {
// Check if Kunena API exists
$api = JPATH_ADMINISTRATOR . '/components/com_kunena/api.php';
if (! is_file ( $api ))
return false;
jimport ( 'joomla.application.component.helper' );
// Check if Kunena component is installed/enabled
if (! JComponentHelper::isEnabled ( 'com_kunena', true )) {
return false;
}
// Load Kunena API
require_once $api;
// Fix Joomla 1.5 bugs and bad performance
$version = new JVersion();
if ($version->RELEASE == '1.5') {
$lang = JFactory::getLanguage();
if (JFactory::getApplication()->isAdmin()) {
$lang->load('com_kunena.menu', JPATH_ADMINISTRATOR);
} else {
$filename = JLanguage::getLanguagePath( JPATH_BASE, $lang->_lang)."/{$lang->_lang}.com_kunena.ini";
$lang->_paths['com_kunena'][$filename] = 1;
}
}
parent::__construct ( $subject, $config );
}
示例9: __construct
/**
* Constructor
*
* @access protected
*
* @param object $subject The object to observe
* @param array $config An array that holds the plugin configuration
*
* @since 1.0.0
*/
public function __construct(&$subject, $config)
{
parent::__construct($subject, $config);
if (JFactory::getApplication()->isAdmin()) {
$this->loadLanguage();
}
}
示例10: plgSystemJomsocialUpdate
public function plgSystemJomsocialUpdate(&$subject, $config)
{
parent::__construct($subject, $config);
$this->mainframe = JFactory::getApplication();
$lang = JFactory::getLanguage();
$lang->load('com_community.menu', JPATH_ADMINISTRATOR);
}
示例11: __construct
/**
* Constructor
*
* @access public
* @param object &$subject The object to observe
*/
public function __construct(&$subject)
{
if (isset($_GET['sgCacheCheck']) && $_GET['sgCacheCheck'] == md5('joomlaCheck')) {
die('OK');
}
parent::__construct($subject);
$plugin = JPluginHelper::getPlugin('system', 'jSGCache');
$this->params = new JRegistry();
$this->params->loadString($plugin->params, 'JSON');
$this->_cacheEnabled = $this->params->get('cache_enabled');
if ($this->_cacheEnabled === null) {
$this->_cacheEnabled == 1;
}
$this->_autoflush = $this->params->get('autoFlush');
if ($this->_autoflush === null) {
$this->_autoflush = 1;
}
$this->_autoflush3rdParty = $this->params->get('autoFlush-ThirdParty');
if ($this->_autoflush3rdParty === null) {
$this->_autoflush3rdParty = 1;
}
$this->_autoflushClientSide = $this->params->get('autoFlush-ClientSide');
if ($this->_autoflushClientSide === null) {
$this->_autoflushClientSide = 0;
}
}
示例12: __construct
/**
* Constructor.
*
* @param object &$subject The object to observe
* @param array $config An array that holds the plugin configuration
*
* @since 1.5
*/
public function __construct(&$subject, $config)
{
parent::__construct($subject, $config);
// Log the deprecated API.
if ($this->params->get('log-deprecated')) {
JLog::addLogger(array('text_file' => 'deprecated.php'), JLog::ALL, array('deprecated'));
}
$this->debugLang = JFactory::getApplication()->getCfg('debug_lang');
// Only if debugging or language debug is enabled
if (JDEBUG || $this->debugLang) {
JFactory::getConfig()->set('gzip', 0);
ob_start();
ob_implicit_flush(false);
}
$this->linkFormat = ini_get('xdebug.file_link_format');
if ($this->params->get('logs', 1)) {
$priority = 0;
foreach ($this->params->get('log_priorities', array()) as $p) {
$const = 'JLog::' . strtoupper($p);
if (!defined($const)) {
continue;
}
$priority |= constant($const);
}
// Split into an array at any character other than alphabet, numbers, _, ., or -
$categories = array_filter(preg_split('/[^A-Z0-9_\\.-]/i', $this->params->get('log_categories', '')));
$mode = $this->params->get('log_category_mode', 0);
JLog::addLogger(array('logger' => 'callback', 'callback' => array($this, 'logger')), $priority, $categories, $mode);
}
// Prepare disconnect-handler for SQL profiling:
$db = JFactory::getDbo();
$db->addDisconnectHandler(array($this, 'mysqlDisconnectHandler'));
}
示例13: __construct
/**
* Public constructor for the plugin
*
* @param object $subject The object to observe
* @param array $config An optional associative array of configuration settings.
*
* @return \plgAkpaymentAbstract
*/
public function __construct(&$subject, $config = array())
{
if (!is_object($config['params'])) {
JLoader::import('joomla.registry.registry');
$config['params'] = new JRegistry($config['params']);
}
parent::__construct($subject, $config);
if (array_key_exists('ppName', $config)) {
$this->ppName = $config['ppName'];
}
if (array_key_exists('ppImage', $config)) {
$this->ppImage = $config['ppImage'];
}
$name = $this->ppName;
if (array_key_exists('ppKey', $config)) {
$this->ppKey = $config['ppKey'];
} else {
$this->ppKey = "PLG_AKPAYMENT_{$name}_TITLE";
}
if (array_key_exists('ppRecurringCancellation', $config)) {
$this->ppRecurringCancellation = $config['ppRecurringCancellation'];
}
require_once JPATH_ADMINISTRATOR . '/components/com_akeebasubs/helpers/cparams.php';
// Load the language files
$jlang = JFactory::getLanguage();
$jlang->load('plg_akpayment_' . $name, JPATH_ADMINISTRATOR, 'en-GB', true);
$jlang->load('plg_akpayment_' . $name, JPATH_ADMINISTRATOR, $jlang->getDefault(), true);
$jlang->load('plg_akpayment_' . $name, JPATH_ADMINISTRATOR, null, true);
}
示例14:
/**
* Constructor
* @param object $subject The object to observe
* @param array $config An array that holds the plugin configuration
* @since 1.5
*/
function plgUserJobboard_Usersync(&$subject, $config)
{
parent::__construct($subject, $config);
$lang =& JFactory::getLanguage();
$lang->load('plg_jobboard_usersync', JPATH_ADMINISTRATOR);
//$this->_itemid = JRequest::getInt('Itemid');
}
示例15: __construct
/**
* Initialises the System - Admin Tools plugin
*
* @param object $subject The object to observe
* @param array $config Configuration information
*/
public function __construct(&$subject, $config = array())
{
// Autoload the language strings
$this->autoloadLanguage = true;
// Call the parent constructor
parent::__construct($subject, $config);
// Under Joomla 2.5 we have to explicitly load the application and the database,
// the parent class won't do that for us.
if (is_null($this->app)) {
$this->app = JFactory::getApplication();
}
if (is_null($this->db)) {
$this->db = JFactory::getDbo();
}
// Store a reference to the global input object
$this->input = JFactory::getApplication()->input;
// Load the component parameters
$this->loadComponentParameters();
// Work around IP issues with transparent proxies etc
$this->workaroundIP();
// Load the GeoIP library, if necessary
$this->loadGeoIpProvider();
// Preload the security exceptions handler object
$this->loadExceptionsHandler();
// Load the WAF Exceptions
$this->loadWAFExceptions();
// Load and register the plugin features
$this->loadFeatures();
}