|
From: <be...@us...> - 2014-03-25 08:47:53
|
Revision: 12408
http://sourceforge.net/p/xoops/svn/12408
Author: beckmi
Date: 2014-03-25 08:47:48 +0000 (Tue, 25 Mar 2014)
Log Message:
-----------
Adding checks for Multilingual menus
Modified Paths:
--------------
XoopsModules/mymenus/trunk/mymenus/admin/admin_links.php
XoopsModules/mymenus/trunk/mymenus/admin/admin_menus.php
XoopsModules/mymenus/trunk/mymenus/blocks/mymenus_block.php
XoopsModules/mymenus/trunk/mymenus/class/about.php
XoopsModules/mymenus/trunk/mymenus/class/builder.php
XoopsModules/mymenus/trunk/mymenus/class/links.php
XoopsModules/mymenus/trunk/mymenus/class/menus.php
XoopsModules/mymenus/trunk/mymenus/class/plugin.php
XoopsModules/mymenus/trunk/mymenus/class/registry.php
XoopsModules/mymenus/trunk/mymenus/docs/readme.txt
XoopsModules/mymenus/trunk/mymenus/docs/skins.txt
XoopsModules/mymenus/trunk/mymenus/docs/usage.txt
XoopsModules/mymenus/trunk/mymenus/include/functions.php
XoopsModules/mymenus/trunk/mymenus/include/update.php
XoopsModules/mymenus/trunk/mymenus/include/xoops.php
XoopsModules/mymenus/trunk/mymenus/plugins/constant/constant.php
XoopsModules/mymenus/trunk/mymenus/plugins/dynamic/dynamic.php
XoopsModules/mymenus/trunk/mymenus/plugins/mymenus/mymenus.php
XoopsModules/mymenus/trunk/mymenus/plugins/smarty/smarty.php
XoopsModules/mymenus/trunk/mymenus/skins/bootstrap/templates/template.html
XoopsModules/mymenus/trunk/mymenus/skins/breadcrumb/template.html
XoopsModules/mymenus/trunk/mymenus/skins/clean/template.html
XoopsModules/mymenus/trunk/mymenus/skins/default/templates/template.html
XoopsModules/mymenus/trunk/mymenus/skins/mainmenu/templates/template.html
XoopsModules/mymenus/trunk/mymenus/skins/multiblack/templates/template.html
XoopsModules/mymenus/trunk/mymenus/skins/superfish/templates/template.html
XoopsModules/mymenus/trunk/mymenus/skins/superfish_navbar/templates/template.html
XoopsModules/mymenus/trunk/mymenus/skins/tw_blue/templates/template.html
Modified: XoopsModules/mymenus/trunk/mymenus/admin/admin_links.php
===================================================================
--- XoopsModules/mymenus/trunk/mymenus/admin/admin_links.php 2014-03-25 05:05:24 UTC (rev 12407)
+++ XoopsModules/mymenus/trunk/mymenus/admin/admin_links.php 2014-03-25 08:47:48 UTC (rev 12408)
@@ -28,7 +28,6 @@
$indexAdmin = new ModuleAdmin();
-
if (empty($menus_list)) {
redirect_header('admin_menus.php', 1, _AM_MYMENUS_MSG_NOMENUS);
exit;
@@ -96,30 +95,30 @@
echo mymenus_admin_list($start);
include 'admin_footer.php';
break;
- case 'toggle':
+ case 'toggle':
mymenus_admin_toggle($id, $visible);
break;
case 'order':
- $order = $_POST['mod'];
- parse_str($order,$test);
+ $order = $_POST['mod'];
+ parse_str($order,$test);
- $i = 1;
+ $i = 1;
$this_handler =& xoops_getModuleHandler('links', 'mymenus');
- foreach ($test['mod'] as $order=>$value) {
+ foreach ($test['mod'] as $order=>$value) {
- $obj = $this_handler->get($order);
- $obj->setVar('weight', ++$i);
+ $obj = $this_handler->get($order);
+ $obj->setVar('weight', ++$i);
- /*set submenu*/
- if(isset($value)){
- $obj->setVar('pid', $value);
- }else{
- $obj->setVar('pid', 0);
- }
- $this_handler->insert($obj);
- $this_handler->update_weights($obj);
+ /*set submenu*/
+ if (isset($value)) {
+ $obj->setVar('pid', $value);
+ } else {
+ $obj->setVar('pid', 0);
+ }
+ $this_handler->insert($obj);
+ $this_handler->update_weights($obj);
- }
+ }
break;
case 'list':
default:
@@ -143,13 +142,16 @@
$xoopsLogger->activated = true;
error_reporting(-1);
-
include 'admin_footer.php';
break;
-
}
+/**
+ * @param int $start
+ *
+ * @return bool|mixed|string
+ */
function mymenus_admin_list($start = 0)
{
global $mymenusTpl, $menu_id;
@@ -181,6 +183,10 @@
return $mymenusTpl->fetch($GLOBALS['xoops']->path('modules/mymenus/templates/static/mymenus_admin_links.html'));
}
+/**
+ * @param $id
+ * @param null $redir
+ */
function mymenus_admin_del($id, $redir = null)
{
if (!$GLOBALS['xoopsSecurity']->check()) {
@@ -197,19 +203,19 @@
redirect_header($GLOBALS['mymenus_adminpage'], 1);
}
- //get sub item
- $criteria = new CriteriaCompo();
- $criteria->add(new Criteria('id', $id));
- $criteria->add(new Criteria('pid', $id),'OR');
+ //get sub item
+ $criteria = new CriteriaCompo();
+ $criteria->add(new Criteria('id', $id));
+ $criteria->add(new Criteria('pid', $id),'OR');
- //first delete links level 2
- global $xoopsDB;
- $query = "DELETE FROM ".$xoopsDB->prefix("mymenus_links")." WHERE pid = (
- SELECT id FROM (
- SELECT * FROM ".$xoopsDB->prefix("mymenus_links")." WHERE pid = ".$id.") AS sec
- );";
- $result = $xoopsDB->queryF($query);
- //delete links level 0 and 1
+ //first delete links level 2
+ global $xoopsDB;
+ $query = "DELETE FROM ".$xoopsDB->prefix("mymenus_links")." WHERE pid = (
+ SELECT id FROM (
+ SELECT * FROM ".$xoopsDB->prefix("mymenus_links")." WHERE pid = ".$id.") AS sec
+ );";
+ $result = $xoopsDB->queryF($query);
+ //delete links level 0 and 1
if (!$this_handler->deleteAll($criteria)) {
xoops_cp_header();
xoops_error(_AM_MYMENUS_MSG_ERROR, $obj->getVar('id'));
@@ -220,6 +226,9 @@
redirect_header(!is_null($redir) ? base64_decode($redir) : $GLOBALS['mymenus_adminpage'] , 2, _AM_MYMENUS_MSG_SUCCESS);
}
+/**
+ * @param null $redir
+ */
function mymenus_admin_delall($redir = null)
{
if (!$GLOBALS['xoopsSecurity']->check()) {
@@ -235,6 +244,11 @@
redirect_header(!is_null($redir) ? base64_decode($redir) : $GLOBALS['mymenus_adminpage'] , 2, _AM_MYMENUS_MSG_SUCCESS);
}
+/**
+ * @param null $id
+ * @param null $redir
+ * @param string $op
+ */
function mymenus_admin_confirmdel($id = null, $redir = null, $op = 'delok')
{
@@ -271,7 +285,7 @@
if (!isset($_POST['hooks'])) {
$_POST['hooks'] = array();
}
- $obj->setVars($_POST);
+ $obj->setVars($_POST);
$obj->setVar('weight', $weight);
if (!$this_handler->insert($obj)) {
@@ -284,6 +298,9 @@
redirect_header($GLOBALS['mymenus_adminpage'] . '?op=list&menu_id=' . $obj->getVar('mid'), 2, $msg);
}
+/**
+ * @param $id
+ */
function mymenus_admin_edit($id)
{
if (!$GLOBALS['xoopsSecurity']->check()) {
@@ -291,14 +308,12 @@
}
global $menu_id;
+ /* Disable xoops debugger in dialog window */
+ include_once XOOPS_ROOT_PATH.'/class/logger/xoopslogger.php';
+ $xoopsLogger =& XoopsLogger::getInstance();
+ $xoopsLogger->activated = false;
+ error_reporting(0);
- /* Disable xoops debugger in dialog window */
- include_once XOOPS_ROOT_PATH.'/class/logger/xoopslogger.php';
- $xoopsLogger =& XoopsLogger::getInstance();
- $xoopsLogger->activated = false;
- error_reporting(0);
-
-
$this_handler =& xoops_getModuleHandler('links','mymenus');
$obj = $this_handler->get($id);
$obj->setVars($_POST);
@@ -312,13 +327,19 @@
redirect_header($GLOBALS['mymenus_adminpage'] . "?op=list&menu_id=$menu_id", 2, $msg);
}
+/**
+ * @param null $id
+ * @param null $pid
+ *
+ * @return string
+ */
function mymenus_admin_form($id = null, $pid = null)
{
- /* Disable xoops debugger in dialog window */
- include_once XOOPS_ROOT_PATH.'/class/logger/xoopslogger.php';
- $xoopsLogger =& XoopsLogger::getInstance();
- $xoopsLogger->activated = false;
- error_reporting(0);
+ /* Disable xoops debugger in dialog window */
+ include_once XOOPS_ROOT_PATH.'/class/logger/xoopslogger.php';
+ $xoopsLogger =& XoopsLogger::getInstance();
+ $xoopsLogger->activated = false;
+ error_reporting(0);
global $menu_id;
@@ -415,6 +436,10 @@
return $form->render();
}
+/**
+ * @param $id
+ * @param $weight
+ */
function mymenus_admin_move($id, $weight)
{
$this_handler =& xoops_getModuleHandler('links', 'mymenus');
@@ -424,17 +449,21 @@
$this_handler->update_weights($obj);
}
+/**
+ * @param $id
+ * @param $visible
+ */
function mymenus_admin_toggle($id, $visible)
{
- include_once XOOPS_ROOT_PATH.'/class/logger/xoopslogger.php';
- $xoopsLogger =& XoopsLogger::getInstance();
- $xoopsLogger->activated = true;
- error_reporting(0);
+ include_once XOOPS_ROOT_PATH.'/class/logger/xoopslogger.php';
+ $xoopsLogger =& XoopsLogger::getInstance();
+ $xoopsLogger->activated = true;
+ error_reporting(0);
- $this_handler =& xoops_getModuleHandler('links', 'mymenus');
+ $this_handler =& xoops_getModuleHandler('links', 'mymenus');
$obj = $this_handler->get($id);
$visible = ($obj->getVar('visible') == 1) ? 0 : 1;
$obj->setVar('visible', $visible);
$this_handler->insert($obj);
- echo $obj->getVar('visible');
+ echo $obj->getVar('visible');
}
Modified: XoopsModules/mymenus/trunk/mymenus/admin/admin_menus.php
===================================================================
--- XoopsModules/mymenus/trunk/mymenus/admin/admin_menus.php 2014-03-25 05:05:24 UTC (rev 12407)
+++ XoopsModules/mymenus/trunk/mymenus/admin/admin_menus.php 2014-03-25 08:47:48 UTC (rev 12408)
@@ -58,13 +58,18 @@
break;
case 'list':
default:
- xoops_cp_header();
- echo $indexAdmin->addNavigation('admin_menus.php');
+ xoops_cp_header();
+ echo $indexAdmin->addNavigation('admin_menus.php');
echo mymenus_admin_list($start);
include 'admin_footer.php';
break;
}
+/**
+ * @param int $start
+ *
+ * @return bool|mixed|string
+ */
function mymenus_admin_list($start = 0)
{
global $mymenusTpl, $limit;
@@ -114,6 +119,10 @@
return $mymenusTpl->fetch($GLOBALS['xoops']->path('modules/mymenus/templates/static/mymenus_admin_menus.html'));
}
+/**
+ * @param $id
+ * @param null $redir
+ */
function mymenus_admin_del($id, $redir = null)
{
if (!$GLOBALS['xoopsSecurity']->check()) {
@@ -145,6 +154,9 @@
redirect_header(!is_null($redir) ? base64_decode($redir) : $GLOBALS['mymenus_adminpage'] , 2, _AM_MYMENUS_MSG_SUCCESS);
}
+/**
+ * @param null $redir
+ */
function mymenus_admin_delall($redir = null)
{
if (!$GLOBALS['xoopsSecurity']->check()) {
@@ -160,6 +172,11 @@
redirect_header(!is_null($redir) ? base64_decode($redir) : $GLOBALS['mymenus_adminpage'] , 2, _AM_MYMENUS_MSG_SUCCESS);
}
+/**
+ * @param null $id
+ * @param null $redir
+ * @param string $op
+ */
function mymenus_admin_confirmdel($id = null, $redir = null, $op = 'delok')
{
$arr = array();
@@ -192,6 +209,9 @@
redirect_header($GLOBALS['mymenus_adminpage'] . '?op=list', 2, $msg);
}
+/**
+ * @param $id
+ */
function mymenus_admin_edit($id)
{
if (!$GLOBALS['xoopsSecurity']->check()) {
@@ -210,6 +230,11 @@
redirect_header($GLOBALS['mymenus_adminpage'] . '?op=list', 2, $msg);
}
+/**
+ * @param null $id
+ *
+ * @return string
+ */
function mymenus_admin_form($id = null)
{
$this_handler =& xoops_getmodulehandler('menus','mymenus');
Modified: XoopsModules/mymenus/trunk/mymenus/blocks/mymenus_block.php
===================================================================
--- XoopsModules/mymenus/trunk/mymenus/blocks/mymenus_block.php 2014-03-25 05:05:24 UTC (rev 12407)
+++ XoopsModules/mymenus/trunk/mymenus/blocks/mymenus_block.php 2014-03-25 08:47:48 UTC (rev 12408)
@@ -20,6 +20,11 @@
defined('XOOPS_ROOT_PATH') or die("XOOPS root path not defined");
+/**
+ * @param $options
+ *
+ * @return array|bool
+ */
function mymenus_block_show($options)
{
$block = array();
@@ -128,6 +133,12 @@
$blockTpl->assign('skinurl', $skin_info['url']);
$blockTpl->assign('skinpath', $skin_info['path']);
+ // xLanguage check
+ if (xoops_isActiveModule('xlanguage')) {
+ $blockTpl->assign('xlanguage', true);
+ }
+
+
/*assign ul class*/
$menucss='';
$menus_handler = xoops_getModuleHandler('menus', 'mymenus');
@@ -136,10 +147,10 @@
$itemsCount = count($menuObj);
if ($menuObj) {
for ($i = 0; $i < $itemsCount; ++$i) {
- $menucss = isset($menuObj[$i]['css']) ? $menuObj[$i]['css']: '';
+ $menucss = isset($menuObj[$i]['css']) ? $menuObj[$i]['css']: '';
}
}
- if(!$menucss){$menucss = "";}
+ if (!$menucss) {$menucss = "";}
$blockTpl->assign('menucss', $menucss);
$block['content'] = $blockTpl->fetch($skin_info['template']);
@@ -156,6 +167,11 @@
return $block;
}
+/**
+ * @param $options
+ *
+ * @return string
+ */
function mymenus_block_edit($options)
{
//Unique ID
@@ -172,6 +188,7 @@
if (count($menus) == 0) {
$form = "<a href='" . $GLOBALS['xoops']->url('modules/mymenus/admin/admin_menus.php') . "'>" . _AM_MYMENUS_MSG_NOMENUS . "</a>";
+
return $form;
}
@@ -209,7 +226,6 @@
//Skin from theme 3 - @luciorota
-
if (file_exists(XOOPS_ROOT_PATH . '/themes/' . $GLOBALS['xoopsConfig']['theme_set'] . '/modules/mymenus/skins/')) {
++$i;
xoops_load('XoopsLists');
Modified: XoopsModules/mymenus/trunk/mymenus/class/about.php
===================================================================
--- XoopsModules/mymenus/trunk/mymenus/class/about.php 2014-03-25 05:05:24 UTC (rev 12407)
+++ XoopsModules/mymenus/trunk/mymenus/class/about.php 2014-03-25 08:47:48 UTC (rev 12408)
@@ -49,6 +49,9 @@
var $_lang_by;
var $_tpl;
+ /**
+ * @param string $aboutTitle
+ */
function __construct($aboutTitle = 'About')
{
@@ -75,6 +78,11 @@
}
+ /**
+ * @param $value
+ *
+ * @return mixed
+ */
function sanitize($value)
{
$myts =& MyTextSanitizer::getInstance();
Modified: XoopsModules/mymenus/trunk/mymenus/class/builder.php
===================================================================
--- XoopsModules/mymenus/trunk/mymenus/class/builder.php 2014-03-25 05:05:24 UTC (rev 12407)
+++ XoopsModules/mymenus/trunk/mymenus/class/builder.php 2014-03-25 08:47:48 UTC (rev 12408)
@@ -22,11 +22,17 @@
var $parents = array();
var $output = array();
+ /**
+ * @param $array
+ */
function __construct($array)
{
$this->addMenu($array);
}
+ /**
+ * @param $array
+ */
function addMenu($array)
{
foreach ($array as $item) {
@@ -34,11 +40,17 @@
}
}
+ /**
+ * @param $item
+ */
function add($item)
{
$this->parents[$item['pid']][] = $item;
}
+ /**
+ * @param int $pid
+ */
function buildMenus($pid = 0)
{
static $idx = -1;
@@ -77,6 +89,9 @@
$level -= 1;
}
+ /**
+ * @param int $pid
+ */
function buildUpDown($pid = 0)
{
static $idx = -1;
@@ -153,6 +168,9 @@
}
}
+ /**
+ * @param $pid
+ */
function addSelectedParents($pid)
{
foreach ($this->output as $idx => $menu) {
@@ -163,6 +181,9 @@
}
}
+ /**
+ * @return array
+ */
function render()
{
$this->buildMenus();
Modified: XoopsModules/mymenus/trunk/mymenus/class/links.php
===================================================================
--- XoopsModules/mymenus/trunk/mymenus/class/links.php 2014-03-25 05:05:24 UTC (rev 12407)
+++ XoopsModules/mymenus/trunk/mymenus/class/links.php 2014-03-25 08:47:48 UTC (rev 12408)
@@ -20,6 +20,9 @@
defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined");
+/**
+ * Class MymenusLinks
+ */
class MymenusLinks extends XoopsObject
{
/**
@@ -42,6 +45,9 @@
$this->initVar('css', XOBJ_DTYPE_TXTBOX);
}
+ /**
+ * @return bool
+ */
function checkAccess()
{
$hooks = $this->getHooks();
@@ -55,6 +61,9 @@
return true;
}
+ /**
+ * @return array
+ */
function getHooks()
{
$ret = array();
@@ -69,19 +78,29 @@
//$info = split(',', trim($line[0]));
$ret[$hook][] = $method;
}
+
return $ret;
}
}
+/**
+ * Class MymenusLinksHandler
+ */
class MymenusLinksHandler extends XoopsPersistableObjectHandler
{
+ /**
+ * @param null|object $db
+ */
function __construct(&$db)
{
parent::__construct($db, 'mymenus_links', 'MymenusLinks', 'id', 'title');
}
+ /**
+ * @param $obj
+ */
function update_weights(&$obj)
{
$sql = "UPDATE " . $this->table
Modified: XoopsModules/mymenus/trunk/mymenus/class/menus.php
===================================================================
--- XoopsModules/mymenus/trunk/mymenus/class/menus.php 2014-03-25 05:05:24 UTC (rev 12407)
+++ XoopsModules/mymenus/trunk/mymenus/class/menus.php 2014-03-25 08:47:48 UTC (rev 12408)
@@ -20,6 +20,9 @@
defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined");
+/**
+ * Class MymenusMenus
+ */
class MymenusMenus extends XoopsObject
{
/**
@@ -35,8 +38,14 @@
}
}
+/**
+ * Class MymenusMenusHandler
+ */
class MymenusMenusHandler extends XoopsPersistableObjectHandler
{
+ /**
+ * @param null|object $db
+ */
function __construct(&$db)
{
parent::__construct($db, 'mymenus_menus', 'MymenusMenus', 'id', 'title', 'css');
Modified: XoopsModules/mymenus/trunk/mymenus/class/plugin.php
===================================================================
--- XoopsModules/mymenus/trunk/mymenus/class/plugin.php 2014-03-25 05:05:24 UTC (rev 12407)
+++ XoopsModules/mymenus/trunk/mymenus/class/plugin.php 2014-03-25 08:47:48 UTC (rev 12408)
@@ -23,6 +23,9 @@
xoops_load('XoopsLists');
include_once $GLOBALS['xoops']->path('modules/mymenus/class/registry.php');
+/**
+ * Class MymenusPlugin
+ */
class MymenusPlugin
{
@@ -30,6 +33,9 @@
var $_plugins;
var $_events;
+ /**
+ *
+ */
function __construct()
{
$this->_plugins = array();
@@ -39,6 +45,9 @@
$this->setEvents();
}
+ /**
+ * @return MymenusPlugin
+ */
static function &getInstance()
{
static $instance = false;
@@ -80,6 +89,10 @@
}
}
+ /**
+ * @param $event_name
+ * @param array $args
+ */
function triggerEvent($event_name, $args = array())
{
$event_name = strtolower(str_replace('.', '', $event_name));
@@ -92,9 +105,17 @@
}
+/**
+ * Class MymenusPluginItem
+ */
class MymenusPluginItem
{
+ /**
+ * @param $name
+ *
+ * @return mixed
+ */
function loadLanguage($name)
{
$language = $GLOBALS['xoopsConfig']['language'];
@@ -102,6 +123,7 @@
if (!($ret = @include_once "{$path}/{$language}/{$name}.php")) {
$ret = @include_once "{$path}/english/{$name}.php";
}
+
return $ret;
}
}
Modified: XoopsModules/mymenus/trunk/mymenus/class/registry.php
===================================================================
--- XoopsModules/mymenus/trunk/mymenus/class/registry.php 2014-03-25 05:05:24 UTC (rev 12407)
+++ XoopsModules/mymenus/trunk/mymenus/class/registry.php 2014-03-25 08:47:48 UTC (rev 12408)
@@ -20,42 +20,68 @@
defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined");
+/**
+ * Class MymenusRegistry
+ */
class MymenusRegistry
{
protected $_entries;
protected $_locks;
+ /**
+ *
+ */
protected function __construct()
{
$this->_entries = array();
$this->_locks = array();
}
+ /**
+ * @return MymenusRegistry
+ */
static public function getInstance()
{
static $instance = false;
if (!$instance) {
$instance = new self();
}
+
return $instance;
}
+ /**
+ * @param $key
+ * @param $item
+ *
+ * @return bool
+ */
public function setEntry($key, $item)
{
if ($this->isLocked($key) == true) {
trigger_error('Unable to set entry `' . $key . '`. Entry is locked.', E_USER_WARNING);
+
return false;
}
$this->_entries[$key] = $item;
+
return true;
}
+ /**
+ * @param $key
+ */
public function unsetEntry($key)
{
unset($this->_entries[$key]);
}
+ /**
+ * @param $key
+ *
+ * @return null
+ */
public function getEntry($key)
{
if (isset($this->_entries[$key]) == false) {
@@ -65,22 +91,41 @@
return $this->_entries[$key];
}
+ /**
+ * @param $key
+ *
+ * @return bool
+ */
public function isEntry($key)
{
return ($this->getEntry($key) !== null);
}
+ /**
+ * @param $key
+ *
+ * @return bool
+ */
public function lockEntry($key)
{
$this->_locks[$key] = true;
+
return true;
}
+ /**
+ * @param $key
+ */
public function unlockEntry($key)
{
unset($this->_locks[$key]);
}
+ /**
+ * @param $key
+ *
+ * @return bool
+ */
public function isLocked($key)
{
return (isset($this->_locks[$key]) == true);
Modified: XoopsModules/mymenus/trunk/mymenus/docs/readme.txt
===================================================================
--- XoopsModules/mymenus/trunk/mymenus/docs/readme.txt 2014-03-25 05:05:24 UTC (rev 12407)
+++ XoopsModules/mymenus/trunk/mymenus/docs/readme.txt 2014-03-25 08:47:48 UTC (rev 12408)
@@ -1,6 +1,6 @@
-What is mymenus module (v1.0) ?
+What is MyMenus module ?
======================
-Mymenus is menu manager module that allows you to display dynamic or static menus in your website.
+MyMenus is menu manager module that allows you to display dynamic or static menus in your website.
Features
@@ -9,24 +9,24 @@
- pluggable plugins (title and links decorators for integration of module features)
- infinite menus levels(nested menus)
- auto selected menus(menus are highlighted depending on the page you are in)
-- ability to assign a menu to a smarty variable(you can use my menus has a block or use it inside your theme or templates)
+- ability to assign a menu to a smarty variable(you can use my menus as a block or use it inside your theme or templates)
- ability to get a skin from the current theme folder(theme/mytheme/menu/scripts go here)
- and much more
Requirements
====================
-Requires xoops 2.4.x and php5
+Requires minimum 2.5.x and PHP 5.3.7
-How to install mymenus
+How to install MyMenus
====================
-Copy mymenus folder into the /modules directory of your website.
-Log in to your site as administrator, go to System Admin > Modules, look for the mymenus
-icon in the list of uninstalled modules and click in the install icon.
+Copy mymenus folder into the /modules directory of your website.
+Log in to your site as administrator, go to System Admin > Modules, look for the MyMenus
+icon in the list of uninstalled modules and click in the install icon.
Follow the directions in the screen and you'll be ready to go.
Usage and developing documentation
======================
-Please refer to docs folder for more information.
\ No newline at end of file
+Please refer to docs folder for more information.
Modified: XoopsModules/mymenus/trunk/mymenus/docs/skins.txt
===================================================================
--- XoopsModules/mymenus/trunk/mymenus/docs/skins.txt 2014-03-25 05:05:24 UTC (rev 12407)
+++ XoopsModules/mymenus/trunk/mymenus/docs/skins.txt 2014-03-25 08:47:48 UTC (rev 12408)
@@ -33,13 +33,13 @@
[oul] => 1 (IMPORTANT! Open UL -> this menu item requires skin to prepend <ul> open element tag)
[oli] => 1 (IMPORTANT! Open LI -> this menu item requires skin to prepend <li> open element tag)
[close] => (IMPORTANT! this holds closing tags, it will automatically generate </li></ul> tags for you)
- [cul] => (IMPORTANT! Close UL -> this menu item requires skin to apend </ul> close element tag, you should use [close] instead, unless you are not suporting multilevel menus)
- [cli] => (IMPORTANT! Close LI -> this menu item requires skin to apend </li> close element tag, you should use [close] instead, unless you are not suporting multilevel menus)
+ [cul] => (IMPORTANT! Close UL -> this menu item requires skin to append </ul> close element tag, you should use [close] instead, unless you are not supporting multilevel menus)
+ [cli] => (IMPORTANT! Close LI -> this menu item requires skin to append </li> close element tag, you should use [close] instead, unless you are not supporting multilevel menus)
[hassub] => 1 (informs if this menu item has submenus, 1 for true, 0 for false)
[level] => 0 (informs the level of nesting of the menu item, 0 is for root, 1 for second level, etc..)
[down_weight] => 3 (for usage in menu sorting in admin side, you can ignore it)
[selected] => 1 (IMPORTANT, this tells the skin to highlight this item)
- [topselected] => 1 (Important, this informs the skin that the menu is of level 0(root) and it is selected, you should higlight it)
+ [topselected] => 1 (Important, this informs the skin that the menu is of level 0(root) and it is selected, you should highlight it)
)
-- Skin structure:
Modified: XoopsModules/mymenus/trunk/mymenus/docs/usage.txt
===================================================================
--- XoopsModules/mymenus/trunk/mymenus/docs/usage.txt 2014-03-25 05:05:24 UTC (rev 12407)
+++ XoopsModules/mymenus/trunk/mymenus/docs/usage.txt 2014-03-25 08:47:48 UTC (rev 12408)
@@ -10,25 +10,25 @@
You can use DECORATORS for links, images, title, and alt_title.
-The decorators follow this sintax:
+The decorators follow this syntax:
{decorator|value}
There are 6 decorators available:
-USER -> gets info for the user that is seing the page
+USER -> gets info for the user that is seeing the page
OWNER -> gets info for the user that match uid on the url(if given)
URI -> gets info about the url arguments
MODULE -> gets dynamic menu from a module (Used in title field only)
SMARTY -> gets smarty variables
CONSTANT -> gets defined constants
-Some sintax examples
+Some syntax examples
{USER|UNAME} gets the username of this user, returns anonymous if not a user
{USER|UID} gets the uid of this user, returns 0 if not a user
{USER|REGDATE} gets the regdate of this user, returns empty if not a user
{USER|any other field of the user table} yes! You can get what you need!
Some special fields you may use
-{USER|PM_NEW} Show number of private messages not readed
+{USER|PM_NEW} Show number of private messages not read
{USER|PM_READED}
{USER|PM_TOTAL}
@@ -37,7 +37,7 @@
{OWNER|UID}
etc..
-And you can get any paramater on the uri with:
+And you can get any parameter on the uri with:
{URI|UID}
{URI|ID}
{URI|SEARCH}
Modified: XoopsModules/mymenus/trunk/mymenus/include/functions.php
===================================================================
--- XoopsModules/mymenus/trunk/mymenus/include/functions.php 2014-03-25 05:05:24 UTC (rev 12407)
+++ XoopsModules/mymenus/trunk/mymenus/include/functions.php 2014-03-25 08:47:48 UTC (rev 12408)
@@ -20,6 +20,10 @@
defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined");
+/**
+ * @param int $currentoption
+ * @param string $breadcrumb
+ */
function mymenus_adminMenu($currentoption = 0, $breadcrumb = '')
{
include_once $GLOBALS['xoops']->path('class/template.php');
@@ -39,6 +43,11 @@
$tpl->display($GLOBALS['xoops']->path('modules/mymenus/templates/static/mymenus_admin_adminmenu.html'));
}
+/**
+ * @param string $dirname
+ *
+ * @return mixed
+ */
function mymenus_getModuleConfig($dirname = 'mymenus')
{
static $config;
@@ -58,6 +67,13 @@
return $config;
}
+/**
+ * @param $skin
+ * @param $skin_from_theme
+ * @param $skin_theme
+ *
+ * @return array
+ */
function mymenus_getSkinInfo($skin, $skin_from_theme, $skin_theme)
{
$error = false;
Modified: XoopsModules/mymenus/trunk/mymenus/include/update.php
===================================================================
--- XoopsModules/mymenus/trunk/mymenus/include/update.php 2014-03-25 05:05:24 UTC (rev 12407)
+++ XoopsModules/mymenus/trunk/mymenus/include/update.php 2014-03-25 08:47:48 UTC (rev 12408)
@@ -17,7 +17,7 @@
//Install
eval ('function xoops_module_pre_install_'.$infoname.'($module) {
- // Templatevorlagen pr�fen
+ // Templatevorlagen prüfen
if (!check_infotemplates($module)) return false;
if (!check_infotable($module)) return false;
return true;
@@ -25,7 +25,7 @@
//Install
eval ('function xoops_module_install_'.$infoname.'($module) {
- // Templatevorlagen pr�fen
+ // Templatevorlagen prüfen
if (!check_infotemplates($module)) return false;
if (!check_infotable($module)) return false;
return true;
@@ -33,23 +33,32 @@
//Update
eval('function xoops_module_update_'.$infoname.'($module) {
- // Templatevorlagen pr�fen
+ // Templatevorlagen prüfen
if (!check_infotemplates($module)) return false;
if (!check_infotable($module)) return false;
return true;
}');
-
+/**
+ * @param $module
+ *
+ * @return bool
+ */
function check_infotemplates($module) {
$err = true;
if (!file_exists(XOOPS_ROOT_PATH."/modules/".$module->getInfo("dirname")."/templates/blocks/".$module->getInfo("dirname")."_block.html")) {
$module->setErrors("Template ".$module->getInfo("dirname")."_block.html not exists!");
- $err = false;
+ $err = false;
}
+
return $err;
}
-
+/**
+ * @param $module
+ *
+ * @return bool
+ */
function check_infotable($module) {
global $xoopsDB;
$err=true;
@@ -73,7 +82,6 @@
"css" => "varchar(150) default NULL"
);
-
if (!InfoTableExists($xoopsDB->prefix($module->getInfo("dirname")).'_menus')) {
$sql= "CREATE TABLE ".$xoopsDB->prefix($module->getInfo("dirname"))."_menus (";
foreach ($tables_menus as $s => $w) {
@@ -82,10 +90,11 @@
$sql.= " PRIMARY KEY (id)
); ";
- echo $sql;
+ echo $sql;
$result = $xoopsDB->queryF($sql);
if (!$result) {
$module->setErrors("Can't create Table ".$xoopsDB->prefix($module->getInfo("dirname")).'_menus');
+
return false;
} else {
$sql="INSERT INTO ".$xoopsDB->prefix($module->getInfo("dirname"))."_menus (id,title) VALUES (1,'Default')";
@@ -105,20 +114,20 @@
}
-
- if (!InfoTableExists($xoopsDB->prefix($module->getInfo("dirname"))."_links")) {
+ if (!InfoTableExists($xoopsDB->prefix($module->getInfo("dirname"))."_links")) {
$sql= "CREATE TABLE ".$xoopsDB->prefix($module->getInfo("dirname"))."_links ( ";
foreach ($tables_links as $c =>$w) {
$sql.= " " . $c . " " .$w.",";
}
$sql .= " PRIMARY KEY (storyid) ) ;";
- $result = $xoopsDB->queryF($sql);
- if (!$result) {
+ $result = $xoopsDB->queryF($sql);
+ if (!$result) {
$module->setErrors("Can't create Table ".$xoopsDB->prefix($module->getInfo("dirname"))."_links");
$sql = 'DROP TABLE ' . $xoopsDB->prefix($module->getInfo("dirname")).'_menus';
$result = $xoopsDB->queryF($sql);
+
return false;
- }
+ }
} else {
foreach ($tables_links as $s => $w) {
if (!InfoColumnExists($xoopsDB->prefix($module->getInfo("dirname")).'_links',$s))
@@ -132,5 +141,6 @@
}
}
+
return true;
}
Modified: XoopsModules/mymenus/trunk/mymenus/include/xoops.php
===================================================================
--- XoopsModules/mymenus/trunk/mymenus/include/xoops.php 2014-03-25 05:05:24 UTC (rev 12407)
+++ XoopsModules/mymenus/trunk/mymenus/include/xoops.php 2014-03-25 08:47:48 UTC (rev 12408)
@@ -18,36 +18,60 @@
$module_name = basename(dirname(dirname(__FILE__))) ;
if (!function_exists("xoops_loadLanguage")) {
+ /**
+ * @param $name
+ * @param string $domain
+ * @param null $language
+ *
+ * @return mixed
+ */
function xoops_loadLanguage( $name, $domain = '', $language = null ) {
$language = empty($language) ? $GLOBALS['xoopsConfig']['language'] : $language;
$path = XOOPS_ROOT_PATH . '/' . ( (empty($domain) || 'global' == $domain) ? '' : "modules/{$domain}/" ) . 'language';
if ( !( $ret = @include_once "{$path}/{$language}/{$name}.php" ) ) {
$ret = @include_once "{$path}/english/{$name}.php";
}
+
return $ret;
}
}
if (!function_exists("InfoTableExists")) {
+ /**
+ * @param $tablename
+ *
+ * @return bool
+ */
function InfoTableExists($tablename) {
global $xoopsDB;
$result=$xoopsDB->queryF("SHOW TABLES LIKE '$tablename'");
- $ret = ($xoopsDB->getRowsNum($result) > 0) ? true : false;
+ $ret = ($xoopsDB->getRowsNum($result) > 0) ? true : false;
+
return $ret;
}
}
if (!function_exists("InfoColumnExists")) {
+ /**
+ * @param $tablename
+ * @param $spalte
+ *
+ * @return bool
+ */
function InfoColumnExists($tablename,$spalte) {
global $xoopsDB;
if ($tablename=="" || $spalte=="") return true; // Fehler!!
$result=$xoopsDB->queryF("SHOW COLUMNS FROM ". $tablename ." LIKE '".$spalte."'");
- $ret = ($xoopsDB->getRowsNum($result) > 0) ? true : false;
+ $ret = ($xoopsDB->getRowsNum($result) > 0) ? true : false;
+
return $ret;
}
}
if (!function_exists("InfoAdminMenu")) {
+ /**
+ * @param int $currentoption
+ */
function InfoAdminMenu ($currentoption = 0) {
/* Nice buttons styles */
global $xoopsConfig,$xoopsModule;
@@ -98,27 +122,34 @@
}
if (!function_exists("self_parrent")) {
- function self_parrent($id=0,$modulname="") {
+ /**
+ * @param int $id
+ * @param string $modulname
+ *
+ * @return array
+ */
+ function self_parrent($id=0,$modulname="") {
global $xoopsDB;
- $currentParent=array();
- if ($modulname=="") return $currentParent;
+ $currentParent=array();
+ if ($modulname=="") return $currentParent;
$cP = $id;
- $sql="SELECT storyid FROM ".$xoopsDB->prefix($modulname)." WHERE parent_id=".intval($cP);
- $result = $xoopsDB->query($sql);
- while ($row = $xoopsDB->fetchArray($result)) {
- if (intval($row['storyid']) > 0) {
+ $sql="SELECT storyid FROM ".$xoopsDB->prefix($modulname)." WHERE parent_id=".intval($cP);
+ $result = $xoopsDB->query($sql);
+ while ($row = $xoopsDB->fetchArray($result)) {
+ if (intval($row['storyid']) > 0) {
$cP = intval($row['storyid']);
- $currentParent[]=$cP;
- $cp2=array();
- $cp2 = self_parrent($cP,$modulname);
- if (count($cp2)>0) {
- foreach ($cp2 as $clist1 ) {
+ $currentParent[]=$cP;
+ $cp2=array();
+ $cp2 = self_parrent($cP,$modulname);
+ if (count($cp2)>0) {
+ foreach ($cp2 as $clist1) {
$currentParent[]=$clist1;
}
}
unset($cp2);
- }
- }
- return $currentParent;
- }
+ }
+ }
+
+ return $currentParent;
+ }
}
Modified: XoopsModules/mymenus/trunk/mymenus/plugins/constant/constant.php
===================================================================
--- XoopsModules/mymenus/trunk/mymenus/plugins/constant/constant.php 2014-03-25 05:05:24 UTC (rev 12407)
+++ XoopsModules/mymenus/trunk/mymenus/plugins/constant/constant.php 2014-03-25 08:47:48 UTC (rev 12408)
@@ -20,6 +20,9 @@
defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined");
+/**
+ * Class ConstantMymenusPluginItem
+ */
class ConstantMymenusPluginItem extends MymenusPluginItem
{
@@ -55,6 +58,11 @@
$registry->setEntry('link_array', $linkArray);
}
+ /**
+ * @param $string
+ *
+ * @return mixed
+ */
function _doDecoration($string)
{
$registry =& MymenusRegistry::getInstance();
Modified: XoopsModules/mymenus/trunk/mymenus/plugins/dynamic/dynamic.php
===================================================================
--- XoopsModules/mymenus/trunk/mymenus/plugins/dynamic/dynamic.php 2014-03-25 05:05:24 UTC (rev 12407)
+++ XoopsModules/mymenus/trunk/mymenus/plugins/dynamic/dynamic.php 2014-03-25 08:47:48 UTC (rev 12408)
@@ -20,6 +20,9 @@
defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined");
+/**
+ * Class DynamicMymenusPluginItem
+ */
class DynamicMymenusPluginItem extends MymenusPluginItem
{
@@ -42,6 +45,12 @@
$registry->setEntry('menus', $newmenus);
}
+ /**
+ * @param $module
+ * @param $pid
+ *
+ * @return array
+ */
function _getModuleMenus($module, $pid)
{
global $xoopsDB, $xoopsUser, $xoopsConfig, $xoopsModule, $xoopsModuleConfig;
Modified: XoopsModules/mymenus/trunk/mymenus/plugins/mymenus/mymenus.php
===================================================================
--- XoopsModules/mymenus/trunk/mymenus/plugins/mymenus/mymenus.php 2014-03-25 05:05:24 UTC (rev 12407)
+++ XoopsModules/mymenus/trunk/mymenus/plugins/mymenus/mymenus.php 2014-03-25 08:47:48 UTC (rev 12408)
@@ -20,6 +20,9 @@
defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined");
+/**
+ * Class MymenusMymenusPluginItem
+ */
class MymenusMymenusPluginItem extends MymenusPluginItem
{
@@ -71,7 +74,7 @@
$registry =& MymenusRegistry::getInstance();
$linkArray = $registry->getEntry('link_array');
- if (!empty($linkArray['image'])) {
+ if (!empty($linkArray['image']) && !filter_var($linkArray['image'], FILTER_VALIDATE_URL)) {
$linkArray['image'] = XOOPS_URL . '/' . $linkArray['image'];
//Do not do this in other decorators
$linkArray['image'] = self::_doDecoration($linkArray['image']);
@@ -98,6 +101,11 @@
$registry->setEntry('link_array', $linkArray);
}
+ /**
+ * @param $string
+ *
+ * @return mixed
+ */
function _doDecoration($string)
{
$registry =& MymenusRegistry::getInstance();
@@ -172,6 +180,9 @@
$registry->setEntry('access_filter', $access_filter);
}
+ /**
+ * @return bool
+ */
function isOwner()
{
$registry =& MymenusRegistry::getInstance();
@@ -179,11 +190,20 @@
return ($registry->getEntry('user_uid') != 0 && $registry->getEntry('user_uid') == $registry->getEntry('get_uid')) ? true : false;
}
+ /**
+ * @return bool
+ */
function isNotOwner()
{
return !self::isOwner();
}
+ /**
+ * @param string $type
+ * @param $value
+ *
+ * @return int
+ */
function getExtraValue($type = 'user', $value)
{
$registry =& MymenusRegistry::getInstance();
Modified: XoopsModules/mymenus/trunk/mymenus/plugins/smarty/smarty.php
===================================================================
--- XoopsModules/mymenus/trunk/mymenus/plugins/smarty/smarty.php 2014-03-25 05:05:24 UTC (rev 12407)
+++ XoopsModules/mymenus/trunk/mymenus/plugins/smarty/smarty.php 2014-03-25 08:47:48 UTC (rev 12408)
@@ -20,6 +20,9 @@
defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined");
+/**
+ * Class SmartyMymenusPluginItem
+ */
class SmartyMymenusPluginItem extends MymenusPluginItem
{
@@ -55,6 +58,11 @@
$registry->setEntry('link_array', $linkArray);
}
+ /**
+ * @param $string
+ *
+ * @return mixed
+ */
function _doDecoration($string)
{
$registry =& MymenusRegistry::getInstance();
Modified: XoopsModules/mymenus/trunk/mymenus/skins/bootstrap/templates/template.html
===================================================================
--- XoopsModules/mymenus/trunk/mymenus/skins/bootstrap/templates/template.html 2014-03-25 05:05:24 UTC (rev 12407)
+++ XoopsModules/mymenus/trunk/mymenus/skins/bootstrap/templates/template.html 2014-03-25 08:47:48 UTC (rev 12408)
@@ -10,6 +10,10 @@
<{/if}>
<{if $menu.oli}>
+ <{assign var=myStr value="["|cat:$xoops_langcode|cat:"]"}>
+ <{if ($xlanguage && (($menu.title|strstr:$myStr) OR ($menu.image|strstr:$myStr)) OR !$xlanguage)}>
+
+
<{if $menu.hassub && $menu.level == 0}>
<li class="dropdown <{if $menu.selected}>active <{/if}><{$menu.css}>">
<a href="<{$menu.link}>" target="<{$menu.target}>" alt="<{$menu.alt_title}>" title="<{$menu.alt_title}>">
@@ -29,7 +33,12 @@
<{$menu.title}>
</a>
<{/if}>
+ <{/if}>
+
+
+
+
<{/if}>
<{if $menu.close != ''}><{$menu.close}><{/if}>
-<{/foreach}>
\ No newline at end of file
+<{/foreach}>
Modified: XoopsModules/mymenus/trunk/mymenus/skins/breadcrumb/template.html
===================================================================
--- XoopsModules/mymenus/trunk/mymenus/skins/breadcrumb/template.html 2014-03-25 05:05:24 UTC (rev 12407)
+++ XoopsModules/mymenus/trunk/mymenus/skins/breadcrumb/template.html 2014-03-25 08:47:48 UTC (rev 12408)
@@ -1,22 +1,24 @@
<ul class="mymenus-breadcrumb" style="background-image:url('<{$skinurl}>/<{$config.iconset}>/bc_bg.png');">
<{if $config.home}>
- <li>
- <a href="<{$xoops_url}>" alt="<{$smarty.const._MB_MYMENUS_HOME}>" title="<{$smarty.const._MB_MYMENUS_HOME}>" style="background-image:url('<{$skinurl}>/<{$config.iconset}>/bc_separator.png');">
- <img class="mymenus-breadcrumb-home" src="<{$skinurl}>/<{$config.iconset}>/home.png" alt="<{$smarty.const._MB_MYMENUS_HOME}>" />
- </a>
- </li>
+ <li>
+ <a href="<{$xoops_url}>" alt="<{$smarty.const._MB_MYMENUS_HOME}>" title="<{$smarty.const._MB_MYMENUS_HOME}>" style="background-image:url('<{$skinurl}>/<{$config.iconset}>/bc_separator.png');">
+ <img class="mymenus-breadcrumb-home" src="<{$skinurl}>/<{$config.iconset}>/home.png" alt="<{$smarty.const._MB_MYMENUS_HOME}>" />
+ </a>
+ </li>
<{/if}>
<{foreach item=menu from=$block}>
- <{if $menu.selected && !$menu.topselected}>
- <li><a href="<{$menu.link}>" target="<{$menu.target}>" alt="<{$menu.alt_title}>" title="<{$menu.alt_title}>" style="background-image:url('<{$skinurl}>/<{$config.iconset}>/bc_separator.png');">
- <{$menu.title}>
- </a></li>
+ <{assign var=myStr value="["|cat:$xoops_langcode|cat:"]"}>
+ <{if ($xlanguage && (($menu.title|strstr:$myStr) OR ($menu.image|strstr:$myStr)) OR !$xlanguage)}>
+ <{if $menu.selected && !$menu.topselected}>
+ <li><a href="<{$menu.link}>" target="<{$menu.target}>" alt="<{$menu.alt_title}>" title="<{$menu.alt_title}>" style="background-image:url('<{$skinurl}>/<{$config.iconset}>/bc_separator.png');">
+ <{$menu.title}>
+ </a></li>
+ <{/if}>
+ <{if $menu.topselected}>
+ <li>
+ <{$menu.title}>
+ </li>
+ <{/if}>
<{/if}>
- <{if $menu.topselected}>
- <li>
- <{$menu.title}>
- </li>
- <{/if}>
-
<{/foreach}>
-</ul>
\ No newline at end of file
+</ul>
Modified: XoopsModules/mymenus/trunk/mymenus/skins/clean/template.html
===================================================================
--- XoopsModules/mymenus/trunk/mymenus/skins/clean/template.html 2014-03-25 05:05:24 UTC (rev 12407)
+++ XoopsModules/mymenus/trunk/mymenus/skins/clean/template.html 2014-03-25 08:47:48 UTC (rev 12408)
@@ -6,11 +6,18 @@
<ul>
<{/if}>
<{/if}>
+
+<{assign var=myStr value="["|cat:$xoops_langcode|cat:"]"}>
+<{if ($xlanguage && (($menu.title|strstr:$myStr) OR ($menu.image|strstr:$myStr)) OR !$xlanguage)}>
+
<{if $menu.level == 0}>
<li <{if $menu.css}>class="<{$menu.css}>"<{/if}>>
<a class="<{if $menu.selected}>active<{/if}>" href="<{$menu.link}>"><{$menu.title}></a>
<{if $menu.hassub}><ul class="dropdown-menu"><{/if}>
<{foreach item=sub from=$block}>
+
+ <{if ($xlanguage && (($menu.title|strstr:$myStr) OR ($menu.image|strstr:$myStr)) OR !$xlanguage)}>
+
<{if $menu.id == $sub.pid}>
<li <{if $sub.css}>class="<{$sub.css}>"<{/if}>>
<a class="<{if $sub.selected}>active<{/if}>" href="<{$sub.link}>" target="<{$sub.target}>" title="<{$sub.alt_title}>"><{$sub.title}></a>
@@ -21,13 +28,17 @@
<a class="<{if $subsub.selected}>active<{/if}>" href="<{$subsub.link}>" target="<{$subsub.target}>" title="<{$subsub.alt_title}>"><{$subsub.title}></a>
</li>
<{/if}>
- <{/foreach}>
+ <{/foreach}>
<{if $sub.hassub}></ul><{/if}>
</li>
<{/if}>
- <{/foreach}>
+ <{/if}>
+ <{/foreach}>
<{if $menu.hassub}></ul><{/if}>
</li>
<{/if}>
+<{/if}>
+
+
<{if $menu.close != ''}><{$menu.close}><{/if}>
-<{/foreach}>
\ No newline at end of file
+<{/foreach}>
Modified: XoopsModules/mymenus/trunk/mymenus/skins/default/templates/template.html
===================================================================
--- XoopsModules/mymenus/trunk/mymenus/skins/default/templates/template.html 2014-03-25 05:05:24 UTC (rev 12407)
+++ XoopsModules/mymenus/trunk/mymenus/skins/default/templates/template.html 2014-03-25 08:47:48 UTC (rev 12408)
@@ -10,7 +10,10 @@
<ul>
<{/if}>
<{/if}>
-
+
+
+
+
<{if $menu.oli}>
<{if $menu.level == 0}>
<li class="default_top" class="<{$menu.css}>">
@@ -18,6 +21,10 @@
<li class="<{$menu.css}>">
<{/if}>
<{/if}>
+
+<{assign var=myStr value="["|cat:$xoops_langcode|cat:"]"}>
+<{if ($xlanguage && (($menu.title|strstr:$myStr) OR ($menu.image|strstr:$myStr)) OR !$xlanguage)}>
+
<{if $menu.level == 0}>
<a href="<{$menu.link}>" class="default_top_link<{if $menu.selected}> default_selected<{/if}>" target="<{$menu.target}>" alt="<{$menu.alt_title}>" title="<{$menu.alt_title}>">
<span <{if $menu.hassub}>class="default_down"<{/if}>>
@@ -31,6 +38,9 @@
<{$menu.title}>
</a>
<{/if}>
+ <{/if}>
+
+
<{if $menu.close != ''}><{$menu.close}><{/if}>
-<{/foreach}>
\ No newline at end of file
+<{/foreach}>
Modified: XoopsModules/mymenus/trunk/mymenus/skins/mainmenu/templates/template.html
===================================================================
--- XoopsModules/mymenus/trunk/mymenus/skins/mainmenu/templates/template.html 2014-03-25 05:05:24 UTC (rev 12407)
+++ XoopsModules/mymenus/trunk/mymenus/skins/mainmenu/templates/template.html 2014-03-25 08:47:48 UTC (rev 12408)
@@ -1,20 +1,25 @@
<div id="mainmenu">
<{foreach item=menu from=$block}>
- <{if $menu.level == 0}>
- <a class="menuMain <{$menu.css}> <{if $menu.topselected}>maincurrent<{/if}>" href="<{$menu.link}>" target="<{$menu.target}>" title="<{$menu.alt_title}>">
- <{if $menu.image}><img src="<{$menu.image}>" /><{/if}>
- <{$menu.title}>
- </a>
- <{if $menu.selected}>
- <{foreach item=sub from=$block}>
- <{if $menu.id == $sub.pid}>
- <a class="menuSub <{$sub.css}> <{if $sub.selected}>maincurrent<{/if}>" href="<{$sub.link}>" target="<{$sub.target}>" title="<{$sub.alt_title}>">
- <{if $sub.image}><img src="<{$sub.image}>" /><{/if}>
- <{$sub.title}>
- </a>
+ <{if $menu.level == 0}>
+ <{assign var=myStr value="["|cat:$xoops_langcode|cat:"]"}>
+ <{if ($xlanguage && (($menu.title|strstr:$myStr) OR ($menu.image|strstr:$myStr)) OR !$xlanguage)}>
+ <a class="menuMain <{$menu.css}> <{if $menu.topselected}>maincurrent<{/if}>" href="<{$menu.link}>" target="<{$menu.target}>" title="<{$menu.alt_title}>">
+ <{if $menu.image}><img src="<{$menu.image}>"/><{/if}>
+ <{$menu.title}>
+ </a>
+ <{if $menu.selected}>
+ <{foreach item=sub from=$block}>
+ <{if $menu.id == $sub.pid}>
+ <{if ($xlanguage && (($menu.title|strstr:$myStr) OR ($menu.image|strstr:$myStr)) OR !$xlanguage)}>
+ <a class="menuSub <{$sub.css}> <{if $sub.selected}>maincurrent<{/if}>" href="<{$sub.link}>" target="<{$sub.target}>" title="<{$sub.alt_title}>">
+ <{if $sub.image}><img src="<{$sub.image}>"/><{/if}>
+ <{$sub.title}>
+ </a>
+ <{/if}>
+ <{/if}>
+ <{/foreach}>
+ <{/if}>
<{/if}>
- <{/foreach}>
<{/if}>
- <{/if}>
<{/foreach}>
-</div>
\ No newline at end of file
+</div>
Modified: XoopsModules/mymenus/trunk/mymenus/skins/multiblack/templates/template.html
===================================================================
--- XoopsModules/mymenus/trunk/mymenus/skins/multiblack/templates/template.html 2014-03-25 05:05:24 UTC (rev 12407)
+++ XoopsModules/mymenus/trunk/mymenus/skins/multiblack/templates/template.html 2014-03-25 08:47:48 UTC (rev 12408)
@@ -10,7 +10,7 @@
<ul>
<{/if}>
<{/if}>
-
+
<{if $menu.oli}>
<{if $menu.level == 0}>
<li class="top <{$menu.css}>">
@@ -18,6 +18,10 @@
<li class="<{$menu.css}>">
<{/if}>
<{/if}>
+
+<{assign var=myStr value="["|cat:$xoops_langcode|cat:"]"}>
+<{if ($xlanguage && (($menu.title|strstr:$myStr) OR ($menu.image|strstr:$myStr)) OR !$xlanguage)}>
+
<{if $menu.level == 0}>
<a href="<{$menu.link}>" class="top_link<{if $menu.selected}> selected<{/if}>" target="<{$menu.target}>" alt="<{$menu.alt_title}>" title="<{$menu.alt_title}>">
<span <{if $menu.hassub}>class="down"<{/if}>>
@@ -31,7 +35,10 @@
<{$menu.title}>
</a>
<{/if}>
+<{/if}>
+
+
<{if $menu.close != ''}><{$menu.close}><{/if}>
<{/foreach}>
Modified: XoopsModules/mymenus/trunk/mymenus/skins/superfish/templates/template.html
===================================================================
--- XoopsModules/mymenus/trunk/mymenus/skins/superfish/templates/template.html 2014-03-25 05:05:24 UTC (rev 12407)
+++ XoopsModules/mymenus/trunk/mymenus/skins/superfish/templates/template.html 2014-03-25 08:47:48 UTC (rev 12408)
@@ -1,19 +1,30 @@
<{foreach item=menu from = $block}>
+
+
+
<{if $menu.oul}>
<{if $menu.level == 0}>
- <ul class="sf-menu">
+
+ <ul class="sf-menu">
+
<{else}>
<ul>
<{/if}>
<{/if}>
-
+
+
<{if $menu.oli}>
<li class="<{$menu.css}> <{if $menu.selected}>current<{/if}>">
<{/if}>
- <a href="<{$menu.link}>" target="<{$menu.target}>" alt="<{$menu.alt_title}>" title="<{$menu.alt_title}>">
- <{if $main.image}><img src="<{$menu.image}>" /><{/if}>
- <{$menu.title}>
- </a>
- <{if $menu.close != ''}><{$menu.close}><{/if}>
+
+ <{assign var=myStr value="["|cat:$xoops_langcode|cat:"]"}>
+ <{if ($xlanguage && (($menu.title|strstr:$myStr) OR ($menu.image|strstr:$myStr)) OR !$xlanguage)}>
+
+ <a href="<{$menu.link}>" target="<{$menu.target}>" alt="<{$menu.alt_title}>" title="<{$menu.alt_title}>">
+ <{if $main.image}><img src="<{$menu.image}>" /><{/if}>
+ <{$menu.title}>
+ </a>
+ <{if $menu.close != ''}><{$menu.close}><{/if}>
+ <{/if}>
<{/foreach}>
-<div style="clear: both"></div>
\ No newline at end of file
+<div style="clear: both"></div>
Modified: XoopsModules/mymenus/trunk/mymenus/skins/superfish_navbar/templates/template.html
===================================================================
--- XoopsModules/mymenus/trunk/mymenus/skins/superfish_navbar/templates/template.html 2014-03-25 05:05:24 UTC (rev 12407)
+++ XoopsModules/mymenus/trunk/mymenus/skins/superfish_navbar/templates/template.html 2014-03-25 08:47:48 UTC (rev 12408)
@@ -1,19 +1,33 @@
<{foreach item=menu from = $block}>
<{if $menu.oul}>
<{if $menu.level == 0}>
- <ul class="sf-menu sf-navbar">
+
+ <ul class="sf-menu sf-navbar">
+
<{else}>
<ul>
<{/if}>
<{/if}>
-
+
+
+
<{if $menu.oli}>
<li class="<{if $menu.selected}>current <{/if}><{$menu.css}>">
<{/if}>
+
+ <{assign var=myStr value="["|cat:$xoops_langcode|cat:"]"}>
+ <{if ($xlanguage && (($menu.title|strstr:$myStr) OR ($menu.image|strstr:$myStr)) OR !$xlanguage)}>
+
<a href="<{$menu.link}>" target="<{$menu.target}>" alt="<{$menu.alt_title}>" title="<{$menu.alt_title}>">
<{if $main.image}><img src="<{$menu.image}>" /><{/if}>
<{$menu.title}>
</a>
+
+ <{/if}>
+
+
<{if $menu.close != ''}><{$menu.close}><{/if}>
+
+
<{/foreach}>
<div style="clear:both"></div>
Modified: XoopsModules/mymenus/trunk/mymenus/skins/tw_blue/templates/template.html
===================================================================
--- XoopsModules/mymenus/trunk/mymenus/skins/tw_blue/templates/template.html 2014-03-25 05:05:24 UTC (rev 12407)
+++ XoopsModules/mymenus/trunk/mymenus/skins/tw_blue/templates/template.html 2014-03-25 08:47:48 UTC (rev 12408)
@@ -3,43 +3,50 @@
<div class="nav-wrapper">
<div class="nav-left"></div>
<div class="nav">
- <ul id="navigation">
- <{foreach item=main from=$block}>
- <{if $main.level == 0}>
- <li class="<{if $main.selected}>active <{/if}><{$main.css}>">
- <a href="<{$main.link}>" target="<{$main.target}>" alt="<{$main.alt_title}>" title="<{$main.alt_title}>">
- <span class="menu-left"></span>
+ <ul id="navigation">
+
+ <{foreach item=menu from=$block}>
+ <{assign var=myStr value="["|cat:$xoops_langcode|cat:"]"}>
+ <{if ($xlanguage && (($menu.title|strstr:$myStr) OR ($menu.image|strstr:$myStr)) OR !$xlanguage)}>
+
+ <{if $menu.level == 0}>
+ <li class="<{if $menu.selected}>active <{/if}><{$menu.css}>">
+ <a href="<{$menu.link}>" target="<{$menu.target}>" alt="<{$menu.alt_title}>" title="<{$menu.alt_title}>">
+ <span class="menu-left"></span>
<span class="menu-mid">
- <{if $main.image}><img src="<{$main.image}>" /><{/if}>
- <{$main.title}>
+ <{if $menu.image}><img src="<{$menu.image}>" /><{/if}>
+ <{$menu.title}>
</span>
- <span class="menu-right"></span>
- </a>
-
- <{if $main.hassub}>
- <div class="sub">
- <ul>
- <{foreach item=sub from=$block}>
- <{if $sub.pid == $main.id}>
- <li class="<{$sub.css}>">
- <a href="<{$sub.link}>" target="<{$sub.target}>" alt="<{$sub.alt_title}>" title="<{$sub.alt_title}>">
- <{if $sub.image}><img src="<{$sub.image}>" /><{/if}>
- <{$sub.title}>
- </a>
- </li>
- <{/if}>
- <{/foreach}>
- </ul>
- <div class="btm-bg"></div>
- </div>
-
- <{/if}>
- </li>
- <{/if}>
- <{/foreach}>
- </ul>
- </div>
- <div class="nav-right"></div>
- </div>
- </div>
-</div>
\ No newline at end of file
+ <span class="menu-right"></span>
+ </a>
+ <{if $menu.hassub}>
+ <div class="sub">
+ <ul>
+ <{foreach item=sub from=$block}>
+ <{if $sub.pid == $menu.id}>
+
+ <{if ($xlanguage && (($menu.title|strstr:$myStr) OR ($menu.image|strstr:$myStr)) OR !$xlanguage)}>
+
+ <li class="<{$sub.css}>">
+ <a href="<{$sub.link}>" target="<{$sub.target}>" alt="<{$sub.alt_title}>" title="<{$sub.alt_title}>">
+ <{if $sub.image}><img src="<{$sub.image}>" /><{/if}>
+ <{$sub.title}>
+ </a>
+ </li>
+ <{/if}>
+ <{/if}>
+ <{/foreach}>
+ </ul>
+ <div class="btm-bg"></div>
+ </div>
+ <{/if}>
+ </li>
+ <{/if}>
+ <{/if}>
+ <{/foreach}>
+ </ul>
+ </div>
+ <div class="nav-right"></div>
+ </div>
+ </div>
+</div>
|