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


PHP JPluginHelper::_import方法代码示例

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


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

示例1: importPlugin

 /**
  * Loads all the plugin files for a particular type if no specific plugin is specified
  * otherwise only the specific pugin is loaded.
  *
  * @access public
  * @param string 	$type 	The plugin type, relates to the sub-directory in the plugins directory
  * @param string 	$plugin	The plugin name
  * @return boolean True if success
  */
 public static function importPlugin($type, $plugin = null, $autocreate = true, $dispatcher = null)
 {
     $result = false;
     $plugins = JPluginHelper::_load();
     $total = count($plugins);
     for ($i = 0; $i < $total; $i++) {
         if ($plugins[$i]->type == $type && ($plugins[$i]->name == $plugin || $plugin === null)) {
             JPluginHelper::_import($plugins[$i], $autocreate, $dispatcher);
             $result = true;
         }
     }
     return $result;
 }
开发者ID:stonyyi,项目名称:anahita,代码行数:22,代码来源:helper.php

示例2: importPlugin

 /**
  * Loads all the plugin files for a particular type if no specific plugin is specified
  * otherwise only the specific pugin is loaded.
  *
  * @access public
  * @param string 	$type 	The plugin type, relates to the sub-directory in the plugins directory
  * @param string 	$plugin	The plugin name
  * @return boolean True if success
  */
 function importPlugin($type, $plugin = null)
 {
     $result = false;
     $plugins = JPluginHelper::_load();
     $total = count($plugins);
     for ($i = 0; $i < $total; $i++) {
         if ($plugins[$i]->type == $type && ($plugins[$i]->element == $plugin || $plugin === null)) {
             JPluginHelper::_import($plugins[$i]);
             $result = true;
         }
     }
     return $result;
 }
开发者ID:plexicloud,项目名称:Plexicloud-Pleximedia,代码行数:22,代码来源:JTubePluginHelper.php

示例3: importPlugin

 /**
  * Loads all the plugin files for a particular type if no specific plugin is specified
  * otherwise only the specific pugin is loaded.
  *
  * @access	public
  * @param	string 		$type 		The plugin type, relates to the sub-directory in the plugins directory.
  * @param	string 		$plugin		The plugin name.
  * @return	boolean		True if success
  */
 public static function importPlugin($type, $plugin = null, $autocreate = true, $dispatcher = null)
 {
     $results = null;
     // Load the plugins from the database.
     $plugins = JPluginHelper::_load();
     // Get the specified plugin(s).
     for ($i = 0, $t = count($plugins); $i < $t; $i++) {
         if ($plugins[$i]->type == $type && ($plugins[$i]->name == $plugin || $plugin === null)) {
             JPluginHelper::_import($plugins[$i], $autocreate, $dispatcher);
             $results = true;
         }
     }
     return $results;
 }
开发者ID:joebushi,项目名称:joomla,代码行数:23,代码来源:helper.php

示例4: define

    exit;
}
define('_JEXEC', 1);
define('JPATH_BASE', dirname(dirname(dirname(dirname(dirname(__FILE__))))));
define('DS', DIRECTORY_SEPARATOR);
$results = array();
require_once JPATH_BASE . DS . 'includes' . DS . 'defines.php';
require JPATH_LIBRARIES . DS . 'joomla' . DS . 'import.php';
require JPATH_LIBRARIES . DS . 'joomla' . DS . 'user' . DS . 'user.php';
require JPATH_LIBRARIES . DS . 'joomla' . DS . 'language' . DS . 'language.php';
require JPATH_LIBRARIES . DS . 'joomla' . DS . 'environment' . DS . 'uri.php';
require JPATH_LIBRARIES . DS . 'joomla' . DS . 'event' . DS . 'dispatcher.php';
require JPATH_LIBRARIES . DS . 'joomla' . DS . 'utilities' . DS . 'string.php';
require JPATH_LIBRARIES . DS . 'joomla' . DS . 'application' . DS . 'menu.php';
$mainframe =& JFactory::getApplication('site');
$mainframe->initialise();
$plugins = JPluginHelper::_load();
$total = count($plugins);
for ($i = 0; $i < $total; $i++) {
    if ($plugins[$i]->type == 'system' && in_array($plugins[$i]->name, array('sef', 'sef_advance'))) {
        JPluginHelper::_import($plugins[$i]);
    }
}
$mainframe->triggerEvent('onAfterInitialise');
foreach ($_POST['pages'] as $url) {
    $url = urldecode($url);
    $results[] = JRoute::_($url);
}
print_r($results);
unset($mainframe);
return $results;
开发者ID:bizanto,项目名称:Hooked,代码行数:31,代码来源:jroute.php

示例5: loadBot

 /**
  * Loads the bot file
  * @param string The folder (group)
  * @param string The elements (name of file without extension)
  * @param int Published state
  * @param string The params for the bot
  */
 function loadBot($folder, $element, $published, $params = '')
 {
     return JPluginHelper::_import($folder, $element, $published, $params = '');
 }
开发者ID:kaantunc,项目名称:MYK-BOR,代码行数:11,代码来源:mambothandler.php

示例6: processArticle


//.........这里部分代码省略.........
                             if (!(strpos($tag, 'text') === false) || !(strpos($tag, 'intro') === false) || !(strpos($tag, 'full') === false)) {
                                 // TEXT data
                                 $article->text = '';
                                 if (!(strpos($tag, 'intro') === false)) {
                                     if (isset($article->introtext)) {
                                         $article->text = $article->introtext;
                                         $ok = 1;
                                     }
                                 } else {
                                     if (!(strpos($tag, 'full') === false)) {
                                         if (isset($article->fulltext)) {
                                             $article->text = $article->fulltext;
                                             $ok = 1;
                                         }
                                     } else {
                                         if (!(strpos($tag, 'text') === false)) {
                                             if (isset($article->introtext) && isset($article->fulltext)) {
                                                 $article->text = $article->introtext . $article->fulltext;
                                                 $ok = 1;
                                             }
                                         }
                                     }
                                 }
                                 if ($type == 'k2') {
                                     $article->parameters = new JParameter($article->params);
                                 } else {
                                     $article->parameters = new JParameter($article->attribs);
                                 }
                                 if ($this->params->run_content_plugins) {
                                     if (!$this->params->dispatcher) {
                                         $plugins = JPluginHelper::_load();
                                         foreach ($plugins as $plugin) {
                                             if ($plugin->type == 'content' || $plugin->type == 'system' || $plugin->type == 'k2') {
                                                 JPluginHelper::_import($plugin);
                                             }
                                         }
                                         $this->params->dispatcher = clone JDispatcher::getInstance();
                                         foreach ($this->params->dispatcher->_observers as $i => $observer) {
                                             if (!is_array($observer) && ($observer->_name == 'articlesanywhere' || $observer->_name == 'betterpreview')) {
                                                 unset($this->params->dispatcher->_observers[$i]);
                                             }
                                         }
                                     }
                                     $this->params->dispatcher->trigger('onPrepareContent', array(&$article, &$article->parameters, 0));
                                 }
                                 $str = $article->text;
                                 if ($extra) {
                                     $attribs = explode(':', $extra);
                                     $max = 0;
                                     $strip = 0;
                                     foreach ($attribs as $attrib) {
                                         if (trim($attrib) == 'strip') {
                                             $strip = 1;
                                         } else {
                                             $max = $attrib;
                                         }
                                     }
                                     $word_limit = !(strpos($max, 'word') === false);
                                     if ($strip) {
                                         // remove pagenavcounter
                                         $str = preg_replace('#(<' . 'div class="pagenavcounter">.*?</div>)#si', ' ', $str);
                                         // remove pagenavbar
                                         $str = preg_replace('#(<' . 'div class="pagenavbar">(<div>.*?</div>)*</div>)#si', ' ', $str);
                                         // remove scripts
                                         $str = preg_replace('#(<' . 'script[^a-z0-9].*?</script>)#si', ' ', $str);
                                         $str = preg_replace('#(<' . 'noscript[^a-z0-9].*?</noscript>)#si', ' ', $str);
开发者ID:jtresca,项目名称:nysurveyor,代码行数:67,代码来源:helper.php

示例7: siteRoute

 /**
  * This function is used as a replacement to JRoute::_() to generate sef urls in Joomla admin
  * 
  * @param mixed $urls
  * @param mixed $xhtml
  * @param mixed $ssl
  */
 function siteRoute($urls, $xhtml = true, $ssl = null)
 {
     global $mainframe;
     !is_array($urls) and $urls = array($urls);
     $parsed_urls = array();
     // Check if plugins already processed
     $_this = cmsFramework::getInstance();
     if (!is_object($_this->jMainframe)) {
         // Backup original mainframe object
         $_this->jMainframe = clone $mainframe;
         // Get a new mainframe object to process the sef plugins
         $mainframe = JApplication::getInstance('site');
         $router = $mainframe->getRouter();
         $plugins = JPluginHelper::_load();
         $total = count($plugins);
         for ($i = 0; $i < $total; $i++) {
             $plugins[$i]->type == 'system' and in_array($plugins[$i]->name, $_this->sef_plugins) and JPluginHelper::_import($plugins[$i]);
         }
         if (class_exists('plgSystemSEF_Advance')) {
             plgSystemSEF_Advance::trigger();
         } else {
             $mainframe->triggerEvent('onAfterInitialise');
         }
         // Store modified mainframe object with sef plugin router
         $_this->newMainframe = $mainframe;
     } else {
         // Load the modified mainframe object with sef plugin router
         $mainframe = $_this->newMainframe;
     }
     $router = $mainframe->getRouter();
     foreach ($urls as $url) {
         $uri = $router->build($url);
         $parsed_url = $uri->toString();
         $parsed_urls[] = str_replace('/administrator', '', $parsed_url);
     }
     // Restore original mainframe object
     $mainframe = $_this->jMainframe;
     return count($parsed_urls) == 1 ? array_shift($parsed_urls) : $parsed_urls;
 }
开发者ID:bizanto,项目名称:Hooked,代码行数:46,代码来源:joomla15.php


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