Your IP : 216.73.216.61


Current Path : /home/w/u/e/wuectly/www/03cbe/
Upload File :
Current File : /home/w/u/e/wuectly/www/03cbe/mod_menu.tar

helper.php000060400000003037152455302500006534 0ustar00<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  mod_menu
 *
 * @copyright   (C) 2007 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

/**
 * Helper for mod_menu
 *
 * @since  1.5
 */
abstract class ModMenuHelper
{
	/**
	 * Get a list of the available menus.
	 *
	 * @return  array  An array of the available menus (from the menu types table).
	 *
	 * @since   1.6
	 *
	 * @deprecated  4.0
	 */
	public static function getMenus()
	{
		$db     = JFactory::getDbo();

		// Search for home menu and language if exists
		$subQuery = $db->getQuery(true)
			->select('b.menutype, b.home, b.language, l.image, l.sef, l.title_native')
			->from('#__menu AS b')
			->leftJoin('#__languages AS l ON l.lang_code = b.language')
			->where('b.home != 0')
			->where('(b.client_id = 0 OR b.client_id IS NULL)');

		// Get all menu types with optional home menu and language
		$query = $db->getQuery(true)
			->select('a.id, a.asset_id, a.menutype, a.title, a.description, a.client_id')
			->select('c.home, c.language, c.image, c.sef, c.title_native')
			->from('#__menu_types AS a')
			->leftJoin('(' . (string) $subQuery . ') c ON c.menutype = a.menutype')
			->order('a.id');

		$db->setQuery($query);

		try
		{
			$result = $db->loadObjectList();
		}
		catch (RuntimeException $e)
		{
			$result = array();
			JFactory::getApplication()->enqueueMessage(JText::sprintf('JERROR_LOADING_MENUS', $e->getMessage()), 'error');
		}

		return $result;
	}
}
mod_menu.php000060400000001632152455302500007057 0ustar00<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  mod_menu
 *
 * @copyright   (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

use Joomla\Registry\Registry;

// Include the module helper classes.
JLoader::register('MenusHelper', JPATH_ADMINISTRATOR . '/components/com_menus/helpers/menus.php');
JLoader::register('ModMenuHelper', __DIR__ . '/helper.php');
JLoader::register('JAdminCssMenu', __DIR__ . '/menu.php');

/** @var  Registry  $params */
$lang    = JFactory::getLanguage();
$user    = JFactory::getUser();
$input   = JFactory::getApplication()->input;
$enabled = !$input->getBool('hidemainmenu');

$menu = new JAdminCssMenu($user);
$menu->load($params, $enabled);

// Render the module layout
require JModuleHelper::getLayoutPath('mod_menu', $params->get('layout', 'default'));
mod_menu.xml000060400000006143152455302500007072 0ustar00<?xml version="1.0" encoding="utf-8"?>
<extension type="module" version="3.1" client="administrator" method="upgrade">
	<name>mod_menu</name>
	<author>Joomla! Project</author>
	<creationDate>March 2006</creationDate>
	<copyright>(C) 2006 Open Source Matters, Inc.</copyright>
	<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
	<authorEmail>admin@joomla.org</authorEmail>
	<authorUrl>www.joomla.org</authorUrl>
	<version>3.0.0</version>
	<description>MOD_MENU_XML_DESCRIPTION</description>
	<files>
		<filename module="mod_menu">mod_menu.php</filename>
		<folder>preset</folder>
		<folder>tmpl</folder>
		<filename>helper.php</filename>
		<filename>menu.php</filename>
	</files>
	<languages>
		<language tag="en-GB">en-GB.mod_menu.ini</language>
		<language tag="en-GB">en-GB.mod_menu.sys.ini</language>
	</languages>
	<help key="JHELP_EXTENSIONS_MODULE_MANAGER_ADMIN_MENU" />
	<config>
		<fields name="params">
			<fieldset name="basic">
				<field
					name="menutype"
					type="menu"
					label="MOD_MENU_FIELD_MENUTYPE_LABEL"
					description="MOD_MENU_FIELD_MENUTYPE_DESC"
					clientid="1"
					>
					<option value="*">MOD_MENU_FIELD_MENUTYPE_OPTION_PREDEFINED</option>
				</field>

				<field
					name="preset"
					type="menuPreset"
					label="MOD_MENU_FIELD_PRESET_LABEL"
					description="MOD_MENU_FIELD_PRESET_DESC"
					addfieldpath="administrator/components/com_menus/models/fields"
					showon="menutype:*"
				/>

				<field
					name="check"
					type="radio"
					label="MOD_MENU_FIELD_CHECK_LABEL"
					description="MOD_MENU_FIELD_CHECK_DESC"
					class="btn-group btn-group-yesno"
					default="1"
					filter="integer"
					showon="menutype!:*"
					>
					<option value="1">JYES</option>
					<option value="0">JNO</option>
				</field>

				<field
					name="shownew"
					type="radio"
					label="MOD_MENU_FIELD_SHOWNEW"
					description="MOD_MENU_FIELD_SHOWNEW_DESC"
					class="btn-group btn-group-yesno"
					default="1"
					filter="integer"
					showon="menutype:*"
					>
					<option value="0">JHIDE</option>
					<option value="1">JSHOW</option>
				</field>

				<field
					name="showhelp"
					type="radio"
					label="MOD_MENU_FIELD_SHOWHELP"
					description="MOD_MENU_FIELD_SHOWHELP_DESC"
					class="btn-group btn-group-yesno"
					default="1"
					filter="integer"
					showon="menutype:*"
					>
					<option value="0">JHIDE</option>
					<option value="1">JSHOW</option>
				</field>

				<field
					name="forum_url"
					type="url"
					label="MOD_MENU_FIELD_FORUMURL_LABEL"
					description="MOD_MENU_FIELD_FORUMURL_DESC"
					filter="url"
					size="30"
					default=""
					showon="menutype:*"
					validate="url"
				/>
			</fieldset>

			<fieldset name="advanced">
				<field
					name="layout"
					type="modulelayout"
					label="JFIELD_ALT_LAYOUT_LABEL"
					description="JFIELD_ALT_MODULE_LAYOUT_DESC"
					validate="moduleLayout"
				/>

				<field
					name="moduleclass_sfx"
					type="textarea"
					label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL"
					description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC"
					rows="3"
				/>
			</fieldset>
		</fields>
	</config>
</extension>
tmpl/default_component.php000060400000002504152455302500011735 0ustar00<?php
/**
 * @package     Joomla.Site
 * @subpackage  mod_menu
 *
 * @copyright   (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

$attributes = array();

if ($item->anchor_title)
{
	$attributes['title'] = $item->anchor_title;
}

if ($item->anchor_css)
{
	$attributes['class'] = $item->anchor_css;
}

if ($item->anchor_rel)
{
	$attributes['rel'] = $item->anchor_rel;
}

$linktype = $item->title;

if ($item->menu_image)
{
	if ($item->menu_image_css)
	{
		$image_attributes['class'] = $item->menu_image_css;
		$linktype = JHtml::_('image', $item->menu_image, $item->title, $image_attributes);
	}
	else
	{
		$linktype = JHtml::_('image', $item->menu_image, $item->title);
	}

	if ($item->params->get('menu_text', 1))
	{
		$linktype .= '<span class="image-title">' . $item->title . '</span>';
	}
}

if ($item->browserNav == 1)
{
	$attributes['target'] = '_blank';
}
elseif ($item->browserNav == 2)
{
	$options = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes';

	$attributes['onclick'] = "window.open(this.href, 'targetWindow', '" . $options . "'); return false;";
}

echo JHtml::_('link', JFilterOutput::ampReplace(htmlspecialchars($item->flink, ENT_COMPAT, 'UTF-8', false)), $linktype, $attributes);
tmpl/default_separator.php000060400000001615152455302500011735 0ustar00<?php
/**
 * @package     Joomla.Site
 * @subpackage  mod_menu
 *
 * @copyright   (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

$title      = $item->anchor_title ? ' title="' . $item->anchor_title . '"' : '';
$anchor_css = $item->anchor_css ?: '';

$linktype   = $item->title;

if ($item->menu_image)
{
	if ($item->menu_image_css)
	{
		$image_attributes['class'] = $item->menu_image_css;
		$linktype = JHtml::_('image', $item->menu_image, $item->title, $image_attributes);
	}
	else
	{
		$linktype = JHtml::_('image', $item->menu_image, $item->title);
	}

	if ($item->params->get('menu_text', 1))
	{
		$linktype .= '<span class="image-title">' . $item->title . '</span>';
	}
}

?>
<span class="separator <?php echo $anchor_css; ?>"<?php echo $title; ?>><?php echo $linktype; ?></span>
tmpl/default_heading.php000060400000001616152455302500011335 0ustar00<?php
/**
 * @package     Joomla.Site
 * @subpackage  mod_menu
 *
 * @copyright   (C) 2012 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

$title      = $item->anchor_title ? ' title="' . $item->anchor_title . '"' : '';
$anchor_css = $item->anchor_css ?: '';

$linktype   = $item->title;

if ($item->menu_image)
{
	if ($item->menu_image_css)
	{
		$image_attributes['class'] = $item->menu_image_css;
		$linktype = JHtml::_('image', $item->menu_image, $item->title, $image_attributes);
	}
	else
	{
		$linktype = JHtml::_('image', $item->menu_image, $item->title);
	}

	if ($item->params->get('menu_text', 1))
	{
		$linktype .= '<span class="image-title">' . $item->title . '</span>';
	}
}

?>
<span class="nav-header <?php echo $anchor_css; ?>"<?php echo $title; ?>><?php echo $linktype; ?></span>
tmpl/default_url.php000060400000002742152455302500010541 0ustar00<?php
/**
 * @package     Joomla.Site
 * @subpackage  mod_menu
 *
 * @copyright   (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

$attributes = array();

if ($item->anchor_title)
{
	$attributes['title'] = $item->anchor_title;
}

if ($item->anchor_css)
{
	$attributes['class'] = $item->anchor_css;
}

if ($item->anchor_rel)
{
	$attributes['rel'] = $item->anchor_rel;
}

$linktype = $item->title;

if ($item->menu_image)
{
	if ($item->menu_image_css)
	{
		$image_attributes['class'] = $item->menu_image_css;
		$linktype = JHtml::_('image', $item->menu_image, $item->title, $image_attributes);
	}
	else
	{
		$linktype = JHtml::_('image', $item->menu_image, $item->title);
	}

	if ($item->params->get('menu_text', 1))
	{
		$linktype .= '<span class="image-title">' . $item->title . '</span>';
	}
}

if ($item->browserNav == 1)
{
	$attributes['target'] = '_blank';
	$attributes['rel'] = 'noopener noreferrer';

	if ($item->anchor_rel == 'nofollow')
	{
		$attributes['rel'] .= ' nofollow';
	}
}
elseif ($item->browserNav == 2)
{
	$options = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,' . $params->get('window_open');

	$attributes['onclick'] = "window.open(this.href, 'targetWindow', '" . $options . "'); return false;";
}

echo JHtml::_('link', JFilterOutput::ampReplace(htmlspecialchars($item->flink, ENT_COMPAT, 'UTF-8', false)), $linktype, $attributes);
tmpl/default.php000060400000001773152455302500007662 0ustar00<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  mod_menu
 *
 * @copyright   (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

$doc       = JFactory::getDocument();
$direction = $doc->direction == 'rtl' ? 'pull-right' : '';
$class     = $enabled ? 'nav ' . $direction : 'nav disabled ' . $direction;

// Recurse through children of root node if they exist
$menuTree = $menu->getTree();
$root     = $menuTree->reset();

if ($root->hasChildren())
{
	echo '<ul id="menu" class="' . $class . '">' . "\n";

	// WARNING: Do not use direct 'include' or 'require' as it is important to isolate the scope for each call
	$menu->renderSubmenu(JModuleHelper::getLayoutPath('mod_menu', 'default_submenu'));

	echo "</ul>\n";

	echo '<ul id="nav-empty" class="dropdown-menu nav-empty hidden-phone"></ul>';

	if ($css = $menuTree->getCss())
	{
		$doc->addStyleDeclaration(implode("\n", $css));
	}
}
index.html000060400000000037152456066540006552 0ustar00<!DOCTYPE html><title></title>
default_heading.php000060400000000510152456066540010365 0ustar00<?php
/**
 * @package     Joomla.Site
 * @subpackage  mod_menu
 *
 * @copyright   Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

?>
<span class="nav-header"><?php echo $item->title; ?></span>default_separator.php000060400000001415152456066540010773 0ustar00<?php
/**
 * @package     Joomla.Site
 * @subpackage  mod_menu
 *
 * @copyright   Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

// Note. It is important to remove spaces between elements.
$title = $item->anchor_title ? ' title="'.$item->anchor_title.'" ' : '';
if ($item->menu_image) {
	$item->params->get('menu_text', 1 ) ?
	$linktype = '<img src="'.$item->menu_image.'" alt="'.$item->title.'" /><span class="image-title">'.$item->title.'</span>' :
	$linktype = '<img src="'.$item->menu_image.'" alt="'.$item->title.'" />';
}
else {
	$linktype = $item->title;
}

?><span class="separator"<?php echo $title; ?>><?php echo $linktype; ?></span>
default_component.php000060400000003240152456066540010773 0ustar00<?php
/**
 * @package     Joomla.Site
 * @subpackage  mod_menu
 * @copyright   Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

// Note. It is important to remove spaces between elements.
$class = $item->anchor_css ? $item->anchor_css : '';
$title = $item->anchor_title ? 'title="'.$item->anchor_title.'" ' : '';
$dropdown = '';
$caret = '';

if($item->deeper && $item->level < 2){
	$class .= ' dropdown-toggle';
	$dropdown = ' data-toggle="dropdown"';
	$caret = '<em class="caret"></em>';
}

if(!empty($class)){
	$class = 'class="'. trim($class) .'" ';
}

if ($item->menu_image) {
	$item->params->get('menu_text', 1 ) ?
	$linktype = '<img src="'.$item->menu_image.'" alt="'.$item->title.'" /><span class="image-title">'.$item->title.'</span>' :
	$linktype = '<img src="'.$item->menu_image.'" alt="'.$item->title.'" />';
} else { 
	$linktype = $item->title;
}

switch ($item->browserNav) :
	default:
	case 0:
?><a <?php echo $class; ?>href="<?php echo $item->flink; ?>" <?php echo $title . $dropdown; ?>><?php echo $linktype . $caret; ?></a><?php
		break;
	case 1:
		// _blank
?><a <?php echo $class; ?>href="<?php echo $item->flink; ?>" target="_blank" <?php echo $title . $dropdown; ?>><?php echo $linktype . $caret; ?></a><?php
		break;
	case 2:
	// window.open
?><a <?php echo $class; ?>href="<?php echo $item->flink; ?>" onclick="window.open(this.href,'targetWindow','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes');return false;" <?php echo $title . $dropdown; ?>><?php echo $linktype . $caret; ?></a>
<?php
		break;
endswitch;
default.php000060400000003645152456066540006722 0ustar00<?php
/**
 * @package     Joomla.Site
 * @subpackage  mod_menu
 * @copyright   Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

// Note. It is important to remove spaces between elements.
?>

<ul class="nav <?php echo $class_sfx;?>"<?php
	$tag = '';
	if ($params->get('tag_id') != null)
	{
		$tag = $params->get('tag_id').'';
		echo ' id="'.$tag.'"';
	}
?>>
<?php
if (is_array($list)) :
	foreach ($list as $i => &$item) :
		$class = 'item-'.$item->id;
		if ($item->id == $active_id) {
			$class .= ' current';
		}

		if (in_array($item->id, $path)) {
			$class .= ' active';
		}
		elseif ($item->type == 'alias') {
			$aliasToId = $item->params->get('aliasoptions');
			if (count($path) > 0 && $aliasToId == $path[count($path)-1]) {
				$class .= ' active';
			}
			elseif (in_array($aliasToId, $path)) {
				$class .= ' alias-parent-active';
			}
		}

		if ($item->deeper) {
			if ($item->level > 1){
				$class .= ' dropdown-submenu';
			} else {
				$class .= ' deeper dropdown';
			}
		}

		if ($item->parent) {
			$class .= ' parent';
		}

		if (!empty($class)) {
			$class = ' class="'.trim($class) .'"';
		}

		echo '<li'.$class.'>';

		// Render the menu item.
		switch ($item->type) :
			case 'separator':
			case 'url':
			case 'component':
			case 'heading':
				require JModuleHelper::getLayoutPath('mod_menu', 'default_'.$item->type);
				break;

			default:
				require JModuleHelper::getLayoutPath('mod_menu', 'default_url');
				break;
		endswitch;

		// The next item is deeper.
		if ($item->deeper) {
			echo '<ul class="nav-child unstyled small dropdown-menu">';
		}
		// The next item is shallower.
		elseif ($item->shallower) {
			echo '</li>';
			echo str_repeat('</ul></li>', $item->level_diff);
		}
		// The next item is on the same level.
		else {
			echo '</li>';
		}
	endforeach;
endif;
?></ul>
default_url.php000060400000003605152456066540007600 0ustar00<?php
/**
 * @package     Joomla.Site
 * @subpackage  mod_menu
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

// Note. It is important to remove spaces between elements.
$class = $item->anchor_css ? $item->anchor_css : '';
$title = $item->anchor_title ? 'title="'.$item->anchor_title.'" ' : '';
$rel = $item->anchor_rel ? 'rel="'.$item->anchor_rel.'" ' : '';
$dropdown = '';
$caret = '';

if($item->deeper && $item->level < 2){
	$class .= ' dropdown-toggle';
	$dropdown = ' data-toggle="dropdown"';
	$caret = '<em class="caret"></em>';
}

if(!empty($class)){
	$class = 'class="'. trim($class) .'" ';
}

if ($item->menu_image) {
	$item->params->get('menu_text', 1 ) ?
	$linktype = '<img src="'.$item->menu_image.'" alt="'.$item->title.'" /><span class="image-title">'.$item->title.'</span>' :
	$linktype = '<img src="'.$item->menu_image.'" alt="'.$item->title.'" />';
} else { 
	$linktype = $item->title;
}
$flink = $item->flink;
$flink = JFilterOutput::ampReplace(htmlspecialchars($flink));

switch ($item->browserNav) :
	default:
	case 0:
?>
	<a <?php echo $class; ?>href="<?php echo $flink; ?>" <?php echo $title, $rel, $dropdown; ?>><?php echo $linktype, $caret; ?></a><?php
		break;
	case 1:
		// _blank
?>
	<a <?php echo $class; ?>href="<?php echo $flink; ?>" target="_blank" <?php echo $title, $rel, $dropdown; ?>><?php echo $linktype, $caret; ?></a><?php
		break;
	case 2:
		// Use JavaScript "window.open"
		$options = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,'.$params->get('window_open');
			?><a <?php echo $class; ?>href="<?php echo $flink; ?>" onclick="window.open(this.href,'targetWindow','<?php echo $options;?>');return false;" <?php echo $title, $dropdown; ?>><?php echo $linktype, $caret; ?></a><?php
		break;
endswitch;
tmpl/default_submenu.php000060400000006107152456111470011421 0ustar00<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  mod_menu
 *
 * @copyright   (C) 2017 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */
use Joomla\CMS\Menu\Node\Separator;

defined('_JEXEC') or die;

/**
 * =========================================================================================================
 * IMPORTANT: The scope of this layout file is the `JAdminCssMenu` object and NOT the module context.
 * =========================================================================================================
 */
/** @var  JAdminCssMenu  $this */
$current = $this->tree->getCurrent();

// Build the CSS class suffix
if (!$this->enabled)
{
	$class = ' class="disabled"';
}
elseif ($current instanceOf Separator)
{
	$class = $current->get('title') ? ' class="menuitem-group"' : ' class="divider"';
}
elseif ($current->hasChildren())
{
	if ($current->getLevel() == 1)
	{
		$class = ' class="dropdown"';
	}
	elseif ($current->get('class') == 'scrollable-menu')
	{
		$class = ' class="dropdown scrollable-menu"';
	}
	else
	{
		$class = ' class="dropdown-submenu"';
	}
}
else
{
	$class = '';
}

// Print the item
echo '<li' . $class . '>';

// Print a link if it exists
$linkClass     = array();
$dataToggle    = '';
$dropdownCaret = '';

if ($current->hasChildren())
{
	$linkClass[] = 'dropdown-toggle';
	$dataToggle  = ' data-toggle="dropdown"';

	if ($current->getLevel() == 1)
	{
		$dropdownCaret = ' <span class="caret"></span>';
	}
}
else
{
	$linkClass[] = 'no-dropdown';
}

if (!($current instanceof Separator) && ($current->getLevel() > 1))
{
	$iconClass = $this->tree->getIconClass();

	if (trim($iconClass))
	{
		$linkClass[] = $iconClass;
	}
}

// Implode out $linkClass for rendering
$linkClass = ' class="' . implode(' ', $linkClass) . '" ';

// Links: component/url/heading/container
if ($link = $current->get('link'))
{
	$icon = $current->get('icon');

	if ($icon)
	{
		if (substr($icon, 0, 6) == 'class:')
		{
			$icon = '<span class="' . substr($icon, 6) . '"></span>';
		}
		elseif (substr($icon, 0, 6) == 'image:')
		{
			$icon = JHtml::_('image', substr($icon, 6), null, null, true);
		}
		else
		{
			$icon = JHtml::_('image', $icon, null);
		}
	}

	$target = $current->get('target') ? 'target="' . $current->get('target') . '"' : '';

	echo '<a' . $linkClass . $dataToggle . ' href="' . $link . '" ' . $target . '>' .
				JText::_($current->get('title')) . $icon . $dropdownCaret . '</a>';
}
// Separator
else
{
	echo '<span>' . JText::_($current->get('title')) . '</span>';
}

// Recurse through children if they exist
if ($this->enabled && $current->hasChildren())
{
	if ($current->getLevel() > 1)
	{
		$id = $current->get('id') ? ' id="menu-' . strtolower($current->get('id')) . '"' : '';

		echo '<ul' . $id . ' class="dropdown-menu menu-scrollable">' . "\n";
	}
	else
	{
		echo '<ul class="dropdown-menu scroll-menu">' . "\n";
	}

	// WARNING: Do not use direct 'include' or 'require' as it is important to isolate the scope for each call
	$this->renderSubmenu(__FILE__);

	echo "</ul>\n";
}

echo "</li>\n";
menu.php000060400000031476152456111470006236 0ustar00<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  mod_menu
 *
 * @copyright   (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\Log\Log;
use Joomla\CMS\Menu\Node;
use Joomla\CMS\Menu\Tree;
use Joomla\CMS\Menu\MenuHelper;
use Joomla\CMS\User\User;
use Joomla\Registry\Registry;
use Joomla\Utilities\ArrayHelper;

/**
 * Tree based class to render the admin menu
 *
 * @since  1.5
 */
class JAdminCssMenu
{
	/**
	 * The Menu tree object
	 *
	 * @var    Tree
	 * @since  3.8.0
	 * @deprecated  4.0
	 */
	protected $tree;

	/**
	 * The module options
	 *
	 * @var    Registry
	 * @since  3.8.0
	 */
	protected $params;

	/**
	 * The menu bar state
	 *
	 * @var    bool
	 * @since  3.8.0
	 */
	protected $enabled;

	/**
	 * The current user
	 *
	 * @var    User
	 * @since  3.9.1
	 */
	protected $user;

	/**
	 * JAdminCssMenu constructor.
	 *
	 * @param   User|null  $user  The current user
	 *
	 * @since   3.9.1
	 */
	public function __construct(User $user = null)
	{
		if ($user === null)
		{
			Log::add(
				sprintf(
					'Not passing a %s instance into the %s constructor is deprecated. As of 4.0, it will be required.',
					'Joomla\CMS\User\User',
					__CLASS__
				),
				Log::WARNING,
				'deprecated'
			);

			$user = Factory::getUser();
		}

		$this->user = $user;
	}

	/**
	 * Get the current menu tree
	 *
	 * @return  Tree
	 *
	 * @since   3.8.0
	 *
	 * @deprecated  4.0
	 */
	public function getTree()
	{
		if (!$this->tree)
		{
			$this->tree = new Tree;
		}

		return $this->tree;
	}

	/**
	 * Populate the menu items in the menu tree object
	 *
	 * @param   Registry  $params   Menu configuration parameters
	 * @param   bool      $enabled  Whether the menu should be enabled or disabled
	 *
	 * @return  void
	 *
	 * @since   3.7.0
	 */
	public function load($params, $enabled)
	{
		$this->tree    = $this->getTree();
		$this->params  = $params;
		$this->enabled = $enabled;
		$menutype      = $this->params->get('menutype', '*');

		if ($menutype === '*')
		{
			$name   = $this->params->get('preset', 'joomla');
			$levels = MenuHelper::loadPreset($name);
		}
		else
		{
			$items = MenusHelper::getMenuItems($menutype, true);

			if ($this->enabled && $this->params->get('check', 1))
			{
				if ($this->check($items, $this->params))
				{
					$this->params->set('recovery', true);

					// In recovery mode, load the preset inside a special root node.
					$this->tree->addChild(new Node\Heading('MOD_MENU_RECOVERY_MENU_ROOT'), true);

					$levels = MenuHelper::loadPreset('joomla');
					$levels = $this->preprocess($levels);

					$this->populateTree($levels);

					$this->tree->addChild(new Node\Separator);

					// Add link to exit recovery mode
					$uri = clone JUri::getInstance();
					$uri->setVar('recover_menu', 0);

					$this->tree->addChild(new Node\Url('MOD_MENU_RECOVERY_EXIT', $uri->toString()));

					$this->tree->getParent();
				}
			}

			$levels = MenuHelper::createLevels($items);
		}

		$levels = $this->preprocess($levels);

		$this->populateTree($levels);
	}

	/**
	 * Method to render a given level of a menu using provided layout file
	 *
	 * @param   string  $layoutFile  The layout file to be used to render
	 *
	 * @return  void
	 *
	 * @since   3.8.0
	 */
	public function renderSubmenu($layoutFile)
	{
		if (is_file($layoutFile))
		{
			$children = $this->tree->getCurrent()->getChildren();

			foreach ($children as $child)
			{
				$this->tree->setCurrent($child);

				// This sets the scope to this object for the layout file and also isolates other `include`s
				require $layoutFile;
			}
		}
	}

	/**
	 * Check the flat list of menu items for important links
	 *
	 * @param   array     $items   The menu items array
	 * @param   Registry  $params  Module options
	 *
	 * @return  boolean  Whether to show recovery menu
	 *
	 * @since   3.8.0
	 */
	protected function check($items, Registry $params)
	{
		$authMenus   = $this->user->authorise('core.manage', 'com_menus');
		$authModules = $this->user->authorise('core.manage', 'com_modules');

		if (!$authMenus && !$authModules)
		{
			return false;
		}

		$app        = JFactory::getApplication();
		$types      = ArrayHelper::getColumn($items, 'type');
		$elements   = ArrayHelper::getColumn($items, 'element');
		$rMenu      = $authMenus && !in_array('com_menus', $elements);
		$rModule    = $authModules && !in_array('com_modules', $elements);
		$rContainer = !in_array('container', $types);

		if ($rMenu || $rModule || $rContainer)
		{
			$recovery = $app->getUserStateFromRequest('mod_menu.recovery', 'recover_menu', 0, 'int');

			if ($recovery)
			{
				return true;
			}

			$missing = array();

			if ($rMenu)
			{
				$missing[] = JText::_('MOD_MENU_IMPORTANT_ITEM_MENU_MANAGER');
			}

			if ($rModule)
			{
				$missing[] = JText::_('MOD_MENU_IMPORTANT_ITEM_MODULE_MANAGER');
			}

			if ($rContainer)
			{
				$missing[] = JText::_('MOD_MENU_IMPORTANT_ITEM_COMPONENTS_CONTAINER');
			}

			$uri = clone JUri::getInstance();
			$uri->setVar('recover_menu', 1);

			$table    = JTable::getInstance('MenuType');
			$menutype = $params->get('menutype');

			$table->load(array('menutype' => $menutype));

			$menutype = $table->get('title', $menutype);
			$message  = JText::sprintf('MOD_MENU_IMPORTANT_ITEMS_INACCESSIBLE_LIST_WARNING', $menutype, implode(', ', $missing), $uri);

			$app->enqueueMessage($message, 'warning');
		}

		return false;
	}

	/**
	 * Filter and perform other preparatory tasks for loaded menu items based on access rights and module configurations for display
	 *
	 * @param   \stdClass[]  $items  The levelled array of menu item objects
	 *
	 * @return  array
	 *
	 * @since   3.8.0
	 */
	protected function preprocess($items)
	{
		$result   = array();
		$language = JFactory::getLanguage();

		$noSeparator = true;

		// Call preprocess for the menu items on plugins.
		// Plugins should normally process the current level only unless their logic needs deep levels too.
		$dispatcher = JEventDispatcher::getInstance();
		$dispatcher->trigger('onPreprocessMenuItems', array('com_menus.administrator.module', &$items, $this->params, $this->enabled));

		foreach ($items as $i => &$item)
		{
			// Exclude item with menu item option set to exclude from menu modules
			if ($item->params->get('menu_show', 1) == 0)
			{
				continue;
			}

			$item->scope = isset($item->scope) ? $item->scope : 'default';
			$item->icon  = isset($item->icon) ? $item->icon : '';

			// Whether this scope can be displayed. Applies only to preset items. Db driven items should use un/published state.
			if (($item->scope === 'help' && !$this->params->get('showhelp', 1)) || ($item->scope === 'edit' && !$this->params->get('shownew', 1)))
			{
				continue;
			}

			if (substr($item->link, 0, 8) === 'special:')
			{
				$special = substr($item->link, 8);

				if ($special === 'language-forum')
				{
					$item->link = 'index.php?option=com_admin&amp;view=help&amp;layout=langforum';
				}
				elseif ($special === 'custom-forum')
				{
					$item->link = $this->params->get('forum_url');
				}
			}

			// Exclude item if is not enabled
			if ($item->element && !JComponentHelper::isEnabled($item->element))
			{
				continue;
			}

			// Exclude Mass Mail if disabled in global configuration
			if ($item->scope === 'massmail' && (JFactory::getApplication()->get('massmailoff', 0) == 1))
			{
				continue;
			}

			// Exclude item if the component is not authorised
			$assetName = $item->element;

			if ($item->element === 'com_categories')
			{
				parse_str($item->link, $query);
				$assetName = isset($query['extension']) ? $query['extension'] : 'com_content';
			}
			elseif ($item->element === 'com_fields')
			{
				parse_str($item->link, $query);

				// Only display Fields menus when enabled in the component
				$createFields = null;

				if (isset($query['context']))
				{
					$createFields = JComponentHelper::getParams(strstr($query['context'], '.', true))->get('custom_fields_enable', 1);
				}

				if (!$createFields)
				{
					continue;
				}

				list($assetName) = isset($query['context']) ? explode('.', $query['context'], 2) : array('com_fields');
			}
			// Special case for components which only allow super user access
			elseif (in_array($item->element, array('com_config', 'com_privacy', 'com_actionlogs'), true) && !$this->user->authorise('core.admin'))
			{
				continue;
			}
			elseif ($item->element === 'com_joomlaupdate' && !$this->user->authorise('core.admin'))
			{
				continue;
			}
			elseif (($item->link === 'index.php?option=com_installer&view=install' || $item->link === 'index.php?option=com_installer&view=languages')
				&& !$this->user->authorise('core.admin'))
			{
				continue;
			}
			elseif ($item->element === 'com_admin')
			{
				parse_str($item->link, $query);

				if (isset($query['view']) && $query['view'] === 'sysinfo' && !$this->user->authorise('core.admin'))
				{
					continue;
				}
			}

			if ($assetName && !$this->user->authorise(($item->scope === 'edit') ? 'core.create' : 'core.manage', $assetName))
			{
				continue;
			}

			// Exclude if link is invalid
			if (is_null($item->link) || (!in_array($item->type, array('separator', 'heading', 'container')) && trim($item->link) === ''))
			{
				continue;
			}

			// Process any children if exists
			$item->submenu = $this->preprocess($item->submenu);

			// Populate automatic children for container items
			if ($item->type === 'container')
			{
				$exclude    = (array) $item->params->get('hideitems') ?: array();
				$components = MenusHelper::getMenuItems('main', false, $exclude);

				$item->components = MenuHelper::createLevels($components);
				$item->components = $this->preprocess($item->components);
				$item->components = ArrayHelper::sortObjects($item->components, 'text', 1, false, true);
			}

			// Exclude if there are no child items under heading or container
			if (in_array($item->type, array('heading', 'container')) && empty($item->submenu) && empty($item->components))
			{
				continue;
			}

			// Remove repeated and edge positioned separators, It is important to put this check at the end of any logical filtering.
			if ($item->type === 'separator')
			{
				if ($noSeparator)
				{
					continue;
				}

				$noSeparator = true;
			}
			else
			{
				$noSeparator = false;
			}

			// Ok we passed everything, load language at last only
			if ($item->element)
			{
				$language->load($item->element . '.sys', JPATH_ADMINISTRATOR, null, false, true) ||
				$language->load($item->element . '.sys', JPATH_ADMINISTRATOR . '/components/' . $item->element, null, false, true);
			}

			if ($item->type === 'separator' && $item->params->get('text_separator') == 0)
			{
				$item->title = '';
			}

			$item->text = JText::_($item->title);

			$result[$i] = $item;
		}

		// If last one was a separator remove it too.
		if ($noSeparator && isset($i))
		{
			unset($result[$i]);
		}

		return $result;
	}

	/**
	 * Load the menu items from a hierarchical list of items into the menu tree
	 *
	 * @param   stdClass[]  $levels  Menu items as a hierarchical list format
	 *
	 * @return  void
	 *
	 * @since   3.8.0
	 *
	 * @deprecated  4.0
	 */
	protected function populateTree($levels)
	{
		foreach ($levels as $item)
		{
			$class = $this->enabled ? $item->class : 'disabled';

			if ($item->type === 'separator')
			{
				$this->tree->addChild(new Node\Separator($item->title));
			}
			elseif ($item->type === 'heading')
			{
				// We already excluded heading type menu item with no children.
				$this->tree->addChild(new Node\Heading($item->title, $class, null, $item->icon), $this->enabled);

				if ($this->enabled)
				{
					$this->populateTree($item->submenu);
					$this->tree->getParent();
				}
			}
			elseif ($item->type === 'url')
			{
				$cNode = new Node\Url($item->title, $item->link, $item->browserNav, $class, null, $item->icon);
				$this->tree->addChild($cNode, $this->enabled);

				if ($this->enabled)
				{
					$this->populateTree($item->submenu);
					$this->tree->getParent();
				}
			}
			elseif ($item->type === 'component')
			{
				$cNode = new Node\Component($item->title, $item->element, $item->link, $item->browserNav, $class, null, $item->icon);
				$this->tree->addChild($cNode, $this->enabled);

				if ($this->enabled)
				{
					$this->populateTree($item->submenu);
					$this->tree->getParent();
				}
			}
			elseif ($item->type === 'container')
			{
				// We already excluded container type menu item with no children.
				$this->tree->addChild(new Node\Container($item->title, $item->class, null, $item->icon), $this->enabled);

				if ($this->enabled)
				{
					$this->populateTree($item->submenu);

					// Add a separator between dynamic menu items and components menu items
					if (count($item->submenu) && count($item->components))
					{
						$this->tree->addChild(new Node\Separator);
					}

					$this->populateTree($item->components);

					$this->tree->getParent();
				}
			}
		}
	}
}