Skip to content

Commit 075ccd4

Browse files
committed
1.51 RC 3
1 parent 8be2c79 commit 075ccd4

20 files changed

+54
-73
lines changed

mymenus/admin/admin_header.php

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
*/
2020

2121
include_once dirname(dirname(dirname(__DIR__))) . '/mainfile.php';
22+
defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
2223
include_once $GLOBALS['xoops']->path('www/include/cp_functions.php');
2324
// Include xoops admin header
2425
include_once $GLOBALS['xoops']->path('www/include/cp_header.php');

mymenus/admin/index.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
* @version $Id: index.php
1919
*/
2020

21-
$currentFile = basename(__FILE__);
2221
include_once __DIR__ . '/admin_header.php';
22+
$currentFile = basename(__FILE__);
2323

2424
// admin navigation
2525
xoops_cp_header();

mymenus/admin/links.php

+7-6
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@
1818
* @version $Id: links.php
1919
*/
2020

21-
$currentFile = basename(__FILE__);
2221
include_once __DIR__ . '/admin_header.php';
2322

23+
$currentFile = basename(__FILE__);
24+
2425
$mymenusTpl = new XoopsTpl(); // will be removed???
2526
$mymenusAdminPage = 'links.php'; // will be removed???
2627
@@ -196,7 +197,7 @@ public static function mymenusAdminList($start = 0, $mid)
196197
$linksCriteria->setSort('weight');
197198
$linksCriteria->setOrder('ASC');
198199
//
199-
$menusArray = array();
200+
// $menusArray = array();
200201
if (($linksCount > 0) && ($linksCount >= (int)$start)) {
201202
$linksCriteria->setStart((int)$start);
202203
$linksArrays = $mymenus->getHandler('links')->getObjects($linksCriteria, false, false); // as array
@@ -317,10 +318,10 @@ public static function mymenusAdminForm($id = null, $pid = null, $mid = null)
317318
$xoopsLogger->activated = false;
318319
error_reporting(0);
319320

320-
global $pathIcon16;
321+
$pathIcon16 = $GLOBALS['xoops']->url('www/' . $GLOBALS['xoopsModule']->getInfo('systemIcons16'));
321322

322-
$registry =& MymenusRegistry::getInstance();
323-
$plugin =& MymenusPlugin::getInstance();
323+
// $registry =& MymenusRegistry::getInstance();
324+
// $plugin =& MymenusPlugin::getInstance();
324325

325326
$linksObj = $mymenus->getHandler('links')->get((int)$id);
326327

@@ -350,7 +351,7 @@ public static function mymenusAdminForm($id = null, $pid = null, $mid = null)
350351
if (count($menusList) > 1) {
351352
// display menu options (if more than 1 menu available
352353
if (!($linksObj->getVar('mid'))) { // initial menu value not set
353-
$menuValues = array_flip($menusList);
354+
// $menuValues = array_flip($menusList);
354355
$formmid = new XoopsFormSelect(_AM_MYMENUS_MENU_MENU, 'mid', $mid);//array_shift($menuValues));
355356
} else {
356357
$formmid = new XoopsFormSelect(_AM_MYMENUS_MENU_MENU, 'mid', $linksObj->getVar('mid'));

mymenus/admin/menu.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@
1818
* @version $Id: menu.php
1919
*/
2020

21-
if(!defined('XOOPS_ROOT_PATH')) {
22-
throw new Exception('XOOPS root path not defined');
23-
}
21+
defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
2422

2523
$moduleDirName = basename(dirname(__DIR__));
2624
$moduleHandler = &xoops_gethandler("module");

mymenus/blocks/mymenus_block.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@
1717
* @version $Id: mymenus_block.php
1818
*/
1919

20-
if (!defined('XOOPS_ROOT_PATH')) {
21-
throw new Exception('XOOPS root path not defined');
22-
}
20+
defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
21+
2322
include_once dirname(__DIR__) . '/include/common.php';
2423

2524
/**
@@ -198,7 +197,7 @@ function mymenus_block_edit($options)
198197
$form .= "</select>\n&nbsp;<i>" . _MB_MYMENUS_SELECT_MENU_DSC . "</i>\n<br /><br />\n";
199198
// option 1: moduleSkin
200199
xoops_load('XoopsLists');
201-
$tempModuleSkinsList = XoopsLists::getDirListAsArray($GLOBALS['xoops']->path("/modules/{$mymenus->dirname}/skins/"), '');
200+
$tempModuleSkinsList = XoopsLists::getDirListAsArray($GLOBALS['xoops']->path("modules/{$mymenus->dirname}/skins/"), '');
202201
$moduleSkinsList = array();
203202
foreach ($tempModuleSkinsList as $key => $moduleSkin) {
204203
if (file_exists($GLOBALS['xoops']->path("modules/{$mymenus->dirname}/skins/{$moduleSkin}/skin_version.php"))) {

mymenus/class/links.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@
1818
* @version $Id: links.php 12944 2015-01-23 13:05:09Z beckmi $
1919
*/
2020

21-
if(!defined('XOOPS_ROOT_PATH')) {
22-
throw new Exception('XOOPS root path not defined');
23-
}
21+
defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
22+
2423
include_once dirname(__DIR__) . '/include/common.php';
2524

2625
/**

mymenus/class/menus.php

+5-7
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@
1818
* @version $Id: menus.php 0 2010-07-21 18:47:04Z trabis $
1919
*/
2020

21-
if(!defined('XOOPS_ROOT_PATH')) {
22-
throw new Exception('XOOPS root path not defined');
23-
}
21+
defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
2422

2523
include_once dirname(__DIR__) . '/include/common.php';
2624

@@ -55,17 +53,17 @@ public function __construct()
5553
*/
5654
public function getForm($action = false)
5755
{
58-
$grouppermHandler = xoops_gethandler('groupperm');
56+
// $grouppermHandler = xoops_gethandler('groupperm');
5957
//
6058
xoops_load('XoopsFormLoader');
6159
//
6260
if ($action === false) {
6361
// $action = $_SERVER['REQUEST_URI'];
64-
$action = XoopsRequest::getString('REQUEST_URI','', 'SERVER');
62+
$action = XoopsRequest::getString('REQUEST_URI', '', 'SERVER');
6563
}
6664
//
67-
$isAdmin = mymenusUserIsAdmin();
68-
$groups = is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getGroups() : array(0 => XOOPS_GROUP_ANONYMOUS);
65+
// $isAdmin = mymenusUserIsAdmin();
66+
// $groups = is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getGroups() : array(0 => XOOPS_GROUP_ANONYMOUS);
6967
//
7068
$title = $this->isNew() ? _AM_MYMENUS_MENUS_ADD : _AM_MYMENUS_MENUS_EDIT;
7169
//

mymenus/class/mymenus.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@
1919
* @version svn:$id$
2020
*/
2121

22-
if(!defined('XOOPS_ROOT_PATH')) {
23-
throw new Exception('XOOPS root path not defined');
24-
}
22+
defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
2523

2624
/**
2725
* Class MymenusMymenus

mymenus/class/plugin.php

+12-10
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@
1818
* @version $Id: plugin.php 12944 2015-01-23 13:05:09Z beckmi $
1919
*/
2020

21-
if (!defined('XOOPS_ROOT_PATH')) {
22-
throw new Exception('XOOPS root path not defined');
23-
}
21+
defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
22+
2423
include_once dirname(__DIR__) . '/include/common.php';
2524
xoops_load('XoopsLists');
2625
include_once $GLOBALS['xoops']->path("modules/{$mymenus->dirname}/class/registry.php");
@@ -65,7 +64,7 @@ public static function &getInstance()
6564
public function setPlugins()
6665
{
6766
if (is_dir($dir = $GLOBALS['xoops']->path("modules/{$this->mymenus->dirname}/plugins/"))) {
68-
$pluginsList = XoopsLists::getDirListAsArray($dir, '');
67+
$pluginsList = XoopsLists::getDirListAsArray($dir);
6968
foreach ($pluginsList as $plugin) {
7069
if (file_exists($GLOBALS['xoops']->path("modules/{$this->mymenus->dirname}/plugins/{$plugin}/{$plugin}.php"))) {
7170
$this->plugins[] = $plugin;
@@ -77,7 +76,7 @@ public function setPlugins()
7776
public function setEvents()
7877
{
7978
foreach ($this->plugins as $plugin) {
80-
include_once $GLOBALS['xoops']->path("/modules/{$this->mymenus->dirname}/plugins/{$plugin}/{$plugin}.php");
79+
include_once $GLOBALS['xoops']->path("modules/{$this->mymenus->dirname}/plugins/{$plugin}/{$plugin}.php");
8180
$className = ucfirst($plugin) . 'MymenusPluginItem';
8281
if (!class_exists($className)) {
8382
continue;
@@ -123,11 +122,14 @@ public function loadLanguage($name)
123122
{
124123
$mymenus = MymenusMymenus::getInstance();
125124
$language = $GLOBALS['xoopsConfig']['language'];
126-
$path = $GLOBALS['xoops']->path("modules/{$mymenus->dirname}/plugins/{$name}/language");
127-
if (!($ret = @include_once "{$path}/{$language}/{$name}.php")) {
128-
$ret = @include_once "{$path}/english/{$name}.php";
129-
}
125+
// $path = $GLOBALS['xoops']->path("modules/{$mymenus->dirname}/plugins/{$name}/language");
126+
// if (!($ret = @include_once "{$path}/{$language}/{$name}.php")) {
127+
// $ret = @include_once "{$path}/english/{$name}.php";
128+
// }
129+
// return $ret;
130130

131-
return $ret;
131+
$path2 = "{$mymenus->dirname}/plugins/{$name}/{$language}/";
132+
xoops_loadLanguage($name, $path2);
133+
return true;
132134
}
133135
}

mymenus/class/registry.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@
1818
* @version $Id: registry.php 12944 2015-01-23 13:05:09Z beckmi $
1919
*/
2020

21-
if(!defined('XOOPS_ROOT_PATH')) {
22-
throw new Exception('XOOPS root path not defined');
23-
}
21+
defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
2422

2523
/**
2624
* Class MymenusRegistry

mymenus/docs/changelog.txt

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
<u>Version 1.51 RC 3 (2015-02-27)</u>
2+
- reverting "throw new Exception" for XOOPS_ROOT_PATH check (zyspec/mamba)
3+
14
<u>Version 1.51 RC 2 (2015-02-27)</u>
25
- added check for empty $options[5] element (mamba)
36
- more PSR-2 updates (mamba)

mymenus/include/common.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@
1919
* @version svn:$id$
2020
*/
2121

22-
if(!defined('XOOPS_ROOT_PATH')) {
23-
throw new Exception('XOOPS root path not defined');
24-
}
22+
defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
2523

2624
// This must contain the name of the folder in which reside mymenus
2725
define("MYMENUS_DIRNAME", basename(dirname(__DIR__)));

mymenus/include/config.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<?php
22

3-
if(!defined('XOOPS_ROOT_PATH')) {
4-
throw new Exception('XOOPS root path not defined');
5-
}
3+
defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
64

75
// module information
86
$moduleImageUrl = MYMENUS_URL . "/assets/images/mymenus.png";

mymenus/include/functions.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@
1818
* @version $Id: functions.php 0 2010-07-21 18:47:04Z trabis $
1919
*/
2020

21-
if(!defined('XOOPS_ROOT_PATH')) {
22-
throw new Exception('XOOPS root path not defined');
23-
}
21+
defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
22+
2423
include_once __DIR__ . '/common.php';
2524

2625
/**
@@ -53,7 +52,7 @@ function mymenusGetSkinInfo($moduleSkin = 'default', $useThemeSkin = false, $the
5352
{
5453
include_once __DIR__ . '/common.php';
5554
$mymenus = MymenusMymenus::getInstance();
56-
$error = false;
55+
$error = false;
5756
if ($useThemeSkin) {
5857
$path = "themes/" . $GLOBALS['xoopsConfig']['theme_set'] . "/menu";
5958
if (!file_exists($GLOBALS['xoops']->path("{$path}/skin_version.php"))) {

mymenus/include/onupdate.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@
1919
* @version svn:$id$
2020
*/
2121

22-
if (!defined('XOOPS_ROOT_PATH')) {
23-
throw new Exception('XOOPS root path not defined');
24-
}
22+
defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
23+
2524
//$moduleDirname = basename(dirname(__DIR__));
2625
//include_once(XOOPS_ROOT_PATH . "/modules/$moduleDirname/include/common.php");
2726
include_once __DIR__ . '/common.php';

mymenus/plugins/constant/constant.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@
1818
* @version $Id: constant.php 12944 2015-01-23 13:05:09Z beckmi $
1919
*/
2020

21-
if(!defined('XOOPS_ROOT_PATH')) {
22-
throw new Exception('XOOPS root path not defined');
23-
}
21+
defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
2422

2523
/**
2624
* Class ConstantMymenusPluginItem

mymenus/plugins/dynamic/dynamic.php

+3-5
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@
1818
* @version $Id: dynamic.php 12944 2015-01-23 13:05:09Z beckmi $
1919
*/
2020

21-
if(!defined('XOOPS_ROOT_PATH')) {
22-
throw new Exception('XOOPS root path not defined');
23-
}
21+
defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
2422

2523
/**
2624
* Class DynamicMymenusPluginItem
@@ -79,11 +77,11 @@ protected function getModuleMenus($module, $pid)
7977
// @TODO: check the following 2 statements, they're basically just assigns - is this intended?
8078
$_xoopsModule = ($xoopsModule instanceof XoopsModule) ? $xoopsModule : $xoopsModule;
8179
$_xoopsModuleConfig = is_object($xoopsModuleConfig) ? $xoopsModuleConfig : $xoopsModuleConfig;
82-
$moduleHandler =& xoops_gethandler('module');
80+
$moduleHandler =& xoops_gethandler('module');
8381
$xoopsModule =& $moduleHandler->getByDirname($module);
8482
$GLOBALS['xoopsModule'] =& $xoopsModule;
8583
if ($xoopsModule instanceof XoopsModule) {
86-
$configHandler =& xoops_gethandler('config');
84+
$configHandler =& xoops_gethandler('config');
8785
$xoopsModuleConfig =& $configHandler->getConfigsByCat(0, $xoopsModule->getVar('mid'));
8886
$GLOBALS['xoopsModuleConfig'] =& $xoopsModuleConfig;
8987
}

mymenus/plugins/mymenus/mymenus.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@
1818
* @version $Id: mymenus.php 12940 2015-01-21 17:33:38Z zyspec $
1919
*/
2020

21-
if (!defined('XOOPS_ROOT_PATH')) {
22-
throw new Exception('XOOPS root path not defined');
23-
}
21+
defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
2422

2523
/**
2624
* Class MymenusMymenusPluginItem

mymenus/plugins/smarty/smarty.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@
1818
* @version $Id: smarty.php 12944 2015-01-23 13:05:09Z beckmi $
1919
*/
2020

21-
if(!defined('XOOPS_ROOT_PATH')) {
22-
throw new Exception('XOOPS root path not defined');
23-
}
21+
defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
2422

2523
/**
2624
* Class SmartyMymenusPluginItem

mymenus/xoops_version.php

+4-6
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@
1818
* @version $Id: xoops_version.php 12944 2015-01-23 13:05:09Z beckmi $
1919
*/
2020

21-
if (!defined('XOOPS_ROOT_PATH')) {
22-
throw new Exception('XOOPS root path not defined');
23-
}
21+
defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
2422

2523
$moduleDirName = basename(__DIR__);
2624

@@ -38,7 +36,7 @@
3836
'help' => "page=help",
3937
//
4038
'release_info' => "release_info",
41-
'release' => "2015-02-27",
39+
'release' => "2015-03-07",
4240
'release_file' => XOOPS_URL . "/modules/{$moduleDirName}/docs/release_info file",
4341

4442
//
@@ -60,8 +58,8 @@
6058
'moduleIcons32' => "assets/images/icons/32",
6159
//About
6260
'version' => 1.51,
63-
'module_status' => "RC 2",
64-
'release_date' => "2015/02/27", // YYYY/mm/dd
61+
'module_status' => "RC 3",
62+
'release_date' => "2015/03/07", // YYYY/mm/dd
6563

6664
'demo_site_url' => "http://www.xoops.org",
6765
'demo_site_name' => "XOOPS Demo Site",

0 commit comments

Comments
 (0)