first commit
97
modules/mod_roknavmenu/MD5SUMS
Normal file
@ -0,0 +1,97 @@
|
||||
5f49179705235577fab80710ee8337f0 en-GB.mod_roknavmenu.ini
|
||||
f33f9454c71f32c0911755c3847620b6 fields/break.php
|
||||
48b4f4c9a55b8e8f71cf489901171041 fields/childtype.js
|
||||
8a3edb0428f11a404535d9134c90063f fields/index.html
|
||||
8cbec2c50545adb9161038cd0a93230b fields/moduleposition.php
|
||||
8aa91cb1192068d5efdab35ee2b89eaa fields/modules.php
|
||||
dc33c26fef52ca53f643d574ac2a6da1 fields/moduletypejs.php
|
||||
fc1fbd17743efd24d48788d076894964 fields/themelist.php
|
||||
964289f7878b3aec19941a9aab2d1c8a fields/themeoptions.php
|
||||
8a3edb0428f11a404535d9134c90063f index.html
|
||||
ee57d1f1763934ddacfeeb576233b80f install.script.php
|
||||
3a69908784e87ee2ed175b1c56a92f9d lib/AbstractJoomlaRokMenuFormatter.php
|
||||
7635d8bc7d1870e6b05cb0c90f2d850a lib/BaseRokNavMenuFormatter.php
|
||||
eff880395fbfe5f44c1acebf2f067e8f lib/BaseRokNavMenuTemplateParams.php
|
||||
bb661ad2e9ea7f98caa4068638157691 lib/RokNavMenu.php
|
||||
61344f1e4d710505c41de2060382b22e lib/RokNavMenuEvents.php
|
||||
03fb62633335d82ff75de9e164fd1a39 lib/RokSubfieldForm.php
|
||||
9a22364135e5467667f8966f776166b2 lib/common/RokBrowserCheck.php
|
||||
6a91dc2e18badd514ced95975f8ab641 lib/common/includes.php
|
||||
8a3edb0428f11a404535d9134c90063f lib/common/index.html
|
||||
0115dadb7f719ab2f558c11e08faf592 lib/helper.php
|
||||
1533a4b922f27cd4df2ff5c42c69a0fe lib/includes.php
|
||||
8a3edb0428f11a404535d9134c90063f lib/index.html
|
||||
f0d03516c7566bd8169997f27f645b67 lib/librokmenu/AbstractRokMenuFormatter.php
|
||||
1743920b22720c72d9ecfe772d271c4d lib/librokmenu/AbstractRokMenuLayout.php
|
||||
e6f9d9c10557c5507c4fd27d8d359dff lib/librokmenu/AbstractRokMenuProvider.php
|
||||
f4bfa5a20e06d0e61e9fd205d8a5ffa1 lib/librokmenu/AbstractRokMenuTheme.php
|
||||
5b1e04e488697aae4ec11d873996c3e1 lib/librokmenu/RokMenu.php
|
||||
b631e09e0f76686bbe6cf4c986fd3c05 lib/librokmenu/RokMenuDefaultRenderer.php
|
||||
b24eaddb97b76240dd440f5e3f44118d lib/librokmenu/RokMenuFormatter.php
|
||||
2c06122d421bb08ea7e84c048869f323 lib/librokmenu/RokMenuGreaterThenLevelFilter.php
|
||||
708ffea348d86387a24decabb502b76b lib/librokmenu/RokMenuHeader.php
|
||||
f2c101a351ca650ac577ed088b6bb37c lib/librokmenu/RokMenuIdFilter.php
|
||||
7fedf8ec1894c5b0f1efd028040c9651 lib/librokmenu/RokMenuIterator.php
|
||||
10c0834c1bc7ca5ca24034db55474b52 lib/librokmenu/RokMenuLayout.php
|
||||
3b5c87bad33ea2547a249be9b8e70594 lib/librokmenu/RokMenuNode.php
|
||||
2d06b5f6e225099a30ab93fb73ea02a0 lib/librokmenu/RokMenuNodeBase.php
|
||||
c6ede6e3d7a7f0db959d2e51a3a54d0e lib/librokmenu/RokMenuNodeTree.php
|
||||
0dcc1e9bf30903eb0080220081afd19b lib/librokmenu/RokMenuNotOnActiveTreeFilter.php
|
||||
75b6db06c22b62e235f8531e747b7d69 lib/librokmenu/RokMenuProvider.php
|
||||
8b4e30bcb284ecc261d773fb3a3de6a1 lib/librokmenu/RokMenuRenderer.php
|
||||
808f34dc7483c40b09df532f9a440bfb lib/librokmenu/RokMenuTheme.php
|
||||
a87e15199534b61a58e092fac9933dbc lib/librokmenu/includes.php
|
||||
8a3edb0428f11a404535d9134c90063f lib/librokmenu/index.html
|
||||
8a3edb0428f11a404535d9134c90063f lib/parameters/index.html
|
||||
e456c88bd9c3e10cf1c17c7ea61ab76f lib/parameters/templateinclude.php
|
||||
ffbc6e3e2fc47a43293cbea18f5cb854 lib/parameters/themelist.php
|
||||
d65647831c8af8397bb0bd18d6169d0c lib/parameters/themeparameters.php
|
||||
a65593d5c1d29940dea6719ee3a27a92 lib/providers/JoomlaRokMenuNode.php
|
||||
26919bd4ad3f4ea54d8121a081f39ce9 lib/providers/RokMenuProviderJoomla.php
|
||||
1f5a67208177065da5b9e198187a1aec lib/providers/RokMenuProviderJoomla16.php
|
||||
a482bf2ea8e9e0d07e058a53a6cf82b5 lib/providers/includes.php
|
||||
8a3edb0428f11a404535d9134c90063f lib/providers/index.html
|
||||
01650c321c1439869ca6edef52919d2b lib/renderers/RokNavMenu1XRenderer.php
|
||||
33c9f1dae2770d33d3c095093cb07871 lib/renderers/RokNavMenu2XRenderer.php
|
||||
9bb006e2cd00ce72527994990e440f06 lib/renderers/RokNavMenuTree.php
|
||||
38935db4fbe757d5b83439e0c7105ba2 lib/renderers/includes.php
|
||||
8a3edb0428f11a404535d9134c90063f lib/renderers/index.html
|
||||
d312dfa949c422aba4c9e2010ab3ec89 mod_roknavmenu.php
|
||||
b36b160a3a63b90a86ea00248e8dddc1 mod_roknavmenu.xml
|
||||
5803410e38932f5ff143f42467016ba8 themes/catalog.php
|
||||
f118251cf5c96a01056ad8714b8280f4 themes/default/formatter.php
|
||||
8a3edb0428f11a404535d9134c90063f themes/default/index.html
|
||||
8a3edb0428f11a404535d9134c90063f themes/default/js/index.html
|
||||
52d64ebaa4f1d5df331342ecaa801c54 themes/default/js/responsive-selectbox.js
|
||||
a92d185f928bbb0131e8d513446e3dcc themes/default/js/responsive.js
|
||||
1c156bfd4c86b1e6217ac5fabad17019 themes/default/js/rokmediaqueries.js
|
||||
f8e8e4122f220092400149e025336b1a themes/default/js/sidemenu.js
|
||||
e51ae8d6b15cc1a20b7534d8ebbf3330 themes/default/layout.php
|
||||
4c9afc2eaccac77433289e7d4f81744d themes/default/theme.php
|
||||
66a15d1b590d52e3e99d17149fda8e1a themes/fusion/css/fusion-ie6.css
|
||||
6166b72cf85ea6b257512027d2d48ad9 themes/fusion/css/fusion.css
|
||||
8a3edb0428f11a404535d9134c90063f themes/fusion/css/index.html
|
||||
7cca91ec7cd4bf6b88cc8b20f5aefde7 themes/fusion/formatter.php
|
||||
93992a1a77e0aca556c095e10571ec45 themes/fusion/images/active-parent.png
|
||||
48860390f42259b16da278c5e5e7488a themes/fusion/images/hover-parent.png
|
||||
8a3edb0428f11a404535d9134c90063f themes/fusion/images/index.html
|
||||
03965b6a0ece0913198f10df9e979b4e themes/fusion/images/level1-parent.png
|
||||
475df6c403f7d7bd2884bd61cc965f6b themes/fusion/images/level2-parent.png
|
||||
92ab2dfd3f11fe8f750681eb1e60024b themes/fusion/images/level3-parent.png
|
||||
4423b8bfdf3756689c25f9ef5272743e themes/fusion/images/level4-parent.png
|
||||
90ae59da48a16570e5ebe7c6efdfe2f1 themes/fusion/images/parents.png
|
||||
0f678ba6f4640eb8bd8d45bc5efe38d8 themes/fusion/images/sep-parent.png
|
||||
b402562d11ee33ae10ae81744b20b511 themes/fusion/images/top-dark.png
|
||||
6299b32b2b413ad976ac72f52cedffbf themes/fusion/images/top-light.png
|
||||
8a3edb0428f11a404535d9134c90063f themes/fusion/index.html
|
||||
09c085954925ba21a7ddb0c290210198 themes/fusion/js/fusion.js
|
||||
8a3edb0428f11a404535d9134c90063f themes/fusion/js/index.html
|
||||
9d36561e22698c4a0d2679e6257958b9 themes/fusion/js/sfhover-ie.js
|
||||
23cbfec362772c8774e073d9c5994f3c themes/fusion/js/sfhover.js
|
||||
902c76ae43d131db8881665c1b8a4798 themes/fusion/language/en-GB/en-GB.fusion.ini
|
||||
8a3edb0428f11a404535d9134c90063f themes/fusion/language/en-GB/index.html
|
||||
8a3edb0428f11a404535d9134c90063f themes/fusion/language/index.html
|
||||
06c8a5037d541f7cbe1c4325920725f3 themes/fusion/layout.php
|
||||
e77fb3a9da941bc2197d22a8576dbb6d themes/fusion/parameters.xml
|
||||
e1304ecc5f771b5ff85cb50f80eb59d4 themes/fusion/theme.php
|
||||
8a3edb0428f11a404535d9134c90063f themes/index.html
|
34
modules/mod_roknavmenu/en-GB.mod_roknavmenu.ini
Normal file
@ -0,0 +1,34 @@
|
||||
ROKNAVMENU.MSG.NO_TEMPLATE_CONFIG="No custom configuration options are available for this template."
|
||||
ROKNAVMENU.LABEL.LIMIT_LEVELS="Limit Levels"
|
||||
ROKNAVMENU.LABEL.TEMPLATE_CONFIG="Template Config"
|
||||
ROKNAVMENU.DESC.TEMPLATE_CONFIG="Custom Parameters supplied by a Joomla Template"
|
||||
ROKNAVMENU.DESCRIPTION.MOD_ROKNAVMENU="RocketTheme Customizable Navigation Menu"
|
||||
ROKNAVMENU.DESC.THEME="The custom theme for the menu."
|
||||
ROKNAVMENU.LABEL.THEME="Menu Theme"
|
||||
ROKNAVMENU.MSG.USING_OLD_FORMATTERS_AND_LAYOUTS="Themes are not available due to old style formatters or layout files:%s%s"
|
||||
ROKNAVMENU.LABEL.THEME_OPTIONS="Menu Theme Options"
|
||||
ROKNAVMENU.DESC.THEME_OPTIONS="Options for the currently selected menu theme."
|
||||
ROKNAVMENU.MSG.NO_THEME="No custom themes are available for this template."
|
||||
ROKNAVMENU.MSG.NO_TEMPLATE_OPTIONS="No custom config is available for this template."
|
||||
ROKNAVMENU.MSG.NO_THEME_OPTIONS_AVAILABLE="There options are available for this theme."
|
||||
|
||||
MOD_MENU="Menu"
|
||||
MOD_MENU_FIELD_ALLCHILDREN_DESC="Expand the menu and make its sub-menu items always visible."
|
||||
MOD_MENU_FIELD_ALLCHILDREN_LABEL="Show Sub-menu Items"
|
||||
MOD_MENU_FIELD_CLASS_DESC="A suffix to be applied to the CSS class of the menu items"
|
||||
MOD_MENU_FIELD_CLASS_LABEL="Menu Class Suffix"
|
||||
MOD_MENU_FIELD_ENDLEVEL_DESC="Level to stop rendering the menu at. If you choose 'All', all levels will be shown depending on 'Show Sub-menu Items' setting."
|
||||
MOD_MENU_FIELD_ENDLEVEL_LABEL="End Level"
|
||||
MOD_MENU_FIELD_MENUTYPE_DESC="Select a menu in the list"
|
||||
MOD_MENU_FIELD_MENUTYPE_LABEL="Select Menu"
|
||||
MOD_MENU_FIELD_STARTLEVEL_DESC="Level to start rendering the menu at. Setting the start and end levels to the same # and setting 'Show Sub-menu Items' to yes will only display that single level."
|
||||
MOD_MENU_FIELD_STARTLEVEL_LABEL="Start Level"
|
||||
MOD_MENU_FIELD_TAG_ID_DESC="An ID attribute to assign to the root UL tag of the menu (optional)"
|
||||
MOD_MENU_FIELD_TAG_ID_LABEL="Menu Tag ID"
|
||||
MOD_MENU_FIELD_TARGET_DESC="JavaScript values to position a popup window, e.g. top=50,left=50,width=200,height=300"
|
||||
MOD_MENU_FIELD_TARGET_LABEL="Target Position"
|
||||
MOD_MENU_XML_DESCRIPTION="This module displays a menu on the frontend."
|
||||
|
||||
MOD_ROKNAVMENU_SELECT_MODULE_POSITION="Select Module Postion"
|
||||
COM_MODULES_CHANGE_POSITION_TITLE="Change position"
|
||||
COM_MODULES_CHANGE_POSITION_BUTTON="Select position"
|
60
modules/mod_roknavmenu/fields/break.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Platform
|
||||
* @subpackage Form
|
||||
*
|
||||
* @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE
|
||||
*/
|
||||
|
||||
defined('JPATH_PLATFORM') or die;
|
||||
|
||||
/**
|
||||
* Form Field class for the Joomla Platform.
|
||||
* Supports a one line text field.
|
||||
*
|
||||
* @package Joomla.Platform
|
||||
* @subpackage Form
|
||||
* @link http://www.w3.org/TR/html-markup/input.text.html#input.text
|
||||
* @since 11.1
|
||||
*/
|
||||
class JFormFieldBreak extends JFormField
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $type = 'Break';
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected function getLabel()
|
||||
{
|
||||
$doc = JFactory::getDocument();
|
||||
$version = new JVersion();
|
||||
$doc->addStyleDeclaration(".rok-break {border-bottom:1px solid #eee;font-size:16px;color:#0088CC;margin-top:15px;padding:2px 0;width:100%}");
|
||||
|
||||
if (isset($this->element['label']) && !empty($this->element['label'])) {
|
||||
$label = JText::_((string)$this->element['label']);
|
||||
$css = (string)$this->element['class'];
|
||||
$version = new JVersion();
|
||||
if (version_compare($version->getShortVersion(), '3.0', '>=')) {
|
||||
return '<div class="rok-break ' . $css . '">' . $label . '</div>';
|
||||
} else {
|
||||
return '<label class="rok-break ' . $css . '">' . $label . '</label>';
|
||||
}
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
protected function getInput()
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
14
modules/mod_roknavmenu/fields/childtype.js
Normal file
@ -0,0 +1,14 @@
|
||||
/*
|
||||
* @version $Id: childtype.js 4758 2012-10-30 19:15:31Z djamil $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
window.addEvent("domready",function(){var f=document.id("jform_params_dropdown_children_type1")||document.id("jform_params_fusion_children_type1"),e=document.id("jform_params_dropdown_children_type2")||document.id("jform_params_fusion_children_type2"),b=document.id("jform_params_dropdown_children_type0")||document.id("jform_params_fusion_children_type0");
|
||||
var g=document.id("jform_params_dropdown_modules")||document.id("jform_params_fusion_modules"),d=document.id("jform_params_dropdown_module_positions")||document.id("jform_params_fusion_module_positions");
|
||||
if(g){var c=g.getParent("li")||g.getParent(".control-group");}if(d){var a=d.getParent("li")||d.getParent(".control-group");}if(f&&g){f.addEvent("click",function(){if(a){a.setStyle("display","none");
|
||||
}if(c){c.setStyle("display","block");}var h=c.getParent(".pane-slider");if(h){if(h.getStyle("height").toInt()>0){h.setStyle("height",c.getParent(".panelform").getSize().y);
|
||||
}}});}if(e&&d){e.addEvent("click",function(){if(c){c.setStyle("display","none");}if(a){a.setStyle("display","block");}var h=a.getParent(".pane-slider");
|
||||
if(h){if(h.getStyle("height").toInt()>0){h.setStyle("height",a.getParent(".panelform").getSize().y);}}});}if(b){b.addEvent("click",function(){if(c){c.setStyle("display","none");
|
||||
}if(a){a.setStyle("display","none");}var h=c.getParent(".pane-slider");if(h){if(h.getStyle("height").toInt()>0){h.setStyle("height",c.getParent(".panelform").getSize().y);
|
||||
}}});}if(b.checked){b.fireEvent("click");}if(f.checked){f.fireEvent("click");}if(e.checked){e.fireEvent("click");}});
|
1
modules/mod_roknavmenu/fields/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
92
modules/mod_roknavmenu/fields/moduleposition.php
Normal file
@ -0,0 +1,92 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: moduleposition.php 4795 2012-10-30 23:22:49Z steph $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
|
||||
defined('JPATH_BASE') or die;
|
||||
|
||||
jimport('joomla.form.formfield');
|
||||
JFormHelper::loadFieldClass('text');
|
||||
|
||||
/**
|
||||
* Supports a modal article picker.
|
||||
*
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage com_content
|
||||
* @since 1.6
|
||||
*/
|
||||
class JFormFieldModulePosition extends JFormFieldText
|
||||
{
|
||||
/**
|
||||
* The form field type.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.6
|
||||
*/
|
||||
protected $type = 'ModulePosition';
|
||||
|
||||
/**
|
||||
* Method to get the field input markup.
|
||||
*
|
||||
* @return string The field input markup.
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function getInput()
|
||||
{
|
||||
$lang = JFactory::getLanguage();
|
||||
$lang->load('mod_roknavmenu', JPATH_BASE, null, false, false)
|
||||
|| $lang->load('mod_roknavmenu', JPATH_SITE.'/modules/mod_roknavmenu', null, false, false)
|
||||
|| $lang->load('mod_roknavmenu', JPATH_BASE, $lang->getDefault(), false, false)
|
||||
|| $lang->load('mod_roknavmenu', JPATH_SITE.'/modules/mod_roknavmenu', $lang->getDefault(), false, false);
|
||||
|
||||
// Get the client id.
|
||||
$clientId = $this->element['client_id'];
|
||||
if (!isset($clientId))
|
||||
{
|
||||
$clientName = $this->element['client'];
|
||||
if (isset($clientName))
|
||||
{
|
||||
$client = JApplicationHelper::getClientInfo($clientName, true);
|
||||
$clientId = $client->id;
|
||||
}
|
||||
}
|
||||
if (!isset($clientId) && $this->form instanceof JForm) {
|
||||
$clientId = $this->form->getValue('client_id');
|
||||
}
|
||||
$clientId = (int) $clientId;
|
||||
|
||||
// Load the modal behavior script.
|
||||
JHtml::_('behavior.modal', 'a.modal');
|
||||
|
||||
// Build the script.
|
||||
$script = array();
|
||||
$script[] = ' function jSelectPosition_'.$this->id.'(name) {';
|
||||
$script[] = ' document.id("'.$this->id.'").value = name;';
|
||||
$script[] = ' SqueezeBox.close();';
|
||||
$script[] = ' }';
|
||||
|
||||
// Add the script to the document head.
|
||||
JFactory::getDocument()->addScriptDeclaration(implode("\n", $script));
|
||||
|
||||
// Setup variables for display.
|
||||
$html = array();
|
||||
$link = 'index.php?option=com_modules&view=positions&layout=modal&tmpl=component&function=jSelectPosition_'.$this->id.'&client_id='.$clientId;
|
||||
|
||||
// The current user display field.
|
||||
$html[] = '<div class="fltlft">';
|
||||
$html[] = parent::getInput();
|
||||
$html[] = '</div>';
|
||||
|
||||
// The user select button.
|
||||
$html[] = '<div class="button2-left">';
|
||||
$html[] = ' <div class="blank">';
|
||||
$html[] = ' <a class="modal" title="'.JText::_('MOD_ROKNAVMENU_SELECT_MODULE_POSITION').'" href="'.$link.'" rel="{handler: \'iframe\', size: {x: 800, y: 450}}">'.JText::_('MOD_ROKNAVMENU_SELECT_MODULE_POSITION').'</a>';
|
||||
$html[] = ' </div>';
|
||||
$html[] = '</div>';
|
||||
|
||||
return implode("\n", $html);
|
||||
}
|
||||
}
|
60
modules/mod_roknavmenu/fields/modules.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: modules.php 4585 2012-10-27 01:44:54Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
defined('JPATH_BASE') or die();
|
||||
|
||||
jimport('joomla.html.html');
|
||||
JFormHelper::loadFieldClass('list');
|
||||
/**
|
||||
* @package gantry
|
||||
* @subpackage admin.elements
|
||||
*/
|
||||
class JFormFieldModules extends JFormFieldList
|
||||
{
|
||||
|
||||
/**
|
||||
* The form field type.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.6
|
||||
*/
|
||||
public $type = 'modules';
|
||||
|
||||
/**
|
||||
* Method to get the field options.
|
||||
*
|
||||
* @return array The field option objects.
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function getOptions()
|
||||
{
|
||||
|
||||
$options = array();
|
||||
$db = JFactory::getDbo();
|
||||
$query = $db->getQuery(true);
|
||||
$query->select('id, title, module, position');
|
||||
$query->from('#__modules AS m');
|
||||
$query->where('m.client_id = 0');
|
||||
$query->order('position, ordering');
|
||||
|
||||
// Set the query
|
||||
$db->setQuery($query);
|
||||
if (!($modules = $db->loadObjectList())) {
|
||||
JError::raiseWarning(500, JText::sprintf('JLIB_APPLICATION_ERROR_MODULE_LOAD', $db->getErrorMsg()));
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach($modules as $module){
|
||||
$options[] = JHtml::_('select.option', $module->id, $module->title . ' (' . $module->module . ')');
|
||||
}
|
||||
|
||||
// Merge any additional options in the XML definition.
|
||||
$options = array_merge(parent::getOptions(), $options);
|
||||
return $options;
|
||||
|
||||
}
|
||||
}
|
52
modules/mod_roknavmenu/fields/moduletypejs.php
Normal file
@ -0,0 +1,52 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: moduletypejs.php 4806 2012-10-31 01:03:01Z steph $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
|
||||
defined('JPATH_BASE') or die;
|
||||
|
||||
jimport('joomla.form.formfield');
|
||||
|
||||
/**
|
||||
* Supports a modal article picker.
|
||||
*
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage com_content
|
||||
* @since 1.6
|
||||
*/
|
||||
class JFormFieldModuleTypeJS extends JFormField
|
||||
{
|
||||
/**
|
||||
* The form field type.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.6
|
||||
*/
|
||||
protected $type = 'ModuleTypeJS';
|
||||
|
||||
/**
|
||||
* Method to get the field input markup.
|
||||
*
|
||||
* @return string The field input markup.
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function getInput()
|
||||
{
|
||||
$lang = JFactory::getLanguage();
|
||||
$lang->load('mod_roknavmenu', JPATH_SITE, null, true, false)
|
||||
|| $lang->load('mod_roknavmenu', JPATH_SITE.'/modules/mod_roknavmenu', null, true, false)
|
||||
|| $lang->load('mod_roknavmenu', JPATH_SITE, $lang->getDefault(), true, false)
|
||||
|| $lang->load('mod_roknavmenu', JPATH_SITE.'/modules/mod_roknavmenu', $lang->getDefault(), true, false);
|
||||
|
||||
$doc =JFactory::getDocument();
|
||||
$doc->addScript(JURI::Root(true)."/modules/mod_roknavmenu/fields/childtype.js");
|
||||
return '';
|
||||
}
|
||||
|
||||
protected function getLabel(){
|
||||
return '';
|
||||
}
|
||||
}
|
111
modules/mod_roknavmenu/fields/themelist.php
Normal file
@ -0,0 +1,111 @@
|
||||
<?php
|
||||
/**
|
||||
* @version 2.0.7 November 5, 2013
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
|
||||
defined('JPATH_BASE') or die;
|
||||
|
||||
jimport('joomla.html.html');
|
||||
jimport('joomla.filesystem.folder');
|
||||
jimport('joomla.form.formfield');
|
||||
jimport('joomla.form.helper');
|
||||
JFormHelper::loadFieldClass('list');
|
||||
|
||||
/**
|
||||
* Supports an HTML select list of folder
|
||||
*
|
||||
* @package Joomla.Framework
|
||||
* @subpackage Form
|
||||
* @since 1.6
|
||||
*/
|
||||
class JFormFieldThemeList extends JFormFieldList
|
||||
{
|
||||
/**
|
||||
* The form field type.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.6
|
||||
*/
|
||||
public $type = 'ThemeList';
|
||||
|
||||
protected $_front_side_template;
|
||||
|
||||
/**
|
||||
* Method to get the field options.
|
||||
*
|
||||
* @return array The field option objects.
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function getOptions()
|
||||
{
|
||||
$doc =JFactory::getDocument();
|
||||
$version = new JVersion();
|
||||
|
||||
if (version_compare($version->getShortVersion(), '3.0', '<')){
|
||||
|
||||
$js = "window.addEvent('load', function() {
|
||||
$('" . $this->id . "').addEvent('change', function(){
|
||||
var sel = this.getSelected().get('value');
|
||||
$$('.themeset').setStyle('display','none');
|
||||
$$('#themeset-'+sel).setStyle('display','block');
|
||||
}).fireEvent('change');
|
||||
});";
|
||||
|
||||
} else {
|
||||
$js = "
|
||||
window.addEvent('load', function() {
|
||||
var chzn = $('" . $this->id . "_chzn');
|
||||
if(chzn!=null){
|
||||
$$('.themeset').setStyle('display','none');
|
||||
$$('#themeset-" . $this->value . "').setStyle('display','block');
|
||||
$('" . $this->id . "_chzn').addEvent('click', function(){
|
||||
$$('.themeset').setStyle('display','none');
|
||||
var text = $('" . $this->id . "_chzn').getElement('span').get('text');
|
||||
var options = $('" . $this->id . "').getElements('option');
|
||||
options.each(function(option) {
|
||||
var optText = String(option.get('text'));
|
||||
var optValue = String(option.get('value'));
|
||||
if(text == optText){
|
||||
var sel = '#themeset-'+optValue;
|
||||
}
|
||||
$$(sel).setStyle('display','block');
|
||||
});
|
||||
}).fireEvent('click');
|
||||
}
|
||||
});";
|
||||
}
|
||||
$doc->addScriptDeclaration($js);
|
||||
|
||||
$options = array();
|
||||
|
||||
|
||||
// Load 2x Catalog Themes
|
||||
require_once(JPATH_ROOT . "/modules/mod_roknavmenu/lib/RokNavMenu.php");
|
||||
RokNavMenu::loadCatalogs();
|
||||
|
||||
foreach (RokNavMenu::$themes as $theme_name => $theme_info)
|
||||
{
|
||||
$options[] = JHtml::_('select.option', $theme_name, $theme_info['fullname']);
|
||||
}
|
||||
|
||||
return $options;
|
||||
}
|
||||
|
||||
function _getFrontSideTemplate() {
|
||||
if (empty($this->_front_side_template)) {
|
||||
$db = JFactory::getDbo();
|
||||
$query = $db->getQuery(true);
|
||||
// Get the current default template
|
||||
$query->select('template');
|
||||
$query->from('#__template_styles');
|
||||
$query->where('client_id = 0 AND home = 1');
|
||||
$db->setQuery((string)$query);
|
||||
$defaultemplate = $db->loadResult();
|
||||
$this->_front_side_template = $defaultemplate;
|
||||
}
|
||||
return $this->_front_side_template;
|
||||
}
|
||||
}
|
100
modules/mod_roknavmenu/fields/themeoptions.php
Normal file
@ -0,0 +1,100 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: themeoptions.php 4597 2012-10-27 04:37:59Z steph $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
|
||||
defined('JPATH_BASE') or die;
|
||||
|
||||
jimport('joomla.html.html');
|
||||
jimport('joomla.filesystem.folder');
|
||||
jimport('joomla.form.formfield');
|
||||
jimport('joomla.form.helper');
|
||||
JHtml::_('behavior.framework', true);
|
||||
|
||||
/**
|
||||
* Supports an HTML select list of folder
|
||||
*
|
||||
* @package Joomla.Framework
|
||||
* @subpackage Form
|
||||
* @since 1.6
|
||||
*/
|
||||
class JFormFieldThemeOptions extends JFormField
|
||||
{
|
||||
/**
|
||||
* The form field type.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.6
|
||||
*/
|
||||
public $type = 'ThemeOptions';
|
||||
|
||||
public function __construct($form = null){
|
||||
parent::__construct($form);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the field input markup.
|
||||
*
|
||||
* @return string The field input markup.
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function getLabel()
|
||||
{
|
||||
$doc =JFactory::getDocument();
|
||||
$css="
|
||||
.rok-break {border-bottom:1px solid #eee;font-size:16px;color:#0088CC;margin-top:15px;padding:2px 0;width:100%;}
|
||||
div.themeset > div.control-label {margin-bottom:18px}
|
||||
div.themeset > div.controls {margin-bottom:18px}
|
||||
";
|
||||
$doc->addStyleDeclaration($css);
|
||||
|
||||
// Load SubfieldForm Class
|
||||
require_once(JPATH_ROOT . "/modules/mod_roknavmenu/lib/RokSubfieldForm.php");
|
||||
|
||||
// Load 2x Catalog Themes
|
||||
require_once(JPATH_ROOT . "/modules/mod_roknavmenu/lib/RokNavMenu.php");
|
||||
RokNavMenu::loadCatalogs();
|
||||
|
||||
$label = JText::_((string)$this->element['label']);
|
||||
$css = (string)$this->element['class'];
|
||||
|
||||
$buffer = '';
|
||||
$form = RokSubfieldForm::getInstanceFromForm($this->form);
|
||||
|
||||
JForm::addFieldPath(dirname(__FILE__) . '/fields');
|
||||
|
||||
$themesets = $form->getSubFieldsets('roknavmenu-themes');
|
||||
|
||||
foreach($themesets as $themeset => $themeset_val)
|
||||
{
|
||||
$themeset_fields = $form->getSubFieldset('roknavmenu-themes', $themeset, 'params');
|
||||
ob_start();
|
||||
?>
|
||||
<div class="control-group themeset" id="themeset-<?php echo $themeset;?>">
|
||||
<?php foreach ($themeset_fields as $themeset_field): ?>
|
||||
<div class="control-label">
|
||||
<?php echo $themeset_field->getLabel(); ?>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<?php echo $themeset_field->getInput(); ?>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php
|
||||
$buffer .= ob_get_clean();
|
||||
}
|
||||
|
||||
return $buffer;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected function getInput()
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
1
modules/mod_roknavmenu/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
103
modules/mod_roknavmenu/install.script.php
Normal file
@ -0,0 +1,103 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: install.script.php 4585 2012-10-27 01:44:54Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
/**
|
||||
* Document Description
|
||||
*
|
||||
* Document Long Description
|
||||
*
|
||||
* PHP4/5
|
||||
*
|
||||
* Created on Jul 21, 2008
|
||||
*
|
||||
* @package package_name
|
||||
* @author Your Name <author@toowoombarc.qld.gov.au>
|
||||
* @author Toowoomba Regional Council Information Management Branch
|
||||
* @license GNU/GPL http://www.gnu.org/licenses/gpl.html
|
||||
* @copyright 2008 Toowoomba Regional Council/Developer Name
|
||||
* @version SVN: $Id: install.script.php 4585 2012-10-27 01:44:54Z btowles $
|
||||
* @see http://joomlacode.org/gf/project/ JoomlaCode Project:
|
||||
*/
|
||||
|
||||
class Mod_RokNavMenuInstallerScript
|
||||
{
|
||||
|
||||
public function install($parent)
|
||||
{
|
||||
if ($this->checkForExtender()) $this->registerExtenderPlugin($parent);
|
||||
$this->clearCache();
|
||||
return true;
|
||||
}
|
||||
|
||||
public function update($parent)
|
||||
{
|
||||
if ($this->checkForExtender()) $this->registerExtenderPlugin($parent);
|
||||
$this->clearCache();
|
||||
return true;
|
||||
}
|
||||
|
||||
public function uninstall($parent)
|
||||
{
|
||||
if ($this->checkForExtender()) $this->unregisterExtenderPlugin($parent);
|
||||
}
|
||||
|
||||
public function preflight($type, $parent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
protected function checkForExtender()
|
||||
{
|
||||
// if the class exists and is loaded just return
|
||||
if (class_exists('plgSystemRokExtender')) return true;
|
||||
$plugin_path = JPATH_ROOT . '/plugins/system/rokextender/rokextender.php';
|
||||
|
||||
// if the plugin isnt installed
|
||||
if (!file_exists($plugin_path) || !is_file($plugin_path)) return false;
|
||||
|
||||
require_once($plugin_path);
|
||||
|
||||
if (!class_exists('plgSystemRokExtender')) {
|
||||
//TODO: add error message output
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function registerExtenderPlugin($parent)
|
||||
{
|
||||
$manifest = $parent->getParent()->getManifest();
|
||||
$basepath = str_replace(JPATH_ROOT, '', $parent->getParent()->getPath('extension_root'));
|
||||
|
||||
foreach ($manifest->plugins->plugin as $plugin) {
|
||||
plgSystemRokExtender::registerExtenderPlugin($basepath . (string)$plugin);
|
||||
}
|
||||
}
|
||||
|
||||
protected function unregisterExtenderPlugin($parent)
|
||||
{
|
||||
$manifest = $parent->getParent()->getManifest();
|
||||
$basepath = str_replace(JPATH_ROOT, '', $parent->getParent()->getPath('extension_root'));
|
||||
|
||||
foreach ($manifest->plugins->plugin as $plugin) {
|
||||
plgSystemRokExtender::registerExtenderPlugin($basepath . (string)$plugin);
|
||||
}
|
||||
}
|
||||
|
||||
protected function clearCache()
|
||||
{
|
||||
$conf = JFactory::getConfig();
|
||||
$options = array(
|
||||
'cachebase' => $conf->get('cache_path', JPATH_SITE.'/cache'));
|
||||
$cache = $cache = JCache::getInstance('callback', $options);
|
||||
|
||||
$cache->clean('mod_roknavmenu');
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: AbstractJoomlaRokMenuFormatter.php 4585 2012-10-27 01:44:54Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
abstract class AbstractJoomlaRokMenuFormatter extends AbstractRokMenuFormatter {
|
||||
protected function _format_subnodes(&$node) {
|
||||
parent::_format_subnodes($node);
|
||||
//See if the the roknavmenudisplay plugins want to play
|
||||
JPluginHelper::importPlugin('roknavmenu');
|
||||
$dispatcher =JDispatcher::getInstance();
|
||||
$dispatcher->trigger('onRokNavMenuModifyLink', array (&$node, &$this->args));
|
||||
}
|
||||
}
|
60
modules/mod_roknavmenu/lib/BaseRokNavMenuFormatter.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: BaseRokNavMenuFormatter.php 4585 2012-10-27 01:44:54Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
// no direct access
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
//require_once (dirname(__FILE__).'/RokNavMenuTree.php');
|
||||
|
||||
/*
|
||||
* Created on Jan 16, 2009
|
||||
*
|
||||
* To change the template for this generated file go to
|
||||
* Window - Preferences - PHPeclipse - PHP - Code Templates
|
||||
*/
|
||||
class BaseRokNavMenuFormatter {
|
||||
function format_tree(&$nav_menu_tree) {
|
||||
if ($nav_menu_tree->hasChildren()){
|
||||
reset($nav_menu_tree->_children);
|
||||
while (list($key, $value) = each($nav_menu_tree->_children)) {
|
||||
$child_node =& $nav_menu_tree->_children[$key];
|
||||
$menu_params =& $nav_menu_tree->_params;
|
||||
$this->format_subnodes($child_node, $menu_params);
|
||||
}
|
||||
}
|
||||
}
|
||||
function format(&$node,$menu_params){
|
||||
|
||||
}
|
||||
function format_subnodes(&$node, &$menu_params) {
|
||||
|
||||
$this->default_format($node, $menu_params);
|
||||
$this->format($node, $menu_params);
|
||||
if ($node->hasChildren()){
|
||||
reset($node->_children);
|
||||
while (list($key, $value) = each($node->_children)) {
|
||||
$child_node =& $node->_children[$key];
|
||||
$this->format_subnodes($child_node, $menu_params);
|
||||
}
|
||||
}
|
||||
}
|
||||
function default_format(&$node, &$menu_params) {
|
||||
// Set up basic nav for target type
|
||||
if ($node->nav == 'new') {
|
||||
$node->target = "_blank";
|
||||
}
|
||||
else if ($node->nav == 'newnotool'){
|
||||
$attribs = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,'.$node->getParameter('window_open');
|
||||
$node->onclick = 'window.open(this.href,\'targetWindow\',\''.$attribs.'\');return false;';
|
||||
}
|
||||
|
||||
//See if the the roknavmenudisplay plugins want to play
|
||||
JPluginHelper::importPlugin('roknavmenu');
|
||||
$dispatcher =JDispatcher::getInstance();
|
||||
$dispatcher->trigger('onRokNavMenuModifyLink', array (&$node, &$menu_params));
|
||||
}
|
||||
}
|
23
modules/mod_roknavmenu/lib/BaseRokNavMenuTemplateParams.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: BaseRokNavMenuTemplateParams.php 4585 2012-10-27 01:44:54Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
// no direct access
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
//require_once (dirname(__FILE__).'/RokNavMenuTree.php');
|
||||
|
||||
/*
|
||||
* Created on Jan 16, 2009
|
||||
*
|
||||
* To change the template for this generated file go to
|
||||
* Window - Preferences - PHPeclipse - PHP - Code Templates
|
||||
*/
|
||||
class BaseRokNavMenuTemplateParams {
|
||||
function getTemplateParams($basename, $base_control_name, &$params){
|
||||
return "";
|
||||
}
|
||||
}
|
225
modules/mod_roknavmenu/lib/RokNavMenu.php
Normal file
@ -0,0 +1,225 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: RokNavMenu.php 4585 2012-10-27 01:44:54Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
require_once(dirname(__FILE__) . "/librokmenu/includes.php");
|
||||
require_once(dirname(__FILE__) . "/helper.php");
|
||||
|
||||
if (!class_exists('RokNavMenu'))
|
||||
{
|
||||
class RokNavMenu extends RokMenu
|
||||
{
|
||||
const TOP_LEVEL_PARENT_ID = 1;
|
||||
static $themes = array();
|
||||
static $current_template;
|
||||
static $catalogs_loaded = false;
|
||||
|
||||
public function __construct($args)
|
||||
{
|
||||
self::loadCatalogs();
|
||||
parent::__construct($args);
|
||||
}
|
||||
|
||||
protected function getProvider()
|
||||
{
|
||||
require_once(dirname(__FILE__) . '/providers/RokMenuProviderJoomla16.php');
|
||||
return new RokMenuProviderJoomla16($this->args);
|
||||
}
|
||||
|
||||
protected function getRenderer()
|
||||
{
|
||||
// if its a registered theme its a 2x theme
|
||||
if (array_key_exists('theme', $this->args) && array_key_exists($this->args['theme'], self::$themes))
|
||||
{
|
||||
$themeinfo = self::$themes[$this->args['theme']];
|
||||
$themeclass = $themeinfo['class'];
|
||||
|
||||
$renderer = new RokNavMenu2XRenderer();
|
||||
|
||||
$theme = new $themeclass();
|
||||
$renderer->setTheme($theme);
|
||||
}
|
||||
else
|
||||
{
|
||||
// its a 1x theme
|
||||
$renderer = new RokNavMenu1XRenderer();
|
||||
}
|
||||
return $renderer;
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
$this->renderHeader();
|
||||
return $this->renderMenu();
|
||||
}
|
||||
|
||||
public static function registerTheme($path, $name, $fullname, $themeClass)
|
||||
{
|
||||
$theme = array('name' => $name, 'fullname' => $fullname, 'path' => $path, 'class' => $themeClass);
|
||||
self::$themes[$name] = $theme;
|
||||
}
|
||||
|
||||
public static function loadCatalogs()
|
||||
{
|
||||
if (!self::$catalogs_loaded) {
|
||||
// load the module themes catalog
|
||||
require_once(JPATH_ROOT . '/modules/mod_roknavmenu/themes/catalog.php');
|
||||
|
||||
foreach (self::getTemplates() as $template) {
|
||||
$template_theme_catalog = JPATH_ROOT . '/templates/' . $template . "/html/mod_roknavmenu/themes/catalog.php";
|
||||
if (JFile::exists($template_theme_catalog)) {
|
||||
//load the templates themes
|
||||
include_once($template_theme_catalog);
|
||||
}
|
||||
}
|
||||
self::$catalogs_loaded = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected static function getTemplates()
|
||||
{
|
||||
$Itemid = JFactory::getApplication()->input->getInt('Itemid');
|
||||
$templates = null;
|
||||
$db = JFactory::getDbo();
|
||||
|
||||
if(!is_null($Itemid)){
|
||||
// Load specific style if one is assigned
|
||||
$query = $db->getQuery(true);
|
||||
$query->select('ts.template');
|
||||
$query->from('#__template_styles AS ts');
|
||||
$query->join('INNER','#__menu AS m ON ts.id=m.template_style_id');
|
||||
$query->where('m.id = '.$Itemid);
|
||||
$query->where('m.template_style_id != 0');
|
||||
|
||||
$db->setQuery($query);
|
||||
$templates = $db->loadColumn();
|
||||
}
|
||||
|
||||
if ($templates){
|
||||
return $templates;
|
||||
}
|
||||
|
||||
// Load styles normally if no specific style is assigned
|
||||
$query = $db->getQuery(true);
|
||||
$query->select('template');
|
||||
$query->from('#__template_styles');
|
||||
$query->where('home = 1');
|
||||
$query->where('client_id = 0');
|
||||
|
||||
$db->setQuery($query);
|
||||
$templates = $db->loadColumn();
|
||||
return $templates;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load published modules
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function &loadModules()
|
||||
{
|
||||
static $clean;
|
||||
|
||||
if (isset($clean)) {
|
||||
return $clean;
|
||||
}
|
||||
|
||||
$Itemid = JFactory::getApplication()->input->getInt('Itemid');
|
||||
$app = JFactory::getApplication();
|
||||
$user = JFactory::getUser();
|
||||
$groups = implode(',', $user->getAuthorisedViewLevels());
|
||||
$lang = JFactory::getLanguage()->getTag();
|
||||
$clientId = (int) $app->getClientId();
|
||||
|
||||
$cache = JFactory::getCache ('com_modules', '');
|
||||
$cacheid = md5(serialize(array($Itemid, $groups, $clientId, $lang)));
|
||||
|
||||
if (!($clean = $cache->get($cacheid))) {
|
||||
$db = JFactory::getDbo();
|
||||
|
||||
$query = $db->getQuery(true);
|
||||
$query->select('id, title, module, position, content, showtitle, params, mm.menuid');
|
||||
$query->from('#__modules AS m');
|
||||
$query->join('LEFT','#__modules_menu AS mm ON mm.moduleid = m.id');
|
||||
$query->where('m.published = 1');
|
||||
|
||||
$date = JFactory::getDate();
|
||||
$now = $date->toSql();
|
||||
$nullDate = $db->getNullDate();
|
||||
$query->where('(m.publish_up = '.$db->Quote($nullDate).' OR m.publish_up <= '.$db->Quote($now).')');
|
||||
$query->where('(m.publish_down = '.$db->Quote($nullDate).' OR m.publish_down >= '.$db->Quote($now).')');
|
||||
|
||||
$query->where('m.access IN ('.$groups.')');
|
||||
$query->where('m.client_id = '. $clientId);
|
||||
$query->where('(mm.menuid = '. (int) $Itemid .' OR mm.menuid <= 0)');
|
||||
|
||||
// Filter by language
|
||||
if ($app->isSite() && $app->getLanguageFilter()) {
|
||||
$query->where('m.language IN (' . $db->Quote($lang) . ',' . $db->Quote('*') . ')');
|
||||
}
|
||||
|
||||
$query->order('position, ordering');
|
||||
|
||||
// Set the query
|
||||
$db->setQuery($query);
|
||||
$modules = $db->loadObjectList();
|
||||
$clean = array();
|
||||
|
||||
if($db->getErrorNum()){
|
||||
JError::raiseWarning(500, JText::sprintf('JLIB_APPLICATION_ERROR_MODULE_LOAD', $db->getErrorMsg()));
|
||||
return $clean;
|
||||
}
|
||||
|
||||
// Apply negative selections and eliminate duplicates
|
||||
$negId = $Itemid ? -(int)$Itemid : false;
|
||||
$dupes = array();
|
||||
for ($i = 0, $n = count($modules); $i < $n; $i++)
|
||||
{
|
||||
$module = &$modules[$i];
|
||||
|
||||
// The module is excluded if there is an explicit prohibition, or if
|
||||
// the Itemid is missing or zero and the module is in exclude mode.
|
||||
$negHit = ($negId === (int) $module->menuid)
|
||||
|| (!$negId && (int)$module->menuid < 0);
|
||||
|
||||
if (isset($dupes[$module->id]))
|
||||
{
|
||||
// If this item has been excluded, keep the duplicate flag set,
|
||||
// but remove any item from the cleaned array.
|
||||
if ($negHit) {
|
||||
unset($clean[$module->id]);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
$dupes[$module->id] = true;
|
||||
|
||||
// Only accept modules without explicit exclusions.
|
||||
if (!$negHit)
|
||||
{
|
||||
//determine if this is a custom module
|
||||
$file = $module->module;
|
||||
$custom = substr($file, 0, 4) == 'mod_' ? 0 : 1;
|
||||
$module->user = $custom;
|
||||
// Custom module name is given by the title field, otherwise strip off "com_"
|
||||
$module->name = $custom ? $module->title : substr($file, 4);
|
||||
$module->style = null;
|
||||
$module->position = strtolower($module->position);
|
||||
$clean[$module->id] = $module;
|
||||
}
|
||||
}
|
||||
unset($dupes);
|
||||
// Return to simple indexing that matches the query order.
|
||||
$clean = array_values($clean);
|
||||
|
||||
$cache->store($clean, $cacheid);
|
||||
}
|
||||
|
||||
return $clean;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
205
modules/mod_roknavmenu/lib/RokNavMenuEvents.php
Normal file
@ -0,0 +1,205 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: RokNavMenuEvents.php 4585 2012-10-27 01:44:54Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
jimport('joomla.plugin.plugin');
|
||||
jimport('joomla.filesystem.file');
|
||||
jimport('joomla.filesystem.folder');
|
||||
|
||||
/**
|
||||
*/
|
||||
class RokNavMenuEvents extends JPlugin
|
||||
{
|
||||
|
||||
public function onContentPrepareForm($form, $data)
|
||||
{
|
||||
|
||||
|
||||
$app = JFactory::getApplication();
|
||||
if (!$app->isAdmin()) return;
|
||||
|
||||
$option = JFactory::getApplication()->input->get('option');
|
||||
$layout = JFactory::getApplication()->input->get('layout');
|
||||
$task = JFactory::getApplication()->input->get('task');
|
||||
$id = JFactory::getApplication()->input->getInt('id');
|
||||
|
||||
|
||||
$module = $this->getModuleType($data);
|
||||
|
||||
|
||||
if (in_array($option, array('com_modules', 'com_advancedmodules')) && $layout == 'edit' && $module == 'mod_roknavmenu')
|
||||
{
|
||||
|
||||
require_once(JPATH_ROOT . '/modules/mod_roknavmenu/lib/RokNavMenu.php');
|
||||
require_once(JPATH_ROOT . '/modules/mod_roknavmenu/lib/RokSubfieldForm.php');
|
||||
JForm::addFieldPath(JPATH_ROOT . '/modules/mod_roknavmenu/fields');
|
||||
// Load 2x Catalog Themes
|
||||
RokNavMenu::loadCatalogs();
|
||||
// Load 1x Themes
|
||||
$this->registerOldThemes();
|
||||
|
||||
foreach (RokNavMenu::$themes as $theme_name => $theme_info)
|
||||
{
|
||||
$params_file = $theme_info['path'] . "/parameters.xml";
|
||||
if (JFile::exists($params_file))
|
||||
{
|
||||
$form->loadFile($params_file, false);
|
||||
}
|
||||
|
||||
$fields_folder = $theme_info['path'] . "/fields";
|
||||
if (JFolder::exists($fields_folder))
|
||||
{
|
||||
JForm::addFieldPath($fields_folder);
|
||||
}
|
||||
|
||||
$language_path = $theme_info['path'] . "/language";
|
||||
if (JFolder::exists($language_path)){
|
||||
$language =JFactory::getLanguage();
|
||||
$language->load($theme_name ,$theme_info['path'], $language->getTag(), true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$subfieldform = RokSubfieldForm::getInstanceFromForm($form);
|
||||
|
||||
if (!empty($data) && isset($data->params)) $subfieldform->setOriginalParams($data->params);
|
||||
|
||||
if ($task == 'save' || $task == 'apply')
|
||||
{
|
||||
$subfieldform->makeSubfieldsVisable();
|
||||
}
|
||||
}
|
||||
else if ($option == 'com_menus' && $layout == 'edit'){
|
||||
JForm::addFieldPath(JPATH_ROOT . '/modules/mod_roknavmenu/fields');
|
||||
// Load 2x Catalog Themes
|
||||
require_once(JPATH_ROOT . "/modules/mod_roknavmenu/lib/RokNavMenu.php");
|
||||
RokNavMenu::loadCatalogs();
|
||||
// Load 1x Themes
|
||||
$this->registerOldThemes();
|
||||
foreach (RokNavMenu::$themes as $theme_name => $theme_info)
|
||||
{
|
||||
$item_file = $theme_info['path'] . "/item.xml";
|
||||
if (JFile::exists($item_file))
|
||||
{
|
||||
$form->loadFile($item_file, true);
|
||||
}
|
||||
|
||||
$fields_folder = $theme_info['path'] . "/fields";
|
||||
if (JFolder::exists($fields_folder))
|
||||
{
|
||||
JForm::addFieldPath($fields_folder);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function registerOldThemes()
|
||||
{
|
||||
$filter = '.';
|
||||
$exclude = array('.svn', 'CVS','.DS_Store','__MACOSX');
|
||||
|
||||
// path to directory
|
||||
$template_themes_path = '/templates/'.$this->_getFrontSideTemplate().'/html/mod_roknavmenu/themes';
|
||||
$template_themes_full_path = JPath::clean(JPATH_ROOT.$template_themes_path);
|
||||
|
||||
$module_themes_path = '/modules/mod_roknavmenu/themes';
|
||||
$module_themes_full_path = JPath::clean(JPATH_ROOT.$module_themes_path);
|
||||
|
||||
|
||||
/** Get the Template Themes parameters **/
|
||||
if (JFolder::exists($template_themes_full_path) && !JFile::exists($template_themes_full_path."/catalog.php")) {
|
||||
$folders = JFolder::folders($template_themes_full_path, $filter);
|
||||
if ( is_array($folders) )
|
||||
{
|
||||
while (list($key, $val) = each($folders)) {
|
||||
$folder =& $folders[$key];
|
||||
if ($exclude)
|
||||
{
|
||||
if (preg_match( chr( 1 ) . $exclude . chr( 1 ), $folder ))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
$theme_full_path = $template_themes_full_path.'/'.$folder;
|
||||
|
||||
$fullname = 'Template theme - '.$folder;
|
||||
$class = 'RokNavMenuFormatterTemplate'.str_replace('-', '', $folder);
|
||||
$name = $folder;
|
||||
|
||||
RokNavMenu::registerTheme($theme_full_path, $name, $fullname, $class);
|
||||
}
|
||||
}
|
||||
}
|
||||
/** Get the Default Themes parameters **/
|
||||
if (JFolder::exists($module_themes_full_path) && !JFile::exists($module_themes_full_path."/catalog.php")) {
|
||||
$folders = JFolder::folders($module_themes_full_path, $filter);
|
||||
if ( is_array($folders) )
|
||||
{
|
||||
while (list($key, $val) = each($folders)) {
|
||||
$folder =& $folders[$key];
|
||||
if ($exclude)
|
||||
{
|
||||
if (preg_match( chr( 1 ) . $exclude . chr( 1 ), $folder ))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
$theme_full_path = $module_themes_full_path.'/'.$folder;
|
||||
|
||||
$fullname = 'Template theme - '.$folder;
|
||||
$class = 'RokNavMenuFormatterTemplate'.str_replace('-', '', $folder);
|
||||
$name = $folder;
|
||||
|
||||
RokNavMenu::registerTheme($theme_full_path, $name, $fullname, $class);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function _getFrontSideTemplate() {
|
||||
if (empty($this->_front_side_template)) {
|
||||
$db = JFactory::getDbo();
|
||||
$query = $db->getQuery(true);
|
||||
// Get the current default template
|
||||
$query->select('template');
|
||||
$query->from('#__template_styles');
|
||||
$query->where('client_id = 0 AND home = 1');
|
||||
$db->setQuery((string)$query);
|
||||
$defaultemplate = $db->loadResult();
|
||||
$this->_front_side_template = $defaultemplate;
|
||||
}
|
||||
return $this->_front_side_template;
|
||||
}
|
||||
|
||||
|
||||
protected function getModuleType(&$data)
|
||||
{
|
||||
if (is_array($data) && isset($data['module']))
|
||||
{
|
||||
return $data['module'];
|
||||
}
|
||||
elseif (is_array($data) && empty($data))
|
||||
{
|
||||
$form = JRequest::getVar('jform');
|
||||
if (is_array($form) && array_key_exists('module',$form))
|
||||
{
|
||||
return $form['module'];
|
||||
}
|
||||
}
|
||||
if (is_object($data) && method_exists( $data , 'get'))
|
||||
{
|
||||
return $data->get('module');
|
||||
}
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
182
modules/mod_roknavmenu/lib/RokSubfieldForm.php
Normal file
@ -0,0 +1,182 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: RokSubfieldForm.php 10623 2013-05-23 23:37:15Z steph $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
if(!class_exists('RokSubfieldForm')){
|
||||
class RokSubfieldForm extends JForm
|
||||
{
|
||||
static $instances = array();
|
||||
|
||||
protected $original_params;
|
||||
|
||||
public static function getInstanceFromForm(JForm $form)
|
||||
{
|
||||
if (!array_key_exists($form->getName(), self::$instances))
|
||||
{
|
||||
self::$instances[$form->getName()] = new RokSubfieldForm($form);
|
||||
}
|
||||
self::$instances[$form->getName()]->updateDataParams();
|
||||
return self::$instances[$form->getName()];
|
||||
}
|
||||
|
||||
public function __construct(JForm &$form)
|
||||
{
|
||||
$form_vars = get_object_vars($form);
|
||||
foreach ($form_vars as $form_var_name => $form_var_value)
|
||||
{
|
||||
$this->$form_var_name = $form_var_value;
|
||||
}
|
||||
}
|
||||
|
||||
public function makeSubfieldsVisable(){
|
||||
$subs = $this->xml->xpath('//subfields/fieldset/field');
|
||||
foreach($subs as $sub){
|
||||
$field =& $this->xml->config[0]->fields->fieldset[0]->addChild('field');
|
||||
foreach($sub->attributes() as $aname=>$aval){
|
||||
$field->addAttribute($aname,$aval);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get an array of <field /> elements from the form XML document which are
|
||||
* in a specified fieldset by name.
|
||||
*
|
||||
* @param string $name The name of the fieldset.
|
||||
*
|
||||
* @return mixed Boolean false on error or array of JXMLElement objects.
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function & findFieldsBySubFieldset($subtype, $name)
|
||||
{
|
||||
// Initialise variables.
|
||||
$false = false;
|
||||
|
||||
// Make sure there is a valid JForm XML document.
|
||||
$version = new JVersion();
|
||||
if (!($this->xml instanceof SimpleXMLElement) && (version_compare($version->getShortVersion(), '3.0', '>='))) {
|
||||
return false;
|
||||
} elseif (!($this->xml instanceof JXMLElement) && (version_compare($version->getShortVersion(), '3.0', '<'))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get an array of <field /> elements that are underneath a <fieldset /> element
|
||||
* with the appropriate name attribute, and also any <field /> elements with
|
||||
* the appropriate fieldset attribute.
|
||||
*/
|
||||
$fields = $this->xml->xpath('//subfields[@name="'.$subtype.'"]/fieldset[@name="'.$name.'"]/field');
|
||||
|
||||
return $fields;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Method to get an array of JFormField objects in a given fieldset by name. If no name is
|
||||
* given then all fields are returned.
|
||||
*
|
||||
* @param string $set The optional name of the fieldset.
|
||||
*
|
||||
* @return array The array of JFormField objects in the fieldset.
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getSubFieldset($subtype, $set, $group="params")
|
||||
{
|
||||
// Initialise variables.
|
||||
$fields = array();
|
||||
|
||||
$elements = $this->findFieldsBySubFieldset($subtype, $set);
|
||||
|
||||
// If no field elements were found return empty.
|
||||
if (empty($elements)) {
|
||||
return $fields;
|
||||
}
|
||||
|
||||
// Build the result array from the found field elements.
|
||||
foreach ($elements as $element)
|
||||
{
|
||||
// If the field is successfully loaded add it to the result array.
|
||||
if ($field = $this->loadField($element, $group)) {
|
||||
$fields[$field->id] = $field;
|
||||
}
|
||||
}
|
||||
|
||||
return $fields;
|
||||
}
|
||||
|
||||
public function setOriginalParams($original_params)
|
||||
{
|
||||
$this->original_params = $original_params;
|
||||
}
|
||||
|
||||
public function getOriginalParams()
|
||||
{
|
||||
return $this->original_params;
|
||||
}
|
||||
|
||||
public function updateDataParams()
|
||||
{
|
||||
if (isset($this->original_params) && (is_array($this->original_params))){
|
||||
foreach($this->original_params as $param_name => $param_value){
|
||||
$this->data->set('params.'.$param_name, $param_value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get an array of fieldset objects optionally filtered over a given field group.
|
||||
*
|
||||
* @param string $group The dot-separated form group path on which to filter the fieldsets.
|
||||
*
|
||||
* @return array The array of fieldset objects.
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getSubFieldsets($subfield_type)
|
||||
{
|
||||
// Initialise variables.
|
||||
$fieldsets = array();
|
||||
$sets = array();
|
||||
|
||||
// Make sure there is a valid JForm XML document.
|
||||
$version = new JVersion();
|
||||
if (!($this->xml instanceof SimpleXMLElement) && (version_compare($version->getShortVersion(), '3.0', '>='))) {
|
||||
return $fieldsets;
|
||||
} elseif (!($this->xml instanceof JXMLElement) && (version_compare($version->getShortVersion(), '3.0', '<'))) {
|
||||
return $fieldsets;
|
||||
}
|
||||
|
||||
// Get an array of <fieldset /> elements and fieldset attributes.
|
||||
$sets = $this->xml->xpath('//subfields[@name="'.$subfield_type.'"]/fieldset');
|
||||
|
||||
// If no fieldsets are found return empty.
|
||||
if (empty($sets)) {
|
||||
return $fieldsets;
|
||||
}
|
||||
|
||||
// Process each found fieldset.
|
||||
foreach ($sets as $set)
|
||||
{
|
||||
// Only create it if it doesn't already exist.
|
||||
if (empty($fieldsets[(string) $set['name']])) {
|
||||
|
||||
// Build the fieldset object.
|
||||
$fieldset = (object) array('name' => '', 'label' => '', 'description' => '');
|
||||
foreach ($set->attributes() as $name => $value)
|
||||
{
|
||||
$fieldset->$name = (string) $value;
|
||||
}
|
||||
|
||||
// Add the fieldset object to the list.
|
||||
$fieldsets[$fieldset->name] = $fieldset;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $fieldsets;
|
||||
}
|
||||
}
|
||||
}
|
196
modules/mod_roknavmenu/lib/common/RokBrowserCheck.php
Normal file
@ -0,0 +1,196 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: RokBrowserCheck.php 4585 2012-10-27 01:44:54Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
|
||||
if (!class_exists('RokBrowserCheck')) {
|
||||
|
||||
class RokBrowserCheck {
|
||||
var $_ua;
|
||||
|
||||
var $name;
|
||||
var $version;
|
||||
var $shortversion;
|
||||
var $platform;
|
||||
var $engine;
|
||||
var $_checks = array();
|
||||
|
||||
function __construct() {
|
||||
$this->_ua = $_SERVER['HTTP_USER_AGENT'];
|
||||
$this->_checkPlatform();
|
||||
$this->_checkBrowser();
|
||||
$this->_checkEngine();
|
||||
|
||||
// add short version
|
||||
if ($this->version != 'unknown') $this->shortversion = substr($this->version, 0, strpos($this->version, '.'));
|
||||
else $this->shortversion = 'unknown';
|
||||
|
||||
$this->_createChecks();
|
||||
}
|
||||
|
||||
function _checkPlatform() {
|
||||
if (preg_match("/iPhone/", $this->_ua) || preg_match("/iPod/", $this->_ua)) {
|
||||
$this->platform = "iphone";
|
||||
}
|
||||
elseif (preg_match("/iPad/", $this->_ua)) {
|
||||
$this->platform = "ipad";
|
||||
}
|
||||
elseif (preg_match("/Android/", $this->_ua)) {
|
||||
$this->platform = "android";
|
||||
}
|
||||
elseif (preg_match("/Mobile/i", $this->_ua)) {
|
||||
$this->platform = "mobile";
|
||||
}
|
||||
elseif (preg_match("/win/i", $this->_ua)) {
|
||||
$this->platform = "win";
|
||||
}
|
||||
elseif (preg_match("/mac/i", $this->_ua)) {
|
||||
$this->platform = "mac";
|
||||
}
|
||||
elseif (preg_match("/linux/i", $this->_ua)) {
|
||||
$this->platform = "linux";
|
||||
} else {
|
||||
$this->platform = "unknown";
|
||||
}
|
||||
|
||||
return $this->platform;
|
||||
}
|
||||
|
||||
function _checkEngine() {
|
||||
switch ($this->name) {
|
||||
case 'ie':
|
||||
$this->engine = 'trident';
|
||||
break;
|
||||
case 'firefox':
|
||||
$this->engine = 'gecko';
|
||||
break;
|
||||
case 'android':
|
||||
case 'ipad':
|
||||
case 'iphone':
|
||||
case 'chrome':
|
||||
case 'safari':
|
||||
$this->engine = 'webkit';
|
||||
break;
|
||||
case 'opera':
|
||||
$this->engine = 'presto';
|
||||
break;
|
||||
default:
|
||||
$this->engine = 'unknown';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function _checkBrowser() {
|
||||
// IE
|
||||
if (preg_match('/msie/i', $this->_ua) && !preg_match('/opera/i', $this->_ua)) {
|
||||
$result = explode(' ', stristr(str_replace(';', ' ', $this->_ua), 'msie'));
|
||||
$this->name = 'ie';
|
||||
$this->version = $result[1];
|
||||
}
|
||||
// Firefox
|
||||
elseif (preg_match('/Firefox/', $this->_ua)) {
|
||||
$result = explode('/', stristr($this->_ua, 'Firefox'));
|
||||
$version = explode(' ', $result[1]);
|
||||
$this->name = 'firefox';
|
||||
$this->version = $version[0];
|
||||
}
|
||||
// Chrome
|
||||
elseif (preg_match('/Chrome/', $this->_ua)) {
|
||||
$result = explode('/', stristr($this->_ua, 'Chrome'));
|
||||
$version = explode(' ', $result[1]);
|
||||
$this->name = 'chrome';
|
||||
$this->version = $version[0];
|
||||
}
|
||||
//Safari
|
||||
elseif (preg_match('/Safari/', $this->_ua) && !preg_match('/iPhone/', $this->_ua) && !preg_match('/iPod/', $this->_ua) && !preg_match('/iPad/', $this->_ua)) {
|
||||
$result = explode('/', stristr($this->_ua, 'Version'));
|
||||
$this->name = 'safari';
|
||||
if (isset ($result[1])) {
|
||||
$version = explode(' ', $result[1]);
|
||||
$this->version = $version[0];
|
||||
} else {
|
||||
$this->version = 'unknown';
|
||||
}
|
||||
}
|
||||
// Opera
|
||||
elseif (preg_match('/opera/i', $this->_ua)) {
|
||||
$result = stristr($this->_ua, 'opera');
|
||||
|
||||
if (preg_match('/\//', $result)) {
|
||||
$result = explode('/', $result);
|
||||
$version = explode(' ', $result[1]);
|
||||
$this->name = 'opera';
|
||||
$this->version = $version[0];
|
||||
} else {
|
||||
$version = explode(' ', stristr($result, 'opera'));
|
||||
$this->name = 'opera';
|
||||
$this->version = $version[1];
|
||||
}
|
||||
}
|
||||
// iPhone/iPod
|
||||
elseif (preg_match('/iPhone/', $this->_ua) || preg_match('/iPod/', $this->_ua)) {
|
||||
$result = explode('/', stristr($this->_ua, 'Version'));
|
||||
$this->name = 'iphone';
|
||||
if (isset ($result[1])) {
|
||||
$version = explode(' ', $result[1]);
|
||||
$this->version = $version[0];
|
||||
} else {
|
||||
$this->version = 'unknown';
|
||||
}
|
||||
}
|
||||
// iPad
|
||||
elseif (preg_match('/iPad/', $this->_ua)) {
|
||||
$result = explode('/', stristr($this->_ua, 'Version'));
|
||||
$this->name = 'ipad';
|
||||
if (isset ($result[1])) {
|
||||
$version = explode(' ', $result[1]);
|
||||
$this->version = $version[0];
|
||||
} else {
|
||||
$this->version = 'unknown';
|
||||
}
|
||||
}
|
||||
// Android
|
||||
elseif (preg_match('/Android/', $this->_ua)) {
|
||||
$result = explode('/', stristr($this->_ua, 'Version'));
|
||||
$this->name = 'android';
|
||||
if (isset ($result[1])) {
|
||||
$version = explode(' ', $result[1]);
|
||||
$this->version = $version[0];
|
||||
} else {
|
||||
$this->version = "unknown";
|
||||
}
|
||||
} else {
|
||||
$this->name = "unknown";
|
||||
$this->version = "unknown";
|
||||
}
|
||||
}
|
||||
|
||||
function _createChecks() {
|
||||
$this->_checks = array(
|
||||
$this->name, // browser check
|
||||
$this->platform, // platform check
|
||||
$this->engine, // render engine
|
||||
$this->name . '-' . $this->platform, // browser + platform check
|
||||
$this->name . $this->shortversion, // short browser version check
|
||||
$this->name . $this->version, // longbrowser version check
|
||||
$this->name . $this->shortversion . '-' . $this->platform, // short browser version + platform check
|
||||
$this->name . $this->version . '-' . $this->platform // longbrowser version + platform check
|
||||
);
|
||||
}
|
||||
|
||||
function getChecks($file, $keep_path = false) {
|
||||
$checkfiles = array();
|
||||
$ext = substr($file, strrpos($file, '.'));
|
||||
$path = ($keep_path) ? dirname($file) . '/' : '';
|
||||
$filename = basename($file, $ext);
|
||||
$checkfiles[] = $path . $filename . $ext;
|
||||
foreach ($this->_checks as $suffix) {
|
||||
$checkfiles[] = $path . $filename . '-' . $suffix . $ext;
|
||||
}
|
||||
return $checkfiles;
|
||||
}
|
||||
}
|
||||
}
|
9
modules/mod_roknavmenu/lib/common/includes.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: includes.php 4585 2012-10-27 01:44:54Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
|
||||
require_once(dirname(__FILE__) . '/RokBrowserCheck.php');
|
1
modules/mod_roknavmenu/lib/common/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
33
modules/mod_roknavmenu/lib/helper.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: helper.php 4585 2012-10-27 01:44:54Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
// no direct access
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
|
||||
/**
|
||||
* mod_roknavmenu Helper class
|
||||
*
|
||||
* @static
|
||||
* @package Joomla
|
||||
* @subpackage Menus
|
||||
* @since 1.5
|
||||
*/
|
||||
class modRokNavMenuHelper
|
||||
{
|
||||
function _getJSVersion() {
|
||||
if (version_compare(JVERSION, '1.5', '>=') && version_compare(JVERSION, '1.6', '<')){
|
||||
if (JPluginHelper::isEnabled('system', 'mtupgrade')){
|
||||
return "-mt1.2";
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
13
modules/mod_roknavmenu/lib/includes.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: includes.php 4585 2012-10-27 01:44:54Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
require_once(dirname(__FILE__) . '/common/includes.php');
|
||||
require_once(dirname(__FILE__) . '/librokmenu/includes.php');
|
||||
require_once(dirname(__FILE__) . '/providers/includes.php');
|
||||
require_once(dirname(__FILE__) . '/renderers/includes.php');
|
||||
require_once(dirname(__FILE__) . '/RokNavMenu.php');
|
||||
require_once(dirname(__FILE__) . '/AbstractJoomlaRokMenuFormatter.php');
|
1
modules/mod_roknavmenu/lib/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
@ -0,0 +1,174 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: AbstractRokMenuFormatter.php 4585 2012-10-27 01:44:54Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
|
||||
|
||||
require_once(dirname(__FILE__) . '/RokMenuFormatter.php');
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
abstract class AbstractRokMenuFormatter implements RokMenuFormatter
|
||||
{
|
||||
protected $active_branch = array();
|
||||
protected $args = array();
|
||||
protected $current_node = 0;
|
||||
|
||||
|
||||
/**
|
||||
* @param $args
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(&$args)
|
||||
{
|
||||
$this->args =& $args;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $current_node
|
||||
* @return void
|
||||
*/
|
||||
public function setCurrentNodeId($current_node)
|
||||
{
|
||||
$this->current_node = $current_node;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $active_branch
|
||||
* @return void
|
||||
*/
|
||||
public function setActiveBranch(array $active_branch)
|
||||
{
|
||||
$this->active_branch = $active_branch;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $menu
|
||||
* @return void
|
||||
*/
|
||||
public function format_tree(&$menu)
|
||||
{
|
||||
if (!empty($menu) && $menu !== false)
|
||||
{
|
||||
$this->_default_format_menu($menu);
|
||||
$this->format_menu($menu);
|
||||
|
||||
$nodeIterator = new RecursiveIteratorIterator($menu, RecursiveIteratorIterator::SELF_FIRST);
|
||||
foreach ($nodeIterator as $node)
|
||||
{
|
||||
$this->_format_subnodes($node);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $node
|
||||
* @return void
|
||||
*/
|
||||
protected function _format_subnodes(&$node)
|
||||
{
|
||||
if ($node->getId() == $this->current_node)
|
||||
{
|
||||
$node->setCssId('current');
|
||||
}
|
||||
if (array_key_exists($node->getId(), $this->active_branch))
|
||||
{
|
||||
$node->addListItemClass('active');
|
||||
}
|
||||
$this->format_subnode($node);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $menu
|
||||
* @return void
|
||||
*/
|
||||
protected function _default_format_menu(&$menu)
|
||||
{
|
||||
// Limit the levels of the tree is called for By limitLevels
|
||||
$start = $this->args['startLevel'];
|
||||
$end = $this->args['endLevel'];
|
||||
|
||||
if ($this->args['limit_levels'])
|
||||
{
|
||||
//Limit to the active path if the start is more the level 0
|
||||
if ($start > 0)
|
||||
{
|
||||
$found = false;
|
||||
// get active path and find the start level that matches
|
||||
if (count($this->active_branch))
|
||||
{
|
||||
foreach ($this->active_branch as $active_child)
|
||||
{
|
||||
if ($active_child->getLevel() == $start - 1)
|
||||
{
|
||||
$menu->resetTop($active_child->getId());
|
||||
$found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!$found)
|
||||
{
|
||||
$menu->setChildren(array());
|
||||
}
|
||||
}
|
||||
//remove lower then the defined end level
|
||||
$menu->removeLevel($end);
|
||||
}
|
||||
|
||||
$always_show_menu = false;
|
||||
if (!array_key_exists('showAllChildren', $this->args) && $start==0)
|
||||
{
|
||||
$always_show_menu = true;
|
||||
}
|
||||
elseif (array_key_exists('showAllChildren', $this->args))
|
||||
{
|
||||
$always_show_menu = $this->args['showAllChildren'];
|
||||
}
|
||||
|
||||
if (!$always_show_menu)
|
||||
{
|
||||
if ($menu->hasChildren())
|
||||
{
|
||||
if (count($this->active_branch) == 0 || empty($this->active_branch))
|
||||
{
|
||||
$menu->removeLevel($start);
|
||||
}
|
||||
else
|
||||
{
|
||||
$active = array_keys($this->active_branch);
|
||||
foreach ($menu->getChildren() as $toplevel)
|
||||
{
|
||||
if (array_key_exists($toplevel->getId(), $this->active_branch) !== false)
|
||||
{
|
||||
end($active);
|
||||
$menu->removeIfNotInTree($active, current($active));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (count($this->active_branch) > 0)
|
||||
$menu->removeLevelFromNonActive($this->active_branch, end($this->active_branch)->getLevel());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $menu
|
||||
* @return void
|
||||
*/
|
||||
public function format_menu(&$menu)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
115
modules/mod_roknavmenu/lib/librokmenu/AbstractRokMenuLayout.php
Normal file
@ -0,0 +1,115 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: AbstractRokMenuLayout.php 4585 2012-10-27 01:44:54Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
|
||||
require_once(dirname(__FILE__) . '/RokMenuLayout.php');
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
abstract class AbstractRokMenuLayout implements RokMenuLayout
|
||||
{
|
||||
protected $args = array();
|
||||
protected $scripts = array();
|
||||
protected $inlineScript = '';
|
||||
protected $styles = array();
|
||||
protected $inlineStyle = '';
|
||||
protected $browser;
|
||||
protected $staged = false;
|
||||
|
||||
public function __construct(&$args)
|
||||
{
|
||||
$this->args =& $args;
|
||||
$this->browser = new RokBrowserCheck();
|
||||
}
|
||||
|
||||
public function doStageHeader()
|
||||
{
|
||||
if ($this->staged) return;
|
||||
$this->stageHeader();
|
||||
$this->staged = true;
|
||||
}
|
||||
|
||||
public function getInlineScript()
|
||||
{
|
||||
return $this->inlineScript;
|
||||
}
|
||||
|
||||
public function getInlineStyle()
|
||||
{
|
||||
return $this->inlineStyle;
|
||||
}
|
||||
|
||||
public function getStyleFiles()
|
||||
{
|
||||
return $this->styles;
|
||||
}
|
||||
|
||||
public function getScriptFiles()
|
||||
{
|
||||
return $this->scripts;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enqeues a script file after doing the browser specific check.
|
||||
* @param $scriptFile the script file relative to the themes root dir
|
||||
* @return void
|
||||
*/
|
||||
protected function addScript($scriptFile, $prefix = 'rokmenu_')
|
||||
{
|
||||
$full_path = $this->args['theme_path'] . '/' . dirname($scriptFile) . '/';
|
||||
$relative_path = $this->args['theme_rel_path'] . '/' . dirname($scriptFile) . '/';
|
||||
$url_path = $this->args['theme_url'] . '/' . dirname($scriptFile) . '/';
|
||||
|
||||
$file_checks = array_reverse($this->browser->getChecks($scriptFile));
|
||||
foreach ($file_checks as $file_check) {
|
||||
if (file_exists($full_path . $file_check) && is_readable($full_path . $file_check)) {
|
||||
$this->scripts[$prefix . $file_check] = array(
|
||||
'full' => $full_path . $file_check,
|
||||
'relative' => $relative_path . $file_check,
|
||||
'url' => $url_path . $file_check
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a css style file and any browser specific versions of it
|
||||
* @param $styleFile the css style file relative to the themes root dir
|
||||
* @return void
|
||||
*/
|
||||
protected function addStyle($styleFile, $prefix = 'rokmenu_')
|
||||
{
|
||||
$full_path = $this->args['theme_path'] . '/' . dirname($styleFile) . '/';
|
||||
$relative_path = $this->args['theme_rel_path'] . '/' . dirname($styleFile) . '/';
|
||||
$url_path = $this->args['theme_url'] . '/' . dirname($styleFile) . '/';
|
||||
|
||||
$file_checks = $this->browser->getChecks($styleFile);
|
||||
foreach ($file_checks as $file_check) {
|
||||
if (file_exists($full_path . $file_check) && is_readable($full_path . $file_check)) {
|
||||
$this->styles[$prefix . $file_check] = array(
|
||||
'full' => $full_path . $file_check,
|
||||
'relative' => $relative_path . $file_check,
|
||||
'url' => $url_path . $file_check
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function appendInlineStyle($inlineStyle)
|
||||
{
|
||||
$this->inlineStyle .= $inlineStyle;
|
||||
}
|
||||
|
||||
protected function appendInlineScript($inlineScript)
|
||||
{
|
||||
$this->inlineScript .= $inlineScript;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,158 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: AbstractRokMenuProvider.php 4585 2012-10-27 01:44:54Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
|
||||
require_once(dirname(__FILE__) . '/RokMenuProvider.php');
|
||||
|
||||
|
||||
/**
|
||||
* The base class for all data providers for menus
|
||||
*/
|
||||
abstract class AbstractRokMenuProvider implements RokMenuProvider
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $args = array();
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $active_branch = array();
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $current_node = 0;
|
||||
|
||||
/**
|
||||
* @var RokMenuNodeTree
|
||||
*/
|
||||
protected $menu;
|
||||
|
||||
/**
|
||||
* @param $args
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(&$args)
|
||||
{
|
||||
$this->args =& $args;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getActiveBranch()
|
||||
{
|
||||
return $this->active_branch;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getCurrentNodeId()
|
||||
{
|
||||
return $this->current_node;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return RokMenuNodeTree
|
||||
*/
|
||||
public function getMenuTree()
|
||||
{
|
||||
if (null == $this->menu) {
|
||||
$this->menu = new RokMenuNodeTree();
|
||||
$this->populateMenuTree();
|
||||
}
|
||||
return $this->menu;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
protected function populateMenuTree()
|
||||
{
|
||||
$nodes = $this->getMenuItems();
|
||||
$this->createMenuTree($nodes, $this->args['maxdepth']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Takes the menu item nodes and puts them into a tree structure
|
||||
* @param $nodes
|
||||
* @param $maxdepth
|
||||
* @return bool|RokMenuNodeTree
|
||||
*/
|
||||
protected function createMenuTree(&$nodes, $maxdepth)
|
||||
{
|
||||
// TODO: move maxdepth to higher processing level?
|
||||
if (!empty($nodes)) {
|
||||
// Build Menu Tree root down (orphan proof - child might have lower id than parent)
|
||||
$ids = array();
|
||||
$ids[0] = true;
|
||||
$unresolved = array();
|
||||
|
||||
// pop the first item until the array is empty if there is any item
|
||||
if (is_array($nodes)) {
|
||||
while (count($nodes) && !is_null($node = array_shift($nodes)))
|
||||
{
|
||||
if (!$this->menu->addNode($node)) {
|
||||
if (!array_key_exists($node->getId(), $unresolved) || $unresolved[$node->getId()] < $maxdepth) {
|
||||
array_push($nodes, $node);
|
||||
if (!isset($unresolved[$node->getId()])) $unresolved[$node->getId()] = 1;
|
||||
else $unresolved[$node->getId()]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $nodeList
|
||||
* @return void
|
||||
*/
|
||||
protected function populateActiveBranch($nodeList)
|
||||
{
|
||||
// setup children array to find parents and children
|
||||
$children = array();
|
||||
$list = array();
|
||||
foreach ($nodeList as $node) {
|
||||
|
||||
$thisref = &$children[$node->getId()];
|
||||
$thisref['parent_id'] = $node->getParent();
|
||||
if ($node->getParent() == 0) {
|
||||
$list[$node->getId()] = &$thisref;
|
||||
} else {
|
||||
$children[$node->getParent()]['children'][] = $node->getId();
|
||||
}
|
||||
}
|
||||
// Find active branch
|
||||
if ($this->current_node != 0) {
|
||||
if (array_key_exists($this->current_node, $nodeList)) {
|
||||
|
||||
$parent_id = $children[$this->current_node]['parent_id'];
|
||||
while ($parent_id != 0) {
|
||||
$this->active_branch[$parent_id] = $nodeList[$parent_id];
|
||||
$parent_id = $children[$parent_id]['parent_id'];
|
||||
}
|
||||
$this->active_branch = array_reverse($this->active_branch, true);
|
||||
$this->active_branch[$this->current_node] = $nodeList[$this->current_node];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This platform specific function should be implemented to get the menu nodes and return them in a RokMenuNodeTree.
|
||||
* @abstract
|
||||
* @return array of RokMenuNode objects
|
||||
*/
|
||||
protected abstract function getMenuItems();
|
||||
}
|
||||
|
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: AbstractRokMenuTheme.php 4585 2012-10-27 01:44:54Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
|
||||
require_once(dirname(__FILE__) . '/RokMenuTheme.php');
|
||||
|
||||
if (!class_exists('AbstractRokMenuTheme')) {
|
||||
|
||||
abstract class AbstractRokMenuTheme implements RokMenuTheme {
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $defaults = array();
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getDefaults() {
|
||||
return $this->defaults;
|
||||
}
|
||||
}
|
||||
}
|
124
modules/mod_roknavmenu/lib/librokmenu/RokMenu.php
Normal file
@ -0,0 +1,124 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: RokMenu.php 4585 2012-10-27 01:44:54Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
|
||||
|
||||
require_once(dirname(__FILE__) . '/RokMenuNodeTree.php');
|
||||
require_once(dirname(__FILE__) . '/RokMenuNode.php');
|
||||
require_once(dirname(__FILE__) . '/RokMenuNodeBase.php');
|
||||
require_once(dirname(__FILE__) . '/RokMenuFormatter.php');
|
||||
require_once(dirname(__FILE__) . '/AbstractRokMenuFormatter.php');
|
||||
require_once(dirname(__FILE__) . '/RokMenuLayout.php');
|
||||
require_once(dirname(__FILE__) . '/AbstractRokMenuLayout.php');
|
||||
require_once(dirname(__FILE__) . '/RokMenuProvider.php');
|
||||
require_once(dirname(__FILE__) . '/AbstractRokMenuProvider.php');
|
||||
require_once(dirname(__FILE__) . '/RokMenuTheme.php');
|
||||
require_once(dirname(__FILE__) . '/AbstractRokMenuTheme.php');
|
||||
|
||||
if (!class_exists('RokMenu')) {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
abstract class RokMenu {
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $args = array();
|
||||
|
||||
/**
|
||||
* @var RokMenuProvider
|
||||
*/
|
||||
protected $provider;
|
||||
|
||||
/**
|
||||
* @var RokMenuRenderer
|
||||
*/
|
||||
protected $renderer;
|
||||
|
||||
/**
|
||||
* @var
|
||||
*/
|
||||
protected static $menu_defaults = array(
|
||||
'limit_levels' => 0,
|
||||
'startLevel' => 0,
|
||||
'endLevel' => 0,
|
||||
'showAllChildren' => 1,
|
||||
'maxdepth' => 10
|
||||
);
|
||||
|
||||
/**
|
||||
* @param RokMenuRenderer $renderer
|
||||
* @param $args
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($args) {
|
||||
$this->args = $args;
|
||||
|
||||
$this->renderer = $this->getRenderer();
|
||||
// get defaults for theme
|
||||
$renderer_defaults = $this->renderer->getDefaults();
|
||||
// merge theme defaults with class defaults theme defaults overrding
|
||||
$defaults = array_merge(self::$menu_defaults, $renderer_defaults);
|
||||
// merge defaults into passed args passed args overriding
|
||||
$this->args = array_merge($defaults, $args);
|
||||
|
||||
$this->renderer->setArgs($this->args);
|
||||
|
||||
$this->provider = $this->getProvider();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @static
|
||||
* @return array
|
||||
*/
|
||||
public static function getDefaults() {
|
||||
return self::$menu_defaults;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function initialize() {
|
||||
$this->renderer->initialize($this->provider);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function renderMenu() {
|
||||
$output = $this->renderer->renderMenu();
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function renderHeader() {
|
||||
$output = $this->renderer->renderHeader();
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function renderFooter() {
|
||||
$output = $this->renderer->renderFooter();
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @return RokMenuProvider
|
||||
*/
|
||||
protected abstract function getProvider();
|
||||
|
||||
protected abstract function getRenderer();
|
||||
}
|
||||
}
|
||||
|
114
modules/mod_roknavmenu/lib/librokmenu/RokMenuDefaultRenderer.php
Normal file
@ -0,0 +1,114 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: RokMenuDefaultRenderer.php 4585 2012-10-27 01:44:54Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class RokMenuDefaultRenderer implements RokMenuRenderer {
|
||||
protected $provider;
|
||||
protected $args;
|
||||
protected $theme;
|
||||
|
||||
/**
|
||||
* @var RokMenuFooter
|
||||
*/
|
||||
protected $formatter;
|
||||
|
||||
/**
|
||||
* @var RokMenuLayout
|
||||
*/
|
||||
protected $layout;
|
||||
|
||||
/**
|
||||
* @var RokMenuNodeTree
|
||||
*/
|
||||
protected $menu;
|
||||
|
||||
/**
|
||||
* @param RokMenuProvider $provider
|
||||
* @param array $args
|
||||
* @return void
|
||||
*/
|
||||
public function __construct() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $args
|
||||
* @return void
|
||||
*/
|
||||
public function setArgs(array &$args){
|
||||
$this->args =& $args;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getDefaults() {
|
||||
if (!isset($this->theme)) {
|
||||
return array();
|
||||
}
|
||||
return $this->theme->getDefaults();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function initialize(RokMenuProvider $provider) {
|
||||
$this->formatter = $this->theme->getFormatter($this->args);
|
||||
$this->layout = $this->theme->getLayout($this->args);
|
||||
$menu = $provider->getMenuTree();
|
||||
$menu = $this->preProcessMenu($menu);
|
||||
if (!empty($menu) && $menu !== false) {
|
||||
$this->formatter->setActiveBranch($provider->getActiveBranch());
|
||||
$this->formatter->setCurrentNodeId($provider->getCurrentNodeId());
|
||||
$this->formatter->format_tree($menu);
|
||||
$this->menu = &$menu;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This is run once the menu nodes are retrieved but before the formatter is run in order to give extending classes
|
||||
* a change to process the nodes in the menu.
|
||||
* @param RokMenuNodeTree $menu
|
||||
* @return RokMenuNodeTree
|
||||
*/
|
||||
protected function preProcessMenu(RokMenuNodeTree &$menu){
|
||||
return $menu;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function renderHeader() {
|
||||
$this->layout->doStageHeader();
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function renderMenu() {
|
||||
return $this->layout->renderMenu($this->menu);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function renderFooter() {
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param RokMenuTheme $theme
|
||||
* @return void
|
||||
*/
|
||||
public function setTheme(RokMenuTheme $theme) {
|
||||
$this->theme = $theme;
|
||||
}
|
||||
}
|
56
modules/mod_roknavmenu/lib/librokmenu/RokMenuFormatter.php
Normal file
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: RokMenuFormatter.php 4585 2012-10-27 01:44:54Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
|
||||
if (!interface_exists('RokMenuFormatter')) {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
interface RokMenuFormatter {
|
||||
/**
|
||||
* @abstract
|
||||
* @param $args
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(&$args);
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @param $menu
|
||||
* @return void
|
||||
*/
|
||||
public function format_tree(&$menu);
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @param RokMenuNodeTree $menu
|
||||
* @return void
|
||||
*/
|
||||
public function format_menu(&$menu);
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @param RokMenuNode $node
|
||||
* @return void
|
||||
*/
|
||||
public function format_subnode(&$node);
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @param array $active_branch
|
||||
* @return void
|
||||
*/
|
||||
public function setActiveBranch(array $active_branch);
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @param int $current_node
|
||||
* @return void
|
||||
*/
|
||||
public function setCurrentNodeId($current_node);
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: RokMenuGreaterThenLevelFilter.php 4585 2012-10-27 01:44:54Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
|
||||
class RokMenuGreaterThenLevelFilter extends RecursiveFilterIterator {
|
||||
protected $level;
|
||||
|
||||
public function __construct(RecursiveIterator $recursiveIter, $end) {
|
||||
$this->level = $end;
|
||||
parent::__construct($recursiveIter);
|
||||
}
|
||||
public function accept() {
|
||||
return $this->hasChildren() || $this->current()->getLevel() > $this->level;
|
||||
}
|
||||
|
||||
public function getChildren() {
|
||||
return new self($this->getInnerIterator()->getChildren(), $this->level);
|
||||
}
|
||||
}
|
13
modules/mod_roknavmenu/lib/librokmenu/RokMenuHeader.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: RokMenuHeader.php 4585 2012-10-27 01:44:54Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
|
||||
if (!interface_exists('RokMenuHeader')) {
|
||||
interface RokMenuHeader {
|
||||
|
||||
}
|
||||
}
|
23
modules/mod_roknavmenu/lib/librokmenu/RokMenuIdFilter.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: RokMenuIdFilter.php 4585 2012-10-27 01:44:54Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
|
||||
class RokMenuIdFilter extends RecursiveFilterIterator {
|
||||
protected $id;
|
||||
|
||||
public function __construct(RecursiveIterator $recursiveIter, $id) {
|
||||
$this->id = $id;
|
||||
parent::__construct($recursiveIter);
|
||||
}
|
||||
public function accept() {
|
||||
return $this->hasChildren() || $this->current()->getId() == $this->id;
|
||||
}
|
||||
|
||||
public function getChildren() {
|
||||
return new self($this->getInnerIterator()->getChildren(), $this->id);
|
||||
}
|
||||
}
|
54
modules/mod_roknavmenu/lib/librokmenu/RokMenuIterator.php
Normal file
@ -0,0 +1,54 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: RokMenuIterator.php 4585 2012-10-27 01:44:54Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
|
||||
|
||||
class RokMenuIterator implements RecursiveIterator
|
||||
{
|
||||
protected $ar;
|
||||
|
||||
public function __construct(RokMenuNodeBase $menuNode)
|
||||
{
|
||||
$this->ar = $menuNode->getChildren();
|
||||
}
|
||||
|
||||
public function rewind()
|
||||
{
|
||||
reset($this->ar);
|
||||
}
|
||||
|
||||
public function valid()
|
||||
{
|
||||
return !is_null(key($this->ar));
|
||||
}
|
||||
|
||||
public function key()
|
||||
{
|
||||
return key($this->ar);
|
||||
}
|
||||
|
||||
public function next()
|
||||
{
|
||||
next($this->ar);
|
||||
}
|
||||
|
||||
public function current()
|
||||
{
|
||||
return current($this->ar);
|
||||
}
|
||||
|
||||
public function hasChildren()
|
||||
{
|
||||
$current = current($this->ar);
|
||||
return $current->hasChildren();
|
||||
}
|
||||
|
||||
public function getChildren()
|
||||
{
|
||||
return new RokMenuIterator($this->current());
|
||||
}
|
||||
}
|
67
modules/mod_roknavmenu/lib/librokmenu/RokMenuLayout.php
Normal file
@ -0,0 +1,67 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: RokMenuLayout.php 4585 2012-10-27 01:44:54Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
|
||||
if (!interface_exists('RokMenuLayout')) {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
interface RokMenuLayout
|
||||
{
|
||||
/**
|
||||
* @abstract
|
||||
* @param $args
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(&$args);
|
||||
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @param $menu
|
||||
* @return void
|
||||
*/
|
||||
public function renderMenu(&$menu);
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @return void
|
||||
*/
|
||||
public function getScriptFiles();
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @return void
|
||||
*/
|
||||
public function getStyleFiles();
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @return void
|
||||
*/
|
||||
public function getInlineStyle();
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @return void
|
||||
*/
|
||||
public function getInlineScript();
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @return void
|
||||
*/
|
||||
public function doStageHeader();
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @return void
|
||||
*/
|
||||
public function stageHeader();
|
||||
}
|
||||
}
|
274
modules/mod_roknavmenu/lib/librokmenu/RokMenuNode.php
Normal file
@ -0,0 +1,274 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: RokMenuNode.php 4585 2012-10-27 01:44:54Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
|
||||
require_once(dirname(__FILE__) . '/RokMenuNodeBase.php');
|
||||
|
||||
|
||||
if (!class_exists('RokMenuNode')) {
|
||||
|
||||
/**
|
||||
* RokMenuNode
|
||||
*/
|
||||
class RokMenuNode extends RokMenuNodeBase
|
||||
{
|
||||
const PARENT_CSS_CLASS = "parent";
|
||||
|
||||
protected $title = null;
|
||||
protected $link = null;
|
||||
protected $cssId = null;
|
||||
protected $target = null;
|
||||
|
||||
protected $attributes = array();
|
||||
|
||||
protected $_link_additions = array();
|
||||
protected $_link_attribs = array();
|
||||
|
||||
protected $_li_classes = array();
|
||||
protected $_a_classes = array();
|
||||
protected $_span_classes = array();
|
||||
|
||||
/**
|
||||
* Gets the title
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
function getTitle()
|
||||
{
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the title
|
||||
* @access public
|
||||
* @param string $title
|
||||
*/
|
||||
function setTitle($title)
|
||||
{
|
||||
$this->title = $title;
|
||||
}
|
||||
|
||||
public function setLink($link)
|
||||
{
|
||||
$this->link = $link;
|
||||
}
|
||||
|
||||
public function hasLink()
|
||||
{
|
||||
return (isset($this->link));
|
||||
}
|
||||
|
||||
public function getLink()
|
||||
{
|
||||
$outlink = $this->link;
|
||||
$outlink .= $this->getLinkAdditions(!strpos($this->link, '?'));
|
||||
return $outlink;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the css_id
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getCssId()
|
||||
{
|
||||
return $this->cssId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the css_id
|
||||
* @access public
|
||||
* @param string $cssId
|
||||
*/
|
||||
public function setCssId($cssId)
|
||||
{
|
||||
$this->cssId = $cssId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function hasCssId(){
|
||||
return isset($this->cssId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the target
|
||||
* @access public
|
||||
* @return string the target
|
||||
*/
|
||||
public function getTarget()
|
||||
{
|
||||
return $this->target;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the target
|
||||
* @access public
|
||||
* @param string the target $target
|
||||
*/
|
||||
public function setTarget($target)
|
||||
{
|
||||
$this->target = $target;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function hasTarget()
|
||||
{
|
||||
return isset($this->target);
|
||||
}
|
||||
|
||||
public function addAttribute($key, $value)
|
||||
{
|
||||
$this->attributes[$key] = $value;
|
||||
}
|
||||
|
||||
public function getAttribute($key)
|
||||
{
|
||||
if (array_key_exists($key, $this->attributes))
|
||||
return $this->attributes[$key];
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $key
|
||||
* @return bool
|
||||
*/
|
||||
public function hasAttribute($key){
|
||||
return array_key_exists($key, $this->attributes);
|
||||
}
|
||||
|
||||
public function getAttributes()
|
||||
{
|
||||
return $this->attributes;
|
||||
}
|
||||
|
||||
public function addLinkAddition($name, $value)
|
||||
{
|
||||
$this->_link_additions[$name] = $value;
|
||||
}
|
||||
|
||||
public function getLinkAdditions($starting_query = false, $starting_seperator = false)
|
||||
{
|
||||
$link_additions = " ";
|
||||
reset($this->_link_additions);
|
||||
$i = 0;
|
||||
foreach ($this->_link_additions as $key => $value) {
|
||||
$link_additions .= (($i == 0) && $starting_query) ? '?' : '';
|
||||
$link_additions .= (($i == 0) && !$starting_query) ? '&' : '';
|
||||
$link_additions .= ($i > 0) ? '&' : '';
|
||||
$link_additions .= $key . '=' . $value;
|
||||
$i++;
|
||||
}
|
||||
return rtrim(ltrim($link_additions));
|
||||
}
|
||||
|
||||
public function getLinkAdditionsArray()
|
||||
{
|
||||
return $this->_link_additions;
|
||||
}
|
||||
|
||||
public function hasLinkAdditions()
|
||||
{
|
||||
return (count($this->_link_additions) > 0) ? true : false;
|
||||
}
|
||||
|
||||
public function addLinkAttrib($name, $value)
|
||||
{
|
||||
$this->_link_attribs[$name] = $value;
|
||||
}
|
||||
|
||||
public function getLinkAttribs()
|
||||
{
|
||||
$link_attribs = " ";
|
||||
foreach ($this->_link_attribs as $key => $value) {
|
||||
$link_attribs .= $key . "='" . $value . "' ";
|
||||
}
|
||||
return rtrim(ltrim($link_attribs));
|
||||
}
|
||||
|
||||
public function getLinkAttribsArray()
|
||||
{
|
||||
return $this->_link_attribs;
|
||||
}
|
||||
|
||||
public function hasLinkAttribs()
|
||||
{
|
||||
return (count($this->_link_attribs) > 0) ? true : false;
|
||||
}
|
||||
|
||||
public function getListItemClasses()
|
||||
{
|
||||
return implode(" ", $this->_li_classes);
|
||||
}
|
||||
|
||||
public function addListItemClass($class)
|
||||
{
|
||||
if (!in_array($class, $this->_li_classes))
|
||||
$this->_li_classes[] = $class;
|
||||
}
|
||||
|
||||
public function hasListItemClasses()
|
||||
{
|
||||
return (count($this->_li_classes) > 0) ? true : false;
|
||||
}
|
||||
|
||||
public function setListItemClasses($classes = array()){
|
||||
$this->_li_classes = $classes;
|
||||
}
|
||||
|
||||
public function getLinkClasses()
|
||||
{
|
||||
return implode(" ", $this->_a_classes);
|
||||
}
|
||||
|
||||
public function addLinkClass($class)
|
||||
{
|
||||
if (!in_array($class, $this->_a_classes))
|
||||
$this->_a_classes[] = $class;
|
||||
}
|
||||
|
||||
public function hasLinkClasses()
|
||||
{
|
||||
return (count($this->_a_classes) > 0) ? true : false;
|
||||
}
|
||||
|
||||
public function setLinkClasses($classes = array()){
|
||||
$this->_a_classes = $classes;
|
||||
}
|
||||
|
||||
public function getSpanClasses()
|
||||
{
|
||||
return implode(" ", $this->_span_classes);
|
||||
}
|
||||
|
||||
public function addSpanClass($class)
|
||||
{
|
||||
if (!in_array($class, $this->_span_classes))
|
||||
$this->_span_classes[] = $class;
|
||||
}
|
||||
|
||||
public function hasSpanClasses()
|
||||
{
|
||||
return (count($this->_span_classes) > 0) ? true : false;
|
||||
}
|
||||
|
||||
public function setSpanClasses($classes = array()){
|
||||
$this->_span_classes = $classes;
|
||||
}
|
||||
|
||||
|
||||
public function addChild(RokMenuNodeBase &$node)
|
||||
{
|
||||
parent::addChild($node);
|
||||
$this->addListItemClass(self::PARENT_CSS_CLASS);
|
||||
}
|
||||
}
|
||||
}
|
179
modules/mod_roknavmenu/lib/librokmenu/RokMenuNodeBase.php
Normal file
@ -0,0 +1,179 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: RokMenuNodeBase.php 4585 2012-10-27 01:44:54Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
|
||||
require_once(dirname(__FILE__) . '/RokMenuIterator.php');
|
||||
|
||||
if (!class_exists('RokMenuNodeBase')) {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class RokMenuNodeBase implements IteratorAggregate {
|
||||
|
||||
function getIterator() {
|
||||
return new RokMenuIterator($this);
|
||||
}
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $id = 0;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $parent = 0;
|
||||
|
||||
/**
|
||||
* @var RokMenuNodeBase
|
||||
*/
|
||||
protected $parentRef = null;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $level = -1;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $children = array();
|
||||
|
||||
|
||||
/**
|
||||
* Gets the id
|
||||
* @access public
|
||||
* @return integer
|
||||
*/
|
||||
public function getId() {
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the id
|
||||
* @access public
|
||||
* @param integer $id
|
||||
*/
|
||||
public function setId($id) {
|
||||
$this->id = $id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the level
|
||||
* @access public
|
||||
* @return integer
|
||||
*/
|
||||
public function getLevel() {
|
||||
return $this->level;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the level
|
||||
* @access public
|
||||
* @param integer $level
|
||||
*/
|
||||
public function setLevel($level) {
|
||||
$this->level = $level;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the parent
|
||||
* @access public
|
||||
* @return integer
|
||||
*/
|
||||
public function getParent() {
|
||||
return $this->parent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the parent
|
||||
* @access public
|
||||
* @param integer $parent
|
||||
*/
|
||||
public function setParent($parent) {
|
||||
$this->parent = $parent;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return RokMenuNodeBase
|
||||
*/
|
||||
public function getParentRef() {
|
||||
return $this->parentRef;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param RokmenuNodeBase $parentRef
|
||||
* @return void
|
||||
*/
|
||||
public function setParentRef(RokmenuNodeBase & $parentRef) {
|
||||
$this->parentRef = &$parentRef;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $children
|
||||
* @return void
|
||||
*/
|
||||
public function setChildren(array $children) {
|
||||
$this->children = $children;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param RokMenuNodeBase $node
|
||||
* @return void
|
||||
*/
|
||||
public function addChild(RokMenuNodeBase &$node) {
|
||||
if (null == $this->children) {
|
||||
$this->children = array();
|
||||
}
|
||||
$node->setParentRef($this);
|
||||
$node->setLevel($this->getLevel()+1);
|
||||
$this->children[$node->getId()] = $node;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function hasChildren() {
|
||||
return !empty($this->children);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function &getChildren() {
|
||||
return $this->children;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $node_id
|
||||
* @return bool
|
||||
*/
|
||||
public function removeChild($node_id) {
|
||||
if (array_key_exists($node_id, $this->children)) {
|
||||
unset($this->children[$node_id]);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $menuId
|
||||
*/
|
||||
public function setMenuId($menuId){
|
||||
$this->menuId = $menuId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return null
|
||||
*/
|
||||
public function getMenuId(){
|
||||
return $this->menuId;
|
||||
}
|
||||
}
|
||||
}
|
167
modules/mod_roknavmenu/lib/librokmenu/RokMenuNodeTree.php
Normal file
@ -0,0 +1,167 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: RokMenuNodeTree.php 4585 2012-10-27 01:44:54Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
|
||||
|
||||
require_once(dirname(__FILE__) . '/RokMenuNodeBase.php');
|
||||
require_once(dirname(__FILE__) . '/RokMenuNode.php');
|
||||
|
||||
if (!class_exists('RokMenuNodeTree')) {
|
||||
/**
|
||||
* Rok Nav Menu Tree Class.
|
||||
*/
|
||||
class RokMenuNodeTree extends RokMenuNodeBase
|
||||
{
|
||||
|
||||
|
||||
protected $rootid;
|
||||
|
||||
public function __construct($rootid = 0){
|
||||
$this->rootid = $rootid;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $top_node_id
|
||||
* @return bool
|
||||
*/
|
||||
public function resetTop($top_node_id)
|
||||
{
|
||||
$new_top = $this->findNode($top_node_id);
|
||||
if (!$new_top) return false;
|
||||
$this->children = $new_top->getChildren();
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param RokMenuNodeBase $node
|
||||
* @return bool
|
||||
*/
|
||||
public function addNode(RokMenuNodeBase &$node)
|
||||
{
|
||||
if ($node->getParent() == $this->rootid) {
|
||||
$this->addChild($node);
|
||||
$node->setLevel(0);
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
$iterator = $this->getIterator();
|
||||
$childrenIterator = new RecursiveIteratorIterator(new RokMenuIdFilter($iterator, $node->getParent()), RecursiveIteratorIterator::SELF_FIRST);
|
||||
foreach ($childrenIterator as $child) {
|
||||
if ($child->getId() == $node->getParent()) {
|
||||
$child->addChild($node);
|
||||
$node->setLevel($childrenIterator->getDepth() + 1);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @return bool
|
||||
*/
|
||||
public function findNode($id)
|
||||
{
|
||||
$iterator = $this->getIterator();
|
||||
$childrenIterator = new RecursiveIteratorIterator(new RokMenuIdFilter($iterator, $id), RecursiveIteratorIterator::SELF_FIRST);
|
||||
foreach ($childrenIterator as $child) {
|
||||
if ($child->getId() == $id) {
|
||||
$childref = &$child;
|
||||
return $childref;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $nodeId
|
||||
* @return bool
|
||||
*/
|
||||
public function removeNode($nodeId)
|
||||
{
|
||||
$iterator = $this->getIterator();
|
||||
$childrenIterator = new RecursiveIteratorIterator(new RokMenuIdFilter($iterator, $nodeId), RecursiveIteratorIterator::SELF_FIRST);
|
||||
foreach ($childrenIterator as $child) {
|
||||
if ($child->getId() == $nodeId) {
|
||||
$parent = $child->getParentRef();
|
||||
$parent->removeChild($nodeId);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $end
|
||||
* @return void
|
||||
*/
|
||||
public function removeLevel($end)
|
||||
{
|
||||
$toRemove = array();
|
||||
$iterator = $this->getIterator();
|
||||
$childrenIterator = new RecursiveIteratorIterator(new RokMenuGreaterThenLevelFilter($iterator, $end), RecursiveIteratorIterator::SELF_FIRST);
|
||||
foreach ($childrenIterator as $child) {
|
||||
if ($child->getLevel() > $end) {
|
||||
$toRemove[] = $child->getId();
|
||||
}
|
||||
}
|
||||
foreach ($toRemove as $remove_id) {
|
||||
$this->removeNode($remove_id);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $end
|
||||
* @return void
|
||||
*/
|
||||
public function removeLevelFromNonActive($active_tree, $end)
|
||||
{
|
||||
$toRemove = array();
|
||||
$iterator = $this->getIterator();
|
||||
$childrenIterator = new RecursiveIteratorIterator(new RokMenuNotOnActiveTreeFilter($iterator,$active_tree,$end), RecursiveIteratorIterator::SELF_FIRST);
|
||||
|
||||
foreach ($childrenIterator as $child) {
|
||||
if ($child->getLevel() > $end+1) {
|
||||
$toRemove[] = $child->getId();
|
||||
}
|
||||
}
|
||||
foreach ($toRemove as $remove_id) {
|
||||
$this->removeNode($remove_id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $active_tree the array of active RokNavMenu items
|
||||
* @param int $last_active the id of the last active item in the tree
|
||||
* @return void
|
||||
*/
|
||||
public function removeIfNotInTree(&$active_tree, $last_active)
|
||||
{
|
||||
if (!empty($active_tree)) {
|
||||
$toRemove = array();
|
||||
$childrenIterator = new RecursiveIteratorIterator($this, RecursiveIteratorIterator::SELF_FIRST);
|
||||
foreach ($childrenIterator as $child) {
|
||||
if (!in_array($child->getId(), $active_tree) && $last_active == $child->getId()) {
|
||||
// i am the last node in the active tree dont show my childs but not my grandchildren
|
||||
foreach ($child as $subchild) {
|
||||
$toRemove = array_merge($toRemove, array_keys($subchild->getChildren()));
|
||||
}
|
||||
}
|
||||
else if (!in_array($child->getId(), $active_tree) && $child->getParent() != $last_active) {
|
||||
// I am not in the active tree and not a child of the last node in the active tree so dont show my children
|
||||
$toRemove = array_merge($toRemove, array_keys($child->getChildren()));
|
||||
}
|
||||
}
|
||||
foreach ($toRemove as $remove_id) {
|
||||
$this->removeNode($remove_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: RokMenuNotOnActiveTreeFilter.php 4585 2012-10-27 01:44:54Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
|
||||
class RokMenuNotOnActiveTreeFilter extends RecursiveFilterIterator {
|
||||
protected $active_tree = array();
|
||||
protected $level;
|
||||
|
||||
public function __construct(RecursiveIterator $recursiveIter, $active_tree, $end) {
|
||||
$this->level = $end;
|
||||
$this->active_tree = $active_tree;
|
||||
parent::__construct($recursiveIter);
|
||||
}
|
||||
public function accept() {
|
||||
|
||||
$array_keys = array_keys($this->active_tree);
|
||||
$key = end($array_keys);
|
||||
|
||||
if (!array_key_exists($this->current()->getId(),$this->active_tree) && $this->current()->getParent() == $key){
|
||||
$this->active_tree[$this->current()->getId()] = $this->current();
|
||||
}
|
||||
if (array_key_exists($this->current()->getId(),$this->active_tree) && $this->current()->getLevel() > $this->level+1){
|
||||
return true;
|
||||
}
|
||||
else if (!array_key_exists($this->current()->getId(),$this->active_tree) && $this->current()->getLevel() > $this->level){
|
||||
return true;
|
||||
}
|
||||
else if ($this->hasChildren()){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getChildren() {
|
||||
return new self($this->getInnerIterator()->getChildren(), $this->active_tree, $this->level);
|
||||
}
|
||||
}
|
40
modules/mod_roknavmenu/lib/librokmenu/RokMenuProvider.php
Normal file
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: RokMenuProvider.php 4585 2012-10-27 01:44:54Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
if (!interface_exists('RokMenuProvider')) {
|
||||
|
||||
/**
|
||||
* The base class for all data providers for menus
|
||||
*/
|
||||
interface RokMenuProvider {
|
||||
/**
|
||||
* Gets an array of RokMenuNodes for that represent the menu items. This should be a non hierarchical array.
|
||||
* @abstract
|
||||
* @return array of RokMenuNode objects
|
||||
*/
|
||||
function getActiveBranch();
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @return int
|
||||
*/
|
||||
function getCurrentNodeId();
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @return RokMenuNodeTree
|
||||
*/
|
||||
function getMenuTree();
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @param $args
|
||||
* @return void
|
||||
*/
|
||||
function __construct(&$args);
|
||||
}
|
||||
}
|
58
modules/mod_roknavmenu/lib/librokmenu/RokMenuRenderer.php
Normal file
@ -0,0 +1,58 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: RokMenuRenderer.php 4585 2012-10-27 01:44:54Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
if (!interface_exists('RokMenuRenderer')) {
|
||||
|
||||
/**
|
||||
* The base class for all data providers for menus
|
||||
*/
|
||||
interface RokMenuRenderer {
|
||||
/**
|
||||
* @abstract
|
||||
* @return void
|
||||
*/
|
||||
public function __construct();
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @param $args
|
||||
* @return void
|
||||
*/
|
||||
public function setArgs(array &$args);
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @return void
|
||||
*/
|
||||
public function initialize(RokMenuProvider $provider);
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @return string
|
||||
*/
|
||||
public function renderHeader();
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @return string
|
||||
*/
|
||||
public function renderMenu();
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @return string
|
||||
*/
|
||||
public function renderFooter();
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @return array
|
||||
*/
|
||||
public function getDefaults();
|
||||
|
||||
}
|
||||
}
|
36
modules/mod_roknavmenu/lib/librokmenu/RokMenuTheme.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: RokMenuTheme.php 4585 2012-10-27 01:44:54Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
if (!interface_exists('RokMenuTheme')) {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
interface RokMenuTheme {
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @return array
|
||||
*/
|
||||
public function getDefaults();
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @param $args array
|
||||
* @return RokMenuFormatter
|
||||
*/
|
||||
public function getFormatter($args);
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @param $args
|
||||
* @return RokMenuLayout
|
||||
*/
|
||||
public function getLayout($args);
|
||||
|
||||
}
|
||||
}
|
32
modules/mod_roknavmenu/lib/librokmenu/includes.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: includes.php 4585 2012-10-27 01:44:54Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
|
||||
|
||||
require_once(dirname(__FILE__) . '/RokMenuNodeBase.php');
|
||||
require_once(dirname(__FILE__) . '/RokMenuIterator.php');
|
||||
require_once(dirname(__FILE__) . '/RokMenuIdFilter.php');
|
||||
require_once(dirname(__FILE__) . '/RokMenuGreaterThenLevelFilter.php');
|
||||
require_once(dirname(__FILE__) . '/RokMenuNotOnActiveTreeFilter.php');
|
||||
require_once(dirname(__FILE__) . '/RokMenuNode.php');
|
||||
require_once(dirname(__FILE__) . '/RokMenuNodeTree.php');
|
||||
|
||||
require_once(dirname(__FILE__) . '/RokMenuFormatter.php');
|
||||
require_once(dirname(__FILE__) . '/RokMenuLayout.php');
|
||||
require_once(dirname(__FILE__) . '/RokMenuProvider.php');
|
||||
require_once(dirname(__FILE__) . '/RokMenuTheme.php');
|
||||
require_once(dirname(__FILE__) . '/RokMenuRenderer.php');
|
||||
|
||||
|
||||
require_once(dirname(__FILE__) . '/AbstractRokMenuFormatter.php');
|
||||
require_once(dirname(__FILE__) . '/AbstractRokMenuLayout.php');
|
||||
require_once(dirname(__FILE__) . '/AbstractRokMenuProvider.php');
|
||||
require_once(dirname(__FILE__) . '/AbstractRokMenuTheme.php');
|
||||
|
||||
require_once(dirname(__FILE__) . '/RokMenuDefaultRenderer.php');
|
||||
|
||||
require_once(dirname(__FILE__) . '/RokMenu.php');
|
1
modules/mod_roknavmenu/lib/librokmenu/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
1
modules/mod_roknavmenu/lib/parameters/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
51
modules/mod_roknavmenu/lib/parameters/templateinclude.php
Normal file
@ -0,0 +1,51 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: templateinclude.php 4585 2012-10-27 01:44:54Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
defined('_JEXEC') or die();
|
||||
require_once (dirname(__FILE__).'/../BaseRokNavMenuTemplateParams.php');
|
||||
|
||||
class JElementTemplateInclude extends JElement
|
||||
{
|
||||
function fetchElement($name, $value, &$node, $control_name)
|
||||
{
|
||||
global $mainframe;
|
||||
$html = "";
|
||||
$values = array();
|
||||
|
||||
// get the current from side tem
|
||||
|
||||
//Run the template formatter if its there if not run the default formatter
|
||||
$tPath = JPATH_ROOT.'/templates/'.$this->_getFrontSideTemplate().'/html/mod_roknavmenu/parameters.php';
|
||||
if (file_exists($tPath)) {
|
||||
|
||||
// get all the params for the module
|
||||
$all_params = $this->_parent;
|
||||
require_once ($tPath);
|
||||
$template_params = new RokNavMenuTemplateParams();
|
||||
$html .= $template_params->getTemplateParams($name, $control_name, $all_params);
|
||||
}
|
||||
|
||||
if (strlen($html) == 0) {
|
||||
$html = JText::_("ROKNAVMENU.MSG.NO_TEMPLATE_CONFIG");
|
||||
}
|
||||
return $html;
|
||||
}
|
||||
|
||||
function _getFrontSideTemplate() {
|
||||
$db =JFactory::getDBO();
|
||||
// Get the current default template
|
||||
$query = ' SELECT template '
|
||||
.' FROM #__template_styles '
|
||||
.' WHERE client_id = 0 '
|
||||
.' AND home = 1 ';
|
||||
$db->setQuery($query);
|
||||
$defaultemplate = $db->loadResult();
|
||||
return $defaultemplate;
|
||||
}
|
||||
|
||||
}
|
||||
|
161
modules/mod_roknavmenu/lib/parameters/themelist.php
Normal file
@ -0,0 +1,161 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: themelist.php 4585 2012-10-27 01:44:54Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
// Check to ensure this file is within the rest of the framework
|
||||
defined('JPATH_BASE') or die();
|
||||
|
||||
/**
|
||||
* Renders a file list from a directory in the current templates directory
|
||||
*/
|
||||
|
||||
class JElementThemelist extends JElement
|
||||
{
|
||||
/**
|
||||
* Element name
|
||||
*
|
||||
* @access protected
|
||||
* @var string
|
||||
*/
|
||||
var $_name = 'TemplateFilelist';
|
||||
|
||||
var $_front_side_template;
|
||||
|
||||
function fetchElement($name, $value, &$node, $control_name)
|
||||
{
|
||||
jimport( 'joomla.filesystem.folder' );
|
||||
jimport( 'joomla.filesystem.file' );
|
||||
|
||||
$filter = $node->attributes('filter');
|
||||
$exclude = $node->attributes('exclude');
|
||||
|
||||
$options = array ();
|
||||
|
||||
|
||||
// Load 2x Catalog Themes
|
||||
require_once(dirname(__FILE__) . "/../RokNavMenu.php");
|
||||
RokNavMenu::setFrontSideTemplate();
|
||||
RokNavMenu::loadCatalogs();
|
||||
|
||||
|
||||
|
||||
foreach(RokNavMenu::$themes as $theme_name => $theme_info){
|
||||
$options[] = JHtml::_('select.option', $theme_name, $theme_info['fullname']);
|
||||
}
|
||||
|
||||
// path to directory
|
||||
$template_themes_path = '/templates/'.$this->_getFrontSideTemplate().'/html/mod_roknavmenu/themes';
|
||||
$template_themes_full_path = JPath::clean(JPATH_ROOT.$template_themes_path);
|
||||
$template_theme_text = JText::_("Template theme");
|
||||
|
||||
$module_themes_path = '/modules/mod_roknavmenu/themes';
|
||||
$module_themes_full_path = JPath::clean(JPATH_ROOT.$module_themes_path);
|
||||
$module_theme_text = JText::_("Default theme");
|
||||
|
||||
/**
|
||||
* check for old school formatter and layout
|
||||
*/
|
||||
if ($this->_getOldFormatter() || $this->_getOldLayout()) {
|
||||
return JText::sprintf("ROKNAVMENU.MSG.USING_OLD_FORMATTERS_AND_LAYOUTS", ($this->_getOldFormatter())? '<br/>'.$this->_getOldFormatter():'', ($this->_getOldLayout())?'<br/>'.$this->_getOldLayout():'');
|
||||
}
|
||||
|
||||
if (!$node->attributes('hide_none'))
|
||||
{
|
||||
$options[] = JHtml::_('select.option', '-1', '- '.JText::_('Do not use').' -');
|
||||
}
|
||||
|
||||
if (!$node->attributes('hide_default'))
|
||||
{
|
||||
$options[] = JHtml::_('select.option', '', '- '.JText::_('Use default').' -');
|
||||
}
|
||||
|
||||
/** Get the Template Themes **/
|
||||
if (JFolder::exists($template_themes_full_path) && !JFile::exists($template_themes_full_path."/catalog.php") ) {
|
||||
$folders = JFolder::folders($template_themes_full_path, $filter);
|
||||
if ( is_array($folders) )
|
||||
{
|
||||
reset($folders);
|
||||
while (list($key, $val) = each($folders)) {
|
||||
$folder =& $folders[$key];
|
||||
if ($exclude)
|
||||
{
|
||||
if (preg_match( chr( 1 ) . $exclude . chr( 1 ), $folder ))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
$options[] = JHtml::_('select.option', $template_themes_path.'/'.$folder, $template_theme_text." - ".$folder);
|
||||
}
|
||||
}
|
||||
}
|
||||
/** Get the Default Themes **/
|
||||
if (JFolder::exists($module_themes_full_path) && !JFile::exists($module_themes_full_path."/catalog.php")) {
|
||||
$folders = JFolder::folders($module_themes_full_path, $filter);
|
||||
if ( is_array($folders) )
|
||||
{
|
||||
reset($folders);
|
||||
while (list($key, $val) = each($folders)) {
|
||||
$folder =& $folders[$key];
|
||||
if ($exclude)
|
||||
{
|
||||
if (preg_match( chr( 1 ) . $exclude . chr( 1 ), $folder ))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
$options[] = JHtml::_('select.option', $module_themes_path.'/'.$folder, $module_theme_text. " - ". $folder);
|
||||
}
|
||||
}
|
||||
}
|
||||
return JHtml::_('select.genericlist', $options, ''.$control_name.'['.$name.']', 'class="inputbox"', 'value', 'text', $value, "param$name");
|
||||
|
||||
}
|
||||
|
||||
function _getFrontSideTemplate() {
|
||||
if (empty($this->_front_side_template)) {
|
||||
$db =JFactory::getDBO();
|
||||
// Get the current default template
|
||||
$query = ' SELECT template '
|
||||
.' FROM #__template_styles '
|
||||
.' WHERE client_id = 0 '
|
||||
.' AND home = 1 ';
|
||||
$db->setQuery($query);
|
||||
$defaultemplate = $db->loadResult();
|
||||
$this->_front_side_template = $defaultemplate;
|
||||
}
|
||||
return $this->_front_side_template;
|
||||
}
|
||||
|
||||
function _getOldFormatter() {
|
||||
$paths = array(
|
||||
JPath::clean('/templates/'.$this->_getFrontSideTemplate().'/html/mod_roknavmenu/formatters/default.php'),
|
||||
JPath::clean('/templates/'.$this->_getFrontSideTemplate().'/html/mod_roknavmenu/formatter.php'),
|
||||
JPath::clean('/modules/mod_roknavmenu/formatters/default.php')
|
||||
);
|
||||
|
||||
for ($i = 0; $i < count($paths); $i++){
|
||||
if (JFile::exists(JPATH_ROOT.$paths[$i])){
|
||||
return $paths[$i];
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function _getOldLayout() {
|
||||
$paths = array(
|
||||
JPath::clean('/templates/'.$this->_getFrontSideTemplate().'/html/mod_roknavmenu/layouts/default.php'),
|
||||
JPath::clean('/templates/'.$this->_getFrontSideTemplate().'/html/mod_roknavmenu/default.php'),
|
||||
JPath::clean('/modules/mod_roknavmenu/tmpl/default.php')
|
||||
);
|
||||
|
||||
for ($i = 0; $i < count($paths); $i++){
|
||||
if (JFile::exists(JPATH_ROOT.$paths[$i])){
|
||||
return $paths[$i];
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
194
modules/mod_roknavmenu/lib/parameters/themeparameters.php
Normal file
@ -0,0 +1,194 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: themeparameters.php 4585 2012-10-27 01:44:54Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
// Check to ensure this file is within the rest of the framework
|
||||
defined('JPATH_BASE') or die();
|
||||
|
||||
/**
|
||||
* Renders a file list from a directory in the current templates directory
|
||||
*/
|
||||
|
||||
class JElementThemeParameters extends JElement
|
||||
{
|
||||
/**
|
||||
* Element name
|
||||
*
|
||||
* @access protected
|
||||
* @var string
|
||||
*/
|
||||
var $_name = 'TemplateFilelist';
|
||||
|
||||
var $_front_side_template;
|
||||
|
||||
function fetchElement($name, $value, &$node, $control_name)
|
||||
{
|
||||
jimport( 'joomla.filesystem.folder' );
|
||||
jimport( 'joomla.filesystem.file' );
|
||||
$doc =JFactory::getDocument();
|
||||
$lang = JFactory::getLanguage();
|
||||
|
||||
$parameter_sets = array();
|
||||
|
||||
$filter = $node->attributes('filter');
|
||||
$exclude = $node->attributes('exclude');
|
||||
|
||||
|
||||
// Load 2x Catalog Themes
|
||||
require_once(dirname(__FILE__) . "/../RokNavMenu.php");
|
||||
RokNavMenu::setFrontSideTemplate();
|
||||
RokNavMenu::loadCatalogs();
|
||||
|
||||
|
||||
|
||||
foreach(RokNavMenu::$themes as $theme_name => $theme_info){
|
||||
$lang_file_path = JPath::clean($theme_info['path'].'/language/'.$lang->_lang.'.ini');
|
||||
$this->loadLangFile($lang_file_path, $theme_info['fullname']);
|
||||
|
||||
$parms_file_path = JPath::clean($theme_info['path'].'/parameters.xml');
|
||||
if (JFile::exists($parms_file_path)) {
|
||||
$parameters = new JForm( $this->_parent->_raw, JPath::clean($parms_file_path));
|
||||
$parameter_sets[$theme_name] = $parameters->getParams();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// path to directory
|
||||
$template_themes_path = '/templates/'.$this->_getFrontSideTemplate().'/html/mod_roknavmenu/themes';
|
||||
$template_themes_full_path = JPath::clean(JPATH_ROOT.$template_themes_path);
|
||||
$template_theme_text = JText::_("Template theme");
|
||||
|
||||
$module_themes_path = '/modules/mod_roknavmenu/themes';
|
||||
$module_themes_full_path = JPath::clean(JPATH_ROOT.$module_themes_path);
|
||||
$module_theme_text = JText::_("Default theme");
|
||||
|
||||
$module_js_path = JURI::root(true).'/modules/mod_roknavmenu/lib/js';
|
||||
$doc->addScript($module_js_path."/switcher".$this->_getJSVersion().".js");
|
||||
$doc->addScriptDeclaration("window.addEvent('domready', function() {new NavMenuSwitcher('paramtheme');});");
|
||||
|
||||
|
||||
/** Get the Template Themes parameters **/
|
||||
if (JFolder::exists($template_themes_full_path) && !JFile::exists($template_themes_full_path."/catalog.php")) {
|
||||
$folders = JFolder::folders($template_themes_full_path, $filter);
|
||||
if ( is_array($folders) )
|
||||
{
|
||||
reset($folders);
|
||||
while (list($key, $val) = each($folders)) {
|
||||
$folder =& $folders[$key];
|
||||
if ($exclude)
|
||||
{
|
||||
if (preg_match( chr( 1 ) . $exclude . chr( 1 ), $folder ))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
$theme_path = $template_themes_path.'/'.$folder;
|
||||
|
||||
$langfile = JPath::clean(JPATH_ROOT.$theme_path.'/language/'.$lang->_lang.'.ini');
|
||||
if (JFile::exists($langfile)) {
|
||||
$lang->_load($langfile,'roknavmenu_theme_template_'.$folder);
|
||||
}
|
||||
|
||||
$param_file_path = $theme_path.'/parameters.xml';
|
||||
if (JFile::exists(JPath::clean(JPATH_ROOT.$param_file_path))) {
|
||||
|
||||
$parameters = new JForm( $this->_parent->_raw, JPath::clean(JPATH_ROOT.$param_file_path));
|
||||
$parameter_sets[$theme_path] = $parameters->getParams();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/** Get the Default Themes parameters **/
|
||||
if (JFolder::exists($module_themes_full_path) && !JFile::exists($module_themes_full_path."/catalog.php")) {
|
||||
$folders = JFolder::folders($module_themes_full_path, $filter);
|
||||
if ( is_array($folders) )
|
||||
{
|
||||
reset($folders);
|
||||
while (list($key, $val) = each($folders)) {
|
||||
$folder =& $folders[$key];
|
||||
if ($exclude)
|
||||
{
|
||||
if (preg_match( chr( 1 ) . $exclude . chr( 1 ), $folder ))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
$theme_path = $module_themes_path.'/'.$folder;
|
||||
|
||||
$langfile = JPath::clean(JPATH_ROOT.$theme_path.'/language/'.$lang->_lang.'.ini');
|
||||
if (JFile::exists($langfile)) {
|
||||
$lang->_load($langfile,'roknavmenu_theme_module_'.$folder);
|
||||
}
|
||||
|
||||
$param_file_path = $theme_path.'/parameters.xml';
|
||||
|
||||
$parameter_sets[$theme_path] = array();
|
||||
if (JFile::exists(JPath::clean(JPATH_ROOT.$param_file_path))) {
|
||||
$parameters = new JForm( $this->_parent->_raw, JPath::clean(JPATH_ROOT.$param_file_path));
|
||||
$parameter_sets[$theme_path] = $parameters->getParams();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$parameter_renders = array();
|
||||
reset($parameter_sets);
|
||||
|
||||
$html = '';
|
||||
// render a parameter set
|
||||
while(list($key, $val) = each($parameter_sets)) {
|
||||
$params =& $parameter_sets[$key];
|
||||
$cls = basename($key);
|
||||
if (empty($params)){
|
||||
$html .= '<p class="'.$cls.'"><span>' . JText::_('ROKNAVMENU.MSG.NO_THEME_OPTIONS_AVAILABLE') . ' </span></p>';
|
||||
}
|
||||
else {
|
||||
//render an individual parameter
|
||||
for ($i=0; $i < count($params); $i++) {
|
||||
$param =& $params[$i];
|
||||
$html .= '<p class="'.$cls.'"><span>'.$param[0].':</span>' .$param[1] . '</p>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
function loadLangFile($langfile, $info){
|
||||
$lang = JFactory::getLanguage();
|
||||
if (JFile::exists($langfile)) {
|
||||
$lang->_load($langfile,$info);
|
||||
}
|
||||
}
|
||||
|
||||
function _getFrontSideTemplate() {
|
||||
if (empty($this->_front_side_template)) {
|
||||
$db =JFactory::getDBO();
|
||||
// Get the current default template
|
||||
$query = ' SELECT template '
|
||||
.' FROM #__template_styles '
|
||||
.' WHERE client_id = 0 '
|
||||
.' AND home = 1 ';
|
||||
$db->setQuery($query);
|
||||
$defaultemplate = $db->loadResult();
|
||||
$this->_front_side_template = $defaultemplate;
|
||||
}
|
||||
return $this->_front_side_template;
|
||||
}
|
||||
|
||||
function _getJSVersion() {
|
||||
if (version_compare(JVERSION, '1.5', '>=') && version_compare(JVERSION, '1.6', '<')){
|
||||
if (JPluginHelper::isEnabled('system', 'mtupgrade')){
|
||||
return "-mt1.2";
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
128
modules/mod_roknavmenu/lib/providers/JoomlaRokMenuNode.php
Normal file
@ -0,0 +1,128 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: JoomlaRokMenuNode.php 4585 2012-10-27 01:44:54Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
if (!class_exists('JoomlaRokMenuNode')) {
|
||||
class JoomlaRokMenuNode extends RokMenuNode {
|
||||
protected $image;
|
||||
protected $alias = false;
|
||||
protected $access = 0;
|
||||
protected $params = '';
|
||||
protected $type = 'menuitem';
|
||||
protected $menuId = null;
|
||||
|
||||
/**
|
||||
* Gets the image
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getImage() {
|
||||
return $this->image;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the image
|
||||
* @access public
|
||||
* @param string $image
|
||||
*/
|
||||
public function setImage($image) {
|
||||
$this->image = $image;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function hasImage(){
|
||||
return isset($this->image);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the alias
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function isAlias() {
|
||||
return $this->alias;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the alias
|
||||
* @access public
|
||||
* @param boolean $alias
|
||||
*/
|
||||
public function setAlias($alias) {
|
||||
$this->alias = $alias;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the access
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getAccess() {
|
||||
return $this->access;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the access
|
||||
* @access public
|
||||
* @param string $access
|
||||
*/
|
||||
public function setAccess($access) {
|
||||
$this->access = $access;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the params
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getParams() {
|
||||
return $this->params;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the params
|
||||
* @access public
|
||||
* @param string $params
|
||||
*/
|
||||
public function setParams($params) {
|
||||
$this->params = $params;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the type
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getType() {
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the type
|
||||
* @access public
|
||||
* @param string $type
|
||||
*/
|
||||
public function setType($type) {
|
||||
$this->type = $type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $menuId
|
||||
*/
|
||||
public function setMenuId($menuId){
|
||||
$this->menuId = $menuId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return null
|
||||
*/
|
||||
public function getMenuId(){
|
||||
return $this->menuId;
|
||||
}
|
||||
}
|
||||
}
|
159
modules/mod_roknavmenu/lib/providers/RokMenuProviderJoomla.php
Normal file
@ -0,0 +1,159 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: RokMenuProviderJoomla.php 8586 2013-03-20 14:15:35Z steph $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
require_once(dirname(__FILE__) . '/JoomlaRokMenuNode.php');
|
||||
if (!class_exists('RokMenuProviderJoomla')) {
|
||||
class RokMenuProviderJoomla extends AbstractRokMenuProvider {
|
||||
|
||||
protected function getMenuItems() {
|
||||
//Cache this basd on access level
|
||||
$conf =JFactory::getConfig();
|
||||
if ($conf->get('caching') && $this->args["cache"]) {
|
||||
$user =JFactory::getUser();
|
||||
$cache =JFactory::getCache('mod_roknavmenu');
|
||||
$cache->setCaching(true);
|
||||
$args = array($this->args);
|
||||
$checksum = md5(implode(',',$this->args));
|
||||
$menuitems = $cache->get(array($this, 'getFullMenuItems'), $args, 'mod_roknavmenu-'.$user->get('aid', 0).'-'.$checksum);
|
||||
}
|
||||
else {
|
||||
$menuitems = $this->getFullMenuItems($this->args);
|
||||
}
|
||||
|
||||
$site = new JSite();
|
||||
$jmenu = $site->getMenu();
|
||||
$active = $jmenu->getActive();
|
||||
|
||||
|
||||
if (is_object($active)){
|
||||
if (array_key_exists($active->id, $menuitems)){
|
||||
$this->current_node = $active->id;
|
||||
}
|
||||
}
|
||||
|
||||
$this->populateActiveBranch($menuitems);
|
||||
|
||||
return $menuitems;
|
||||
}
|
||||
|
||||
public function getFullMenuItems($args){
|
||||
$site = new JSite();
|
||||
$menu = $site->getMenu();
|
||||
// Get Menu Items
|
||||
$rows = $menu->getItems('menutype', $args['menutype']);
|
||||
|
||||
$outputNodes = array();
|
||||
if(is_array($rows) && count($rows) > 0){
|
||||
foreach ($rows as $item) {
|
||||
//Create the new Node
|
||||
$node = new JoomlaRokMenuNode();
|
||||
|
||||
$node->setId($item->id);
|
||||
$node->setParent($item->parent);
|
||||
$node->setTitle(addslashes(htmlspecialchars($item->name, ENT_QUOTES, 'UTF-8')));
|
||||
$node->setParams($item->params);
|
||||
$node->setLink($item->link);
|
||||
|
||||
// Menu Link is a special type that is a link to another item
|
||||
if ($item->type == 'menulink' && $newItem = $menu->getItem($item->query['Itemid'])) {
|
||||
$node->setAlias(true);
|
||||
$node->setLink($newItem->link);
|
||||
}
|
||||
|
||||
// Get the icon image associated with the item
|
||||
$iParams = (is_object($item->params)) ? $item->params : new JRegisry($item->params);
|
||||
if ($args['menu_images'] && $iParams->get('menu_image') && $iParams->get('menu_image') != -1) {
|
||||
$node->setImage(JURI::base(true) . '/images/stories/' . $iParams->get('menu_image'));
|
||||
if ($args['menu_images_link']) {
|
||||
$node->setLink(null);
|
||||
}
|
||||
}
|
||||
|
||||
switch ($item->type)
|
||||
{
|
||||
case 'separator':
|
||||
$node->setType('separator');
|
||||
break;
|
||||
case 'url':
|
||||
if ((strpos($node->getLink(), 'index.php?') === 0) && (strpos($node->getLink(), 'Itemid=') === false)) {
|
||||
$node->setLink($node->getLink() . '&Itemid=' . $node->getId());
|
||||
}
|
||||
$node->setType('menuitem');
|
||||
break;
|
||||
default :
|
||||
$router = JSite::getRouter();
|
||||
if ($node->isAlias() && $newItem){
|
||||
$menu_id = $item->query['Itemid'];
|
||||
}
|
||||
else {
|
||||
$menu_id = $node->getId();
|
||||
}
|
||||
$link = ($router->getMode() == JROUTER_MODE_SEF)? 'index.php?Itemid=' . $menu_id : $node->getLink() . '&Itemid=' . $menu_id;
|
||||
$node->setLink($link);
|
||||
$node->setType('menuitem');
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if ($node->getLink() != null) {
|
||||
// set the target based on menu item options
|
||||
switch ($item->browserNav)
|
||||
{
|
||||
case 1:
|
||||
$node->setTarget('_blank');
|
||||
break;
|
||||
case 2:
|
||||
//$node->setLink(str_replace('index.php', 'index2.php', $node->getLink()));
|
||||
//$node->setTarget('newnotool');
|
||||
$value = addslashes(htmlspecialchars("window.open(this.href,'targetWindow','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes');return false;", ENT_QUOTES, 'UTF-8'));
|
||||
$node->addLinkAttrib('onclick', $value);
|
||||
break;
|
||||
default:
|
||||
//$node->setTarget('current');
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// Get the final URL
|
||||
if ($item->home == 1) { // Set Home Links to the Base
|
||||
$node->setLink(JURI::base());
|
||||
}
|
||||
|
||||
if ($item->type != 'separator' && $item->type != 'url') {
|
||||
$iSecure = $iParams->get('secure', 0);
|
||||
if (array_key_exists('url_type',$args) && $args['url_type'] == 'full') {
|
||||
$url = JRoute::_($node->getLink(), true, $iSecure);
|
||||
$base = (!preg_match("/^http/", $node->getLink())) ? rtrim(JURI::base(false).'/') : '';
|
||||
$routed = $base . $url;
|
||||
$secure = RokNavMenuTree::_getSecureUrl($routed, $iSecure);
|
||||
$node->setLink($secure);
|
||||
} else {
|
||||
$node->setLink(JRoute::_($node->getLink(), true, $iSecure));
|
||||
}
|
||||
}
|
||||
else if ($item->type == 'url') {
|
||||
$node->setLink(str_replace('&', '&', $node->getLink()));
|
||||
}
|
||||
}
|
||||
|
||||
$node->addListItemClass("item" . $node->getId());
|
||||
$node->setAccess($item->access);
|
||||
$node->addSpanClass($node->getType());
|
||||
|
||||
$user =JFactory::getUser();
|
||||
|
||||
|
||||
if (($node->getAccess() <= $user->get('aid', 0))||((isset($args['check_access_level'][0]) && $args['check_access_level'][0]==1))){
|
||||
// Add node to output list
|
||||
$outputNodes[$node->getId()] = $node;
|
||||
}
|
||||
}
|
||||
return $outputNodes;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
314
modules/mod_roknavmenu/lib/providers/RokMenuProviderJoomla16.php
Normal file
@ -0,0 +1,314 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: RokMenuProviderJoomla16.php 9104 2013-04-04 02:26:54Z steph $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
require_once(dirname(__FILE__) . '/JoomlaRokMenuNode.php');
|
||||
|
||||
if (!class_exists('RokMenuProviderJoomla16')) {
|
||||
|
||||
|
||||
class RokMenuProviderJoomla16 extends AbstractRokMenuProvider
|
||||
{
|
||||
|
||||
const ROOT_ID = 1;
|
||||
|
||||
protected function getMenuItems()
|
||||
{
|
||||
//Cache this basd on access level
|
||||
$conf = JFactory::getConfig();
|
||||
if ($conf->get('caching') && $this->args["cache"]) {
|
||||
$user = JFactory::getUser();
|
||||
$cache = JFactory::getCache('mod_roknavmenu');
|
||||
$cache->setCaching(true);
|
||||
$args = array($this->args);
|
||||
$checksum = md5(implode(',', $this->args));
|
||||
$menuitems = $cache->get(array(
|
||||
$this, 'getFullMenuItems'
|
||||
), $args, 'mod_roknavmenu-' . $user->get('aid', 0) . '-' . $checksum);
|
||||
} else {
|
||||
$menuitems = $this->getFullMenuItems($this->args);
|
||||
}
|
||||
|
||||
|
||||
/* Set the active to the current run since its not saved with the cache */
|
||||
$app = JFactory::getApplication();
|
||||
$jmenu = $app->getMenu();
|
||||
$active = $jmenu->getActive();
|
||||
|
||||
if (is_object($active)) {
|
||||
if (array_key_exists($active->id, $menuitems)) {
|
||||
$this->current_node = $active->id;
|
||||
}
|
||||
}
|
||||
|
||||
$this->populateActiveBranch($menuitems);
|
||||
return $menuitems;
|
||||
}
|
||||
|
||||
public function getFullMenuItems($args)
|
||||
{
|
||||
$app = JFactory::getApplication();
|
||||
$menu = $app->getMenu();
|
||||
|
||||
$attributes = array('menutype');
|
||||
$values = array($args['menutype']);
|
||||
|
||||
//public level menu items
|
||||
if (isset($args['check_access_level']) && $args['check_access_level']==0) {
|
||||
$attributes[] = 'access';
|
||||
$values[] = array(1);
|
||||
}
|
||||
|
||||
//registered level menu items
|
||||
elseif (isset($args['check_access_level']) && $args['check_access_level']==1) {
|
||||
$attributes[] = 'access';
|
||||
$values[] = array(1,2);
|
||||
}
|
||||
|
||||
//user level menu items
|
||||
else {
|
||||
$attributes[] = 'access';
|
||||
$values[] = JFactory::getUser()->getAuthorisedViewLevels();
|
||||
}
|
||||
|
||||
// Get Menu Items
|
||||
$rows = $menu->getItems($attributes, $values);
|
||||
|
||||
$outputNodes = array();
|
||||
|
||||
if (is_array($rows) && count($rows) > 0) {
|
||||
foreach ($rows as $item) {
|
||||
//Create the new Node
|
||||
$node = new JoomlaRokMenuNode();
|
||||
|
||||
$node->setId($item->id);
|
||||
$node->setParent($item->parent_id);
|
||||
$node->setTitle(addslashes(htmlspecialchars($item->title, ENT_QUOTES, 'UTF-8')));
|
||||
$node->setParams($item->params);
|
||||
$node->setLink($item->link);
|
||||
|
||||
// Menu Link is a special type that is a link to another item
|
||||
if ($item->type == 'alias' && $newItem = $menu->getItem($item->params->get('aliasoptions'))) {
|
||||
$node->setAlias(true);
|
||||
$node->setLink($newItem->link);
|
||||
}
|
||||
|
||||
// Get the icon image associated with the item
|
||||
$iParams = (is_object($item->params)) ? $item->params : new JRegisry($item->params);
|
||||
if ($args['menu_images'] && $iParams->get('menu_image') && $iParams->get('menu_image') != -1) {
|
||||
$node->setImage(JURI::base(true) . '/images/stories/' . $iParams->get('menu_image'));
|
||||
if ($args['menu_images_link']) {
|
||||
$node->setLink(null);
|
||||
}
|
||||
}
|
||||
|
||||
switch ($item->type) {
|
||||
case 'separator':
|
||||
$node->setType('separator');
|
||||
break;
|
||||
case 'url':
|
||||
if ((strpos($node->getLink(), 'index.php?') === 0) && (strpos($node->getLink(), 'Itemid=') === false)) {
|
||||
$node->setLink($node->getLink() . '&Itemid=' . $node->getId());
|
||||
} elseif (!empty($item->link) && ($item->link != null)) {
|
||||
$node->setLink($item->link);
|
||||
}
|
||||
$node->setType('menuitem');
|
||||
break;
|
||||
default :
|
||||
$router = JSite::getRouter();
|
||||
if ($node->isAlias() && $newItem) {
|
||||
$menu_id = $item->params->get('aliasoptions');
|
||||
$node->setMenuId($menu_id);
|
||||
//for aliased items formatter.php doesn't cover
|
||||
if ($node->getMenuId() == $this->current_node) {
|
||||
//taken back out because it caused all the aliased menu items on RT demos to highlight
|
||||
//$node->addListItemClass('active');
|
||||
//$node->setCssId('current');
|
||||
}
|
||||
} else {
|
||||
$menu_id = $node->getId();
|
||||
$node->setMenuId($menu_id);
|
||||
}
|
||||
$link = ($router->getMode() == JROUTER_MODE_SEF) ? 'index.php?Itemid=' . $menu_id : $node->getLink() . '&Itemid=' . $menu_id;
|
||||
$node->setLink($link);
|
||||
$node->setType('menuitem');
|
||||
break;
|
||||
}
|
||||
|
||||
if ($node->getLink() != null) {
|
||||
// set the target based on menu item options
|
||||
switch ($item->browserNav) {
|
||||
case 1:
|
||||
$node->setTarget('_blank');
|
||||
break;
|
||||
case 2:
|
||||
//$node->setLink(str_replace('index.php', 'index2.php', $node->getLink()));
|
||||
//$node->setTarget('newnotool');
|
||||
$value = addslashes(htmlspecialchars("window.open(this.href,'targetWindow','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes');return false;", ENT_QUOTES, 'UTF-8'));
|
||||
$node->addLinkAttrib('onclick', $value);
|
||||
break;
|
||||
default:
|
||||
//$node->setTarget('current');
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// Get the final URL
|
||||
if ($item->home == 1) { // Set Home Links to the Base
|
||||
//removed because it breaks SEF extensions
|
||||
//$node->setLink(JRoute::_(JURI::base()));
|
||||
}
|
||||
|
||||
if ($item->type != 'separator' && $item->type != 'url') {
|
||||
$iSecure = $iParams->get('secure', 0);
|
||||
if (array_key_exists('url_type', $args) && $args['url_type'] == 'full') {
|
||||
$url = JRoute::_($node->getLink(), true, $iSecure);
|
||||
$base = (!preg_match("/^http/", $node->getLink())) ? rtrim(JURI::base(false) . '/') : '';
|
||||
$routed = $base . $url;
|
||||
$secure = RokNavMenuTree::_getSecureUrl($routed, $iSecure);
|
||||
$node->setLink($secure);
|
||||
} else {
|
||||
$node->setLink(JRoute::_($node->getLink(), true, $iSecure));
|
||||
}
|
||||
} else if ($item->type == 'url') {
|
||||
$node->setLink(str_replace('&', '&', $node->getLink()));
|
||||
}
|
||||
}
|
||||
$node->addListItemClass("item" . $node->getId());
|
||||
$node->setAccess($item->access);
|
||||
$node->addSpanClass($node->getType());
|
||||
|
||||
// Add node to output list
|
||||
$outputNodes[$node->getId()] = $node;
|
||||
}
|
||||
}
|
||||
return $outputNodes;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $nodeList
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function populateActiveBranch($nodeList)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return RokMenuNodeTree
|
||||
*/
|
||||
public function getRealMenuTree()
|
||||
{
|
||||
$menuitems = $this->getFullMenuItems($this->args);
|
||||
|
||||
$app = JFactory::getApplication();
|
||||
$jmenu = $app->getMenu();
|
||||
$active = $jmenu->getActive();
|
||||
if (is_object($active)) {
|
||||
if (array_key_exists($active->id, $menuitems)) {
|
||||
$this->current_node = $active->id;
|
||||
}
|
||||
}
|
||||
//$this->populateActiveBranch($menuitems);
|
||||
|
||||
$menu = $this->createJoomlaMenuTree($menuitems, $this->args['maxdepth']);
|
||||
|
||||
|
||||
return $menu;
|
||||
}
|
||||
|
||||
/**
|
||||
* Takes the menu item nodes and puts them into a tree structure
|
||||
*
|
||||
* @param $nodes
|
||||
* @param $maxdepth
|
||||
*
|
||||
* @return bool|RokMenuNodeTree
|
||||
*/
|
||||
protected function createJoomlaMenuTree(&$nodes, $maxdepth)
|
||||
{
|
||||
$menu = new RokMenuNodeTree(self::ROOT_ID);
|
||||
// TODO: move maxdepth to higher processing level?
|
||||
if (!empty($nodes)) {
|
||||
// Build Menu Tree root down (orphan proof - child might have lower id than parent)
|
||||
$ids = array();
|
||||
$ids[0] = true;
|
||||
$unresolved = array();
|
||||
|
||||
// pop the first item until the array is empty if there is any item
|
||||
if (is_array($nodes)) {
|
||||
while (count($nodes) && !is_null($node = array_shift($nodes))) {
|
||||
if (!$menu->addNode($node)) {
|
||||
if (!array_key_exists($node->getId(), $unresolved) || $unresolved[$node->getId()] < $maxdepth) {
|
||||
array_push($nodes, $node);
|
||||
if (!isset($unresolved[$node->getId()])) $unresolved[$node->getId()] = 1; else $unresolved[$node->getId()]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $menu;
|
||||
}
|
||||
|
||||
public function getMenuTree()
|
||||
{
|
||||
if (null == $this->menu) {
|
||||
//Cache this basd on access level
|
||||
$conf = JFactory::getConfig();
|
||||
if ($conf->get('caching',0) && isset($this->args["module_cache"]) && $this->args["module_cache"]) {
|
||||
$user = JFactory::getUser();
|
||||
$cache = JFactory::getCache('mod_roknavmenu');
|
||||
$cache->setCaching(true);
|
||||
$args = array($this->args);
|
||||
$checksum = md5(implode(',', $this->args));
|
||||
$this->menu = $cache->get(array(
|
||||
$this, 'getRealMenuTree'
|
||||
), $args, 'mod_roknavmenu-' . $user->get('aid', 0) . '-' . $checksum);
|
||||
} else {
|
||||
$this->menu = $this->getRealMenuTree();
|
||||
}
|
||||
|
||||
|
||||
$app = JFactory::getApplication();
|
||||
$jmenu = $app->getMenu();
|
||||
$active = $jmenu->getActive();
|
||||
if (is_object($active)) {
|
||||
if ($this->menu->findNode($active->id)) {
|
||||
$this->current_node = $active->id;
|
||||
}
|
||||
}
|
||||
$this->active_branch = $this->findActiveBranch($this->menu, $this->current_node);
|
||||
}
|
||||
return $this->menu;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the current active based on the current_node
|
||||
*
|
||||
* @param RokMenuNodeTree $menu
|
||||
* @param $active_id
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function findActiveBranch(RokMenuNodeTree $menu, $active_id)
|
||||
{
|
||||
$active_branch = array();
|
||||
/** @var $current JoomlaRokMenuNode */
|
||||
$current = $menu->findNode($active_id);
|
||||
if ($current) {
|
||||
do {
|
||||
$active_branch[$current->getId()] = $current;
|
||||
if ($current->getParent() == self::ROOT_ID) break;
|
||||
} while ($current = $current->getParentRef());
|
||||
$active_branch = array_reverse($active_branch, true);
|
||||
}
|
||||
return $active_branch;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
10
modules/mod_roknavmenu/lib/providers/includes.php
Normal file
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: includes.php 4585 2012-10-27 01:44:54Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
require_once(dirname(__FILE__) . '/JoomlaRokMenuNode.php');
|
||||
require_once(dirname(__FILE__) . '/RokMenuProviderJoomla.php');
|
||||
require_once(dirname(__FILE__) . '/RokMenuProviderJoomla16.php');
|
1
modules/mod_roknavmenu/lib/providers/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
346
modules/mod_roknavmenu/lib/renderers/RokNavMenu1XRenderer.php
Normal file
@ -0,0 +1,346 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: RokNavMenu1XRenderer.php 9687 2013-04-24 20:37:47Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
class RokNavMenu1XRenderer implements RokMenuRenderer {
|
||||
protected $provider;
|
||||
protected $args;
|
||||
|
||||
public function __construct(){
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $args
|
||||
* @return void
|
||||
*/
|
||||
public function setArgs(array &$args) {
|
||||
$this->args =& $args;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getDefaults() {
|
||||
if (!isset($this->theme)) {
|
||||
return array();
|
||||
}
|
||||
return $this->theme->getDefaults();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function initialize(RokMenuProvider $provider) {
|
||||
$menu_data = $provider->getMenuTree();
|
||||
if (!empty($menu_data) && $menu_data !== false) {
|
||||
$menu = $this->convertNodes($menu_data);
|
||||
|
||||
$menu_params = new JRegistry();
|
||||
$menu_params->loadArray($this->args);
|
||||
|
||||
$menu = $this->getFormattedMenu($menu, $menu_params);
|
||||
$this->layout_path = $this->getLayoutPath($menu_params);
|
||||
$this->menu = &$menu;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function renderHeader() {
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function renderMenu() {
|
||||
$menu =& $this->menu;
|
||||
require($this->layout_path);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function renderFooter() {
|
||||
return '';
|
||||
}
|
||||
|
||||
protected function convertNodes(RokMenuNodeTree $menu) {
|
||||
|
||||
$top = new RokNavMenuTree();
|
||||
$top->_params = $this->convertArgsToParams();
|
||||
|
||||
$subnodes = array();
|
||||
// convert the nodes to an array of old school node types
|
||||
$itr = new RecursiveIteratorIterator($menu, RecursiveIteratorIterator::SELF_FIRST);
|
||||
foreach ($itr as $tmp) {
|
||||
$node = new RokNavMenuNode();
|
||||
$node->id = $tmp->getId();
|
||||
$node->parent = $tmp->getParent();
|
||||
$node->title = $tmp->getTitle();
|
||||
$node->access = $tmp->getAccess();
|
||||
$node->link = $tmp->getLink();
|
||||
$node->level = $tmp->getLevel();
|
||||
$node->image = $tmp->getImage();
|
||||
$node->alias = $tmp->isAlias();
|
||||
$node->nav = $tmp->getTarget();
|
||||
$node->access = $tmp->getAccess();
|
||||
switch ($tmp->getTarget()) {
|
||||
case 'newnotool':
|
||||
$node->displayType = 2;
|
||||
break;
|
||||
case 'new':
|
||||
$node->displayType = 1;
|
||||
break;
|
||||
default:
|
||||
$node->displayType = 0;
|
||||
break;
|
||||
}
|
||||
$node->setParameters($tmp->getParams());
|
||||
$node->type = $tmp->getType();
|
||||
//$node->order = $item->ordering;
|
||||
|
||||
foreach(explode(" ",$tmp->getListItemClasses()) as $class){
|
||||
$node->addListItemClass($class);
|
||||
}
|
||||
foreach(explode(" ",$tmp->getSpanClasses()) as $class){
|
||||
$node->addSpanClass($class);
|
||||
}
|
||||
foreach(explode(" ",$tmp->getLinkClasses()) as $class){
|
||||
$node->addLinkClass($class);
|
||||
}
|
||||
foreach($tmp->getLinkAttribsArray() as $name => $attrib){
|
||||
$node->addLinkAttrib($name, $attrib);
|
||||
}
|
||||
foreach($tmp->getLinkAdditionsArray() as $name => $value){
|
||||
$node->addLinkAddition($name, $value);
|
||||
}
|
||||
|
||||
if ($node->parent == RokNavMenu::TOP_LEVEL_PARENT_ID){
|
||||
$node->_parentRef = $top;
|
||||
$top->_children[$node->id] = $node;
|
||||
|
||||
}
|
||||
else {
|
||||
foreach ($subnodes as $subnode){
|
||||
if ($node->parent == $subnode->id){
|
||||
$subnode->addChild($node);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
$subnodes[] = $node;
|
||||
}
|
||||
return $top;
|
||||
}
|
||||
|
||||
protected function convertArgsToParams() {
|
||||
$params = new JRegistry();
|
||||
$params->loadArray($this->args);
|
||||
return $params;
|
||||
}
|
||||
|
||||
|
||||
public function getThemePath(&$params) {
|
||||
$default_module_theme_dir = JPath::clean('/modules/mod_roknavmenu/themes');
|
||||
$basic_theme = $default_module_theme_dir . '/default';
|
||||
$theme = $params->get('theme', $basic_theme);
|
||||
// Set the theme to the old school default theme if it exists
|
||||
if ($params->get('default_formatter', false)) {
|
||||
$theme = $default_module_theme_dir . '/' . $params->get('default_formatter', 'default');
|
||||
}
|
||||
return $theme;
|
||||
}
|
||||
|
||||
public function getFormatterPath(&$params) {
|
||||
$app = JFactory::getApplication();
|
||||
$theme = $this->getThemePath($params);
|
||||
|
||||
// Get the formatters path
|
||||
$formatter_path = JPath::clean(JPATH_ROOT . $params->get('theme', $theme) . "/formatter.php");
|
||||
|
||||
$template_default_formatter_path = JPath::clean(JPATH_ROOT . '/templates/' . $app->getTemplate() . '/html/mod_roknavmenu/formatter.php');
|
||||
if (JFile::exists($template_default_formatter_path)) {
|
||||
$formatter_path = $template_default_formatter_path;
|
||||
}
|
||||
|
||||
$template_formatter_path = JPath::clean(JPATH_ROOT . '/templates/' . $app->getTemplate() . '/html/mod_roknavmenu/themes/' . $theme . '/formatter.php');
|
||||
if (JFile::exists($template_formatter_path)) {
|
||||
$formatter_path = $template_formatter_path;
|
||||
}
|
||||
|
||||
//see if the backwards compat custom_formatter is set.
|
||||
$template_formatter = $params->get('custom_formatter', "default");
|
||||
$template_named_formatter_path = JPath::clean(JPATH_ROOT . '/templates/' . $app->getTemplate() . '/html/mod_roknavmenu/formatters/' . $template_formatter . '.php');
|
||||
if (JFile::exists($template_named_formatter_path)) {
|
||||
$formatter_path = $template_named_formatter_path;
|
||||
}
|
||||
return $formatter_path;
|
||||
}
|
||||
|
||||
public function getLayoutPath(&$params) {
|
||||
$app = JFactory::getApplication();
|
||||
$theme = $this->getThemePath($params);
|
||||
|
||||
// Get the layout path
|
||||
$layout_path = JPath::clean(JPATH_ROOT . $theme . "/layout.php");
|
||||
|
||||
$joomla_layout_path = JModuleHelper::getLayoutPath('mod_roknavmenu');
|
||||
if (JFile::exists($joomla_layout_path)) {
|
||||
$layout_path = $joomla_layout_path;
|
||||
}
|
||||
|
||||
$template_layout_path = JPath::clean(JPATH_ROOT . '/templates/' . $app->getTemplate() . '/html/mod_roknavmenu/themes/' . $theme . '/layout.php');
|
||||
if (JFile::exists($template_layout_path)) {
|
||||
$layout_path = $template_layout_path;
|
||||
}
|
||||
|
||||
//see if the backwards compat custom_formatter is set.
|
||||
if ($params->get('custom_layout', false)) {
|
||||
$template_layout = $params->get('custom_layout', "default");
|
||||
$template_named_layput_path = JPath::clean(JPATH_ROOT . '/templates/' . $app->getTemplate() . '/html/mod_roknavmenu/layouts/' . $template_layout . '.php');
|
||||
if (JFile::exists($template_named_layput_path)) {
|
||||
$layout_path = $template_named_layput_path;
|
||||
}
|
||||
}
|
||||
return $layout_path;
|
||||
}
|
||||
|
||||
protected function getFormattedMenu($menu, &$params) {
|
||||
$app = JFactory::getApplication();
|
||||
// get the base menu data structure
|
||||
|
||||
// Run the basic formatter
|
||||
$this->formatMenu($menu);
|
||||
|
||||
$default_module_theme_dir = JPath::clean('/modules/mod_roknavmenu/themes');
|
||||
|
||||
$theme = $this->getThemePath($params);
|
||||
|
||||
$theme_name = basename($params->get('theme', $theme));
|
||||
|
||||
$formatter_path = $this->getFormatterPath($params);
|
||||
|
||||
//load the formatter
|
||||
require_once ($formatter_path);
|
||||
|
||||
$theme_type = 'Template';
|
||||
// Find if this is a Default or Template theme
|
||||
if (dirname(JPath::clean($params->get('theme', $theme))) == $default_module_theme_dir) {
|
||||
$theme_type = 'Default';
|
||||
}
|
||||
|
||||
// run the formatter class
|
||||
$theme_formatter_class = 'RokNavMenuFormatter' . str_replace('-', '', $theme_type . $theme_name);
|
||||
if (class_exists($theme_formatter_class)) {
|
||||
$formatter = new $theme_formatter_class();
|
||||
$formatter->format_tree($menu);
|
||||
}
|
||||
else if (class_exists('RokNavMenuFormatter')) {
|
||||
$formatter = new RokNavMenuFormatter();
|
||||
$formatter->format_tree($menu);
|
||||
}
|
||||
|
||||
return $menu;
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform the basic common formatting to all menu nodes
|
||||
*/
|
||||
protected function formatMenu(&$menu) {
|
||||
|
||||
|
||||
//set the active tree branch
|
||||
$site = new JSite();
|
||||
$joomlamenu = $site->getMenu();
|
||||
$active = $joomlamenu->getActive();
|
||||
if (isset($active) && isset($active->tree) && count($active->tree)) {
|
||||
reset($active->tree);
|
||||
while (list($key, $value) = each($active->tree)) {
|
||||
$active_node =& $active->tree[$key];
|
||||
$active_child =& $menu->findChild($active_node);
|
||||
if ($active_child !== false) {
|
||||
$active_child->addListItemClass('active');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// set the current node
|
||||
if (isset($active)) {
|
||||
$current_child =& $menu->findChild($active->id);
|
||||
if ($current_child !== false && !$current_child->menualias) {
|
||||
$current_child->css_id = 'current';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Limit the levels of the tree is called for By limitLevels
|
||||
if ($menu->getParameter('limit_levels')) {
|
||||
$start = $menu->getParameter('startLevel');
|
||||
$end = $menu->getParameter('endLevel');
|
||||
|
||||
//Limit to the active path if the start is more the level 0
|
||||
if ($start > 0) {
|
||||
$found = false;
|
||||
// get active path and find the start level that matches
|
||||
if (isset($active) && isset($active->tree) && count($active->tree)) {
|
||||
reset($active->tree);
|
||||
while (list($key, $value) = each($active->tree)) {
|
||||
$active_child = $menu->findChild($active->tree[$key]);
|
||||
if ($active_child != null && $active_child !== false) {
|
||||
if ($active_child->level == $start - 1) {
|
||||
$menu->resetTop($active_child->id);
|
||||
$found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!$found) {
|
||||
$menu->_children = array();
|
||||
}
|
||||
}
|
||||
//remove lower then the defined end level
|
||||
$menu->removeLevel($end);
|
||||
}
|
||||
|
||||
// Remove the child nodes that were not needed to display unless showAllChildren is set
|
||||
$showAllChildren = $menu->getParameter('showAllChildren');
|
||||
if (!$showAllChildren) {
|
||||
if ($menu->hasChildren()) {
|
||||
reset($menu->_children);
|
||||
while (list($key, $value) = each($menu->_children)) {
|
||||
$toplevel =& $menu->_children[$key];
|
||||
if (isset($active) && isset($active->tree) && in_array($toplevel->id, $active->tree) !== false) {
|
||||
$last_active =& $menu->findChild($active->tree[count($active->tree) - 1]);
|
||||
if ($last_active !== false) {
|
||||
$toplevel->removeIfNotInTree($active->tree, $last_active->id);
|
||||
//$toplevel->removeLevel($last_active->level+1);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$toplevel->removeLevel($toplevel->level);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function _getJSVersion() {
|
||||
if (version_compare(JVERSION, '1.5', '>=') && version_compare(JVERSION, '1.6', '<')) {
|
||||
if (JPluginHelper::isEnabled('system', 'mtupgrade')) {
|
||||
return "-mt1.2";
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: RokNavMenu2XRenderer.php 4585 2012-10-27 01:44:54Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
class RokNavMenu2XRenderer extends RokMenuDefaultRenderer
|
||||
{
|
||||
public function renderHeader(){
|
||||
parent::renderHeader();
|
||||
$doc = JFactory::getDocument();
|
||||
|
||||
foreach($this->layout->getScriptFiles() as $script){
|
||||
$doc->addScript($script['relative']);
|
||||
}
|
||||
|
||||
foreach($this->layout->getStyleFiles() as $style){
|
||||
$doc->addStyleSheet($style['relative']);
|
||||
}
|
||||
$doc->addScriptDeclaration($this->layout->getInlineScript());
|
||||
$doc->addStyleDeclaration($this->layout->getInlineStyle());
|
||||
}
|
||||
}
|
554
modules/mod_roknavmenu/lib/renderers/RokNavMenuTree.php
Normal file
@ -0,0 +1,554 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: RokNavMenuTree.php 4585 2012-10-27 01:44:54Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
// no direct access
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
jimport('joomla.base.tree');
|
||||
//require_once (dirname(__FILE__).'/RokNavMenuNode.php');
|
||||
|
||||
|
||||
/**
|
||||
* Base Class for menu tree nodes
|
||||
*/
|
||||
|
||||
class RokMenuTreeBase {
|
||||
|
||||
|
||||
/**
|
||||
* Base ID for the menu as ultimate parent
|
||||
*/
|
||||
var $id = 0;
|
||||
var $parent = 0;
|
||||
var $_parentRef = null;
|
||||
var $level = -1;
|
||||
var $access = 2;
|
||||
|
||||
var $_check_access_level = null;
|
||||
|
||||
var $_children = array();
|
||||
|
||||
function __construct($params = null)
|
||||
{
|
||||
$this->_params = &$params;
|
||||
}
|
||||
/**
|
||||
* Menu parameters
|
||||
*/
|
||||
var $_params = null;
|
||||
|
||||
function addChild(&$node) {
|
||||
if (!$node->isAccessable()){
|
||||
return true;
|
||||
}
|
||||
if ( $this->id == $node->parent) {
|
||||
$node->_parentRef = $this;
|
||||
$this->_children[$node->id] = $node;
|
||||
return true;
|
||||
}
|
||||
else if ($this->hasChildren()) {
|
||||
reset($this->_children);
|
||||
while (list($key, $value) = each($this->_children)) {
|
||||
$child =& $this->_children[$key];
|
||||
if ($child->addChild($node)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function hasChildren()
|
||||
{
|
||||
return count($this->_children);
|
||||
}
|
||||
|
||||
function &getChildren()
|
||||
{
|
||||
return $this->_children;
|
||||
}
|
||||
|
||||
function setParameters($params) {
|
||||
$this->_params = is_object($params) ? $params : new JRegistry($params);
|
||||
}
|
||||
|
||||
function getParameter($param) {
|
||||
if (null == $param || null == $this->_params) {
|
||||
return null;
|
||||
}
|
||||
return $this->_params->get($param);
|
||||
}
|
||||
|
||||
function &findChild($node_id) {
|
||||
if (array_key_exists($node_id, $this->_children)) {
|
||||
return $this->_children[$node_id];
|
||||
}
|
||||
else if ($this->hasChildren()) {
|
||||
reset($this->_children);
|
||||
while (list($key, $value) = each($this->_children)) {
|
||||
$child =& $this->_children[$key];
|
||||
$wanted_node = $child->findChild($node_id);
|
||||
if ($wanted_node !== false) {
|
||||
return $wanted_node;
|
||||
}
|
||||
}
|
||||
}
|
||||
$ret = false;
|
||||
return $ret;
|
||||
}
|
||||
|
||||
function removeChild($node_id) {
|
||||
if (array_key_exists($node_id, $this->_children)) {
|
||||
unset($this->_children[$node_id]);
|
||||
return true;
|
||||
}
|
||||
else if ($this->hasChildren()) {
|
||||
reset($this->_children);
|
||||
while (list($key, $value) = each($this->_children)) {
|
||||
$child =& $this->_children[$key];
|
||||
$ret = $child->removeChild($node_id);
|
||||
if ($ret === true) {
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function removeLevel($end) {
|
||||
if ( $this->level == $end ) {
|
||||
$this->_children = array();
|
||||
}
|
||||
else if ($this->level < $end) {
|
||||
if ($this->hasChildren()) {
|
||||
reset($this->_children);
|
||||
while (list($key, $value) = each($this->_children)) {
|
||||
$child =& $this->_children[$key];
|
||||
$child->removeLevel($end);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function removeIfNotInTree(&$active_tree, $last_active) {
|
||||
if (!empty($active_tree)) {
|
||||
|
||||
if (in_array((int)$this->id, $active_tree) && $last_active == $this->id) {
|
||||
// i am the last node in the active tree
|
||||
if ($this->hasChildren()) {
|
||||
reset($this->_children);
|
||||
while (list($key, $value) = each($this->_children)) {
|
||||
$child =& $this->_children[$key];
|
||||
$child->_children = array();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (in_array((int)$this->id, $active_tree)) {
|
||||
// i am in the active tree but not the last node
|
||||
if ($this->hasChildren()) {
|
||||
reset($this->_children);
|
||||
while (list($key, $value) = each($this->_children)) {
|
||||
$child =& $this->_children[$key];
|
||||
$child->removeIfNotInTree($active_tree, $last_active);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
// i am not in the active tree
|
||||
$this->_children = array();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function isAccessable(){
|
||||
$user =JFactory::getUser();
|
||||
$view_levels = $user->getAuthorisedViewLevels();
|
||||
if (null == $this->access ) {
|
||||
return null;
|
||||
}
|
||||
else if (in_array($this->access,$view_levels)) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function getParent() {
|
||||
return $this->_parentRef;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Rok Nav Menu Tree Class.
|
||||
*/
|
||||
class RokNavMenuTree extends RokMenuTreeBase
|
||||
{
|
||||
// const MENUPARAM_MENU_IMAGES = "menu_images";
|
||||
// const MENUPARAM_LIMIT_LEVELS = "limit_levels";
|
||||
// const MENUPARAM_START_LEVEL = "startLevel";
|
||||
// const MENUPARAM_END_LEVEL = "endLevel";
|
||||
// const MENUPARAM_SHOW_ALL_CHILDREN = "showAllChildren";
|
||||
// const MENUPARAM_TAG_ID = "tag_id";
|
||||
// const MENUPARAM_CLASS_SUFFIX = "class_sfx";
|
||||
// const MENUPARAM_MENU_IMAGES_LINK = "menu_images_link";
|
||||
// const MENUPARAM_MAX_DEPTH = "maxdepth";
|
||||
|
||||
|
||||
|
||||
function addNode(&$params, $item)
|
||||
{
|
||||
// Get menu item data
|
||||
|
||||
$node = $this->_getItemData($params, $item);
|
||||
$node->_check_access_level = $params->get('check_access_level',null);
|
||||
if ($node !== false) {
|
||||
return $this->addChild($node);
|
||||
}
|
||||
else {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function resetTop($top_node_id) {
|
||||
$new_top_node = $this->findChild($top_node_id);
|
||||
if ($new_top_node !== false)
|
||||
{
|
||||
$this->id = $new_top_node->id;
|
||||
$this->_children = $new_top_node->getChildren();
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function _getSecureUrl($url, $secure) {
|
||||
if ($secure == -1) {
|
||||
$url = str_replace('https://', 'http://', $url);
|
||||
} elseif ($secure == 1) {
|
||||
$url = str_replace('http://', 'https://', $url);
|
||||
}
|
||||
return $url;
|
||||
}
|
||||
|
||||
function _getItemData(&$params, $item)
|
||||
{
|
||||
//Create the new Node
|
||||
$node = new RokNavMenuNode();
|
||||
|
||||
$tmp = null;
|
||||
// Menu Link is a special type that is a link to another item
|
||||
if ($item->type == 'menulink')
|
||||
{
|
||||
$site = new JSite();
|
||||
$menu = $site->getMenu();
|
||||
if ($newItem = $menu->getItem($item->query['Itemid'])) {
|
||||
$tmp = clone($newItem);
|
||||
$tmp->name = addslashes(htmlspecialchars($item->name, ENT_QUOTES, 'UTF-8'));
|
||||
$tmp->mid = $item->id;
|
||||
$tmp->parent = $item->parent;
|
||||
$tmp->params = $item->params;
|
||||
$tmp->url = null;
|
||||
$tmp->nav = 'current';
|
||||
$tmp->menualias = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ($item->type != 'menulink' || ($item->type == 'menulink' && $tmp == null)){
|
||||
$tmp = clone($item);
|
||||
$tmp->name = addslashes(htmlspecialchars($item->name, ENT_QUOTES, 'UTF-8'));
|
||||
$tmp->mid = $tmp->id;
|
||||
$tmp->url = null;
|
||||
$tmp->nav = 'current';
|
||||
$tmp->menualias = false;
|
||||
}
|
||||
|
||||
|
||||
$iParams = new JRegistry($tmp->params);
|
||||
|
||||
if ($params->get('menu_images') && $iParams->get('menu_image') && $iParams->get('menu_image') != -1) {
|
||||
$image = JURI::base(true).'/images/stories/'.$iParams->get('menu_image');
|
||||
if($tmp->ionly){
|
||||
$tmp->name = null;
|
||||
}
|
||||
} else {
|
||||
$image = null;
|
||||
}
|
||||
|
||||
|
||||
switch ($tmp->type)
|
||||
{
|
||||
case 'separator':
|
||||
$tmp->outtype = 'separator';
|
||||
break;
|
||||
case 'url':
|
||||
if ((strpos($tmp->link, 'index.php?') === 0) && (strpos($tmp->link, 'Itemid=') === false)) {
|
||||
$tmp->url = $tmp->link.'&Itemid='.$tmp->id;
|
||||
} else {
|
||||
$tmp->url = $tmp->link;
|
||||
}
|
||||
$tmp->outtype = 'menuitem';
|
||||
break;
|
||||
default :
|
||||
$router = JSite::getRouter();
|
||||
$tmp->url = $router->getMode() == JROUTER_MODE_SEF ? 'index.php?Itemid='.$tmp->id : $tmp->link.'&Itemid='.$tmp->id;
|
||||
$tmp->outtype = 'menuitem';
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if ($tmp->url != null)
|
||||
{
|
||||
// set the target based on menu item options
|
||||
switch ($tmp->browserNav)
|
||||
{
|
||||
case 0:
|
||||
$tmp->nav = 'current';
|
||||
break;
|
||||
case 1:
|
||||
$tmp->nav = 'new';
|
||||
break;
|
||||
case 2:
|
||||
$tmp->url = str_replace('index.php', 'index2.php', $tmp->url);
|
||||
$tmp->nav = 'newnotool';
|
||||
break;
|
||||
default:
|
||||
$tmp->nav = 'current';
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// Get the final URL
|
||||
if ($tmp->home == 1) {// Set Home Links to the Base
|
||||
$tmp->url = str_replace(array($tmp->route.'/', $tmp->route), '', JRoute::_( $tmp->url ));
|
||||
}
|
||||
|
||||
if ($tmp->type != 'separator' && $tmp->type != 'url') {
|
||||
$iSecure = $iParams->get('secure', 0);
|
||||
|
||||
if ($this->_params->get('url_type','relative') == 'full') {
|
||||
$url = JRoute::_($tmp->url, true, $iSecure);
|
||||
$base = (!preg_match("/^http/",$tmp->url))?rtrim(JURI::base(false), '/'):'';
|
||||
$routed = $base.$url;
|
||||
$secure = RokNavMenuTree::_getSecureUrl($routed,$iSecure);
|
||||
$tmp->url =$secure;
|
||||
} else {
|
||||
$tmp->url = JRoute::_($tmp->url, true, $iSecure);
|
||||
}
|
||||
}
|
||||
else if($tmp->type == 'url') {
|
||||
$tmp->url = str_replace('&', '&', $tmp->url);
|
||||
}
|
||||
else {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$node->id = $tmp->mid;
|
||||
$node->parent = $tmp->parent;
|
||||
$node->title = $tmp->name;
|
||||
$node->access = $tmp->access;
|
||||
$node->link = $tmp->url;
|
||||
$node->level = $item->sublevel;
|
||||
$node->image = $image;
|
||||
$node->alias = $tmp->alias;
|
||||
$node->nav = $tmp->nav;
|
||||
$node->displayType = $tmp->browserNav;
|
||||
|
||||
|
||||
$node->setParameters($tmp->params);
|
||||
$node->type = $tmp->outtype;
|
||||
$node->order = $item->ordering;
|
||||
$node->addListItemClass("item" . $node->id);
|
||||
$node->addSpanClass($tmp->outtype);
|
||||
return $node;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* RokNavMenuNode
|
||||
*/
|
||||
class RokNavMenuNode extends RokMenuTreeBase
|
||||
{
|
||||
// const TYPE_MENU_LINK = "menulink";
|
||||
// const TYPE_SEPARATOR = "separator";
|
||||
// const TYPE_MENU_ITEM = "menuitem";
|
||||
// const TYPE_URL = "url";
|
||||
//
|
||||
// const TARGET_CURRENT = "current";
|
||||
// const TARGET_NEW = "new";
|
||||
// const TARGET_NEW_NO_TOOLBAR = "newnotool";
|
||||
//
|
||||
// const CLASS_PARENT = "parent";
|
||||
// const CLASS_ACTIVE = "active";
|
||||
// const ID_CURRENT = "current";
|
||||
|
||||
|
||||
var $title = null;
|
||||
var $link = null;
|
||||
|
||||
var $image = null;
|
||||
var $alias = null;
|
||||
var $type = null;
|
||||
var $target = null;
|
||||
var $order = null;
|
||||
var $nav = null;
|
||||
var $displayType = null;
|
||||
var $menualias = false;
|
||||
|
||||
|
||||
var $_link_additions = array();
|
||||
var $_link_attribs = array();
|
||||
var $_li_classes = array();
|
||||
var $_a_classes = array();
|
||||
var $_span_classes = array();
|
||||
var $css_id = null;
|
||||
|
||||
|
||||
function hasLink() {
|
||||
return (isset($this->link));
|
||||
}
|
||||
|
||||
function getLink() {
|
||||
$outlink = $this->link;
|
||||
$outlink .= $this->getLinkAdditions(!strpos($this->link, '?'));
|
||||
return $outlink;
|
||||
}
|
||||
|
||||
function addLinkAddition($name ,$value) {
|
||||
$this->_link_additions[$name] = $value;
|
||||
}
|
||||
|
||||
function getLinkAdditions($starting_query = false, $starting_seperator = false){
|
||||
$link_additions = " ";
|
||||
reset($this->_link_additions);
|
||||
$i = 0;
|
||||
while (list($key, $value) = each($this->_link_additions)) {
|
||||
$link_additions .= (($i == 0) && $starting_query )?'?':'';
|
||||
$link_additions .= (($i == 0) && !$starting_query )?'&':'';
|
||||
$link_additions .= ($i > 0)?'&':'';
|
||||
$link_additions .= $key.'='.$value;
|
||||
$i++;
|
||||
}
|
||||
return rtrim(ltrim($link_additions));
|
||||
}
|
||||
|
||||
|
||||
|
||||
function hasLinkAdditions(){
|
||||
return count($this->_link_additions);
|
||||
}
|
||||
|
||||
function addLinkAttrib($name, $value) {
|
||||
$this->_link_attribs[$name] = $value;
|
||||
}
|
||||
|
||||
function getLinkAttribs(){
|
||||
$link_attribs = " ";
|
||||
reset($this->_link_attribs);
|
||||
while (list($key, $value) = each($this->_link_attribs)) {
|
||||
$link_attribs .= $key . "='" .$value . "' ";
|
||||
}
|
||||
return rtrim(ltrim($link_attribs));
|
||||
}
|
||||
|
||||
function hasLinkAttribs(){
|
||||
return count($this->_link_attribs);
|
||||
}
|
||||
|
||||
function getListItemClasses() {
|
||||
$html_classes = " ";
|
||||
reset($this->_li_classes);
|
||||
while (list($key, $value) = each($this->_li_classes)) {
|
||||
$class =& $this->_li_classes[$key];
|
||||
$html_classes .= $class. " ";
|
||||
}
|
||||
return rtrim(ltrim($html_classes));
|
||||
}
|
||||
|
||||
function addListItemClass($class) {
|
||||
$this->_li_classes[] = $class;
|
||||
}
|
||||
|
||||
function hasListItemClasses(){
|
||||
return count($this->_li_classes);
|
||||
}
|
||||
|
||||
|
||||
function getLinkClasses() {
|
||||
$html_classes = " ";
|
||||
reset($this->_a_classes);
|
||||
while (list($key, $value) = each($this->_a_classes)) {
|
||||
$class =& $this->_a_classes[$key];
|
||||
$html_classes .= $class. " ";
|
||||
}
|
||||
return rtrim(ltrim($html_classes));
|
||||
}
|
||||
|
||||
function addLinkClass($class) {
|
||||
$this->_a_classes[] = $class;
|
||||
}
|
||||
|
||||
function hasLinkClasses(){
|
||||
return count($this->_a_classes);
|
||||
}
|
||||
|
||||
function getSpanClasses() {
|
||||
$html_classes = " ";
|
||||
reset($this->_span_classes);
|
||||
while (list($key, $value) = each($this->_span_classes)) {
|
||||
$class =& $this->_span_classes[$key];
|
||||
$html_classes .= $class. " ";
|
||||
}
|
||||
return rtrim(ltrim($html_classes));
|
||||
}
|
||||
|
||||
function addSpanClass($class) {
|
||||
$this->_span_classes[] = $class;
|
||||
}
|
||||
function hasSpanClasses(){
|
||||
return count($this->_span_classes);
|
||||
}
|
||||
|
||||
function addChild(&$node) {
|
||||
if($node->isAccessable()) {
|
||||
|
||||
//$ret = parent::addChild($node);
|
||||
$ret = false;
|
||||
|
||||
if (!$node->isAccessable()){
|
||||
$ret = true;
|
||||
}
|
||||
if ( $this->id == $node->parent) {
|
||||
$node->_parentRef = &$this;
|
||||
$this->_children[$node->id] = $node;
|
||||
$ret = true;
|
||||
}
|
||||
else if ($this->hasChildren()) {
|
||||
reset($this->_children);
|
||||
while (list($key, $value) = each($this->_children)) {
|
||||
$child =& $this->_children[$key];
|
||||
if ($child->addChild($node)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($ret === true) {
|
||||
if (!array_search('parent', $this->_li_classes)) {
|
||||
$this->addListItemClass('parent');
|
||||
}
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
return true; // item is not accessable so return true to remove from the stack
|
||||
}
|
||||
}
|
||||
|
10
modules/mod_roknavmenu/lib/renderers/includes.php
Normal file
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: includes.php 4585 2012-10-27 01:44:54Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
require_once(dirname(__FILE__) . '/RokNavMenu2XRenderer.php');
|
||||
require_once(dirname(__FILE__) . '/RokNavMenu1XRenderer.php');
|
||||
require_once(dirname(__FILE__) . '/RokNavMenuTree.php');
|
1
modules/mod_roknavmenu/lib/renderers/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
25
modules/mod_roknavmenu/mod_roknavmenu.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: mod_roknavmenu.php 4585 2012-10-27 01:44:54Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
|
||||
$params->def('menutype', 'mainmenu');
|
||||
$params->def('class_sfx', '');
|
||||
$params->def('menu_images', 0);
|
||||
$params->def('startLevel', 0);
|
||||
$params->def('endLevel', 0);
|
||||
$params->def('showAllChildren', 0);
|
||||
|
||||
require_once(dirname(__FILE__)."/lib/includes.php");
|
||||
$rnm = new RokNavMenu($params->toArray());
|
||||
$rnm->initialize();
|
||||
$output = $rnm->render();
|
||||
$output = trim($output);
|
||||
echo $output;
|
110
modules/mod_roknavmenu/mod_roknavmenu.xml
Normal file
@ -0,0 +1,110 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<extension client="site" method="upgrade" type="module" version="2.5">
|
||||
<name>RokNavMenu</name>
|
||||
<author>RocketTheme, LLC</author>
|
||||
<creationDate>November 5, 2013</creationDate>
|
||||
<authorEmail>support@rockettheme.com</authorEmail>
|
||||
<authorUrl>http://www.rockettheme.com</authorUrl>
|
||||
<copyright>(C) 2005 - 2013 RocketTheme, LLC. All rights reserved.</copyright>
|
||||
<license>http://www.gnu.org/copyleft/gpl.html GNU/GPL</license>
|
||||
<version>2.0.7</version>
|
||||
<description>RocketTheme Customizable Navigation Menu</description>
|
||||
<scriptfile>install.script.php</scriptfile>
|
||||
<updateservers>
|
||||
<server name="RocketTheme Update Directory" priority="1" type="collection">http://updates.rockettheme.com/joomla/updates.xml</server>
|
||||
</updateservers>
|
||||
<files>
|
||||
<filename>install.script.php</filename>
|
||||
<filename module="mod_roknavmenu">mod_roknavmenu.php</filename>
|
||||
<folder>fields</folder>
|
||||
<filename>index.html</filename>
|
||||
<folder>themes</folder>
|
||||
<filename>en-GB.mod_roknavmenu.ini</filename>
|
||||
<folder>lib</folder>
|
||||
</files>
|
||||
<plugins>
|
||||
<plugin>/lib/RokNavMenuEvents.php</plugin>
|
||||
</plugins>
|
||||
<languages>
|
||||
<language tag="en-GB">en-GB.mod_roknavmenu.ini</language>
|
||||
</languages>
|
||||
<config>
|
||||
<fields name="params">
|
||||
<fieldset addfieldpath="/modules/mod_roknavmenu/fields" name="basic">
|
||||
<field description="MOD_MENU_FIELD_MENUTYPE_DESC" label="MOD_MENU_FIELD_MENUTYPE_LABEL" name="menutype" type="menu"/>
|
||||
<field hr="true" name="filteringspacer1" type="spacer"/>
|
||||
<field default="0" description="DESC.LIMIT_LEVELS" label="ROKNAVMENU.LABEL.LIMIT_LEVELS" name="limit_levels" type="list">
|
||||
<option value="1">Yes</option>
|
||||
<option value="0">No</option>
|
||||
</field>
|
||||
<field default="0" description="MOD_MENU_FIELD_STARTLEVEL_DESC" label="MOD_MENU_FIELD_STARTLEVEL_LABEL" name="startLevel" type="list">
|
||||
<option value="0">0</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 default="0" description="MOD_MENU_FIELD_ENDLEVEL_DESC" label="MOD_MENU_FIELD_ENDLEVEL_LABEL" name="endLevel" type="list">
|
||||
<option value="0">0</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 default="0" description="MOD_MENU_FIELD_ALLCHILDREN_DESC" label="MOD_MENU_FIELD_ALLCHILDREN_LABEL" name="showAllChildren" type="radio">
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field hr="true" name="filteringspacer1" type="spacer"/>
|
||||
<!--<field name="window_open" type="text" default="" label="Target Position" description="PARAMTARGETPOSITION" />-->
|
||||
<field default="" description="" label="" name="filteringspacer2" type="spacer"/>
|
||||
<field description="" label="Theme Options" name="spacer_themeoptions" type="break"/>
|
||||
|
||||
<field default="default" name="theme" type="hidden"/>
|
||||
<!--<field name="theme" type="themelist" default="/modules/mod_roknavmenu/themes/basic" label="ROKNAVMENU.LABEL.THEME" description="ROKNAVMENU.DESC.THEME" filter="" exclude="" hide_none="true" hide_default="true"/> -->
|
||||
<!--<field name="theme_options" type="themeparameters" label="ROKNAVMENU.LABEL.THEME_OPTIONS" description="ROKNAVMENU.DESC.THEME_OPTIONS" filter="" exclude="index.html"/>-->
|
||||
<!--<field name="template" type="templateinclude" label="ROKNAVMENU.LABEL.TEMPLATE_CONFIG" description="ROKNAVMENU.DESC.TEMPLATE_CONFIG"/>-->
|
||||
<field default="default.php" name="custom_layout" type="hidden"/>
|
||||
<field default="default.php" name="custom_formatter" type="hidden"/>
|
||||
<field label="Themes" name="theme" type="themelist"/>
|
||||
<field label="Theme Options" name="themeoptions" type="themeoptions"/>
|
||||
</fieldset>
|
||||
|
||||
<fieldset name="advanced">
|
||||
<field description="MOD_MENU_FIELD_TAG_ID_DESC" label="MOD_MENU_FIELD_TAG_ID_LABEL" name="tag_id" type="text"/>
|
||||
|
||||
<field description="MOD_MENU_FIELD_CLASS_DESC" label="MOD_MENU_FIELD_CLASS_LABEL" name="class_sfx" type="text"/>
|
||||
|
||||
<field description="MOD_MENU_FIELD_TARGET_DESC" label="MOD_MENU_FIELD_TARGET_LABEL" name="window_open" type="text"/>
|
||||
|
||||
<field description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" name="moduleclass_sfx" type="text"/>
|
||||
|
||||
<field default="0" name="cache" type="hidden">
|
||||
</field>
|
||||
<field default="1" description="COM_MODULES_FIELD_CACHING_DESC" label="COM_MODULES_FIELD_CACHING_LABEL" name="module_cache" type="list">
|
||||
<option value="1">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option>
|
||||
</field>
|
||||
<field default="900" description="COM_MODULES_FIELD_CACHE_TIME_DESC" label="COM_MODULES_FIELD_CACHE_TIME_LABEL" name="cache_time" type="text"/>
|
||||
<field default="itemid" name="cachemode" type="hidden">
|
||||
<option value="itemid"/>
|
||||
</field>
|
||||
|
||||
</fieldset>
|
||||
</fields>
|
||||
</config>
|
||||
</extension>
|
13
modules/mod_roknavmenu/themes/catalog.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: catalog.php 4585 2012-10-27 01:44:54Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
|
||||
require_once(dirname(__FILE__) . '/default/theme.php');
|
||||
RokNavMenu::registerTheme(dirname(__FILE__).'/default','default', 'Default', 'RokNavMenuDefaultTheme');
|
||||
|
||||
require_once(dirname(__FILE__) . '/fusion/theme.php');
|
||||
RokNavMenu::registerTheme(dirname(__FILE__).'/fusion','fusion', 'Default Fusion', 'RokNavMenuFusionTheme');
|
20
modules/mod_roknavmenu/themes/default/formatter.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: formatter.php 4585 2012-10-27 01:44:54Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
|
||||
if (!class_exists('RokNavMenuDefaultFormatter')) {
|
||||
class RokNavMenuDefaultFormatter extends AbstractJoomlaRokMenuFormatter {
|
||||
function format_subnode(&$node) {
|
||||
if ($node->getId() == $this->current_node) {
|
||||
$node->setCssId('current');
|
||||
}
|
||||
if (in_array($node->getId(), array_keys($this->active_branch))){
|
||||
$node->addListItemClass('active');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
1
modules/mod_roknavmenu/themes/default/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
1
modules/mod_roknavmenu/themes/default/js/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
@ -0,0 +1,17 @@
|
||||
/*
|
||||
* @version $Id: responsive-selectbox.js 8885 2013-03-28 17:38:51Z djamil $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
((function(){var a={cache:[],build:function(){var d=document.getElement("ul.gf-menu"),c=document.getElement(".gf-menu-device-container");
|
||||
if(!d||!c||d.retrieve("roknavmenu:dropdown:select")){return;}d.store("roknavmenu:dropdown:select",true);var b=new Element("select").inject(c,"top");a.getChildren(d,b,0);
|
||||
a.attachEvent(b);},getChildren:function(d,n,h){var e=d.getChildren().flatten(),c,o,r,p,b,k,m,j,q;for(var g=0,f=e.length;g<f;g++){r=e[g].getElement(".item");
|
||||
if(!r){continue;}b=e[g].className.replace(/\s/g,"-");if(a.cache.contains(b)){continue;}a.cache.push(b);o=r.getElement("em")||r.getElement("i");c=e[g].getElement("ul");
|
||||
p=e[g].getElement("ol");q=e[g].hasClass("active");k=r.get("text").clean();m=o?o.get("text").clean():"";if(k.length!=m.length){k=k.substr(0,(k.length-1)-(m.length-1));
|
||||
}j=new Element("option",{value:r.get("href"),text:"-".repeat(h)+" "+k}).inject(n);if(q){j.set("selected","selected");}if(c){if(c.getParent(".column")){a.getChildren(c.getParent(".dropdown").getElements(" > .column > ul"),n,h+1);
|
||||
}else{a.getChildren(c,n,h+1);}}if(p){a.getChildren(p,n,h+1);}}},attachEvent:function(b){b.addEvent("change",function(){window.location.href=this.value;
|
||||
});}};window.addEvent("domready",a.build);if(typeof ResponsiveMenu!="undefined"){ResponsiveMenu.implement({mediaQuery:function(d){var e=document.getElement(".gf-menu"),c=document.getElement(".gf-menu-device-container"),b=this.toggler.retrieve("roknavmenu:slide");
|
||||
if(!e&&!c){return;}if(d=="(min-width: 768px)"){e.setStyle("display","inherit");this.slide.wrapper.setStyle("display","none");this.toggler.setStyle("display","none");
|
||||
}else{e.setStyle("display","none");this.slide.wrapper.setStyle("display","inherit");this.toggler.setStyle("display","block");}b.hide();this.toggler.removeClass("active");
|
||||
}});}})());
|
16
modules/mod_roknavmenu/themes/default/js/responsive.js
Normal file
@ -0,0 +1,16 @@
|
||||
/*
|
||||
* @version $Id: responsive.js 4586 2012-10-27 01:50:24Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
((function(){var a=this.ResponsiveMenu=new Class({initialize:function(){this.build();
|
||||
this.attachEvents();this.mediaQuery(RokMediaQueries.getQuery());},build:function(){if(this.toggler){return this.toggler;}this.toggler=new Element("div.gf-menu-toggle").inject(document.body);
|
||||
(3).times(function(b){new Element("span.icon-bar").inject(this.toggler);},this);return this.toggler;},attachEvents:function(){var c=this.toggler.retrieve("roknavmenu:click",function(d){this.toggle.call(this,d,this.toggler);
|
||||
}.bind(this));this.toggler.addEvent("click",c);this.slide=this.toggler.retrieve("roknavmenu:slide",new Fx.Slide(document.getElement(".gf-menu-device-container"),{duration:350,hideOverflow:true,resetHeight:true,link:"cancel",onStart:function(){if(!this.open){this.wrapper.addClass("gf-menu-device-wrapper");
|
||||
}},onComplete:function(){if(this.open){this.wrapper.removeClass("gf-menu-device-wrapper");}}}).hide());try{RokMediaQueries.on("(max-width: 767px)",this.mediaQuery.bind(this));
|
||||
RokMediaQueries.on("(min-width: 768px)",this.mediaQuery.bind(this));}catch(b){if(typeof console!="undefined"){console.error('Error [Responsive Menu] while trying to add a RokMediaQuery "match" event',b);
|
||||
}}},toggle:function(c,d){var b=d.retrieve("roknavmenu:slide");d[b.open?"removeClass":"addClass"]("active");b[b.open?"slideOut":"slideIn"]();},mediaQuery:function(d){var e=document.getElement(".gf-menu"),c=document.getElement(".gf-menu-device-container"),b=this.toggler.retrieve("roknavmenu:slide");
|
||||
if(!e&&!c){return;}if(d=="(min-width: 768px)"){e.inject(b.wrapper,"after");this.slide.wrapper.setStyle("display","none");this.toggler.setStyle("display","none");
|
||||
}else{e.inject(c);this.slide.wrapper.setStyle("display","inherit");this.toggler.setStyle("display","block");}b.hide();this.toggler.removeClass("active");
|
||||
}});window.addEvent("domready",function(){this.RokNavMenu=new a();});})());
|
21
modules/mod_roknavmenu/themes/default/js/rokmediaqueries.js
Normal file
@ -0,0 +1,21 @@
|
||||
/*
|
||||
* @version $Id: rokmediaqueries.js 4586 2012-10-27 01:50:24Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
((function(){window.matchMedia=window.matchMedia||window.msMatchMedia||(function(e,f){var c,a=e.documentElement,b=a.firstElementChild||a.firstChild,d=e.createElement("body"),g=e.createElement("div");
|
||||
g.id="mq-test-1";g.style.cssText="position:absolute;top:-100em";d.style.background="none";d.appendChild(g);return function(h){g.innerHTML='­<style media="'+h+'"> #mq-test-1 { width: 42px; }</style>';
|
||||
a.insertBefore(d,b);c=g.offsetWidth==42;a.removeChild(d);return{matches:c,media:h,addListener:function(i){if(!Browser.ie9&&!window.opera){return"";}if(window.retrieve("rokmediaqueries:listener:"+h.replace(/[a-z]|[(|)|:|\s|-]/gi,""),false)){return;
|
||||
}window.store("rokmediaqueries:listener:"+h.replace(/[a-z]|[(|)|:|\s|-]/gi,""),true);window[window.addListener?"addListener":"attachEvent"]("resize",function(){var l={},k=0,j,m=false;
|
||||
h.replace(/(\w+-?\w+)\s?:\s?(\d+){1,}/g,function(o,s,q,p,r,n){l[s]=q;k++;});if(!k){return;}else{if(k==1){j=window.getSize();m=false;Object.each(l,function(n,o){if(o=="min-width"){m+=j.x>=n;
|
||||
}else{if(o=="max-width"){m+=j.x<=n;}else{if(o=="width"){m+=j.x==n;}}}});}else{if(k>1){j=window.getSize();m=true;Object.each(l,function(n,o){if(o=="min-width"){m*=j.x>=n;
|
||||
}else{if(o=="max-width"){m*=j.x<=n;}else{if(o=="width"){m*=j.x==n;}}}});}}}if(m){return i.call(i,h);}});}};};})(document);})());((function(c,b){if(typeof RokMediaQueries!="undefined"){return;
|
||||
}var a=new Class({Implements:[Events,Options],options:{queries:["(min-width: 1200px)","(min-width: 960px) and (max-width: 1199px)","(min-width: 768px) and (max-width: 959px)","(min-width: 481px) and (max-width: 767px)","(max-width: 480px)"]},initialize:function(d){this.setOptions(d);
|
||||
this.queries=this.options.queries;this.queriesEvents={};this.timers=[];for(var e=this.queries.length-1;e>=0;e--){var f=c.matchMedia(this.queries[e]);f.addListener(this._fireEvent.bind(this,this.queries[e]));
|
||||
this.queriesEvents[this.queries[e]]=[];}},on:function(f,d){if(f=="every"){for(var e=this.queries.length-1;e>=0;e--){this._addOnMatch(this.queries[e],d);
|
||||
}}else{this._addOnMatch(f,d);}},add:function(d){if(!this.queries.contains(d)){var e;this.queries.push(d);e=c.matchMedia(d);e.addListener(this._fireEvent.bind(this,d));
|
||||
}if(!this.queriesEvents[d]){this.queriesEvents[d]=[];}},getQuery:function(){var e="";for(var d=this.queries.length-1;d>=0;d--){if(c.matchMedia(this.queries[d]).matches){e=this.queries[d];
|
||||
break;}}return e;},_fireEvent:function(e){if(!c.matchMedia(e).matches||!Object.getLength(this.queriesEvents)||!this.queriesEvents[e]){return;}for(var d=this.queriesEvents[e].length-1;
|
||||
d>=0;d--){this.queriesEvents[e][d].delay(5,this,e);}},_addOnMatch:function(e,d){this.add(e);this.queriesEvents[e].push(d);}});c.RokMediaQueries=new a();
|
||||
})(window,document));
|
23
modules/mod_roknavmenu/themes/default/js/sidemenu.js
Normal file
@ -0,0 +1,23 @@
|
||||
/*
|
||||
* @version $Id: sidemenu.js 14307 2013-10-08 15:44:26Z djamil $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
((function(){var b=(function(){return !!("ontouchstart" in window);
|
||||
})(),a=navigator.userAgent.match(/iPad/i)!=null;var c=this.SideMenu=new Class({initialize:function(){this.build();this.mediaQuery(RokMediaQueries.getQuery());
|
||||
this.attachEvents();this.mediaQuery(RokMediaQueries.getQuery());},build:function(){if(this.toggler){return this.toggler;}this.toggler=new Element("div.gf-menu-toggle").inject(document.body);
|
||||
this.container=document.getElement(".gf-menu-device-container");this.wrapper=new Element("div.gf-menu-device-container-wrapper").inject(this.container);
|
||||
this.container=new Element("div.gf-menu-device-wrapper-sidemenu").wraps(this.container);this.menu=document.getElement(".gf-menu");this.originalPosition=this.menu.getParent();
|
||||
this.open=false;(3).times(function(){new Element("span.icon-bar").inject(this.toggler);},this);this.container.inject(document.body);return this.toggler;
|
||||
},attachEvents:function(){var e=this.toggler.retrieve("roknavmenu:click",function(f){f.preventDefault().stopPropagation();this.toggle.call(this,f,this.toggler);
|
||||
}.bind(this));this.toggler.addEvent("click",e);this.touchEvents={click:function(f){f.preventDefault();},touchstart:function(){this.store("touched",true);
|
||||
},touchcancel:function(f){f.preventDefault();this.store("touched",false);},touchmove:function(){this.store("touched",false);},touchend:function(f){console.log(this);
|
||||
if(!this.retrieve("touched",false)){f.preventDefault();}else{location.href=this.get("href");}}};try{RokMediaQueries.on("(max-width: 767px)",this.mediaQuery.bind(this));
|
||||
RokMediaQueries.on("(min-width: 768px)",this.mediaQuery.bind(this));}catch(d){if(typeof console!="undefined"){console.error('Error [Responsive Menu] while trying to add a RokMediaQuery "match" event',d);
|
||||
}}},attachTouchEvents:function(){if(b&&!a){$$(".responsive-type-panel .item").removeEvents().forEach(function(d){Object.forEach(this.touchEvents,function(f,e){d.addEventListener(e,f,false);
|
||||
});},this);}},detachTouchEvents:function(){if(b&&!a){$$(".responsive-type-panel .item").forEach(function(d){Object.forEach(this.touchEvents,function(f,e){d.removeEventListener(e,f,false);
|
||||
});},this);}},toggle:function(d,e){this.container[!this.open?"addClass":"removeClass"]("gf-sidemenu-size-left");document.body[!this.open?"addClass":"removeClass"]("gf-sidemenu-size-marginleft");
|
||||
e[!this.open?"addClass":"removeClass"]("active");this.open=!this.open;},mediaQuery:function(e){var f=this.menu,d=this.wrapper;if(!f&&!d){return;}if(e!="(min-width: 768px)"&&e!="(max-width: 767px)"){return;
|
||||
}if(e=="(min-width: 768px)"){f.inject(this.originalPosition);this.detachTouchEvents();this.toggler.setStyle("display","none");}else{f.inject(d);this.attachTouchEvents();
|
||||
this.toggler.setStyle("display","block");}this.toggler.removeClass("active");}});window.addEvent("domready",function(){this.RokNavMenu=new c();});})());
|
58
modules/mod_roknavmenu/themes/default/layout.php
Normal file
@ -0,0 +1,58 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: layout.php 4585 2012-10-27 01:44:54Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
if(!class_exists('RokMavMenuDefaultLayout')){
|
||||
class RokMavMenuDefaultLayout extends AbstractRokMenuLayout
|
||||
{
|
||||
|
||||
public function stageHeader()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function renderMenu(&$menu)
|
||||
{
|
||||
ob_start();
|
||||
?>
|
||||
<ul class = "menu<?php echo $this->args['class_sfx']; ?>" <?php if ($this->args['tag_id'] != null): ?>id="<?php echo $this->args['tag_id']; ?>"<?php endif; ?>>
|
||||
<?php foreach ($menu->getChildren() as $item) : ?>
|
||||
<?php $this->renderItem($item, $menu); ?>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php
|
||||
return ob_get_clean();
|
||||
}
|
||||
|
||||
protected function renderItem(JoomlaRokMenuNode &$item, &$menu)
|
||||
{
|
||||
?>
|
||||
<li <?php if ($item->hasListItemClasses()) : ?>class="<?php echo $item->getListItemClasses(); ?>"<?php endif; ?> <?php if (null != $item->getCssId()): ?>id="<?php echo $item->getCssId(); ?>"<?php endif; ?>>
|
||||
<?php if ($item->getType() == 'menuitem') : ?>
|
||||
<a <?php if ($item->hasLinkClasses()): ?>class="<?php echo $item->getLinkClasses(); ?>"<?php endif; ?> <?php if ($item->hasLink()): ?>href="<?php echo $item->getLink(); ?>"<?php endif; ?> <?php if (null != $item->getTarget()): ?>target="<?php echo $item->getTarget(); ?>"<?php endif; ?> <?php if ($item->hasLinkAttribs()): ?> <?php echo $item->getLinkAttribs(); ?><?php endif; ?>>
|
||||
<?php if (null != $item->getImage()): ?>
|
||||
<img alt="<?php echo $item->getAlias();?>" src="<?php echo $item->getImage();?>"/><?php endif; ?>
|
||||
<span <?php if ($item->hasSpanClasses()): ?>class="<?php echo $item->getSpanClasses(); ?>"<?php endif; ?>><?php echo $item->getTitle();?></span>
|
||||
</a>
|
||||
<?php elseif ($item->getType() == 'separator') : ?>
|
||||
<span <?php if ($item->hasSpanClasses()): ?>class="<?php echo $item->getSpanClasses(); ?>"<?php endif; ?>><?php echo $item->getTitle();?></span>
|
||||
<?php endif; ?>
|
||||
<?php if ($item->hasChildren()): ?>
|
||||
<ul>
|
||||
<?php foreach ($item->getChildren() as $child) : ?>
|
||||
<?php $this->renderItem($child, $menu); ?>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</li>
|
||||
<?php
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
22
modules/mod_roknavmenu/themes/default/theme.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: theme.php 4585 2012-10-27 01:44:54Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
class RokNavMenuDefaultTheme extends AbstractRokMenuTheme {
|
||||
|
||||
protected $defaults = array(
|
||||
);
|
||||
|
||||
public function getFormatter($args){
|
||||
require_once(dirname(__FILE__) . '/formatter.php');
|
||||
return new RokNavMenuDefaultFormatter($args);
|
||||
}
|
||||
|
||||
public function getLayout($args){
|
||||
require_once(dirname(__FILE__) . '/layout.php');
|
||||
return new RokMavMenuDefaultLayout($args);
|
||||
}
|
||||
}
|
49
modules/mod_roknavmenu/themes/fusion/css/fusion-ie6.css
Normal file
@ -0,0 +1,49 @@
|
||||
/*!
|
||||
* @version $Id: fusion-ie6.css 4586 2012-10-27 01:50:24Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
.menutop,.menutop *{margin:0;padding:0;}
|
||||
.menutop li a.item, .menutop li span.item {text-decoration:none;color:#333;}
|
||||
.menutop{float:left;position:relative;}
|
||||
.menutop li{float:left;list-style-image:none;list-style-position:outside;list-style-type:none;position:relative;vertical-align:top;}
|
||||
.menutop span.nolink{cursor:default;}
|
||||
.menutop li .item, .menutop .root .item {display:block;float:left;}
|
||||
.menutop li li .item,.menutop li.active li .item, .menutop .level2 .item, .menutop .level3 .item, .menutop .level4 .item{display:block;float:none;margin:0;text-decoration:none;}
|
||||
.menutop li ul{float:none;left:-999em;position:absolute;z-index:500;}
|
||||
.menutop li.sfHover li ul,.menutop li li.sfHover li ul,.menutop li li li.sfHover li ul{top:-999em;}
|
||||
.menutop li li{float:none;position:relative;width:100%;}
|
||||
.menutop li{height:30px;}
|
||||
.menutop li li, .menutop .level2 li, .menutop .level3 li, .menutop .level4 li{height:auto;}
|
||||
.menutop li .item {height:30px;line-height:30px;padding:0 15px;}
|
||||
.menutop .level2 .item, .menutop .level3 .item, .menutop .level4 .item {height:25px;line-height:25px;}
|
||||
.menutop li .item,.menutop li li .item,.menutop li li li .item,.menutop li li li li .item{background-image:none;}
|
||||
.menutop li .daddy,.menutop li.sfHover .daddy{background-image:url(../images/top-dark.png);background-position:100% 100%;background-repeat:no-repeat;}
|
||||
.menutop li.sfHover .daddy-sfHover{background-image:url(../images/top-light.png);background-position:100% 100%;}
|
||||
.menutop li li.sfHover .daddy-sfHover{background-position:100% 50%;}
|
||||
.menutop .item{color:#333333;text-decoration:none;}
|
||||
.menutop li .item{background-color:#DDDDDD;border-color:#EEEEEE #CCCCCC #CCCCCC #EEEEEE;border-style:solid;border-width:1px;color:#333;}
|
||||
.menutop li li .item,.menutop li.sfHover .item, .menutop .level2 li .item{background-color:#CCCCCC;border-color:#DDDDDD #BBBBBB #BBBBBB #DDDDDD;border-style:solid;border-width:1px;color:#333;}
|
||||
.menutop li.sfHover li .daddy,.menutop li li .daddy, .menutop .level2 li .daddy{background-image:url(../images/level2-parent.png);background-position:100% 50%;background-repeat:no-repeat;}
|
||||
.menutop li li li .item,.menutop li li.sfHover .item, .menutop .level3 li .item{background-color:#BBBBBB;border-color:#CCCCCC #AAAAAA #AAAAAA #CCCCCC;border-style:solid;border-width:1px;color:#333;}
|
||||
.menutop li li li .daddy,.menutop li li.sfHover .daddy, .menutop .level3 li .daddy{background-image:url(../images/level3-parent.png);background-position:100% 50%;background-repeat:no-repeat;}
|
||||
.menutop li li li li .item,.menutop li li li.sfHover .item, .menutop .level4 li .item{background-color:#AAAAAA;border-color:#BBBBBB #999999 #999999 #BBBBBB;border-style:solid;border-width:1px;color:#333;}
|
||||
.menutop li li li li .daddy,.menutop li li li.sfHover .daddy, .menutop .level4 li .daddy{background-image:url(../images/level4-parent.png);background-position:100% 50%;background-repeat:no-repeat;}
|
||||
|
||||
.menutop li.active .item-active,.menutop li li.active .item-active,.menutop li li li.active .item-active,.menutop li li li li.active .item-active, .menutop li.active .daddy-item-active, .menutop li li.active .daddy-item-active {background-color:#EE501C;border-color:#F86134 #D24916 #D24916 #F86134;border-style:solid;border-width:1px;color:#FFFFFF;}
|
||||
|
||||
.menutop li.active .daddy-item-active {background-image:url(../images/top-light.png);background-position:100% 100%;}
|
||||
.menutop li li.active .daddy-item-active, .menutop .level2 li.active .daddy-item-active, .menutop .level3 li.active .daddy-item-active, .menutop .level4 li.active .daddy-item-active {background-image:url(../images/active-parent.png);background-position:100% 50%;background-repeat:no-repeat;}
|
||||
|
||||
.menutop li.sfHover .item-sfHover,.menutop li li.sfHover .item-sfHover,.menutop li li li.sfHover .item-sfHover, .menutop .level2 li.sfHover .item-sfHover, .menutop .level3 li.sfHover .item-sfHover, .menutop .level4 li.sfHover .item-sfHover{background-color:#2C87C0;border-color:#138FDC #0D5F92 #0D5F92 #138FDC;border-style:solid;border-width:1px;color:#FFFFFF;}
|
||||
.menutop li li.sfHover .daddy-sfHover,.menutop li li li.sfHover .daddy-sfHover,.menutop li li li li.sfHover .daddy-sfHover, .menutop .level2 li.sfHover .daddy-sfHover, .menutop .level3 li.sfHover .daddy-sfHover, .menutop .level4 li.sfHover .daddy-sfHover{background-image:url(../images/hover-parent.png);background-position:100% 50%;background-repeat:no-repeat;}
|
||||
.menutop li.sfHover span.item-sfHover,.menutop li li.sfHover span.item-sfHover,.menutop li li li.sfHover span.item-sfHover, .menutop .level2 li.sfHover span.item-sfHover, , .menutop .level3 li.sfHover span.item-sfHover, , .menutop .level4 li.sfHover span.item-sfHover{background-color:#666666;border-color:#777777 #555555 #555555 #777777;border-style:solid;border-width:1px;color:#FFFFFF;}
|
||||
.menutop li li.sfHover span.daddy-sfHover,.menutop li li li.sfHover span.daddy-sfHover,.menutop li li li li.sfHover span.daddy-sfHover, .menutop .level2 li.sfHover span.daddy-sfHover {background-image:url(../images/sep-parent.png);background-position:100% 50%;background-repeat:no-repeat;}
|
||||
.menutop li li .item{height:auto;line-height:1.2em;padding:0;}
|
||||
.menutop li li .item span{display:block;padding:0 5px;}
|
||||
.menutop li.sfHover ul{left:0;top:32px;}
|
||||
.menutop ul{width:175px;}
|
||||
.menutop li li.sfHover ul,.menutop li li li.sfHover ul,.menutop li li li li.sfHover ul{left:175px;top:0;}
|
||||
|
||||
.fusion-js-container {position:absolute !important;}
|
93
modules/mod_roknavmenu/themes/fusion/css/fusion.css
Normal file
@ -0,0 +1,93 @@
|
||||
/*!
|
||||
* @version $Id: fusion.css 4586 2012-10-27 01:50:24Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
body {font-family:Helvetica,Arial,sans-serif;font-size:12px;}
|
||||
|
||||
/* CORE */
|
||||
|
||||
.menutop,.menutop * {margin:0;padding:0;}
|
||||
.menutop {float:left;position:relative;padding-bottom:2px;}
|
||||
.menutop li {list-style:none;position:relative;width:100%;height:25px;float:none;}
|
||||
.menutop li a.item {cursor:pointer;}
|
||||
.menutop li span.item {cursor:default;outline:none;}
|
||||
.menutop li .item {display:block;float:left;display:block;margin:0;height:25px;line-height:25px;}
|
||||
.menutop li li .item,
|
||||
.menutop li .item, .menutop li.active li .item {display:block;margin:0;text-decoration:none;float:none;}
|
||||
.menutop li .fusion-submenu-wrapper, .menutop li ul {float: none;left: -999em;position: absolute;z-index: 500;}
|
||||
.menutop li:hover li ul, .menutop li.sfHover li ul {top: -999em;}
|
||||
.menutop li:hover ul, .menutop li.sfHover ul {top: 0;}
|
||||
.menutop li li {position:relative;float:none;}
|
||||
|
||||
/* Drop Downs */
|
||||
.menutop ul {width:175px;position:relative;}
|
||||
|
||||
/* Level 1 */
|
||||
.menutop li .item {text-decoration:none;display:block;padding:0 15px;background:#ddd;border-color:#eee #ccc #ccc #eee;border-style:solid;border-width:1px;color:#333333;text-decoration:none;}
|
||||
|
||||
.level1 .f-mainparent-itemfocus .item {background:#ccc 100% 100% no-repeat;border-color:#ddd #bbb #bbb #ddd;border-style:solid;border-width:1px;}
|
||||
|
||||
.menutop li:hover > .item {background-color:#ccc;border-top:1px solid #ddd;border-left:1px solid #ddd;border-right:1px solid #bbb;border-bottom:1px solid #bbb;}
|
||||
.menutop li:hover > .daddy:hover {background-image:url(../images/top-light.png);background-position: 100% 100%;}
|
||||
|
||||
/* Level 2 */
|
||||
.menutop .level2 li > .item {background:#ccc;border-color:#ddd #bbb #bbb #ddd;border-style:solid;border-width:1px;}
|
||||
.menutop .level2 li:hover > .daddy, .menutop .level2 li > .daddy {background-image:url(../images/level2-parent.png);background-position:100% 50%;background-repeat:no-repeat;}
|
||||
|
||||
.menutop .level2 .f-menuparent-itemfocus .item, .menutop .level2 li:hover .item {background:#bbb;border-color:#ccc #aaa #aaa #ccc;color:#333;}
|
||||
.menutop .level2 .f-menuparent-itemfocus .daddy, .menutop .level2 li:hover .daddy {background-image:url(../images/level3-parent.png);background-position:100% 50%;background-repeat:no-repeat;}
|
||||
|
||||
|
||||
/* Level 3 */
|
||||
.menutop .level3 li > .item {background:#bbb;border-color:#ccc #aaa #aaa #ccc;border-style:solid;border-width:1px;}
|
||||
.menutop .level3 li:hover > .daddy, .menutop .level3 li > .daddy {background-image:url(../images/level3-parent.png);background-position:100% 50%;background-repeat:no-repeat;}
|
||||
|
||||
.menutop .level3 .f-menuparent-itemfocus .item, .menutop .level3 li:hover .item {background:#aaa;border-color:#bbb #999 #999 #bbb;color:#333;}
|
||||
.menutop .level3 .f-menuparent-itemfocus .daddy, .menutop .level3 li:hover .daddy {background-image:url(../images/level4-parent.png);background-position:100% 50%;background-repeat:no-repeat;}
|
||||
|
||||
/* Level 4 */
|
||||
.menutop .level4 li > .item {background:#aaa;border-color:#bbb #999 #999 #bbb;border-style:solid;border-width:1px;}
|
||||
.menutop .level4 li:hover > .daddy, .menutop .level4 li > .daddy {background-image:url(../images/level4-parent.png);background-position:100% 50%;background-repeat:no-repeat;}
|
||||
|
||||
.menutop .level4 .f-menuparent-itemfocus .item, .menutop .level4 li:hover .item {background:#999;border-color:#aaa #888 #888 #aaa;color:#333;}
|
||||
|
||||
/* regular hover */
|
||||
.menutop li:hover .item:hover, .menutop li.active .item:hover {background-color:#2c87c0;border-top:1px solid #138fdc;border-left:1px solid #138fdc;border-right:1px solid #0d5f92;border-bottom:1px solid #0d5f92;color:#fff}
|
||||
.menutop li:hover .daddy:hover, .menutop ul li.active:hover > .daddy:hover {background-image:url(../images/hover-parent.png);background-repeat: no-repeat;background-position: 100% 50%;}
|
||||
|
||||
/* seperator hover */
|
||||
.menutop span.item:hover,
|
||||
.menutop li:hover span.item:hover {background-color:#666;border-top:1px solid #777;border-left:1px solid #777;border-right:1px solid #555;border-bottom:1px solid #555;color:#fff}
|
||||
.menutop li:hover span.daddy:hover {background-image:url(../images/sep-parent.png);background-repeat: no-repeat;background-position: 100% 50%;}
|
||||
|
||||
/* Root Items */
|
||||
.menutop li.root {width:auto;float:left;height:30px;}
|
||||
.menutop li.root > .item {float:left;width: auto;height:30px;line-height:30px;}
|
||||
.menutop li.root:hover > .daddy:hover {background-image:url(../images/top-light.png);background-position: 100% 100%;}
|
||||
.menutop li.root > .daddy, .menutop li.root:hover > .daddy {background-image: url(../images/top-dark.png); background-position: 100% 100%; background-repeat: no-repeat;}
|
||||
|
||||
/* Active Items */
|
||||
.menutop li.active > .item {background-color:#EE501C;border-color:#F86134 #D24916 #D24916 #F86134;color:#fff;}
|
||||
.menutop li.active > .daddy {background-image:url(../images/active-parent.png);background-repeat: no-repeat;background-position: 100% 50%;}
|
||||
.menutop li.root.active > .daddy, .menutop li.root.active:hover > .daddy {background-image:url(../images/top-light.png);background-position: 100% 100%;}
|
||||
|
||||
|
||||
/* No JS */
|
||||
.menutop li:hover > .fusion-submenu-wrapper, .menutop li:hover > ul {left:170px;top:0;}
|
||||
.menutop li.root:hover > .fusion-submenu-wrapper, .menutop li.root:hover > ul {top:32px;left:0;}
|
||||
.menutop li:hover ul,
|
||||
.menutop li.sfHover ul {left: 0;top:32px;}
|
||||
.menutop ul {width:175px;}
|
||||
.menutop li li:hover > ul, .menutop li li.sfHover > ul {left:175px;top: 0;}
|
||||
|
||||
.menutop .level2 li {position:relative;float:left;width:100%;}
|
||||
|
||||
/* Fusion Pill */
|
||||
.fusion-pill-l {height: 35px;margin:0 0 0 12px;top:6px;width:50px;position:absolute;left:0;}
|
||||
.fusion-pill-r {margin-left: -12px;height: 35px;}
|
||||
|
||||
/* Fusion JS */
|
||||
.fusion-js-container {display:block;height:0;left:0;overflow:visible;position:absolute;top:0;z-index:600000!important;background:transparent !important;}
|
||||
.fusion-js-subs {display:none;margin:0 0 0 -2px;overflow:hidden;padding:0 2px;position:absolute;}
|
1
modules/mod_roknavmenu/themes/fusion/css/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
28
modules/mod_roknavmenu/themes/fusion/formatter.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: formatter.php 4585 2012-10-27 01:44:54Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
// no direct access
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class RokNavMenuFusionFormatter extends AbstractJoomlaRokMenuFormatter {
|
||||
function format_subnode(&$node) {
|
||||
// Format the current node
|
||||
|
||||
if ($node->getType() == 'menuitem' or $node->getType() == 'separator') {
|
||||
if ($node->hasChildren() ) {
|
||||
$node->addLinkClass("daddy");
|
||||
}
|
||||
$node->addLinkClass("item");
|
||||
}
|
||||
if ($node->getLevel() == "0") {
|
||||
$node->addListItemClass("root");
|
||||
}
|
||||
}
|
||||
}
|
BIN
modules/mod_roknavmenu/themes/fusion/images/active-parent.png
Normal file
After Width: | Height: | Size: 234 B |
BIN
modules/mod_roknavmenu/themes/fusion/images/hover-parent.png
Normal file
After Width: | Height: | Size: 234 B |
1
modules/mod_roknavmenu/themes/fusion/images/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
BIN
modules/mod_roknavmenu/themes/fusion/images/level1-parent.png
Normal file
After Width: | Height: | Size: 228 B |
BIN
modules/mod_roknavmenu/themes/fusion/images/level2-parent.png
Normal file
After Width: | Height: | Size: 228 B |
BIN
modules/mod_roknavmenu/themes/fusion/images/level3-parent.png
Normal file
After Width: | Height: | Size: 228 B |
BIN
modules/mod_roknavmenu/themes/fusion/images/level4-parent.png
Normal file
After Width: | Height: | Size: 228 B |
BIN
modules/mod_roknavmenu/themes/fusion/images/parents.png
Normal file
After Width: | Height: | Size: 478 B |
BIN
modules/mod_roknavmenu/themes/fusion/images/sep-parent.png
Normal file
After Width: | Height: | Size: 234 B |
BIN
modules/mod_roknavmenu/themes/fusion/images/top-dark.png
Normal file
After Width: | Height: | Size: 219 B |
BIN
modules/mod_roknavmenu/themes/fusion/images/top-light.png
Normal file
After Width: | Height: | Size: 219 B |
1
modules/mod_roknavmenu/themes/fusion/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
132
modules/mod_roknavmenu/themes/fusion/js/fusion.js
Normal file
@ -0,0 +1,132 @@
|
||||
/*
|
||||
* @version $Id: fusion.js 14422 2013-10-10 18:10:04Z djamil $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
((function(){var b=navigator.userAgent.match(/iPad/i)!=null;
|
||||
var a=new Class({Implements:[Options],version:"1.9.8",options:{centered:false,tweakInitial:{x:0,y:0},tweakSubsequent:{x:0,y:0},tweakSizes:{width:0,height:0},pill:true,direction:{x:"right",y:"down"},effect:"slide and fade",orientation:"horizontal",opacity:1,hideDelay:50000,menuFx:{duration:500,transition:"quad:out"},pillFx:{duration:400,transition:"back:out"}},initialize:function(j,q){this.element=$$(j)[0];
|
||||
this.id=$$(".fusion")[0];if(this.id){this.id=this.id.id;}else{this.id="";}this.setOptions(q);var n=this.element.getElements(".item"),e=this.options,l=Browser.Platform.ios?"mouseover":"mouseenter",k=Browser.Platform.ios?"mouseout":"mouseleave";
|
||||
this.rtl=document.id(document.body).getStyle("direction")=="rtl";this.options.tweakSubsequent.x-=this.options.tweakSizes.width/2;this.options.tweakSubsequent.y-=this.options.tweakSizes.height/2;
|
||||
if(this.rtl){this.options.direction.x="left";this.options.tweakInitial.x*=-1;this.options.tweakSubsequent.x*=-1;}if(this.options.pill){var h=new Element("div",{"class":"fusion-pill-l"}).inject(this.element,"after").setStyle("display","none"),p=this;
|
||||
new Element("div",{"class":"fusion-pill-r"}).inject(h);this.pillsRoots=this.element.getElements(".root");var g=this.element.getElement(".active");this.pillsMargins=h.getStyle("margin-left").toInt()+h.getStyle("margin-right").toInt();
|
||||
this.pillsTopMargins=h.getStyle("margin-top").toInt()+h.getStyle("margin-bottom").toInt();if(!g){this.options.pill=false;}else{h.setStyle("display","block");
|
||||
this.pillsDefaults={left:g.offsetLeft,width:g.offsetWidth-this.pillsMargins,top:g.offsetTop};this.pillFx=new Fx.Morph(h,{duration:e.pillFx.duration,transition:e.pillFx.transition,link:"cancel"}).set(this.pillsDefaults);
|
||||
var f=this.pillsRoots.filter(function(r){return !r.hasClass("parent");});$$(f).addEvent(l,function(){p.ghostRequest=true;p.pillFx.start({left:this.offsetLeft,width:this.offsetWidth-p.pillsMargins,top:this.offsetTop});
|
||||
}).addEvent(k,function(){p.ghostRequest=false;p.pillFx.start(p.pillsDefaults);});}}this.parentLinks={};this.parentSubMenus={};this.childMenu={};this.menuType={};
|
||||
this.subMenus=[];this.hideAllMenusTimeout=null;this.subMenuZindex=1;n.each(function(u,s){u.getCustomID();this.parentLinks[u.id]=u.getParent().getParents("li").getElement(".item");
|
||||
this.childMenu[u.id]=u.getNext(".fusion-submenu-wrapper")||u.getNext("ul")||u.getNext("ol");if(this.childMenu[u.id]){u.fusionSize=this.childMenu[u.id].getCoordinates();
|
||||
}if(this.childMenu[u.id]&&Browser.ie){var r=this.childMenu[u.id].getElement("ul");if(r){var v=r.getStyle("padding-bottom").toInt()||0;u.fusionSize.height+=v;
|
||||
}}var t="subseq";if(document.id(u.getParent(".fusion-submenu-wrapper")||u.getParent("ul")||u.getParent("ol"))===this.element){t="init";}this.menuType[u.id]=t;
|
||||
},this);this.jsContainer=new Element("div",{"class":"fusion-js-container menutop"}).inject(document.body);this.jsContainer.addEvent(l,function(){window.RTFUSION=true;
|
||||
}).addEvent(k,function(){window.RTFUSION=false;});var o=this.element.className.replace("menutop","");if(this.id.length){this.jsContainer.id=this.id;}if(o.length){var m="fusion-js-container "+o+" menutop";
|
||||
this.jsContainer.className=m.clean();}var i=this.element.getElements(".fusion-submenu-wrapper");if(!i.length){i=this.element.getElements("ul");}i.each(function(s,r){var t=s.getElements(".item")[r];
|
||||
if(t&&this.parentLinks[t.id].length==1){t=this.parentLinks[t.id].getLast().getParents("li")[0];}var u=new Element("div",{"class":"fusion-js-subs"}).inject(this.jsContainer).adopt(s);
|
||||
if(t&&t.hasClass("active")){s.getParent().addClass("active");}},this);this.jsContainer.getElements(".item").setProperty("tabindex","-1");n.each(function(u,s){if(!this.childMenu[u.id]){return;
|
||||
}this.childMenu[u.id]=this.childMenu[u.id].getParent("div");this.subMenus.include(this.childMenu[u.id]);var r=[];this.parentLinks[u.id].each(function(w,v){r.push(this.childMenu[w.id]);
|
||||
},this);this.parentSubMenus[u.id]=r;var t=new c(this.options,this,u);},this);}});var c=new Class({Implements:[Options],options:{onSubMenuInit_begin:(function(e){}),onSubMenuInit_complete:(function(e){}),onMatchWidth_begin:(function(e){}),onMatchWidth_complete:(function(e){}),onHideSubMenu_begin:(function(e){}),onHideSubMenu_complete:(function(e){}),onHideOtherSubMenus_begin:(function(e){}),onHideOtherSubMenus_complete:(function(e){}),onHideAllSubMenus_begin:(function(e){}),onHideAllSubMenus_complete:(function(e){}),onPositionSubMenu_begin:(function(e){}),onPositionSubMenu_complete:(function(e){}),onShowSubMenu_begin:(function(e){}),onShowSubMenu_complete:(function(e){})},root:null,btn:null,hidden:true,myEffect:null,initialize:function(g,f,h){this.setOptions(g);
|
||||
this.root=f;this.btn=document.id(h);this.childMenu=document.id(f.childMenu[h.id]);this.subMenuType=f.menuType[h.id];this.parentSubMenus=$$(f.parentSubMenus[h.id]);
|
||||
this.parentLinks=$$(f.parentLinks[h.id]);this.parentSubMenu=document.id(this.parentSubMenus[0]);this.otherSubMenus={};this.fxMorph={};this.rtl=f.rtl;this.options.tweakInitial=this.root.options.tweakInitial;
|
||||
this.options.tweakSubsequent=this.root.options.tweakSubsequent;this.options.centered=this.root.options.centered;this.childMenu.fusionStatus="closed";this.options.onSubMenuInit_begin(this);
|
||||
this.childMenu.addEvent("hide",this.hideSubMenu.bind(this));this.childMenu.addEvent("show",this.showSubMenu.bind(this));var k=this.childMenu,e=Browser.Platform.ios?"mouseover":"mouseenter",i=Browser.Platform.ios?"mouseout":"mouseleave";
|
||||
if(this.options.effect){this.myEffect=new Fx.Morph(this.childMenu.getFirst(),{duration:this.options.menuFx.duration,transition:this.options.menuFx.transition,link:"cancel",onStart:function(){this.element.setStyle("display","block");
|
||||
},onComplete:function(){if(k.fusionStatus=="closed"){if(!Browser.ie){k.setStyle("display","none");}else{this.element.setStyle("display","none");}}}});}if(this.options.effect=="slide"||this.options.effect=="slide and fade"){if(this.subMenuType=="init"&&this.options.orientation=="horizontal"){this.myEffect.set({"margin-top":"0"});
|
||||
}else{if(!this.rtl){this.myEffect.set({"margin-left":"0"});}else{this.myEffect.set({"margin-right":"0"});}}}else{if(this.options.effect=="fade"||this.options.effect=="slide and fade"){this.myEffect.set({opacity:0});
|
||||
}}if(this.options.effect!="fade"&&this.options.effect!="slide and fade"){this.myEffect.set({opacity:this.options.opacity});}var j=document.id(this.childMenu).getElements(".item").filter(function(m,l){return !f.childMenu[m.id];
|
||||
});j.each(function(o,l){document.id(o).getParent().addClass("f-submenu-item");var n=o.getParent();var m=o.getParents("li").length;if(m<2&&!n.hasClass("fusion-grouped")){n.addEvent(e,function(p){this.childMenu.fireEvent("show");
|
||||
if(!b){this.cancellHideAllSubMenus();this.hideOtherSubMenus();}}.bind(this));n.addEvent(i,function(p){this.cancellHideAllSubMenus();this.hideAllSubMenus();
|
||||
}.bind(this));n.addEvents({focus:function(p){this.childMenu.fireEvent("show");this.cancellHideAllSubMenus();this.hideOtherSubMenus();}.bind(this),blur:function(p){this.cancellHideAllSubMenus();
|
||||
this.hideAllSubMenus();}.bind(this)});}else{n.addEvent(e,function(p){this.childMenu.fireEvent("show");this.cancellHideAllSubMenus();if(!n.hasClass("fusion-grouped")){this.hideOtherSubMenus();
|
||||
}}.bind(this)).addEvent(i,function(p){}.bind(this));}},this);this.btn.removeClass("fusion-submenu-item");if(this.subMenuType=="init"){this.btn.getParent().addClass("f-main-parent");
|
||||
}else{this.btn.getParent().addClass("f-parent-item");}this.btn.getParent().addEvent(e,function(l){this.cancellHideAllSubMenus();this.hideOtherSubMenus();
|
||||
this.showSubMenu();if(this.subMenuType=="init"&&this.options.mmbClassName&&this.options.mmbFocusedClassName){if(!this.fxMorph[this.btn.id]){this.fxMorph[this.btn.id]={};
|
||||
}if(!this.fxMorph[this.btn.id]["btnMorph"]){this.fxMorph[this.btn.id]["btnMorph"]=new Fx.Morph(this.btn,{duration:this.options.menuFx.duration,transition:this.options.menuFx.transition,link:"cancel"});
|
||||
}this.fxMorph[this.btn.id]["btnMorph"].start(this.options.mmbFocusedClassName);}}.bind(this)).addEvent(i,function(l){this.cancellHideAllSubMenus();this.hideAllSubMenus(this.btn,this.btn.getParent().getParent().get("tag")=="ol");
|
||||
}.bind(this)).addEvents({focus:function(l){this.cancellHideAllSubMenus();this.hideOtherSubMenus();this.showSubMenu();if(this.subMenuType=="init"&&this.options.mmbClassName&&this.options.mmbFocusedClassName){if(!this.fxMorph[this.btn.id]){this.fxMorph[this.btn.id]={};
|
||||
}if(!this.fxMorph[this.btn.id]["btnMorph"]){this.fxMorph[this.btn.id]["btnMorph"]=new Fx.Morph(this.btn,{duration:this.options.menuFx.duration,transition:this.options.menuFx.transition,link:"cancel"});
|
||||
}this.fxMorph[this.btn.id]["btnMorph"].start(this.options.mmbFocusedClassName);}}.bind(this),blur:function(l){this.cancellHideAllSubMenus();this.hideAllSubMenus();
|
||||
}.bind(this)});this.options.onSubMenuInit_complete(this);},matchWidth:function(){if(this.widthMatched||this.subMenuType==="subseq"){return;}this.options.onMatchWidth_begin(this);
|
||||
var e=this.btn.getCoordinates().width;this.childMenu.getElements(".item").each(function(i,h){var g=parseFloat(this.childMenu.getFirst().getStyle("border-left-width"))+parseFloat(this.childMenu.getFirst().getStyle("border-right-width"));
|
||||
var f=parseFloat(i.getStyle("padding-left"))+parseFloat(i.getStyle("padding-right"));var j=g+f;if(e>i.getCoordinates().width){i.setStyle("width",e-j);i.setStyle("margin-right",-g);
|
||||
}}.bind(this));this.width=this.btn.fusionSize.width;this.widthMatched=true;this.options.onMatchWidth_complete(this);},hideSubMenu:function(){if(this.childMenu.fusionStatus==="closed"){return;
|
||||
}this.options.onHideSubMenu_begin(this);if(this.subMenuType=="init"){if(this.options.mmbClassName&&this.options.mmbFocusedClassName){if(!this.fxMorph[this.btn.id]){this.fxMorph[this.btn.id]={};
|
||||
}if(!this.fxMorph[this.btn.id]["btnMorph"]){this.fxMorph[this.btn.id]["btnMorph"]=new Fx.Morph(this.btn,{duration:this.options.menuFx.duration,transition:this.options.menuFx.transition,link:"cancel"});
|
||||
}this.fxMorph[this.btn.id]["btnMorph"].start(this.options.mmbClassName).chain(function(){this.btn.getParent().removeClass("f-mainparent-itemfocus");this.btn.getParent().addClass("f-mainparent-item");
|
||||
}.bind(this));}else{this.btn.getParent().removeClass("f-mainparent-itemfocus");this.btn.getParent().addClass("f-mainparent-item");}}else{this.btn.getParent().removeClass("f-menuparent-itemfocus");
|
||||
this.btn.getParent().addClass("f-menuparent-item");}this.childMenu.setStyle("z-index",1);if(this.options.effect&&this.options.effect.toLowerCase()==="slide"){if(this.subMenuType=="init"&&this.options.orientation=="horizontal"&&this.options.direction.y=="down"){this.myEffect.start({"margin-top":-this.height}).chain(function(){if(this.childMenu.fusionStatus=="closed"){if(!Browser.ie){this.myEffect.set({display:"none"});
|
||||
}else{this.myEffect.element.setStyle("display","none");}}}.bind(this));}else{if(this.subMenuType=="init"&&this.options.orientation=="horizontal"&&this.options.direction.y=="up"){this.myEffect.start({"margin-top":this.height}).chain(function(){if(this.childMenu.fusionStatus=="closed"){if(!Browser.ie){this.myEffect.set({display:"none"});
|
||||
}else{this.myEffect.element.setStyle("display","none");}}}.bind(this));}else{if(this.options.direction.x=="right"){if(!this.rtl){tmp={"margin-left":-this.width};
|
||||
}else{tmp={"margin-right":this.width};}this.myEffect.start(tmp).chain(function(){if(this.childMenu.fusionStatus=="closed"){if(!Browser.ie){this.myEffect.set({display:"none"});
|
||||
}else{this.myEffect.element.setStyle("display","none");}}}.bind(this));}else{if(this.options.direction.x=="left"){if(!this.rtl){tmp={"margin-left":this.width};
|
||||
}else{tmp={"margin-right":-this.width};}this.myEffect.start(tmp).chain(function(){if(this.childMenu.fusionStatus=="closed"){if(!Browser.ie){this.myEffect.set({display:"none"});
|
||||
}else{this.myEffect.element.setStyle("display","none");}}}.bind(this));}}}}}else{if(this.options.effect=="fade"){this.myEffect.start({opacity:0}).chain(function(){if(this.childMenu.fusionStatus=="closed"){if(!Browser.ie){this.myEffect.set({display:"none"});
|
||||
}else{this.myEffect.element.setStyle("display","none");}}}.bind(this));}else{if(this.options.effect=="slide and fade"){if(this.subMenuType=="init"&&this.options.orientation=="horizontal"&&this.options.direction.y=="down"){this.myEffect.start({"margin-top":-this.height,opacity:0}).chain(function(){if(this.childMenu.fusionStatus=="closed"){if(!Browser.ie){this.myEffect.set({display:"none"});
|
||||
}else{this.myEffect.element.setStyle("display","none");}}}.bind(this));}else{if(this.subMenuType=="init"&&this.options.orientation=="horizontal"&&this.options.direction.y=="up"){this.myEffect.start({"margin-top":this.height,opacity:0}).chain(function(){if(this.childMenu.fusionStatus=="closed"){if(!Browser.ie){this.myEffect.set({display:"none"});
|
||||
}else{this.myEffect.element.setStyle("display","none");}}}.bind(this));}else{if(this.options.direction.x=="right"){if(!this.rtl){tmp={"margin-left":-this.width,opacity:0};
|
||||
}else{tmp={"margin-right":this.width,opacity:0};}this.myEffect.start(tmp).chain(function(){if(this.childMenu.fusionStatus=="closed"){if(!Browser.ie){this.myEffect.set({display:"none"});
|
||||
}else{this.myEffect.element.setStyle("display","none");}}}.bind(this));}else{if(this.options.direction.x=="left"){if(!this.rtl){tmp={"margin-left":this.width,opacity:0};
|
||||
}else{tmp={"margin-right":-this.width,opacity:0};}this.myEffect.start(tmp).chain(function(){if(this.childMenu.fusionStatus=="closed"){if(!Browser.ie){this.myEffect.set({display:"none"});
|
||||
}else{this.myEffect.element.setStyle("display","none");}}}.bind(this));}}}}}else{if(!Browser.ie){this.myEffect.set({display:"none"});}else{this.myEffect.element.setStyle("display","none");
|
||||
}}}}this.childMenu.fusionStatus="closed";this.options.onHideSubMenu_complete(this);},hideOtherSubMenus:function(){this.options.onHideOtherSubMenus_begin(this);
|
||||
if(!this.otherSubMenus[this.btn.id]){this.otherSubMenus[this.btn.id]=$$(this.root.subMenus.filter(function(e){return !this.root.parentSubMenus[this.btn.id].contains(e)&&e!=this.childMenu;
|
||||
}.bind(this)));}this.parentSubMenus.fireEvent("show");this.otherSubMenus[this.btn.id].fireEvent("hide");this.options.onHideOtherSubMenus_complete(this);
|
||||
},hideAllSubMenus:function(e,f){this.options.onHideAllSubMenus_begin(this);clearTimeout(this.root.hideAllMenusTimeout);this.root.hideAllMenusTimeout=(function(){if(!window.RTFUSION){clearTimeout(this.hideAllMenusTimeout);
|
||||
this.myEffect.cancel();if(this.root.options.pill&&!this.root.ghostRequest){this.root.pillFx.start(this.root.pillsDefaults);}if(f){var g=$$(this.root.subMenus).filter(function(h){return !h.hasChild(e);
|
||||
});$$(g).fireEvent("hide");}else{$$(this.root.subMenus).fireEvent("hide");}}}).bind(this).delay(this.options.hideDelay);this.options.onHideAllSubMenus_complete(this);
|
||||
},cancellHideAllSubMenus:function(){clearTimeout(this.root.hideAllMenusTimeout);},showSubMenu:function(e){if(this.root.options.pill&&this.subMenuType=="init"){this.root.ghostRequest=false;
|
||||
this.root.pillFx.start({left:this.btn.getParent().offsetLeft,width:this.btn.getParent().offsetWidth-this.root.pillsMargins,top:this.btn.getParent().offsetTop});
|
||||
}if(this.childMenu.fusionStatus==="open"){return;}this.options.onShowSubMenu_begin(this);if(this.subMenuType=="init"){this.btn.getParent().removeClass("f-mainparent-item");
|
||||
this.btn.getParent().addClass("f-mainparent-itemfocus");}else{this.btn.getParent().removeClass("f-menuparent-item");this.btn.getParent().addClass("f-menuparent-itemfocus");
|
||||
}this.root.subMenuZindex++;this.childMenu.setStyles({display:"block",visibility:"hidden","z-index":this.root.subMenuZindex});if(!this.width||!this.height){this.width=this.btn.fusionSize.width;
|
||||
this.height=this.btn.fusionSize.height;this.childMenu.getFirst().setStyle("height",this.height,"border");if(this.options.effect=="slide"||this.options.effect=="slide and fade"){if(this.subMenuType=="init"&&this.options.orientation=="horizontal"){this.childMenu.getFirst().setStyle("margin-top","0");
|
||||
if(this.options.direction.y=="down"){this.myEffect.set({"margin-top":-this.height});}else{if(this.options.direction.y=="up"){this.myEffect.set({"margin-top":this.height});
|
||||
}}}else{if(this.options.direction.x=="left"){if(!this.rtl){tmp={"margin-left":this.width};}else{tmp={"margin-right":-this.width};}this.myEffect.set(tmp);
|
||||
}else{if(!this.rtl){tmp={"margin-left":-this.width};}else{tmp={"margin-right":this.width};}this.myEffect.set(tmp);}}}}this.matchWidth();this.positionSubMenu();
|
||||
this.fixedHeader=document.body.hasClass("fixedheader-1");if(this.fixedHeader&&!this.scrollingEvent){this.scrollingEvent=true;window.addEvent("scroll",function(){this.positionSubMenu();
|
||||
}.bind(this));this.positionSubMenu();}if(this.options.effect=="slide"){this.childMenu.setStyles({display:"block",visibility:"visible"});if(this.subMenuType==="init"&&this.options.orientation==="horizontal"){if(e){this.myEffect.set({"margin-top":0}).chain(function(){this.showSubMenuComplete();
|
||||
}.bind(this));}else{this.myEffect.start({"margin-top":0}).chain(function(){this.showSubMenuComplete();}.bind(this));}}else{if(!this.rtl){tmp={"margin-left":0};
|
||||
}else{tmp={"margin-right":0};}if(e){this.myEffect.set(tmp).chain(function(){this.showSubMenuComplete();}.bind(this));}else{this.myEffect.start(tmp).chain(function(){this.showSubMenuComplete();
|
||||
}.bind(this));}}}else{if(this.options.effect=="fade"){if(e){this.myEffect.set({opacity:this.options.opacity}).chain(function(){this.showSubMenuComplete();
|
||||
}.bind(this));}else{this.myEffect.start({opacity:this.options.opacity}).chain(function(){this.showSubMenuComplete();}.bind(this));}}else{if(this.options.effect=="slide and fade"){this.childMenu.setStyles({display:"block",visibility:"visible"});
|
||||
this.childMenu.getFirst().setStyles({left:0});if(this.subMenuType=="init"&&this.options.orientation=="horizontal"){if(e){this.myEffect.set({"margin-top":0,opacity:this.options.opacity}).chain(function(){this.showSubMenuComplete();
|
||||
}.bind(this));}else{this.myEffect.start({"margin-top":0,opacity:this.options.opacity}).chain(function(){this.showSubMenuComplete();}.bind(this));}}else{if(!this.rtl){tmp={"margin-left":0,opacity:this.options.opacity};
|
||||
}else{tmp={"margin-right":0,opacity:this.options.opacity};}if(e){if(this.options.direction.x=="right"){this.myEffect.set(tmp).chain(function(){this.showSubMenuComplete();
|
||||
}.bind(this));}else{if(this.options.direction.x=="left"){this.myEffect.set(tmp).chain(function(){this.showSubMenuComplete();}.bind(this));}}}else{if(this.options.direction.x=="right"){this.myEffect.set({"margin-left":-this.width,opacity:this.options.opacity});
|
||||
this.myEffect.start(tmp).chain(function(){this.showSubMenuComplete();}.bind(this));}else{if(this.options.direction.x=="left"){this.myEffect.set({"margin-left":this.width,opacity:this.options.opacity});
|
||||
this.myEffect.start(tmp).chain(function(){this.showSubMenuComplete();}.bind(this));}}}}}else{this.childMenu.setStyles({display:"block",visibility:"visible"});
|
||||
this.showSubMenuComplete(this);}}}this.childMenu.fusionStatus="open";},showSubMenuComplete:function(){this.options.onShowSubMenu_complete(this);},positionSubMenu:function(){this.options.onPositionSubMenu_begin(this);
|
||||
var q=this.childMenu.getStyle("padding-bottom").toInt()+this.options.tweakSizes.height;var e=this.options.tweakSizes.width;if(!Browser.opera||!Browser.firefox||!Browser.safari){e=0;
|
||||
q=0;}if(!this.rtl){this.childMenu.setStyles({width:this.width+this.options.tweakSizes.width,"padding-bottom":this.options.tweakSizes.height,"padding-top":this.options.tweakSizes.height/2,"padding-left":this.options.tweakSizes.width/2});
|
||||
}else{this.childMenu.setStyles({width:this.width+this.options.tweakSizes.width,"padding-bottom":this.options.tweakSizes.height,"padding-top":this.options.tweakSizes.height/2,"padding-right":this.options.tweakSizes.width/2});
|
||||
}this.childMenu.getFirst().setStyle("width",this.width);if(this.subMenuType=="subseq"){this.options.direction.x="right";this.options.direction.xInverse="left";
|
||||
this.options.direction.y="down";this.options.direction.yInverse="up";if(this.rtl){this.options.direction.x="left";this.options.direction.xInverse="right";
|
||||
}}var l;var n;if(this.subMenuType=="init"){if(this.options.direction.y=="up"){if(this.options.orientation=="vertical"){l=this.btn.getCoordinates().bottom-this.height+this.options.tweakInitial.y;
|
||||
}else{l=this.btn.getCoordinates().top-this.height+this.options.tweakInitial.y;}this.childMenu.style.top=l+"px";}else{if(this.options.orientation=="horizontal"){this.childMenu.style.top=this.btn.getCoordinates().bottom+this.options.tweakInitial.y+"px";
|
||||
}else{if(this.options.orientation=="vertical"){l=this.btn.getPosition().y+this.options.tweakInitial.y;if((l+this.childMenu.getSize2().y)>=document.body.getScrollSize2().y){n=(l+this.childMenu.getSize2().y)-document.body.getScrollSize2().y;
|
||||
l=l-n-20;}this.childMenu.style.top=l+"px";}}}if(this.options.orientation=="horizontal"){var h=this.btn.getPosition().x+this.options.tweakInitial.x,f=0;
|
||||
if(this.rtl){var o=0;if(this.btn.getStyle("margin-left").toInt()<0&&!this.options.centered){o=this.btn.getParent().getPosition().x+this.options.tweakInitial.x;
|
||||
}else{if(this.btn.getStyle("margin-left").toInt()<0&&this.options.centered){o=this.btn.getPosition().x-this.options.tweakInitial.x;}else{o=this.btn.getPosition().x;
|
||||
}}h=o+this.btn.getSize2().x-this.childMenu.getSize2().x;}if(this.options.centered){f=0;var p=this.btn.getSize2().x;if(this.btn.getStyle("margin-left").toInt()<0&&!this.rtl){f=Math.abs(this.btn.getStyle("margin-left").toInt())-Math.abs(this.btn.getFirst().getStyle("padding-left").toInt());
|
||||
}else{f=Math.abs(this.btn.getStyle("margin-right").toInt())-Math.abs(this.btn.getFirst().getStyle("padding-right").toInt());}var m=this.childMenu.getSize2().x;
|
||||
p+=f;var k=Math.max(p,m),g=Math.min(p,m);size=(k-g)/2;if(!this.rtl){h-=size;}else{h+=size;}}this.childMenu.style.left=h+"px";}else{if(this.options.direction.x=="left"){this.childMenu.style.left=this.btn.getPosition().x-this.childMenu.getCoordinates().width+this.options.tweakInitial.x+"px";
|
||||
}else{if(this.options.direction.x=="right"){this.childMenu.style.left=this.btn.getCoordinates().right+this.options.tweakInitial.x+"px";}}}}else{if(this.subMenuType=="subseq"){if(this.options.direction.y==="down"){if((this.btn.getCoordinates().top+this.options.tweakSubsequent.y+this.childMenu.getSize2().y)>=document.body.getScrollSize2().y){n=(this.btn.getCoordinates().top+this.options.tweakSubsequent.y+this.childMenu.getSize2().y)-document.body.getScrollSize2().y;
|
||||
this.childMenu.style.top=(this.btn.getCoordinates().top+this.options.tweakSubsequent.y)-n-20+"px";}else{this.childMenu.style.top=this.btn.getCoordinates().top+this.options.tweakSubsequent.y+"px";
|
||||
}}else{if(this.options.direction.y==="up"){if((this.btn.getCoordinates().bottom-this.height+this.options.tweakSubsequent.y)<1){this.options.direction.y="down";
|
||||
this.options.direction.yInverse="up";this.childMenu.style.top=this.btn.getCoordinates().top+this.options.tweakSubsequent.y+"px";}else{this.childMenu.style.top=this.btn.getCoordinates().bottom-this.height+this.options.tweakSubsequent.y+"px";
|
||||
}}}if(this.options.direction.x=="left"){this.childMenu.style.left=this.btn.getCoordinates().left-this.childMenu.getCoordinates().width+this.options.tweakSubsequent.x+"px";
|
||||
if(this.childMenu.getPosition().x<0){this.options.direction.x="right";this.options.direction.xInverse="left";this.childMenu.style.left=this.btn.getPosition().x+this.btn.getCoordinates().width+this.options.tweakSubsequent.x+"px";
|
||||
if(this.options.effect==="slide"||this.options.effect==="slide and fade"){if(!this.rtl){tmp={"margin-left":-this.width,opacity:this.options.opacity};}else{tmp={"margin-right":this.width,opacity:this.options.opacity};
|
||||
}this.myEffect.set(tmp);}}}else{if(this.options.direction.x=="right"){this.childMenu.style.left=this.btn.getCoordinates().right+this.options.tweakSubsequent.x+"px";
|
||||
var i=this.childMenu.getCoordinates().right;var j=document.body.getSize2().x+window.getScroll2().x;if(i>j){this.options.direction.x="left";this.options.direction.xInverse="right";
|
||||
this.childMenu.style.left=this.btn.getCoordinates().left-this.childMenu.getCoordinates().width-this.options.tweakSubsequent.x+"px";if(this.options.effect=="slide"||this.options.effect=="slide and fade"){if(!this.rtl){tmp={"margin-left":this.width,opacity:this.options.opacity};
|
||||
}else{tmp={"margin-right":-this.width,opacity:this.options.opacity};}this.myEffect.set(tmp);}}}}}}this.options.onPositionSubMenu_complete(this);}});Element.implement({getCustomID:function(){if(!this.id){var e=this.get("tag")+"-"+Date.now()+Number.random(0,1000);
|
||||
this.id=e;}return this.id;}});Element.implement({getSize2:function(){if((/^(?:body|html)$/i).test(this.tagName)){return this.getWindow().getSize();}return{x:this.offsetWidth,y:this.offsetHeight};
|
||||
},getScrollSize2:function(){if((/^(?:body|html)$/i).test(this.tagName)){return this.getWindow().getScrollSize();}return{x:this.scrollWidth,y:this.scrollHeight};
|
||||
},getScroll2:function(){if((/^(?:body|html)$/i).test(this.tagName)){return this.getWindow().getScroll();}return{x:this.scrollLeft,y:this.scrollTop};}});
|
||||
[Document,Window].each(function(e){e.implement({getSize2:function(){return this.getSize();},getScroll2:function(){return this.getScroll();},getScrollSize2:function(){return this.getScrollSize();
|
||||
}});});if(!Browser.Engine){if(Browser.Platform.ios){Browser.Platform.ios=true;}Browser.Engine={};var d=function(f,e){Browser.Engine.name=f;Browser.Engine[f+e]=true;
|
||||
Browser.Engine.version=e;};if(Browser.ie){Browser.ie=true;switch(Browser.version){case 6:d("trident",4);break;case 7:d("trident",5);break;case 8:d("trident",6);
|
||||
}}if(Browser.firefox){Browser.firefox=true;if(Browser.version>=3){d("gecko",19);}else{d("gecko",18);}}if(Browser.safari||Browser.chrome){Browser.safari=true;
|
||||
switch(Browser.version){case 2:d("webkit",419);break;case 3:d("webkit",420);break;case 4:d("webkit",525);}}if(Browser.opera){Browser.opera=true;if(Browser.version>=9.6){d("presto",960);
|
||||
}else{if(Browser.version>=9.5){d("presto",950);}else{d("presto",925);}}}if(Browser.name=="unknown"){switch((ua.match(/(?:webkit|khtml|gecko)/)||[])[0]){case"webkit":case"khtml":Browser.safari=true;
|
||||
break;case"gecko":Browser.firefox=true;}}}window.Fusion=a;})());
|
1
modules/mod_roknavmenu/themes/fusion/js/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
14
modules/mod_roknavmenu/themes/fusion/js/sfhover-ie.js
Normal file
@ -0,0 +1,14 @@
|
||||
/*
|
||||
* @version $Id: sfhover-ie.js 4586 2012-10-27 01:50:24Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
var sfHover=function(c,e){if(!e){e="sfHover";
|
||||
}var a="sfActive";var b=$$("."+c).getElements("li");b[0].each(function(f){var g=f.getFirst();if(g){b[0].push(g);}});var d=$$("."+c).getElements("li.active");
|
||||
if(d[0]&&d[0].length){d=d[0];d.each(function(h){var j=h.getFirst();if(j){j.addClass("active");var g=j.getProperty("class").split(" ");var f=[];for(i=1,l=g.length;
|
||||
i<l;i++){f.push(g[0]+"-"+g[i]);}f.push(g.join("-"));f.each(function(k){j.addClass(k);});}});}if(!b.length){return false;}b.each(function(f){f.addEvents({mouseenter:function(){var h=this.getProperty("class").split(" ");
|
||||
h=h.filter(function(j){return !j.test("-"+e)&&!j.test("-"+a);});h.each(function(j){if(this.hasClass(j)){this.addClass(j+"-"+e);}},this);var g=h.join("-")+"-"+e;
|
||||
if(!this.hasClass(g)){this.addClass(g);}this.addClass(e);},mouseleave:function(){var h=this.getProperty("class").split(" ");h=h.filter(function(j){return j.test("-"+e);
|
||||
});h.each(function(j){if(this.hasClass(j)){this.removeClass(j);}},this);var g=h.join("-")+"-"+e;if(!this.hasClass(g)){this.removeClass(g);}this.removeClass(e);
|
||||
}});});};window.addEvent("domready",function(){sfHover("menutop");});
|
14
modules/mod_roknavmenu/themes/fusion/js/sfhover.js
Normal file
@ -0,0 +1,14 @@
|
||||
/*
|
||||
* @version $Id: sfhover.js 4586 2012-10-27 01:50:24Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
var sfHover=function(c,e){if(!e){e="sfHover";
|
||||
}var a="sfActive";var b=$$("."+c).getElements("li");b[0].each(function(f){var g=f.getFirst();if(g){b[0].push(g);}});var d=$$("."+c).getElements("li.active");
|
||||
if(d[0]&&d[0].length){d=d[0];d.each(function(h){var j=h.getFirst();if(j){j.addClass("active");var g=j.getProperty("class").split(" ");var f=[];for(i=1,l=g.length;
|
||||
i<l;i++){f.push(g[0]+"-"+g[i]);}f.push(g.join("-"));f.each(function(k){j.addClass(k);});}});}if(!b.length){return false;}b.each(function(f){f.addEvents({mouseenter:function(){var h=this.getProperty("class").split(" ");
|
||||
h=h.filter(function(j){return !j.test("-"+e)&&!j.test("-"+a);});h.each(function(j){if(this.hasClass(j)){this.addClass(j+"-"+e);}},this);var g=h.join("-")+"-"+e;
|
||||
if(!this.hasClass(g)){this.addClass(g);}this.addClass(e);},mouseleave:function(){var h=this.getProperty("class").split(" ");h=h.filter(function(j){return j.test("-"+e);
|
||||
});h.each(function(j){if(this.hasClass(j)){this.removeClass(j);}},this);var g=h.join("-")+"-"+e;if(!this.hasClass(g)){this.removeClass(g);}this.removeClass(e);
|
||||
}});});};window.addEvent("domready",function(){sfHover("menutop");});
|
@ -0,0 +1 @@
|
||||
SAMPLE_PARAMTER_LABEL=Show Subtext
|
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
1
modules/mod_roknavmenu/themes/fusion/language/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
106
modules/mod_roknavmenu/themes/fusion/layout.php
Normal file
@ -0,0 +1,106 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: layout.php 4585 2012-10-27 01:44:54Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
if(!class_exists('RokMavMenuFusionLayout')){
|
||||
class RokMavMenuFusionLayout extends AbstractRokMenuLayout
|
||||
{
|
||||
protected $theme_path;
|
||||
protected $params;
|
||||
|
||||
public function __construct(&$args)
|
||||
{
|
||||
parent::__construct($args);
|
||||
|
||||
$this->theme_path = JPATH_SITE . "/modules/mod_roknavmenu/themes/fusion";
|
||||
$this->args['theme_path'] = $this->theme_path;
|
||||
$this->args['theme_rel_path'] = JURI::root(true) . str_replace(JPATH_SITE, '', $this->theme_path);
|
||||
$this->args['theme_url'] = $this->args['theme_rel_path'];
|
||||
}
|
||||
|
||||
public function stageHeader()
|
||||
{
|
||||
if ($this->args['roknavmenu_fusion_effect'] == 'slidefade') $this->args['roknavmenu_fusion_effect'] = "slide and fade";
|
||||
$this->addScript('js/sfhover.js');
|
||||
|
||||
if ($this->browser->name == "ie" && $this->args['roknavmenu_fusion_effect'] == 'slide and fade') $this->args['roknavmenu_fusion_effect'] = "slide";
|
||||
|
||||
if ($this->args['roknavmenu_fusion_enable_js']) {
|
||||
JHtml::_('behavior.framework', true);
|
||||
$this->addScript('js/fusion.js');
|
||||
ob_start();
|
||||
?>
|
||||
window.addEvent('domready', function() {
|
||||
new Fusion('ul.menutop', {
|
||||
pill: <?php echo $this->args['roknavmenu_fusion_pill']; ?>,
|
||||
effect: '<?php echo $this->args['roknavmenu_fusion_effect']; ?>',
|
||||
opacity: <?php echo $this->args['roknavmenu_fusion_opacity']; ?>,
|
||||
hideDelay: <?php echo $this->args['roknavmenu_fusion_hidedelay']; ?>,
|
||||
centered: <?php echo $this->args['roknavmenu_fusion_centeredOffset']; ?>,
|
||||
tweakInitial: {'x': <?php echo $this->args['roknavmenu_fusion_tweakInitial_x']; ?>, 'y': <?php echo $this->args['roknavmenu_fusion_tweakInitial_y']; ?>},
|
||||
tweakSubsequent: {'x': <?php echo $this->args['roknavmenu_fusion_tweakSubsequent_x']; ?>, 'y': <?php echo $this->args['roknavmenu_fusion_tweakSubsequent_y']; ?>},
|
||||
tweakSizes: {'width': <?php echo $this->args['roknavmenu_fusion_tweak-width']; ?>, 'height': <?php echo $this->args['roknavmenu_fusion_tweak-height']; ?>},
|
||||
menuFx: {duration: <?php echo $this->args['roknavmenu_fusion_menu_duration']; ?>, transition: Fx.Transitions.<?php echo $this->args['roknavmenu_fusion_menu_animation']; ?>},
|
||||
pillFx: {duration: <?php echo $this->args['roknavmenu_fusion_pill_duration']; ?>, transition: Fx.Transitions.<?php echo $this->args['roknavmenu_fusion_pill_animation']; ?>}
|
||||
});
|
||||
});
|
||||
<?php
|
||||
$inline = ob_get_clean();
|
||||
$this->appendInlineScript($inline);
|
||||
}
|
||||
if ($this->args['roknavmenu_fusion_load_css']) {
|
||||
$this->addStyle("css/fusion.css");
|
||||
}
|
||||
}
|
||||
|
||||
protected function renderItem(JoomlaRokMenuNode &$item, RokMenuNodeTree &$menu)
|
||||
{
|
||||
?>
|
||||
<li <?php if ($item->hasListItemClasses()) : ?>class="<?php echo $item->getListItemClasses(); ?>"<?php endif; ?> <?php if ($item->hasCssId() && $this->args['roknavmenu_fusion_enable_current_id']): ?>id="<?php echo $item->css_id; ?>"<?php endif; ?>>
|
||||
<?php if ($item->getType() == 'menuitem') : ?>
|
||||
<a <?php if ($item->hasLinkClasses()): ?>class="<?php echo $item->getLinkClasses(); ?>"<?php endif; ?> <?php if ($item->hasLink()): ?>href="<?php echo $item->getLink(); ?>"<?php endif; ?> <?php if ($item->hasTarget()): ?>target="<?php echo $item->getTarget(); ?>"<?php endif; ?> <?php if ($item->hasAttribute('onclick')): ?>onclick="<?php echo $item->getAttribute('onclick'); ?>"<?php endif; ?><?php if ($item->hasLinkAttribs()): ?> <?php echo $item->getLinkAttribs(); ?><?php endif; ?>>
|
||||
<?php if ($item->hasImage()): ?>
|
||||
<img alt="<?php echo $item->getAlias; ?>" src="<?php echo $item->getImage(); ?>"/><?php endif; ?>
|
||||
<span><?php echo $item->getTitle();?></span>
|
||||
</a>
|
||||
<?php elseif ($item->getType() == 'separator') : ?>
|
||||
<span <?php if ($item->hasLinkClasses()): ?>class="<?php echo $item->getLinkClasses(); ?> nolink"<?php endif; ?>>
|
||||
<span><?php echo $item->getTitle();?></span>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
<?php if ($item->hasChildren()): ?>
|
||||
<ul class="level<?php echo intval($item->getLevel()) + 2; ?>">
|
||||
<?php foreach ($item->getChildren() as $child) : ?>
|
||||
<?php $this->renderItem($child, $menu); ?>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</li>
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function renderMenu(&$menu)
|
||||
{
|
||||
ob_start();
|
||||
?>
|
||||
<div id="horizmenu-surround">
|
||||
<ul class="menutop level1" <?php if ($this->args['tag_id'] != null): ?>id="<?php echo$this->args['tag_id']; ?>"<?php endif; ?>>
|
||||
<?php foreach ($menu->getChildren() as $item) : ?>
|
||||
<?php $this->renderItem($item, $menu); ?>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php
|
||||
return ob_get_clean();
|
||||
}
|
||||
}
|
||||
}
|
112
modules/mod_roknavmenu/themes/fusion/parameters.xml
Normal file
@ -0,0 +1,112 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
@version $Id: parameters.xml 4585 2012-10-27 01:44:54Z btowles $
|
||||
@author RocketTheme http://www.rockettheme.com
|
||||
@copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
@license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
-->
|
||||
<form>
|
||||
<subfields name="roknavmenu-themes">
|
||||
<fieldset name="fusion">
|
||||
<field name="roknavmenu_fusion_load_css" type="radio" default="1" label="Load CSS" description="">
|
||||
<option value="0">No</option>
|
||||
<option value="1">Yes</option>
|
||||
</field>
|
||||
<field name="roknavmenu_fusion_enable_js" type="radio" default="0" label="Enable JavaScript" description="Enable the JavaScript Effects">
|
||||
<option value="0">No</option>
|
||||
<option value="1">Yes</option>
|
||||
</field>
|
||||
<field name="roknavmenu_fusion_opacity" type="text" default="1" label="Menu Opacity" description="When JavaScript is enabled, this is the menu maximum opacity. Goes from 0.1 to 1" />
|
||||
<field name="roknavmenu_fusion_effect" type="list" default="slidefade" label="Menu Effect" description="When JavaScript is enabled, this is the type of effect for the menu.">
|
||||
<option value="slide">Slide</option>
|
||||
<option value="slidefade">Slide and Fade</option>
|
||||
</field>
|
||||
<field name="roknavmenu_fusion_hidedelay" type="text" default="500" label="Hide Delay" description="When JavaScript is enabled, this is the timeout in milliseconds for the menu to close." />
|
||||
<field name="roknavmenu_fusion_menu_animation" type="list" default="Quad.easeOut" label="Menu Animation" description="When JavaScript is enabled, this is the menu animation">
|
||||
<option value="linear">linear</option>
|
||||
<option value="Quad.easeOut">Quad.easeOut</option>
|
||||
<option value="Quad.easeIn">Quad.easeIn</option>
|
||||
<option value="Quad.easeInOut">Quad.easeInOut</option>
|
||||
<option value="Cubic.easeOut">Cubic.easeOut</option>
|
||||
<option value="Cubic.easeIn">Cubic.easeIn</option>
|
||||
<option value="Cubic.easeInOut">Cubic.easeInOut</option>
|
||||
<option value="Quart.easeOut">Quart.easeOut</option>
|
||||
<option value="Quart.easeIn">Quart.easeIn</option>
|
||||
<option value="Quart.easeInOut">Quart.easeInOut</option>
|
||||
<option value="Quint.easeOut">Quint.easeOut</option>
|
||||
<option value="Quint.easeIn">Quint.easeIn</option>
|
||||
<option value="Quint.easeInOut">Quint.easeInOut</option>
|
||||
<option value="Expo.easeOut">Expo.easeOut</option>
|
||||
<option value="Expo.easeIn">Expo.easeIn</option>
|
||||
<option value="Expo.easeInOut">Expo.easeInOut</option>
|
||||
<option value="Circ.easeOut">Circ.easeOut</option>
|
||||
<option value="Circ.easeIn">Circ.easeIn</option>
|
||||
<option value="Circ.easeInOut">Circ.easeInOut</option>
|
||||
<option value="Sine.easeOut">Sine.easeOut</option>
|
||||
<option value="Sine.easeIn">Sine.easeIn</option>
|
||||
<option value="Sine.easeInOut">Sine.easeInOut</option>
|
||||
<option value="Back.easeOut">Back.easeOut</option>
|
||||
<option value="Back.easeIn">Back.easeIn</option>
|
||||
<option value="Back.easeInOut">Back.easeInOut</option>
|
||||
<option value="Bounce.easeOut">Bounce.easeOut</option>
|
||||
<option value="Bounce.easeIn">Bounce.easeIn</option>
|
||||
<option value="Bounce.easeInOut">Bounce.easeInOut</option>
|
||||
<option value="Elastic.easeOut">Elastic.easeOut</option>
|
||||
<option value="Elastic.easeIn">Elastic.easeIn</option>
|
||||
<option value="Elastic.easeInOut">Elastic.easeInOut</option>
|
||||
</field>
|
||||
<field name="roknavmenu_fusion_menu_duration" type="text" default="400" label="Menu Duration" description="" />
|
||||
|
||||
<field name="roknavmenu_fusion_pill" type="radio" default="0" label="Enable Pill" description="Enable the Pill animation">
|
||||
<option value="0">No</option>
|
||||
<option value="1">Yes</option>
|
||||
</field>
|
||||
<field name="roknavmenu_fusion_pill_animation" type="list" default="Back.easeOut" label="Pill Animation" description="When JavaScript is enabled, this is the pill animation">
|
||||
<option value="linear">linear</option>
|
||||
<option value="Quad.easeOut">Quad.easeOut</option>
|
||||
<option value="Quad.easeIn">Quad.easeIn</option>
|
||||
<option value="Quad.easeInOut">Quad.easeInOut</option>
|
||||
<option value="Cubic.easeOut">Cubic.easeOut</option>
|
||||
<option value="Cubic.easeIn">Cubic.easeIn</option>
|
||||
<option value="Cubic.easeInOut">Cubic.easeInOut</option>
|
||||
<option value="Quart.easeOut">Quart.easeOut</option>
|
||||
<option value="Quart.easeIn">Quart.easeIn</option>
|
||||
<option value="Quart.easeInOut">Quart.easeInOut</option>
|
||||
<option value="Quint.easeOut">Quint.easeOut</option>
|
||||
<option value="Quint.easeIn">Quint.easeIn</option>
|
||||
<option value="Quint.easeInOut">Quint.easeInOut</option>
|
||||
<option value="Expo.easeOut">Expo.easeOut</option>
|
||||
<option value="Expo.easeIn">Expo.easeIn</option>
|
||||
<option value="Expo.easeInOut">Expo.easeInOut</option>
|
||||
<option value="Circ.easeOut">Circ.easeOut</option>
|
||||
<option value="Circ.easeIn">Circ.easeIn</option>
|
||||
<option value="Circ.easeInOut">Circ.easeInOut</option>
|
||||
<option value="Sine.easeOut">Sine.easeOut</option>
|
||||
<option value="Sine.easeIn">Sine.easeIn</option>
|
||||
<option value="Sine.easeInOut">Sine.easeInOut</option>
|
||||
<option value="Back.easeOut">Back.easeOut</option>
|
||||
<option value="Back.easeIn">Back.easeIn</option>
|
||||
<option value="Back.easeInOut">Back.easeInOut</option>
|
||||
<option value="Bounce.easeOut">Bounce.easeOut</option>
|
||||
<option value="Bounce.easeIn">Bounce.easeIn</option>
|
||||
<option value="Bounce.easeInOut">Bounce.easeInOut</option>
|
||||
<option value="Elastic.easeOut">Elastic.easeOut</option>
|
||||
<option value="Elastic.easeIn">Elastic.easeIn</option>
|
||||
<option value="Elastic.easeInOut">Elastic.easeInOut</option>
|
||||
</field>
|
||||
<field name="roknavmenu_fusion_pill_duration" type="text" default="400" label="Pill Duration" description="" />
|
||||
<field name="roknavmenu_fusion_centeredOffset" type="radio" default="0" label="Centered Dropdowns" description="Used to have the dropdown centering with the root menu.">
|
||||
<option value="0">No</option>
|
||||
<option value="1">Yes</option>
|
||||
</field>
|
||||
<field name="roknavmenu_fusion_tweakInitial_x" type="text" default="0" label="Level 2 X Offset" description="Used to adjust the offset of the X axis starting point of the Level 2 submenu" />
|
||||
<field name="roknavmenu_fusion_tweakInitial_y" type="text" default="0" label="Level 2 Y Offset" description="Used to adjust the offset of the Y axis starting point of the Level 2 submenu" />
|
||||
<field name="roknavmenu_fusion_tweakSubsequent_x" type="text" default="0" label="Submenus X Offset" description="Used to adjust the offset of the X axis starting point of the submenu" />
|
||||
<field name="roknavmenu_fusion_tweakSubsequent_y" type="text" default="0" label="Submenus Y Offset" description="Used to adjust the offset of the Y axis starting point of the submenu" />
|
||||
<field name="roknavmenu_fusion_enable_current_id" type="radio" default="0" label="Enable Active ID" description="Joomla's default menu uses an Active ID that can cause CSS invalidation. It is not used by the fusion menu.">
|
||||
<option value="0">No</option>
|
||||
<option value="1">Yes</option>
|
||||
</field>
|
||||
</fieldset>
|
||||
</subfields>
|
||||
</form>
|
41
modules/mod_roknavmenu/themes/fusion/theme.php
Normal file
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: theme.php 4585 2012-10-27 01:44:54Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
|
||||
class RokNavMenuFusionTheme extends AbstractRokMenuTheme {
|
||||
|
||||
protected $defaults = array(
|
||||
'roknavmenu_fusion_load_css' => 1,
|
||||
'roknavmenu_fusion_enable_js' => 1,
|
||||
'roknavmenu_fusion_opacity' => 1,
|
||||
'roknavmenu_fusion_effect' => 'slidefade',
|
||||
'roknavmenu_fusion_hidedelay' => 500,
|
||||
'roknavmenu_fusion_menu_animation' => 'Sine.easeOut',
|
||||
'roknavmenu_fusion_menu_duration' => 700,
|
||||
'roknavmenu_fusion_pill' => 0,
|
||||
'roknavmenu_fusion_pill_animation' => 'Sine.easeOut',
|
||||
'roknavmenu_fusion_pill_duration' => 700,
|
||||
'roknavmenu_fusion_centeredOffset' => 0,
|
||||
'roknavmenu_fusion_tweakInitial_x' => -3,
|
||||
'roknavmenu_fusion_tweakInitial_y' => 0,
|
||||
'roknavmenu_fusion_tweakSubsequent_x' => 0,
|
||||
'roknavmenu_fusion_tweakSubsequent_y' => 1,
|
||||
'roknavmenu_fusion_tweak-width' => 0,
|
||||
'roknavmenu_fusion_tweak-height' => 0,
|
||||
'roknavmenu_fusion_enable_current_id' => 0
|
||||
);
|
||||
|
||||
public function getFormatter($args){
|
||||
require_once(dirname(__FILE__) . '/formatter.php');
|
||||
return new RokNavMenuFusionFormatter($args);
|
||||
}
|
||||
|
||||
public function getLayout($args){
|
||||
require_once(dirname(__FILE__) . '/layout.php');
|
||||
return new RokMavMenuFusionLayout($args);
|
||||
}
|
||||
}
|
1
modules/mod_roknavmenu/themes/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|