Skip to content

Commit

Permalink
Merge pull request #12192 from zero-24/phpcs
Browse files Browse the repository at this point in the history
PHPCS for the backend menu mudul templates
  • Loading branch information
wilsonge committed Sep 29, 2016
2 parents 179728b + 132489c commit 404f2b9
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 25 deletions.
4 changes: 2 additions & 2 deletions administrator/modules/mod_menu/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

defined('_JEXEC') or die;

$document = JFactory::getDocument();
$direction = $document->direction == 'rtl' ? 'pull-right' : '';
$direction = JFactory::getDocument()->direction == 'rtl' ? 'pull-right' : '';

require JModuleHelper::getLayoutPath('mod_menu', $enabled ? 'default_enabled' : 'default_disabled');

$menu->renderMenu('menu', $enabled ? 'nav ' . $direction : 'nav disabled ' . $direction);
21 changes: 10 additions & 11 deletions administrator/modules/mod_menu/tmpl/default_disabled.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,40 +9,38 @@

defined('_JEXEC') or die;

$showhelp = $params->get('showhelp', 1);

/**
* Site SubMenu
**/
*/
$menu->addChild(new JMenuNode(JText::_('MOD_MENU_SYSTEM'), null, 'disabled'));

/**
* Users Submenu
**/
*/
if ($user->authorise('core.manage', 'com_users'))
{
$menu->addChild(new JMenuNode(JText::_('MOD_MENU_COM_USERS'), null, 'disabled'));
}

/**
* Menus Submenu
**/
*/
if ($user->authorise('core.manage', 'com_menus'))
{
$menu->addChild(new JMenuNode(JText::_('MOD_MENU_MENUS'), null, 'disabled'));
}

/**
* Content Submenu
**/
*/
if ($user->authorise('core.manage', 'com_content'))
{
$menu->addChild(new JMenuNode(JText::_('MOD_MENU_COM_CONTENT'), null, 'disabled'));
}

/**
* Components Submenu
**/
*/

// Get the authorised components and sub-menus.
$components = ModMenuHelper::getComponents(true);
Expand All @@ -55,7 +53,7 @@

/**
* Extensions Submenu
**/
*/
$im = $user->authorise('core.manage', 'com_installer');
$mm = $user->authorise('core.manage', 'com_modules');
$pm = $user->authorise('core.manage', 'com_plugins');
Expand All @@ -69,7 +67,8 @@

/**
* Help Submenu
**/
if ($showhelp == 1) {
$menu->addChild(new JMenuNode(JText::_('MOD_MENU_HELP'), null, 'disabled'));
*/
if ($params->get('showhelp', 1))
{
$menu->addChild(new JMenuNode(JText::_('MOD_MENU_HELP'), null, 'disabled'));
}
27 changes: 15 additions & 12 deletions administrator/modules/mod_menu/tmpl/default_enabled.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@

defined('_JEXEC') or die;

use Joomla\Utilities\ArrayHelper;

/* @var $menu JAdminCSSMenu */

$shownew = (boolean) $params->get('shownew', 1);
$showhelp = $params->get('showhelp', 1);
$user = JFactory::getUser();
$lang = JFactory::getLanguage();
$shownew = (boolean) $params->get('shownew', 1);
$showhelp = (boolean) $params->get('showhelp', 1);
$user = JFactory::getUser();
$lang = JFactory::getLanguage();

/*
/**
* Site Submenu
*/
$menu->addChild(new JMenuNode(JText::_('MOD_MENU_SYSTEM'), '#'), true);
Expand Down Expand Up @@ -48,7 +50,7 @@

$menu->getParent();

/*
/**
* Users Submenu
*/
if ($user->authorise('core.manage', 'com_users'))
Expand Down Expand Up @@ -119,7 +121,7 @@
$menu->getParent();
}

/*
/**
* Menus Submenu
*/
if ($user->authorise('core.manage', 'com_menus'))
Expand All @@ -142,7 +144,7 @@

// Menu Types
$menuTypes = ModMenuHelper::getMenus();
$menuTypes = JArrayHelper::sortObjects($menuTypes, 'title', 1, false);
$menuTypes = ArrayHelper::sortObjects($menuTypes, 'title', 1, false);

foreach ($menuTypes as $menuType)
{
Expand Down Expand Up @@ -205,13 +207,14 @@
$menu->getParent();
}

/*
/**
* Content Submenu
*/
if ($user->authorise('core.manage', 'com_content'))
{
$menu->addChild(new JMenuNode(JText::_('MOD_MENU_COM_CONTENT'), '#'), true);
$createContent = $shownew && $user->authorise('core.create', 'com_content');

$menu->addChild(new JMenuNode(JText::_('MOD_MENU_COM_CONTENT_ARTICLE_MANAGER'), 'index.php?option=com_content', 'class:article'), $createContent);

if ($createContent)
Expand Down Expand Up @@ -247,7 +250,7 @@
$menu->getParent();
}

/*
/**
* Components Submenu
*/

Expand Down Expand Up @@ -282,7 +285,7 @@
$menu->getParent();
}

/*
/**
* Extensions Submenu
*/
$im = $user->authorise('core.manage', 'com_installer');
Expand Down Expand Up @@ -347,7 +350,7 @@
$menu->getParent();
}

/*
/**
* Help Submenu
*/
if ($showhelp == 1)
Expand Down

0 comments on commit 404f2b9

Please sign in to comment.