/** * @param string The position * @param int The style. 0=normal, 1=horiz, -1=no wrapper */ function mosLoadModules($position = 'left', $style = 0) { global $mosConfig_gzip, $mosConfig_absolute_path, $database, $my, $Itemid, $mosConfig_caching; $tp = mosGetParam($_GET, 'tp', 0); if ($tp) { echo '<div style="height:50px;background-color:#eee;margin:2px;padding:10px;border:1px solid #f00;color:#700;">'; echo $position; echo '</div>'; return; } $style = intval($style); $cache =& mosCache::getCache('com_content'); require_once 'includes/frontend.html.php'; /* $query = "SELECT id, title, module, position, content, showtitle, params" ."\nFROM #__modules AS m, #__modules_menu AS mm" . "\nWHERE m.published='1' AND m.access <= '$my->gid' AND m.position='$position' AND m.client_id='0'" . "\nAND mm.moduleid=m.id" . "\nAND (mm.menuid = '$Itemid' OR mm.menuid = '0')" . "\nORDER BY ordering"; $database->setQuery( $query ); $modules = $database->loadObjectList(); if($database->getErrorNum()) { echo "MA ".$database->stderr(true); return; } */ $allModules =& initModules(); if (isset($GLOBALS['_MOS_MODULES'][$position])) { $modules = $GLOBALS['_MOS_MODULES'][$position]; } else { $modules = array(); } if (count($modules) < 1) { $style = 0; } if ($style == 1) { echo "<table cellspacing=\"1\" cellpadding=\"0\" border=\"0\" width=\"100%\">\n"; echo "<tr>\n"; } $prepend = $style == 1 ? "<td valign=\"top\">\n" : ''; $postpend = $style == 1 ? "</td>\n" : ''; foreach ($modules as $module) { $params =& new mosParameters($module->params); echo $prepend; if (substr("{$module->module}", 0, 4) == "mod_") { if ($params->get('cache') == 1 && $mosConfig_caching == 1) { $cache->call('modules_html::module2', $module, $params, $Itemid, $style); } else { modules_html::module2($module, $params, $Itemid, $style); } } else { if ($params->get('cache') == 1 && $mosConfig_caching == 1) { $cache->call('modules_html::module', $module, $params, $Itemid, $style); } else { modules_html::module($module, $params, $Itemid, $style); } } echo $postpend; } if ($style == 1) { echo "</tr>\n</table>\n"; } }
public static function modoutput_rounded($module, $params, $Itemid, $moduleclass_sfx, $type = 0) { global $mosConfig_live_site, $mosConfig_sitename, $mosConfig_lang, $mosConfig_absolute_path; global $mainframe, $database, $my; ?> <div class="module<?php echo $moduleclass_sfx; ?> "> <div> <div> <div> <?php if ($module->showtitle != 0) { echo "<h3>" . htmlspecialchars($module->title) . "</h3>"; } if ($type) { modules_html::CustomContent($module, $params); } else { include $mosConfig_absolute_path . '/modules/' . $module->module . '.php'; if (isset($content)) { echo $content; } } ?> </div> </div> </div> </div> <?php }
/** * @param string The position * @param int The style. 0=normal, 1=horiz, -1=no wrapper */ function mosLoadModules($position = 'left', $style = 0) { global $mosConfig_gzip, $mosConfig_absolute_path, $database, $my, $Itemid, $mosConfig_caching; $tp = intval(mosGetParam($_GET, 'tp', 0)); if ($tp) { echo '<div style="height:50px;background-color:#eee;margin:2px;padding:10px;border:1px solid #f00;color:#700;">'; echo $position; echo '</div>'; return; } $style = intval($style); $cache =& mosCache::getCache('com_content'); require_once $mosConfig_absolute_path . '/includes/frontend.html.php'; $allModules =& initModules(); if (isset($GLOBALS['_MOS_MODULES'][$position])) { $modules = $GLOBALS['_MOS_MODULES'][$position]; } else { $modules = array(); } if (count($modules) < 1) { $style = 0; } if ($style == 1) { echo "<table cellspacing=\"1\" cellpadding=\"0\" border=\"0\" width=\"100%\">\n"; echo "<tr>\n"; } $prepend = $style == 1 ? "<td valign=\"top\">\n" : ''; $postpend = $style == 1 ? "</td>\n" : ''; $count = 1; foreach ($modules as $module) { $params = new mosParameters($module->params); echo $prepend; if (substr("{$module->module}", 0, 4) == 'mod_') { // normal modules if ($params->get('cache') == 1 && $mosConfig_caching == 1) { // module caching $cache->call('modules_html::module2', $module, $params, $Itemid, $style, $my->gid); } else { modules_html::module2($module, $params, $Itemid, $style, $count); } } else { // custom or new modules if ($params->get('cache') == 1 && $mosConfig_caching == 1) { // module caching $cache->call('modules_html::module', $module, $params, $Itemid, $style, 0, $my->gid); } else { modules_html::module($module, $params, $Itemid, $style); } } echo $postpend; $count++; } if ($style == 1) { echo "</tr>\n</table>\n"; } }