/** * Get the administrator login module by name (real, eg 'login' or folder, eg 'mod_login') * * @param string $name The name of the module * @param string $title The title of the module, optional * * @return object The Module object * * @since 11.1 */ public static function getLoginModule($name = 'mod_login', $title = null) { $result = null; $modules = LoginModelLogin::_load($name); $total = count($modules); for ($i = 0; $i < $total; $i++) { // Match the title if we're looking for a specific instance of the module if (!$title || $modules[$i]->title == $title) { $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) && substr($name, 0, 4) == 'mod_') { $result = new stdClass(); $result->id = 0; $result->title = ''; $result->module = $name; $result->position = ''; $result->content = ''; $result->showtitle = 0; $result->control = ''; $result->params = ''; $result->user = 0; } return $result; }
<?php /** * @package Joomla.Administrator * @subpackage com_login * * @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JHtml::_('behavior.noframes'); // Get the login modules // If you want to use a completely different login module change the value of name // in your layout override. $loginmodule = LoginModelLogin::getLoginModule('mod_login'); echo JModuleHelper::renderModule($loginmodule, array('style' => 'rounded', 'id' => 'section-box')); //Get any other modules in the login position. //If you want to use a different position for the modules, change the name here in your override. $modules = JModuleHelper::getModules('login'); foreach ($modules as $module) { // Render the login modules if ($module->module != 'mod_login') { echo JModuleHelper::renderModule($module, array('style' => 'rounded', 'id' => 'section-box')); } }