Spade
Mini Shell
| Directory:~$ /home/lmsyaran/public_html/css/ |
| [Home] [System Details] [Kill Me] |
helper.php000064400000014531151165350110006536 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;
/**
* Helper for mod_menu
*
* @since 1.5
*/
class ModMenuHelper
{
/**
* Get a list of the menu items.
*
* @param \Joomla\Registry\Registry &$params The module options.
*
* @return array
*
* @since 1.5
*/
public static function getList(&$params)
{
$app = JFactory::getApplication();
$menu = $app->getMenu();
// Get active menu item
$base = self::getBase($params);
$user = JFactory::getUser();
$levels = $user->getAuthorisedViewLevels();
asort($levels);
$key = 'menu_items' . $params . implode(',', $levels)
. '.' . $base->id;
$cache = JFactory::getCache('mod_menu', '');
if ($cache->contains($key))
{
$items = $cache->get($key);
}
else
{
$path = $base->tree;
$start = (int) $params->get('startLevel', 1);
$end = (int) $params->get('endLevel', 0);
$showAll = $params->get('showAllChildren', 1);
$items = $menu->getItems('menutype',
$params->get('menutype'));
$hidden_parents = array();
$lastitem = 0;
if ($items)
{
foreach ($items as $i => $item)
{
$item->parent = false;
if (isset($items[$lastitem]) && $items[$lastitem]->id ==
$item->parent_id &&
$item->params->get('menu_show', 1) == 1)
{
$items[$lastitem]->parent = true;
}
if (($start && $start > $item->level)
|| ($end && $item->level > $end)
|| (!$showAll && $item->level > 1 &&
!in_array($item->parent_id, $path))
|| ($start > 1 && !in_array($item->tree[$start - 2],
$path)))
{
unset($items[$i]);
continue;
}
// Exclude item with menu item option set to exclude from menu modules
if (($item->params->get('menu_show', 1) == 0) ||
in_array($item->parent_id, $hidden_parents))
{
$hidden_parents[] = $item->id;
unset($items[$i]);
continue;
}
$item->deeper = false;
$item->shallower = false;
$item->level_diff = 0;
if (isset($items[$lastitem]))
{
$items[$lastitem]->deeper = ($item->level >
$items[$lastitem]->level);
$items[$lastitem]->shallower = ($item->level <
$items[$lastitem]->level);
$items[$lastitem]->level_diff = ($items[$lastitem]->level -
$item->level);
}
$lastitem = $i;
$item->active = false;
$item->flink = $item->link;
// Reverted back for CMS version 2.5.6
switch ($item->type)
{
case 'separator':
break;
case 'heading':
// No further action needed.
break;
case 'url':
if ((strpos($item->link, 'index.php?') === 0)
&& (strpos($item->link, 'Itemid=') === false))
{
// If this is an internal Joomla link, ensure the Itemid is set.
$item->flink = $item->link . '&Itemid=' .
$item->id;
}
break;
case 'alias':
$item->flink = 'index.php?Itemid=' .
$item->params->get('aliasoptions');
// Get the language of the target menu item when site is
multilingual
if (JLanguageMultilang::isEnabled())
{
$newItem =
JFactory::getApplication()->getMenu()->getItem((int)
$item->params->get('aliasoptions'));
// Use language code if not set to ALL
if ($newItem != null && $newItem->language &&
$newItem->language !== '*')
{
$item->flink .= '&lang=' . $newItem->language;
}
}
break;
default:
$item->flink = 'index.php?Itemid=' . $item->id;
break;
}
if ((strpos($item->flink, 'index.php?') !== false)
&& strcasecmp(substr($item->flink, 0, 4), 'http'))
{
$item->flink = JRoute::_($item->flink, true,
$item->params->get('secure'));
}
else
{
$item->flink = JRoute::_($item->flink);
}
// We prevent the double encoding because for some reason the $item is
shared for menu modules and we get double encoding
// when the cause of that is found the argument should be removed
$item->title = htmlspecialchars($item->title,
ENT_COMPAT, 'UTF-8', false);
$item->anchor_css =
htmlspecialchars($item->params->get('menu-anchor_css',
''), ENT_COMPAT, 'UTF-8', false);
$item->anchor_title =
htmlspecialchars($item->params->get('menu-anchor_title',
''), ENT_COMPAT, 'UTF-8', false);
$item->anchor_rel =
htmlspecialchars($item->params->get('menu-anchor_rel',
''), ENT_COMPAT, 'UTF-8', false);
$item->menu_image =
$item->params->get('menu_image', '') ?
htmlspecialchars($item->params->get('menu_image',
''), ENT_COMPAT, 'UTF-8', false) : '';
$item->menu_image_css =
htmlspecialchars($item->params->get('menu_image_css',
''), ENT_COMPAT, 'UTF-8', false);
}
if (isset($items[$lastitem]))
{
$items[$lastitem]->deeper = (($start ?: 1) >
$items[$lastitem]->level);
$items[$lastitem]->shallower = (($start ?: 1) <
$items[$lastitem]->level);
$items[$lastitem]->level_diff = ($items[$lastitem]->level -
($start ?: 1));
}
}
$cache->store($items, $key);
}
return $items;
}
/**
* Get base menu item.
*
* @param \Joomla\Registry\Registry &$params The module options.
*
* @return object
*
* @since 3.0.2
*/
public static function getBase(&$params)
{
// Get base menu item from parameters
if ($params->get('base'))
{
$base =
JFactory::getApplication()->getMenu()->getItem($params->get('base'));
}
else
{
$base = false;
}
// Use active menu item if no base found
if (!$base)
{
$base = self::getActive($params);
}
return $base;
}
/**
* Get active menu item.
*
* @param \Joomla\Registry\Registry &$params The module options.
*
* @return object
*
* @since 3.0.2
*/
public static function getActive(&$params)
{
$menu = JFactory::getApplication()->getMenu();
return $menu->getActive() ?: self::getDefault();
}
/**
* Get default menu item (home page) for current language.
*
* @return object
*/
public static function getDefault()
{
$menu = JFactory::getApplication()->getMenu();
$lang = JFactory::getLanguage();
// Look for the home menu
if (JLanguageMultilang::isEnabled())
{
return $menu->getDefault($lang->getTag());
}
else
{
return $menu->getDefault();
}
}
}
menu.php000064400000031026151165350110006221 0ustar00<?php
/**
* @package Joomla.Administrator
* @subpackage mod_menu
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @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
*/
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
*/
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&view=help&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->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 (!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
*/
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();
}
}
}
}
}
mod_menu.php000064400000001542151165350110007060 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;
// Include the menu functions only once
JLoader::register('ModMenuHelper', __DIR__ .
'/helper.php');
$list = ModMenuHelper::getList($params);
$base = ModMenuHelper::getBase($params);
$active = ModMenuHelper::getActive($params);
$default = ModMenuHelper::getDefault();
$active_id = $active->id;
$default_id = $default->id;
$path = $base->tree;
$showAll = $params->get('showAllChildren', 1);
$class_sfx = htmlspecialchars($params->get('class_sfx',
''), ENT_COMPAT, 'UTF-8');
if (count($list))
{
require JModuleHelper::getLayoutPath('mod_menu',
$params->get('layout', 'default'));
}
mod_menu.xml000064400000010544151165350110007073 0ustar00<?xml
version="1.0" encoding="utf-8"?>
<extension type="module" version="3.1"
client="site" method="upgrade">
<name>mod_menu</name>
<author>Joomla! Project</author>
<creationDate>July 2004</creationDate>
<copyright>(C) 2005 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>tmpl</folder>
<filename>helper.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_MENU" />
<config>
<fields name="params">
<fieldset name="basic"
addfieldpath="/administrator/components/com_menus/models/fields"
>
<field
name="menutype"
type="menu"
label="MOD_MENU_FIELD_MENUTYPE_LABEL"
description="MOD_MENU_FIELD_MENUTYPE_DESC"
clientid="0"
/>
<field
name="base"
type="modal_menu"
label="MOD_MENU_FIELD_ACTIVE_LABEL"
description="MOD_MENU_FIELD_ACTIVE_DESC"
select="true"
new="true"
edit="true"
clear="true"
filter="integer"
>
<option value="">JCURRENT</option>
</field>
<field
name="startLevel"
type="list"
label="MOD_MENU_FIELD_STARTLEVEL_LABEL"
description="MOD_MENU_FIELD_STARTLEVEL_DESC"
default="1"
filter="integer"
>
<option value="1">J1</option>
<option value="2">J2</option>
<option value="3">J3</option>
<option value="4">J4</option>
<option value="5">J5</option>
<option value="6">J6</option>
<option value="7">J7</option>
<option value="8">J8</option>
<option value="9">J9</option>
<option value="10">J10</option>
</field>
<field
name="endLevel"
type="list"
label="MOD_MENU_FIELD_ENDLEVEL_LABEL"
description="MOD_MENU_FIELD_ENDLEVEL_DESC"
default="0"
filter="integer"
>
<option value="0">JALL</option>
<option value="1">J1</option>
<option value="2">J2</option>
<option value="3">J3</option>
<option value="4">J4</option>
<option value="5">J5</option>
<option value="6">J6</option>
<option value="7">J7</option>
<option value="8">J8</option>
<option value="9">J9</option>
<option value="10">J10</option>
</field>
<field
name="showAllChildren"
type="radio"
label="MOD_MENU_FIELD_ALLCHILDREN_LABEL"
description="MOD_MENU_FIELD_ALLCHILDREN_DESC"
class="btn-group btn-group-yesno"
default="1"
filter="integer"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
</fieldset>
<fieldset name="advanced">
<field
name="tag_id"
type="text"
label="MOD_MENU_FIELD_TAG_ID_LABEL"
description="MOD_MENU_FIELD_TAG_ID_DESC"
/>
<field
name="class_sfx"
type="text"
label="MOD_MENU_FIELD_CLASS_LABEL"
description="MOD_MENU_FIELD_CLASS_DESC"
/>
<field
name="window_open"
type="text"
label="MOD_MENU_FIELD_TARGET_LABEL"
description="MOD_MENU_FIELD_TARGET_DESC"
/>
<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"
/>
<field
name="cache"
type="list"
label="COM_MODULES_FIELD_CACHING_LABEL"
description="COM_MODULES_FIELD_CACHING_DESC"
default="1"
filter="integer"
>
<option value="1">JGLOBAL_USE_GLOBAL</option>
<option
value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option>
</field>
<field
name="cache_time"
type="number"
label="COM_MODULES_FIELD_CACHE_TIME_LABEL"
description="COM_MODULES_FIELD_CACHE_TIME_DESC"
default="900"
filter="integer"
/>
<field
name="cachemode"
type="hidden"
default="itemid"
>
<option value="itemid"></option>
</field>
</fieldset>
</fields>
</config>
</extension>
tmpl/default.php000064400000003534151165350110007660 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;
$id = '';
if ($tagId = $params->get('tag_id', ''))
{
$id = ' id="' . $tagId . '"';
}
// The menu class is deprecated. Use nav instead
?>
<ul class="nav menu<?php echo $class_sfx; ?>
mod-list"<?php echo $id; ?>>
<?php foreach ($list as $i => &$item)
{
$class = 'item-' . $item->id;
if ($item->id == $default_id)
{
$class .= ' default';
}
if ($item->id == $active_id || ($item->type === 'alias'
&& $item->params->get('aliasoptions') ==
$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->type === 'separator')
{
$class .= ' divider';
}
if ($item->deeper)
{
$class .= ' deeper';
}
if ($item->parent)
{
$class .= ' parent';
}
echo '<li class="' . $class . '">';
switch ($item->type) :
case 'separator':
case 'component':
case 'heading':
case 'url':
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">';
}
// 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>';
}
}
?></ul>
tmpl/default_submenu.php000064400000006124151165350110011414
0ustar00<?php
/**
* @package Joomla.Administrator
* @subpackage mod_menu
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @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";
tmpl/default_component.php000064400000002504151165526710011751
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_heading.php000064400000001616151165526710011351
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_separator.php000064400000001615151165526710011751
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_url.php000064400000002742151165526710010555 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);