Skip to content

Commit

Permalink
Merge pull request #22 from Bakual/ModuleTitle
Browse files Browse the repository at this point in the history
Directly change the module title in the module.
  • Loading branch information
infograf768 committed Sep 24, 2015
2 parents e3c698a + 722a7ea commit 3906b28
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 20 deletions.
6 changes: 6 additions & 0 deletions administrator/modules/mod_latest/mod_latest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,10 @@
require_once __DIR__ . '/helper.php';

$list = ModLatestHelper::getList($params);

if ($params->get('automatic_title', 0))
{
$module->title = ModLatestHelper::getTitle($params);
}

require JModuleHelper::getLayoutPath('mod_latest', $params->get('layout', 'default'));
4 changes: 2 additions & 2 deletions administrator/modules/mod_latest/mod_latest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@
default="0"
label="COM_MODULES_FIELD_AUTOMATIC_TITLE_LABEL"
description="COM_MODULES_FIELD_AUTOMATIC_TITLE_DESC">
<option
value="0">JNO</option>
<option
value="1">JYES</option>
<option
value="0">JNO</option>
</field>
</fieldset>
</fields>
Expand Down
5 changes: 5 additions & 0 deletions administrator/modules/mod_logged/mod_logged.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,9 @@

$users = ModLoggedHelper::getList($params);

if ($params->get('automatic_title', 0))
{
$module->title = ModLoggedHelper::getTitle($params);
}

require JModuleHelper::getLayoutPath('mod_logged', $params->get('layout', 'default'));
4 changes: 2 additions & 2 deletions administrator/modules/mod_logged/mod_logged.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@
default="0"
label="COM_MODULES_FIELD_AUTOMATIC_TITLE_LABEL"
description="COM_MODULES_FIELD_AUTOMATIC_TITLE_DESC">
<option
value="0">JNO</option>
<option
value="1">JYES</option>
<option
value="0">JNO</option>
</field>
</fieldset>
</fields>
Expand Down
5 changes: 5 additions & 0 deletions administrator/modules/mod_popular/mod_popular.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,10 @@
// Get module data.
$list = ModPopularHelper::getList($params);

if ($params->get('automatic_title', 0))
{
$module->title = ModPopularHelper::getTitle($params);
}

// Render the module
require JModuleHelper::getLayoutPath('mod_popular', $params->get('layout', 'default'));
4 changes: 2 additions & 2 deletions administrator/modules/mod_popular/mod_popular.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@
default="0"
label="COM_MODULES_FIELD_AUTOMATIC_TITLE_LABEL"
description="COM_MODULES_FIELD_AUTOMATIC_TITLE_DESC">
<option
value="0">JNO</option>
<option
value="1">JYES</option>
<option
value="0">JNO</option>
</field>
</fieldset>
</fields>
Expand Down
14 changes: 0 additions & 14 deletions libraries/cms/module/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,20 +192,6 @@ public static function renderModule($module, $attribs = array())
ob_end_clean();
}

// Automatic title
if ($params->get('automatic_title', '0') == '0')
{
$module->title = $module->title;
}
elseif (method_exists('mod' . $module->name . 'Helper', 'getTitle'))
{
$module->title = call_user_func_array(array('mod' . $module->name . 'Helper', 'getTitle'), array($params));
}
else
{
$module->title = JText::_('MOD_' . $module->name . '_TITLE');
}

// Load the module chrome functions
if (!$chrome)
{
Expand Down

0 comments on commit 3906b28

Please sign in to comment.