Skip to content
This repository has been archived by the owner on Nov 9, 2019. It is now read-only.

Commit

Permalink
Adds parameter and corresponding language files
Browse files Browse the repository at this point in the history
  • Loading branch information
betweenbrain committed Jul 15, 2014
1 parent 9c01450 commit 0607f60
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
3 changes: 2 additions & 1 deletion helper.php
Expand Up @@ -41,6 +41,7 @@ public function __construct($params)
function getBranches()
{
$renderedItems = $this->params->get('renderedItems', 0);
$showCategoryItems = $this->params->get('showCategoryItems', 0);
$showSubmenu = $this->params->get('showSubmenu', 1);
$hideSubmenu = $this->params->get('hideSubmenu', 0);
// http://stackoverflow.com/questions/3787669/how-to-get-specific-menu-items-from-joomla/10218419#10218419
Expand All @@ -67,7 +68,7 @@ function getBranches()
$items[$item->id] = $item;

// If menu item is a category, add all articles as menu items
if (array_key_exists('view', $item->query) && $item->query['view'] === 'category')
if ($showCategoryItems && array_key_exists('view', $item->query) && $item->query['view'] === 'category')
{
$items[$item->id]->children = $this->linkCategoryItems(
$this->getCategoryItems($item->query['id']),
Expand Down
2 changes: 2 additions & 0 deletions language/en-GB/en-GB.mod_menuwrench.ini
@@ -1,4 +1,6 @@
MOD_MENU_WRENCH_DESC="<a href="_QQ_"http://betweenbrain.com/"_QQ_" target="_QQ_"_blank"_QQ_"><img src="_QQ_"http://betweenbrain.com/images/logo.png"_QQ_" /></a><p class="_QQ_"clear"_QQ_">Throw a wrench at your Joomla menus! This module allows you to render selected menu items from any number of Joomla menus, at any depth in the menu tree, and render them as one menu.</p>"
MOD_MENU_WRENCH_SHOW_CATEGORY_ITEMS_DESC="Yes to render items belonging to a category blog or list as sub-menu items of that category menu item."
MOD_MENU_WRENCH_SHOW_CATEGORY_ITEMS_LABEL="Show Category Items"
MOD_MENU_WRENCH_HIDE_SUBMENU_ITEMS_DESC="Menu item, or items, to NEVER render the menu branch of."
MOD_MENU_WRENCH_HIDE_SUBMENU_ITEMS_LABEL="Hide Sub-menu Items"
MOD_MENU_WRENCH_RENDER_DEPTH_DESC="The levels of depth to render sub-menu items of. Enter 0 to render none."
Expand Down
9 changes: 9 additions & 0 deletions mod_menuwrench.xml
Expand Up @@ -58,6 +58,15 @@
<option value="1">JYES</option>
</field>

<field name="showCategoryItems"
type="radio"
default="0"
label="MOD_MENU_WRENCH_SHOW_CATEGORY_ITEMS_LABEL"
description="MOD_MENU_WRENCH_SHOW_CATEGORY_ITEMS_DESC">
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>

<field name="hideSubmenu"
type="menuitem"
multiple="true"
Expand Down

0 comments on commit 0607f60

Please sign in to comment.