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


PHP JModuleHelper::_load方法代码示例

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


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

示例1: count

 /**
  * Get module by id
  *
  * @param   integer  $id   The id of the module
  * @return  object  The Module object
  * @author	Sakis Terz
  * @since	1.6.0
  */
 public static function &getModule($id)
 {
     $result = null;
     $modules =& JModuleHelper::_load();
     $total = count($modules);
     for ($i = 0; $i < $total; $i++) {
         // Match the id of the module
         if ($modules[$i]->id == (int) $id) {
             // Found it
             $result =& $modules[$i];
             break;
             // Found it
         }
     }
     // If we didn't find it, and the name is mod_something, create a dummy object
     if (is_null($result)) {
         $result = parent::getModule('mod_cf_filtering');
         if (is_null($result)) {
             $result = new stdClass();
             $result->id = 0;
             $result->title = '';
             $result->module = 'mod_cf_filtering';
             $result->position = '';
             $result->content = '';
             $result->showtitle = 0;
             $result->control = '';
             $result->params = '';
             $result->user = 0;
         }
     }
     return $result;
 }
开发者ID:alesconti,项目名称:FF_2015,代码行数:40,代码来源:cfmoduleHelper.php

示例2: load

 public static function load()
 {
     if (MagebridgeModelConfig::load('preload_all_modules') == 0 && JRequest::getInt('Itemid') != 0) {
         static $modules = null;
         if (is_array($modules) == false) {
             $modules = JModuleHelper::_load();
             foreach ($modules as $index => $module) {
                 if (strstr($module->module, 'mod_magebridge') == false) {
                     unset($modules[$index]);
                 }
             }
         }
         return $modules;
     }
     $application = JFactory::getApplication();
     $db = JFactory::getDBO();
     $where = array();
     $where[] = 'm.published = 1';
     $where[] = 'm.module LIKE "mod_magebridge%"';
     $where[] = 'm.client_id = ' . (int) $application->getClientId();
     $query = 'SELECT m.*' . ' FROM #__modules AS m' . ' LEFT JOIN #__modules_menu AS mm ON mm.moduleid = m.id' . ' WHERE ' . implode(' AND ', $where) . ' ORDER BY m.position, m.ordering';
     $db->setQuery($query);
     $modules = $db->loadObjectList();
     return $modules;
 }
开发者ID:traveladviser,项目名称:magebridge-mirror,代码行数:25,代码来源:module.php

示例3: getModules

 /**
  * Get modules by position
  *
  * @param   string  $position  The position of the module
  *
  * @return  array  An array of module objects
  *
  * @since   11.1
  */
 public static function getModules($position)
 {
     // [!] HUBzero compatibility
     if (class_exists('\\Module')) {
         return \Module::byPosition($position);
     }
     $position = strtolower($position);
     $result = array();
     $modules =& JModuleHelper::_load();
     $total = count($modules);
     for ($i = 0; $i < $total; $i++) {
         if ($modules[$i]->position == $position) {
             $result[] =& $modules[$i];
         }
     }
     if (count($result) == 0) {
         if (JRequest::getBool('tp') && JComponentHelper::getParams('com_templates')->get('template_positions_display')) {
             $result[0] = JModuleHelper::getModule('mod_' . $position);
             $result[0]->title = $position;
             $result[0]->content = $position;
             $result[0]->position = $position;
         }
     }
     return $result;
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:34,代码来源:helper.php

示例4: strtolower

 /**
  * Get modules by position
  *
  * @param   string  $position  The position of the module
  *
  * @return  array  An array of module objects
  * 
  * @since   11.1
  */
 public static function &getModules($position)
 {
     $app = JFactory::getApplication();
     $position = strtolower($position);
     $result = array();
     if (!empty($position) && MageBridgeTemplateHelper::allowPosition($position) == false) {
         return $result;
     }
     $modules = JModuleHelper::_load();
     $total = count($modules);
     for ($i = 0; $i < $total; $i++) {
         if ($modules[$i]->position == $position) {
             $result[] =& $modules[$i];
         }
     }
     if (count($result) == 0) {
         if (JRequest::getBool('tp') && JComponentHelper::getParams('com_templates')->get('template_positions_display')) {
             $result[0] = JModuleHelper::getModule('mod_' . $position);
             $result[0]->title = $position;
             $result[0]->content = $position;
             $result[0]->position = $position;
         }
     }
     return $result;
 }
开发者ID:traveladviser,项目名称:magebridge-mirror,代码行数:34,代码来源:helper.php

示例5: __construct

 /**
  * Constructor
  *
  * @param	array An optional associative array of configuration settings.
  */
 public function __construct(KConfig $config)
 {
     parent::__construct($config);
     $this->_state->insert('position', 'cmd')->insert('module', 'cmd')->insert('limit', 'int', 0);
     KLoader::load('lib.joomla.application.module.helper');
     $this->_list =& JModuleHelper::_load();
     $this->_total = count($this->_list);
 }
开发者ID:ravenlife,项目名称:Ninja-Framework,代码行数:13,代码来源:modules.php

示例6: strtolower

 /**
  * Get modules by position
  *
  * @access public
  * @param string 	$position	The position of the module
  * @return array	An array of module objects
  */
 function &getModules($position)
 {
     $position = strtolower($position);
     $result = array();
     $modules =& JModuleHelper::_load();
     $total = count($modules);
     for ($i = 0; $i < $total; $i++) {
         if ($modules[$i]->position == $position) {
             $result[] =& $modules[$i];
         }
     }
     return $result;
 }
开发者ID:Fellah,项目名称:govnobaki,代码行数:20,代码来源:helper.php

示例7: strtolower

 /**
  * Get modules by position
  *
  * @access public
  * @param string 	$position	The position of the module
  * @return array	An array of module objects
  */
 function &getModules($position)
 {
     $position = strtolower($position);
     $result = array();
     $modules =& JModuleHelper::_load();
     $total = count($modules);
     for ($i = 0; $i < $total; $i++) {
         if ($modules[$i]->position == $position) {
             $result[] =& $modules[$i];
         }
     }
     if (count($result) == 0) {
         if (JRequest::getBool('tp')) {
             $result[0] = JModuleHelper::getModule('mod_' . $position);
             $result[0]->title = $position;
             $result[0]->content = $position;
             $result[0]->position = $position;
         }
     }
     return $result;
 }
开发者ID:JSWebdesign,项目名称:intranet-platform,代码行数:28,代码来源:helper.php

示例8: strtolower

 /**
  * Get modules by position
  *
  * @param string 	$position	The position of the module
  *
  * @return array	An array of module objects
  */
 public static function &getModules($position)
 {
     $app =& JFactory::getApplication();
     $position = strtolower($position);
     $result = array();
     $modules =& JModuleHelper::_load();
     $total = count($modules);
     for ($i = 0; $i < $total; $i++) {
         if ($modules[$i]->position == $position) {
             $result[] =& $modules[$i];
         }
     }
     if (count($result) == 0) {
         if ($app->getCfg('debug_modules') && JRequest::getBool('tp')) {
             $result[0] = JModuleHelper::getModule('mod_' . $position);
             $result[0]->title = $position;
             $result[0]->content = $position;
             $result[0]->position = $position;
         }
     }
     return $result;
 }
开发者ID:joebushi,项目名称:joomla,代码行数:29,代码来源:helper.php

示例9: displayCart

 /**
  * Displays the cart, expects to be called via ajax
  *
  * @return unknown_type
  */
 function displayCart()
 {
     JLoader::import('com_tienda.library.json', JPATH_ADMINISTRATOR . '/components');
     jimport('joomla.application.module.helper');
     $modules = JModuleHelper::_load();
     if (empty($modules)) {
         echo json_encode(array('msg' => ''));
         return;
     }
     foreach ($modules as $module) {
         if ($module->module == 'mod_tienda_cart') {
             $mainframe = JFactory::getApplication();
             $mainframe->setUserState('mod_usercart.isAjax', '1');
             echo json_encode(array('msg' => JModuleHelper::renderModule($module)));
             return;
         }
     }
     echo json_encode(array('msg' => ''));
     return;
 }
开发者ID:annggeel,项目名称:tienda,代码行数:25,代码来源:productcompare.php

示例10: render

 public function render($content = ' ', $title = false, array $module = array(), $attribs = array())
 {
     /*
     		KLoader::load('lib.joomla.application.module.helper');
     		$load =& JModuleHelper::_load();
     		$load[] = (object) array(
     			'id' => 50,
     			'title' => $title,
     			     'module' => 'mod_custom',
     			     'position' => 'above',
     			     'content' => $content,
     			     'showtitle' => 1,
     			     'control' => '',
     			     'params' => '
     			moduleclass_sfx=-slide red
     			cache=0
     			
     			',
     			     'user' => 0,
     			     'name' => 'custom',
     			     //'style' => isset($module['style']) ? $module['style'] : 'rounded',
     			     'style' => 'xhtml'
     		);
     		return null;
     		die('<pre>'.print_r($load, true).'</pre>');
     		//*/
     /*
     	 0 => 
     stdClass::__set_state(array(
        'id' => '50',
        'title' => 'Breadcrumb',
        'module' => 'mod_breadcrumbs',
        'position' => 'breadcrumb',
        'content' => '',
        'showtitle' => '0',
        'control' => '',
        'params' => 'showHome=1
     	homeText=Home
     	showLast=1
     	separator=
     	moduleclass_sfx=
     	cache=0
     	
     	',
        'user' => 0,
        'name' => 'breadcrumbs',
        'style' => NULL,
     )),
     */
     $tmp = $module;
     $module = new KObject();
     $module->params = 'moduleclass_sfx=' . @$tmp['moduleclass_sfx'];
     $module->module = 'mod_' . $this->_identifier->package . '_' . $this->_identifier->name;
     $module->id = KFactory::tmp('lib.koowa.filter.int')->sanitize(uniqid());
     $module->title = (string) $title;
     $module->style = isset($tmp['style']) ? $tmp['style'] : 'rounded';
     $module->position = $this->_identifier->package . '-' . $this->_identifier->name;
     $module->showtitle = (bool) $title;
     $module->name = $this->_identifier->package . '_' . $this->_identifier->name;
     $module->user = 0;
     $module->content = $content;
     $module->set($tmp);
     if (!isset($attribs['name'])) {
         $attribs['name'] = $module->position;
     }
     if (!isset($attribs['style'])) {
         $attribs['style'] = $module->style;
     }
     if (!isset($attribs['first'])) {
         $attribs['first'] = null;
     }
     if (!isset($attribs['last'])) {
         $attribs['last'] = null;
     }
     if (($yoofix = JPATH_THEMES . DS . KFactory::get('lib.joomla.application')->getTemplate() . DS . 'lib' . DS . 'php' . DS . 'template.php') && ($isYoo = file_exists($yoofix))) {
         require_once $yoofix;
     }
     if ($isYoo) {
         $attribs['style'] = 'yoo';
     }
     static $chrome;
     $mainframe = JFactory::getApplication();
     $scope = $mainframe->scope;
     //record the scope
     $mainframe->scope = $module->module;
     //set scope to Component name
     // Get module parameters
     $params = new JParameter($module->params);
     // Get module path
     $module->module = preg_replace('/[^A-Z0-9_\\.-]/i', '', $module->module);
     $path = JPATH_BASE . DS . 'modules' . DS . $module->module . DS . $module->module . '.php';
     // Load the module
     if (!$module->user && file_exists($path) && empty($module->content)) {
         $lang =& JFactory::getLanguage();
         $lang->load($module->module);
         $content = '';
         ob_start();
         require $path;
         $module->content = ob_get_contents() . $content;
         ob_end_clean();
//.........这里部分代码省略.........
开发者ID:ravenlife,项目名称:Ninja-Framework,代码行数:101,代码来源:html.php

示例11: removeMenu

 function removeMenu($menutype = 'mainmenu')
 {
     $tt =& JModuleHelper::_load();
     foreach ($tt as $k => $mod) {
         if (!is_object($mod)) {
             continue;
         }
         if (preg_match("/menutype={$menutype}/i", $mod->params)) {
             $tt[$k]->position = 'none';
         }
     }
 }
开发者ID:Arturogcalleja,项目名称:herbolario,代码行数:12,代码来源:functions.php

示例12: getModule

 function getModule($id = 0, $name = '')
 {
     $modules =& JModuleHelper::_load();
     $total = count($modules);
     for ($i = 0; $i < $total; $i++) {
         // Match the name of the module
         if ($modules[$i]->id == $id || $modules[$i]->name == $name) {
             return $modules[$i];
         }
     }
     return null;
 }
开发者ID:laiello,项目名称:senluonirvana,代码行数:12,代码来源:layout.php

示例13:

		/**
		 * Implements myLoad to overwrite load()
		 *
		 * @return array
		 */
		public static function &myLoad( ) {
			return JModuleHelper::_load();
		}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:8,代码来源:cbsubs.content_helper.php

示例14: preloadModules

 /**
  * Preload modules 
  * 
  * @todo: This is currently not working
  * @access private
  * @param null
  * @return null
  */
 private function preloadModules()
 {
     //MageBridgeModelDebug::getInstance()->notice( 'System Plugin: Preloading modules' );
     // Check the configuration variables
     $module_chrome = $this->loadConfig('module_chrome');
     $module_show_title = $this->loadConfig('module_show_title');
     if (empty($module_chrome) && empty($module_show_title)) {
         return;
     }
     // Import the module-helper
     jimport('joomla.application.module.helper');
     $modules =& JModuleHelper::_load();
     // Load settings
     foreach ($modules as $index => $module) {
         if (preg_match('/^mod_magebridge_/', $module->module)) {
             $mod =& JModuleHelper::getModule($module->name, $module->title);
             if (!empty($module_chrome)) {
                 $mod->style = $module_chrome;
             }
             if (!empty($module_show_title)) {
                 $mod->show_title = (int) $module_show_title;
             }
         }
     }
 }
开发者ID:traveladviser,项目名称:magebridge-mirror,代码行数:33,代码来源:magebridge.php

示例15:

 /**
  * Return modules, optionally filtered by position
  *
  * @param  string|null $position Module position
  * @return array
  */
 public static function &getModules($position)
 {
     if ($position) {
         $modules =& JModuleHelper::getModules($position);
     } else {
         $modules =& JModuleHelper::_load();
     }
     return $modules;
 }
开发者ID:daodaoliang,项目名称:nooku-framework,代码行数:15,代码来源:module.php


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