本文整理汇总了PHP中JPluginHelper::_load方法的典型用法代码示例。如果您正苦于以下问题:PHP JPluginHelper::_load方法的具体用法?PHP JPluginHelper::_load怎么用?PHP JPluginHelper::_load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JPluginHelper
的用法示例。
在下文中一共展示了JPluginHelper::_load方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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;
}
示例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;
示例5: processArticle
//.........这里部分代码省略.........
$ok = 1;
}
} else {
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);
示例6: 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;
}