You've already forked joomla_test
first commit
This commit is contained in:
144
administrator/modules/mod_menu/helper.php
Normal file
144
administrator/modules/mod_menu/helper.php
Normal file
@ -0,0 +1,144 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @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;
|
||||
|
||||
/**
|
||||
* Helper for mod_menu
|
||||
*
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage 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
|
||||
*/
|
||||
public static function getMenus()
|
||||
{
|
||||
$db = JFactory::getDbo();
|
||||
$query = $db->getQuery(true)
|
||||
->select('a.*, SUM(b.home) AS home')
|
||||
->from('#__menu_types AS a')
|
||||
->join('LEFT', '#__menu AS b ON b.menutype = a.menutype AND b.home != 0')
|
||||
->select('b.language')
|
||||
->join('LEFT', '#__languages AS l ON l.lang_code = language')
|
||||
->select('l.image')
|
||||
->select('l.sef')
|
||||
->select('l.title_native')
|
||||
->where('(b.client_id = 0 OR b.client_id IS NULL)');
|
||||
|
||||
// Sqlsrv change
|
||||
$query->group('a.id, a.menutype, a.description, a.title, b.menutype,b.language,l.image,l.sef,l.title_native');
|
||||
|
||||
$db->setQuery($query);
|
||||
|
||||
$result = $db->loadObjectList();
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a list of the authorised, non-special components to display in the components menu.
|
||||
*
|
||||
* @param boolean $authCheck An optional switch to turn off the auth check (to support custom layouts 'grey out' behaviour).
|
||||
*
|
||||
* @return array A nest array of component objects and submenus
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public static function getComponents($authCheck = true)
|
||||
{
|
||||
$lang = JFactory::getLanguage();
|
||||
$user = JFactory::getUser();
|
||||
$db = JFactory::getDbo();
|
||||
$query = $db->getQuery(true);
|
||||
$result = array();
|
||||
|
||||
// Prepare the query.
|
||||
$query->select('m.id, m.title, m.alias, m.link, m.parent_id, m.img, e.element')
|
||||
->from('#__menu AS m');
|
||||
|
||||
// Filter on the enabled states.
|
||||
$query->join('LEFT', '#__extensions AS e ON m.component_id = e.extension_id')
|
||||
->where('m.client_id = 1')
|
||||
->where('e.enabled = 1')
|
||||
->where('m.id > 1');
|
||||
|
||||
// Order by lft.
|
||||
$query->order('m.lft');
|
||||
|
||||
$db->setQuery($query);
|
||||
|
||||
// Component list
|
||||
$components = $db->loadObjectList();
|
||||
|
||||
// Parse the list of extensions.
|
||||
foreach ($components as &$component)
|
||||
{
|
||||
// Trim the menu link.
|
||||
$component->link = trim($component->link);
|
||||
|
||||
if ($component->parent_id == 1)
|
||||
{
|
||||
// Only add this top level if it is authorised and enabled.
|
||||
if ($authCheck == false || ($authCheck && $user->authorise('core.manage', $component->element)))
|
||||
{
|
||||
// Root level.
|
||||
$result[$component->id] = $component;
|
||||
|
||||
if (!isset($result[$component->id]->submenu))
|
||||
{
|
||||
$result[$component->id]->submenu = array();
|
||||
}
|
||||
|
||||
// If the root menu link is empty, add it in.
|
||||
if (empty($component->link))
|
||||
{
|
||||
$component->link = 'index.php?option=' . $component->element;
|
||||
}
|
||||
|
||||
if (!empty($component->element))
|
||||
{
|
||||
// Load the core file then
|
||||
// Load extension-local file.
|
||||
$lang->load($component->element . '.sys', JPATH_BASE, null, false, false)
|
||||
|| $lang->load($component->element . '.sys', JPATH_ADMINISTRATOR . '/components/' . $component->element, null, false, false)
|
||||
|| $lang->load($component->element . '.sys', JPATH_BASE, $lang->getDefault(), false, false)
|
||||
|| $lang->load($component->element . '.sys', JPATH_ADMINISTRATOR . '/components/' . $component->element, $lang->getDefault(), false, false);
|
||||
}
|
||||
|
||||
$component->text = $lang->hasKey($component->title) ? JText::_($component->title) : $component->alias;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Sub-menu level.
|
||||
if (isset($result[$component->parent_id]))
|
||||
{
|
||||
// Add the submenu link if it is defined.
|
||||
if (isset($result[$component->parent_id]->submenu) && !empty($component->link))
|
||||
{
|
||||
$component->text = $lang->hasKey($component->title) ? JText::_($component->title) : $component->alias;
|
||||
$result[$component->parent_id]->submenu[] = &$component;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$result = JArrayHelper::sortObjects($result, 'text', 1, true, true);
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
1
administrator/modules/mod_menu/index.html
Normal file
1
administrator/modules/mod_menu/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
452
administrator/modules/mod_menu/menu.php
Normal file
452
administrator/modules/mod_menu/menu.php
Normal file
@ -0,0 +1,452 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @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;
|
||||
|
||||
/**
|
||||
* Tree based class to render the admin menu
|
||||
*
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage mod_menu
|
||||
* @since 1.5
|
||||
*/
|
||||
class JAdminCssMenu extends JObject
|
||||
{
|
||||
/**
|
||||
* CSS string to add to document head
|
||||
* @var string
|
||||
*/
|
||||
protected $_css = null;
|
||||
|
||||
/**
|
||||
* Root node
|
||||
*
|
||||
* @var object
|
||||
*/
|
||||
protected $_root = null;
|
||||
|
||||
/**
|
||||
* Current working node
|
||||
*
|
||||
* @var object
|
||||
*/
|
||||
protected $_current = null;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->_root = new JMenuNode('ROOT');
|
||||
$this->_current = & $this->_root;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to add a child
|
||||
*
|
||||
* @param JMenuNode &$node The node to process
|
||||
* @param boolean $setCurrent True to set as current working node
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addChild(JMenuNode &$node, $setCurrent = false)
|
||||
{
|
||||
$this->_current->addChild($node);
|
||||
|
||||
if ($setCurrent)
|
||||
{
|
||||
$this->_current = &$node;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the parent
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function getParent()
|
||||
{
|
||||
$this->_current = &$this->_current->getParent();
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the parent
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function reset()
|
||||
{
|
||||
$this->_current = &$this->_root;
|
||||
}
|
||||
|
||||
public function addSeparator()
|
||||
{
|
||||
$this->addChild(new JMenuNode(null, null, 'separator', false));
|
||||
}
|
||||
|
||||
public function renderMenu($id = 'menu', $class = '')
|
||||
{
|
||||
$depth = 1;
|
||||
|
||||
if (!empty($id))
|
||||
{
|
||||
$id = 'id="' . $id . '"';
|
||||
}
|
||||
|
||||
if (!empty($class))
|
||||
{
|
||||
$class = 'class="' . $class . '"';
|
||||
}
|
||||
|
||||
// Recurse through children if they exist
|
||||
while ($this->_current->hasChildren())
|
||||
{
|
||||
echo "<ul " . $id . " " . $class . ">\n";
|
||||
|
||||
foreach ($this->_current->getChildren() as $child)
|
||||
{
|
||||
$this->_current = & $child;
|
||||
$this->renderLevel($depth++);
|
||||
}
|
||||
|
||||
echo "</ul>\n";
|
||||
}
|
||||
|
||||
if ($this->_css)
|
||||
{
|
||||
// Add style to document head
|
||||
$doc = JFactory::getDocument();
|
||||
$doc->addStyleDeclaration($this->_css);
|
||||
}
|
||||
}
|
||||
|
||||
public function renderLevel($depth)
|
||||
{
|
||||
// Build the CSS class suffix
|
||||
$class = '';
|
||||
|
||||
if ($this->_current->hasChildren())
|
||||
{
|
||||
$class = ' class="dropdown"';
|
||||
}
|
||||
|
||||
if ($this->_current->class == 'separator')
|
||||
{
|
||||
$class = ' class="divider"';
|
||||
}
|
||||
|
||||
if ($this->_current->hasChildren() && $this->_current->class)
|
||||
{
|
||||
$class = ' class="dropdown-submenu"';
|
||||
}
|
||||
|
||||
if ($this->_current->class == 'disabled')
|
||||
{
|
||||
$class = ' class="disabled"';
|
||||
}
|
||||
|
||||
/*
|
||||
* Print the item
|
||||
*/
|
||||
echo "<li" . $class . ">";
|
||||
|
||||
/*
|
||||
* Print a link if it exists
|
||||
*/
|
||||
|
||||
$linkClass = array();
|
||||
$dataToggle = '';
|
||||
$dropdownCaret = '';
|
||||
|
||||
if ($this->_current->hasChildren())
|
||||
{
|
||||
$linkClass[] = 'dropdown-toggle';
|
||||
$dataToggle = ' data-toggle="dropdown"';
|
||||
|
||||
if (!$this->_current->getParent()->hasParent())
|
||||
{
|
||||
$dropdownCaret = ' <span class="caret"></span>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->_current->link != null && $this->_current->getParent()->title != 'ROOT')
|
||||
{
|
||||
$iconClass = $this->getIconClass($this->_current->class);
|
||||
|
||||
if (!empty($iconClass))
|
||||
{
|
||||
$linkClass[] = $iconClass;
|
||||
}
|
||||
}
|
||||
|
||||
// Implode out $linkClass for rendering
|
||||
$linkClass = ' class="' . implode(' ', $linkClass) . '"';
|
||||
|
||||
if ($this->_current->link != null && $this->_current->target != null)
|
||||
{
|
||||
echo "<a" . $linkClass . " " . $dataToggle . " href=\"" . $this->_current->link . "\" target=\"" . $this->_current->target . "\" >" . $this->_current->title . $dropdownCaret . "</a>";
|
||||
}
|
||||
elseif ($this->_current->link != null && $this->_current->target == null)
|
||||
{
|
||||
echo "<a" . $linkClass . " " . $dataToggle . " href=\"" . $this->_current->link . "\">" . $this->_current->title . $dropdownCaret . "</a>";
|
||||
}
|
||||
elseif ($this->_current->title != null)
|
||||
{
|
||||
echo "<a" . $linkClass . " " . $dataToggle . ">" . $this->_current->title . $dropdownCaret . "</a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<span></span>";
|
||||
}
|
||||
|
||||
// Recurse through children if they exist
|
||||
while ($this->_current->hasChildren())
|
||||
{
|
||||
if ($this->_current->class)
|
||||
{
|
||||
$id = '';
|
||||
|
||||
if (!empty($this->_current->id))
|
||||
{
|
||||
$id = ' id="menu-' . strtolower($this->_current->id) . '"';
|
||||
}
|
||||
|
||||
echo '<ul' . $id . ' class="dropdown-menu menu-component">' . "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<ul class="dropdown-menu">' . "\n";
|
||||
}
|
||||
|
||||
foreach ($this->_current->getChildren() as $child)
|
||||
{
|
||||
$this->_current = & $child;
|
||||
$this->renderLevel($depth++);
|
||||
}
|
||||
|
||||
echo "</ul>\n";
|
||||
}
|
||||
|
||||
echo "</li>\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the CSS class name for an icon identifier or create one if
|
||||
* a custom image path is passed as the identifier
|
||||
*
|
||||
* @param string $identifier Icon identification string
|
||||
*
|
||||
* @return string CSS class name
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
public function getIconClass($identifier)
|
||||
{
|
||||
static $classes;
|
||||
|
||||
// Initialise the known classes array if it does not exist
|
||||
if (!is_array($classes))
|
||||
{
|
||||
$classes = array();
|
||||
}
|
||||
|
||||
/*
|
||||
* If we don't already know about the class... build it and mark it
|
||||
* known so we don't have to build it again
|
||||
*/
|
||||
if (!isset($classes[$identifier]))
|
||||
{
|
||||
if (substr($identifier, 0, 6) == 'class:')
|
||||
{
|
||||
// We were passed a class name
|
||||
$class = substr($identifier, 6);
|
||||
$classes[$identifier] = "menu-$class";
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($identifier == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
// Build the CSS class for the icon
|
||||
$class = preg_replace('#\.[^.]*$#', '', basename($identifier));
|
||||
$class = preg_replace('#\.\.[^A-Za-z0-9\.\_\- ]#', '', $class);
|
||||
|
||||
$this->_css .= "\n.menu-$class {\n" .
|
||||
"\tbackground: url($identifier) no-repeat;\n" .
|
||||
"}\n";
|
||||
|
||||
$classes[$identifier] = "menu-$class";
|
||||
}
|
||||
}
|
||||
|
||||
return $classes[$identifier];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A Node for JAdminCssMenu
|
||||
*
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage mod_menu
|
||||
* @see JAdminCssMenu
|
||||
* @since 1.5
|
||||
*/
|
||||
class JMenuNode extends JObject
|
||||
{
|
||||
/**
|
||||
* Node Title
|
||||
*/
|
||||
public $title = null;
|
||||
|
||||
/**
|
||||
* Node Id
|
||||
*/
|
||||
public $id = null;
|
||||
|
||||
/**
|
||||
* Node Link
|
||||
*/
|
||||
public $link = null;
|
||||
|
||||
/**
|
||||
* Link Target
|
||||
*/
|
||||
public $target = null;
|
||||
|
||||
/**
|
||||
* CSS Class for node
|
||||
*/
|
||||
public $class = null;
|
||||
|
||||
/**
|
||||
* Active Node?
|
||||
*/
|
||||
public $active = false;
|
||||
|
||||
/**
|
||||
* Parent node
|
||||
* @var object
|
||||
*/
|
||||
protected $_parent = null;
|
||||
|
||||
/**
|
||||
* Array of Children
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_children = array();
|
||||
|
||||
public function __construct($title, $link = null, $class = null, $active = false, $target = null, $titleicon = null)
|
||||
{
|
||||
$this->title = $titleicon ? $title . $titleicon : $title;
|
||||
$this->link = JFilterOutput::ampReplace($link);
|
||||
$this->class = $class;
|
||||
$this->active = $active;
|
||||
|
||||
$this->id = null;
|
||||
|
||||
if (!empty($link) && $link !== '#')
|
||||
{
|
||||
$uri = new JUri($link);
|
||||
$params = $uri->getQuery(true);
|
||||
$parts = array();
|
||||
|
||||
foreach ($params as $value)
|
||||
{
|
||||
$parts[] = str_replace(array('.', '_'), '-', $value);
|
||||
}
|
||||
|
||||
$this->id = implode('-', $parts);
|
||||
}
|
||||
|
||||
$this->target = $target;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add child to this node
|
||||
*
|
||||
* If the child already has a parent, the link is unset
|
||||
*
|
||||
* @param JMenuNode &$child The child to be added
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addChild(JMenuNode &$child)
|
||||
{
|
||||
$child->setParent($this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the parent of a this node
|
||||
*
|
||||
* If the node already has a parent, the link is unset
|
||||
*
|
||||
* @param JMenuNode &$parent The JMenuNode for parent to be set or null
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setParent(JMenuNode &$parent = null)
|
||||
{
|
||||
$hash = spl_object_hash($this);
|
||||
|
||||
if (!is_null($this->_parent))
|
||||
{
|
||||
unset($this->_parent->children[$hash]);
|
||||
}
|
||||
|
||||
if (!is_null($parent))
|
||||
{
|
||||
$parent->_children[$hash] = & $this;
|
||||
}
|
||||
|
||||
$this->_parent = & $parent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the children of this node
|
||||
*
|
||||
* @return array The children
|
||||
*/
|
||||
public function &getChildren()
|
||||
{
|
||||
return $this->_children;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the parent of this node
|
||||
*
|
||||
* @return mixed JMenuNode object with the parent or null for no parent
|
||||
*/
|
||||
public function &getParent()
|
||||
{
|
||||
return $this->_parent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test if this node has children
|
||||
*
|
||||
* @return boolean True if there are children
|
||||
*/
|
||||
public function hasChildren()
|
||||
{
|
||||
return (bool) count($this->_children);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test if this node has a parent
|
||||
*
|
||||
* @return boolean True if there is a parent
|
||||
*/
|
||||
public function hasParent()
|
||||
{
|
||||
return $this->getParent() != null;
|
||||
}
|
||||
}
|
30
administrator/modules/mod_menu/mod_menu.php
Normal file
30
administrator/modules/mod_menu/mod_menu.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @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;
|
||||
|
||||
// Include the module helper classes.
|
||||
if (!class_exists('ModMenuHelper'))
|
||||
{
|
||||
require __DIR__ . '/helper.php';
|
||||
}
|
||||
|
||||
if (!class_exists('JAdminCssMenu'))
|
||||
{
|
||||
require __DIR__ . '/menu.php';
|
||||
}
|
||||
|
||||
$lang = JFactory::getLanguage();
|
||||
$user = JFactory::getUser();
|
||||
$input = JFactory::getApplication()->input;
|
||||
$menu = new JAdminCSSMenu;
|
||||
$enabled = $input->getBool('hidemainmenu') ? false : true;
|
||||
|
||||
// Render the module layout
|
||||
require JModuleHelper::getLayoutPath('mod_menu', $params->get('layout', 'default'));
|
83
administrator/modules/mod_menu/mod_menu.xml
Normal file
83
administrator/modules/mod_menu/mod_menu.xml
Normal file
@ -0,0 +1,83 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<extension
|
||||
type="module"
|
||||
version="3.1"
|
||||
client="administrator">
|
||||
<name>mod_menu</name>
|
||||
<author>Joomla! Project</author>
|
||||
<creationDate>March 2006</creationDate>
|
||||
<copyright>Copyright (C) 2005 - 2013 Open Source Matters. All rights reserved.</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>
|
||||
<filename>menu.php</filename>
|
||||
<filename>helper.php</filename>
|
||||
<filename>index.html</filename>
|
||||
<folder>tmpl</folder>
|
||||
</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="advanced">
|
||||
<field
|
||||
name="layout"
|
||||
type="modulelayout"
|
||||
label="JFIELD_ALT_LAYOUT_LABEL"
|
||||
description="JFIELD_ALT_MODULE_LAYOUT_DESC" />
|
||||
<field
|
||||
name="moduleclass_sfx"
|
||||
type="textarea" rows="3"
|
||||
label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL"
|
||||
description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" />
|
||||
|
||||
<field
|
||||
name="shownew"
|
||||
type="list"
|
||||
default="1"
|
||||
label="MOD_MENU_FIELD_SHOWNEW"
|
||||
description="MOD_MENU_FIELD_SHOWNEW_DESC">
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="showhelp"
|
||||
type="list"
|
||||
default="1"
|
||||
label="MOD_MENU_FIELD_SHOWHELP"
|
||||
description="MOD_MENU_FIELD_SHOWHELP_DESC">
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="forum_url"
|
||||
type="url"
|
||||
class="inputbox"
|
||||
size="30"
|
||||
default=""
|
||||
label="MOD_MENU_FIELD_FORUMURL_LABEL"
|
||||
description="MOD_MENU_FIELD_FORUMURL_DESC"
|
||||
/>
|
||||
|
||||
<field
|
||||
name="cache"
|
||||
type="list"
|
||||
default="0"
|
||||
label="COM_MODULES_FIELD_CACHING_LABEL"
|
||||
description="COM_MODULES_FIELD_CACHING_DESC">
|
||||
<option
|
||||
value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option>
|
||||
</field>
|
||||
</fieldset>
|
||||
</fields>
|
||||
</config>
|
||||
</extension>
|
16
administrator/modules/mod_menu/tmpl/default.php
Normal file
16
administrator/modules/mod_menu/tmpl/default.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @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;
|
||||
|
||||
$document = JFactory::getDocument();
|
||||
$direction = $document->direction == 'rtl' ? 'pull-right' : '';
|
||||
require JModuleHelper::getLayoutPath('mod_menu', $enabled ? 'default_enabled' : 'default_disabled');
|
||||
|
||||
$menu->renderMenu('menu', $enabled ? 'nav ' . $direction : 'nav disabled ' . $direction);
|
75
administrator/modules/mod_menu/tmpl/default_disabled.php
Normal file
75
administrator/modules/mod_menu/tmpl/default_disabled.php
Normal file
@ -0,0 +1,75 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @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;
|
||||
|
||||
$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);
|
||||
|
||||
// Check if there are any components, otherwise, don't display the components menu item
|
||||
if ($components)
|
||||
{
|
||||
$menu->addChild(new JMenuNode(JText::_('MOD_MENU_COMPONENTS'), null, 'disabled'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Extensions Submenu
|
||||
**/
|
||||
$im = $user->authorise('core.manage', 'com_installer');
|
||||
$mm = $user->authorise('core.manage', 'com_modules');
|
||||
$pm = $user->authorise('core.manage', 'com_plugins');
|
||||
$tm = $user->authorise('core.manage', 'com_templates');
|
||||
$lm = $user->authorise('core.manage', 'com_languages');
|
||||
|
||||
if ($im || $mm || $pm || $tm || $lm)
|
||||
{
|
||||
$menu->addChild(new JMenuNode(JText::_('MOD_MENU_EXTENSIONS_EXTENSIONS'), null, 'disabled'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Help Submenu
|
||||
**/
|
||||
if ($showhelp == 1) {
|
||||
$menu->addChild(new JMenuNode(JText::_('MOD_MENU_HELP'), null, 'disabled'));
|
||||
}
|
413
administrator/modules/mod_menu/tmpl/default_enabled.php
Normal file
413
administrator/modules/mod_menu/tmpl/default_enabled.php
Normal file
@ -0,0 +1,413 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @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;
|
||||
|
||||
/* @var $menu JAdminCSSMenu */
|
||||
|
||||
$shownew = (boolean) $params->get('shownew', 1);
|
||||
$showhelp = $params->get('showhelp', 1);
|
||||
$user = JFactory::getUser();
|
||||
$lang = JFactory::getLanguage();
|
||||
|
||||
/**
|
||||
* Site SubMenu
|
||||
**/
|
||||
$menu->addChild(
|
||||
new JMenuNode(JText::_('MOD_MENU_SYSTEM'), '#'), true
|
||||
);
|
||||
$menu->addChild(
|
||||
new JMenuNode(JText::_('MOD_MENU_CONTROL_PANEL'), 'index.php', 'class:cpanel')
|
||||
);
|
||||
|
||||
$menu->addSeparator();
|
||||
|
||||
if ($user->authorise('core.admin'))
|
||||
{
|
||||
$menu->addChild(new JMenuNode(JText::_('MOD_MENU_CONFIGURATION'), 'index.php?option=com_config', 'class:config'));
|
||||
$menu->addSeparator();
|
||||
}
|
||||
|
||||
$chm = $user->authorise('core.manage', 'com_checkin');
|
||||
$cam = $user->authorise('core.manage', 'com_cache');
|
||||
|
||||
if ($chm || $cam )
|
||||
{
|
||||
// Keep this for when bootstrap supports submenus?
|
||||
/* $menu->addChild(
|
||||
new JMenuNode(JText::_('MOD_MENU_MAINTENANCE'), 'index.php?option=com_checkin', 'class:maintenance'), true
|
||||
);*/
|
||||
|
||||
if ($chm)
|
||||
{
|
||||
$menu->addChild(new JMenuNode(JText::_('MOD_MENU_GLOBAL_CHECKIN'), 'index.php?option=com_checkin', 'class:checkin'));
|
||||
$menu->addSeparator();
|
||||
}
|
||||
|
||||
if ($cam)
|
||||
{
|
||||
$menu->addChild(new JMenuNode(JText::_('MOD_MENU_CLEAR_CACHE'), 'index.php?option=com_cache', 'class:clear'));
|
||||
$menu->addChild(new JMenuNode(JText::_('MOD_MENU_PURGE_EXPIRED_CACHE'), 'index.php?option=com_cache&view=purge', 'class:purge'));
|
||||
}
|
||||
|
||||
// $menu->getParent();
|
||||
}
|
||||
|
||||
$menu->addSeparator();
|
||||
|
||||
if ($user->authorise('core.admin'))
|
||||
{
|
||||
$menu->addChild(
|
||||
new JMenuNode(JText::_('MOD_MENU_SYSTEM_INFORMATION'), 'index.php?option=com_admin&view=sysinfo', 'class:info')
|
||||
);
|
||||
}
|
||||
|
||||
$menu->getParent();
|
||||
|
||||
/**
|
||||
* Users Submenu
|
||||
**/
|
||||
if ($user->authorise('core.manage', 'com_users'))
|
||||
{
|
||||
$menu->addChild(
|
||||
new JMenuNode(JText::_('MOD_MENU_COM_USERS_USERS'), '#'), true
|
||||
);
|
||||
$createUser = $shownew && $user->authorise('core.create', 'com_users');
|
||||
$createGrp = $user->authorise('core.admin', 'com_users');
|
||||
|
||||
$menu->addChild(
|
||||
new JMenuNode(JText::_('MOD_MENU_COM_USERS_USER_MANAGER'), 'index.php?option=com_users&view=users', 'class:user'), $createUser
|
||||
);
|
||||
|
||||
if ($createUser)
|
||||
{
|
||||
$menu->addChild(
|
||||
new JMenuNode(JText::_('MOD_MENU_COM_USERS_ADD_USER'), 'index.php?option=com_users&task=user.add', 'class:newarticle')
|
||||
);
|
||||
$menu->getParent();
|
||||
}
|
||||
|
||||
if ($createGrp)
|
||||
{
|
||||
$menu->addChild(
|
||||
new JMenuNode(JText::_('MOD_MENU_COM_USERS_GROUPS'), 'index.php?option=com_users&view=groups', 'class:groups'), $createUser
|
||||
);
|
||||
|
||||
if ($createUser)
|
||||
{
|
||||
$menu->addChild(
|
||||
new JMenuNode(JText::_('MOD_MENU_COM_USERS_ADD_GROUP'), 'index.php?option=com_users&task=group.add', 'class:newarticle')
|
||||
);
|
||||
$menu->getParent();
|
||||
}
|
||||
|
||||
$menu->addChild(
|
||||
new JMenuNode(JText::_('MOD_MENU_COM_USERS_LEVELS'), 'index.php?option=com_users&view=levels', 'class:levels'), $createUser
|
||||
);
|
||||
|
||||
if ($createUser)
|
||||
{
|
||||
$menu->addChild(
|
||||
new JMenuNode(JText::_('MOD_MENU_COM_USERS_ADD_LEVEL'), 'index.php?option=com_users&task=level.add', 'class:newarticle')
|
||||
);
|
||||
$menu->getParent();
|
||||
}
|
||||
}
|
||||
|
||||
$menu->addSeparator();
|
||||
$menu->addChild(
|
||||
new JMenuNode(JText::_('MOD_MENU_COM_USERS_NOTES'), 'index.php?option=com_users&view=notes', 'class:user-note'), $createUser
|
||||
);
|
||||
|
||||
if ($createUser)
|
||||
{
|
||||
$menu->addChild(
|
||||
new JMenuNode(JText::_('MOD_MENU_COM_USERS_ADD_NOTE'), 'index.php?option=com_users&task=note.add', 'class:newarticle')
|
||||
);
|
||||
$menu->getParent();
|
||||
}
|
||||
|
||||
$menu->addChild(
|
||||
new JMenuNode(JText::_('MOD_MENU_COM_USERS_NOTE_CATEGORIES'), 'index.php?option=com_categories&view=categories&extension=com_users', 'class:category'), $createUser
|
||||
);
|
||||
|
||||
if ($createUser)
|
||||
{
|
||||
$menu->addChild(
|
||||
new JMenuNode(JText::_('MOD_MENU_COM_CONTENT_NEW_CATEGORY'), 'index.php?option=com_categories&task=category.add&extension=com_users.notes', 'class:newarticle')
|
||||
);
|
||||
$menu->getParent();
|
||||
}
|
||||
|
||||
$menu->addSeparator();
|
||||
$menu->addChild(
|
||||
new JMenuNode(JText::_('MOD_MENU_MASS_MAIL_USERS'), 'index.php?option=com_users&view=mail', 'class:massmail')
|
||||
);
|
||||
|
||||
$menu->getParent();
|
||||
}
|
||||
|
||||
/**
|
||||
* Menus Submenu
|
||||
**/
|
||||
if ($user->authorise('core.manage', 'com_menus'))
|
||||
{
|
||||
$menu->addChild(
|
||||
new JMenuNode(JText::_('MOD_MENU_MENUS'), '#'), true
|
||||
);
|
||||
$createMenu = $shownew && $user->authorise('core.create', 'com_menus');
|
||||
|
||||
$menu->addChild(
|
||||
new JMenuNode(JText::_('MOD_MENU_MENU_MANAGER'), 'index.php?option=com_menus&view=menus', 'class:menumgr'), $createMenu
|
||||
);
|
||||
|
||||
if ($createMenu)
|
||||
{
|
||||
$menu->addChild(
|
||||
new JMenuNode(JText::_('MOD_MENU_MENU_MANAGER_NEW_MENU'), 'index.php?option=com_menus&view=menu&layout=edit', 'class:newarticle')
|
||||
);
|
||||
$menu->getParent();
|
||||
}
|
||||
|
||||
$menu->addSeparator();
|
||||
|
||||
// Menu Types
|
||||
foreach (ModMenuHelper::getMenus() as $menuType)
|
||||
{
|
||||
$alt = '*' . $menuType->sef . '*';
|
||||
|
||||
if ($menuType->home == 0)
|
||||
{
|
||||
$titleicon = '';
|
||||
}
|
||||
elseif ($menuType->home == 1 && $menuType->language == '*')
|
||||
{
|
||||
$titleicon = ' <i class="icon-home"></i>';
|
||||
}
|
||||
elseif ($menuType->home > 1)
|
||||
{
|
||||
$titleicon = ' <span>'.JHtml::_('image', 'mod_languages/icon-16-language.png', $menuType->home, array('title' => JText::_('MOD_MENU_HOME_MULTIPLE')), true).'</span>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$image = JHtml::_('image', 'mod_languages/' . $menuType->image . '.gif', null, null, true, true);
|
||||
|
||||
if (!$image)
|
||||
{
|
||||
$titleicon = ' <span>' . JHtml::_('image', 'mod_languages/icon-16-language.png', $alt, array('title' => $menuType->title_native), true) . '</span>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$titleicon = ' <span>' . JHtml::_('image', 'mod_languages/' . $menuType->image . '.gif', $alt, array('title' => $menuType->title_native), true) . '</span>';
|
||||
}
|
||||
}
|
||||
|
||||
$menu->addChild(
|
||||
new JMenuNode($menuType->title, 'index.php?option=com_menus&view=items&menutype='.$menuType->menutype, 'class:menu', null, null, $titleicon), $createMenu
|
||||
);
|
||||
|
||||
if ($createMenu)
|
||||
{
|
||||
$menu->addChild(
|
||||
new JMenuNode(JText::_('MOD_MENU_MENU_MANAGER_NEW_MENU_ITEM'), 'index.php?option=com_menus&view=item&layout=edit&menutype='.$menuType->menutype, 'class:newarticle')
|
||||
);
|
||||
$menu->getParent();
|
||||
}
|
||||
}
|
||||
$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)
|
||||
{
|
||||
$menu->addChild(
|
||||
new JMenuNode(JText::_('MOD_MENU_COM_CONTENT_NEW_ARTICLE'), 'index.php?option=com_content&task=article.add', 'class:newarticle')
|
||||
);
|
||||
$menu->getParent();
|
||||
}
|
||||
|
||||
$menu->addChild(
|
||||
new JMenuNode(JText::_('MOD_MENU_COM_CONTENT_CATEGORY_MANAGER'), 'index.php?option=com_categories&extension=com_content', 'class:category'), $createContent
|
||||
);
|
||||
|
||||
if ($createContent)
|
||||
{
|
||||
$menu->addChild(
|
||||
new JMenuNode(JText::_('MOD_MENU_COM_CONTENT_NEW_CATEGORY'), 'index.php?option=com_categories&task=category.add&extension=com_content', 'class:newarticle')
|
||||
);
|
||||
$menu->getParent();
|
||||
}
|
||||
|
||||
$menu->addChild(
|
||||
new JMenuNode(JText::_('MOD_MENU_COM_CONTENT_FEATURED'), 'index.php?option=com_content&view=featured', 'class:featured')
|
||||
);
|
||||
$menu->addSeparator();
|
||||
|
||||
if ($user->authorise('core.manage', 'com_media'))
|
||||
{
|
||||
$menu->addChild(new JMenuNode(JText::_('MOD_MENU_MEDIA_MANAGER'), 'index.php?option=com_media', 'class:media'));
|
||||
}
|
||||
|
||||
$menu->getParent();
|
||||
}
|
||||
|
||||
/**
|
||||
* Components Submenu
|
||||
**/
|
||||
|
||||
// Get the authorised components and sub-menus.
|
||||
$components = ModMenuHelper::getComponents(true);
|
||||
|
||||
// Check if there are any components, otherwise, don't render the menu
|
||||
if ($components)
|
||||
{
|
||||
$menu->addChild(new JMenuNode(JText::_('MOD_MENU_COMPONENTS'), '#'), true);
|
||||
|
||||
foreach ($components as &$component)
|
||||
{
|
||||
if (!empty($component->submenu))
|
||||
{
|
||||
// This component has a db driven submenu.
|
||||
$menu->addChild(new JMenuNode($component->text, $component->link, $component->img), true);
|
||||
|
||||
foreach ($component->submenu as $sub)
|
||||
{
|
||||
$menu->addChild(new JMenuNode($sub->text, $sub->link, $sub->img));
|
||||
}
|
||||
|
||||
$menu->getParent();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$menu->addChild(new JMenuNode($component->text, $component->link, $component->img));
|
||||
}
|
||||
}
|
||||
|
||||
$menu->getParent();
|
||||
}
|
||||
|
||||
/**
|
||||
* Extensions Submenu
|
||||
**/
|
||||
$im = $user->authorise('core.manage', 'com_installer');
|
||||
$mm = $user->authorise('core.manage', 'com_modules');
|
||||
$pm = $user->authorise('core.manage', 'com_plugins');
|
||||
$tm = $user->authorise('core.manage', 'com_templates');
|
||||
$lm = $user->authorise('core.manage', 'com_languages');
|
||||
|
||||
if ($im || $mm || $pm || $tm || $lm)
|
||||
{
|
||||
$menu->addChild(new JMenuNode(JText::_('MOD_MENU_EXTENSIONS_EXTENSIONS'), '#'), true);
|
||||
|
||||
if ($im)
|
||||
{
|
||||
$menu->addChild(new JMenuNode(JText::_('MOD_MENU_EXTENSIONS_EXTENSION_MANAGER'), 'index.php?option=com_installer', 'class:install'));
|
||||
$menu->addSeparator();
|
||||
}
|
||||
|
||||
if ($mm)
|
||||
{
|
||||
$menu->addChild(new JMenuNode(JText::_('MOD_MENU_EXTENSIONS_MODULE_MANAGER'), 'index.php?option=com_modules', 'class:module'));
|
||||
}
|
||||
|
||||
if ($pm)
|
||||
{
|
||||
$menu->addChild(new JMenuNode(JText::_('MOD_MENU_EXTENSIONS_PLUGIN_MANAGER'), 'index.php?option=com_plugins', 'class:plugin'));
|
||||
}
|
||||
|
||||
if ($tm)
|
||||
{
|
||||
$menu->addChild(new JMenuNode(JText::_('MOD_MENU_EXTENSIONS_TEMPLATE_MANAGER'), 'index.php?option=com_templates', 'class:themes'));
|
||||
}
|
||||
|
||||
if ($lm)
|
||||
{
|
||||
$menu->addChild(new JMenuNode(JText::_('MOD_MENU_EXTENSIONS_LANGUAGE_MANAGER'), 'index.php?option=com_languages', 'class:language'));
|
||||
}
|
||||
|
||||
$menu->getParent();
|
||||
}
|
||||
|
||||
/**
|
||||
* Help Submenu
|
||||
**/
|
||||
if ($showhelp == 1)
|
||||
{
|
||||
$menu->addChild(
|
||||
new JMenuNode(JText::_('MOD_MENU_HELP'), '#'), true
|
||||
);
|
||||
$menu->addChild(
|
||||
new JMenuNode(JText::_('MOD_MENU_HELP_JOOMLA'), 'index.php?option=com_admin&view=help', 'class:help')
|
||||
);
|
||||
$menu->addSeparator();
|
||||
|
||||
$menu->addChild(
|
||||
new JMenuNode(JText::_('MOD_MENU_HELP_SUPPORT_OFFICIAL_FORUM'), 'http://forum.joomla.org', 'class:help-forum', false, '_blank')
|
||||
);
|
||||
|
||||
if ($forum_url = $params->get('forum_url'))
|
||||
{
|
||||
$menu->addChild(
|
||||
new JMenuNode(JText::_('MOD_MENU_HELP_SUPPORT_CUSTOM_FORUM'), $forum_url, 'class:help-forum', false, '_blank')
|
||||
);
|
||||
}
|
||||
|
||||
$debug = $lang->setDebug(false);
|
||||
|
||||
if ($lang->hasKey('MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM_VALUE') && JText::_('MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM_VALUE') != '')
|
||||
{
|
||||
$forum_url = 'http://forum.joomla.org/viewforum.php?f=' . (int) JText::_('MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM_VALUE');
|
||||
$lang->setDebug($debug);
|
||||
$menu->addChild(
|
||||
new JMenuNode(JText::_('MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM'), $forum_url, 'class:help-forum', false, '_blank')
|
||||
);
|
||||
}
|
||||
|
||||
$lang->setDebug($debug);
|
||||
$menu->addChild(
|
||||
new JMenuNode(JText::_('MOD_MENU_HELP_DOCUMENTATION'), 'http://docs.joomla.org', 'class:help-docs', false, '_blank')
|
||||
);
|
||||
$menu->addSeparator();
|
||||
|
||||
$menu->addChild(
|
||||
new JMenuNode(JText::_('MOD_MENU_HELP_EXTENSIONS'), 'http://extensions.joomla.org', 'class:help-jed', false, '_blank')
|
||||
);
|
||||
$menu->addChild(
|
||||
new JMenuNode(JText::_('MOD_MENU_HELP_TRANSLATIONS'), 'http://community.joomla.org/translations.html', 'class:help-trans', false, '_blank')
|
||||
);
|
||||
$menu->addChild(
|
||||
new JMenuNode(JText::_('MOD_MENU_HELP_RESOURCES'), 'http://resources.joomla.org', 'class:help-jrd', false, '_blank')
|
||||
);
|
||||
$menu->addChild(
|
||||
new JMenuNode(JText::_('MOD_MENU_HELP_COMMUNITY'), 'http://community.joomla.org', 'class:help-community', false, '_blank')
|
||||
);
|
||||
$menu->addChild(
|
||||
new JMenuNode(JText::_('MOD_MENU_HELP_SECURITY'), 'http://developer.joomla.org/security.html', 'class:help-security', false, '_blank')
|
||||
);
|
||||
$menu->addChild(
|
||||
new JMenuNode(JText::_('MOD_MENU_HELP_DEVELOPER'), 'http://developer.joomla.org', 'class:help-dev', false, '_blank')
|
||||
);
|
||||
$menu->addChild(
|
||||
new JMenuNode(JText::_('MOD_MENU_HELP_SHOP'), 'http://shop.joomla.org', 'class:help-shop', false, '_blank')
|
||||
);
|
||||
$menu->getParent();
|
||||
}
|
1
administrator/modules/mod_menu/tmpl/index.html
Normal file
1
administrator/modules/mod_menu/tmpl/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
Reference in New Issue
Block a user