29
0
mirror of https://github.com/joomla/joomla-cms.git synced 2024-06-26 07:13:21 +00:00

Add "Use Global" option for "Show Page Heading" setting of menu item.

Fixes #4819
This commit is contained in:
kochinc 2014-12-14 01:01:07 +00:00 committed by wilsonge
parent a89cb007b6
commit f4c7f31bf6
2 changed files with 11 additions and 5 deletions

View File

@ -39,12 +39,13 @@
label="COM_MENUS_ITEM_FIELD_PAGE_TITLE_LABEL"
description="COM_MENUS_ITEM_FIELD_PAGE_TITLE_DESC" />
<field name="show_page_heading" type="radio"
class="btn-group btn-group-yesno"
<field name="show_page_heading" type="list"
class="chzn-color"
label="COM_MENUS_ITEM_FIELD_SHOW_PAGE_HEADING_LABEL"
description="COM_MENUS_ITEM_FIELD_SHOW_PAGE_HEADING_DESC"
default="0" filter="integer"
default=""
>
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="1" class="yes">JYES</option>
<option value="0" class="no">JNO</option>
</field>

View File

@ -342,9 +342,15 @@ final class JApplicationSite extends JApplicationCms
$rights = $this->get('MetaRights');
$robots = $this->get('robots');
// Retrieve com_menu global settings
$temp = clone JComponentHelper::getParams('com_menus');
// Lets cascade the parameters if we have menu item parameters
if (is_object($menu))
{
// Get show_page_heading from com_menu global settings
$params[$hash]->def('show_page_heading', $temp->get('show_page_heading'));
$temp = new Registry;
$temp->loadString($menu->params);
$params[$hash]->merge($temp);
@ -352,8 +358,7 @@ final class JApplicationSite extends JApplicationCms
}
else
{
// Get com_menu global settings
$temp = clone JComponentHelper::getParams('com_menus');
// Merge com_menu global settings
$params[$hash]->merge($temp);
// If supplied, use page title