@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // |
30 | 30 | // ------------------------------------------------------------------------ // |
31 | 31 | |
32 | -require_once dirname(__DIR__).'/class/AltsysBreadcrumbs.class.php' ; |
|
32 | +require_once dirname(__DIR__).'/class/AltsysBreadcrumbs.class.php'; |
|
33 | 33 | include_once XOOPS_ROOT_PATH.'/class/xoopsblock.php'; |
34 | 34 | |
35 | 35 | $xoopsOption['theme_use_smarty'] = 1; |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | //HACK by domifara |
59 | 59 | if (defined('XOOPS_CUBE_LEGACY')) { |
60 | 60 | $handler = xoops_gethandler('block'); |
61 | - $xoopsblock =& $handler->create(false) ; |
|
61 | + $xoopsblock = & $handler->create(false); |
|
62 | 62 | } else { |
63 | 63 | $xoopsblock = new XoopsBlock(); |
64 | 64 | } |
@@ -68,46 +68,46 @@ discard block |
||
68 | 68 | if (is_object($xoopsUser)) { |
69 | 69 | $xoopsTpl->assign(array('xoops_isuser' => true, 'xoops_userid' => $xoopsUser->getVar('uid'), 'xoops_uname' => $xoopsUser->getVar('uname'), 'xoops_isadmin' => $xoopsUserIsAdmin)); |
70 | 70 | if (is_object(@$xoopsModule)) { |
71 | - if ($xoopsModule->getVar('mid') == 1 && @$_GET['fct'] == 'preferences' && @$_GET['op'] == 'showmod' && ! empty($_GET['mod'])) { |
|
72 | - $module_handler = xoops_gethandler('module') ; |
|
73 | - $target_module = $module_handler->get((int)$_GET['mod']) ; |
|
71 | + if ($xoopsModule->getVar('mid') == 1 && @$_GET['fct'] == 'preferences' && @$_GET['op'] == 'showmod' && !empty($_GET['mod'])) { |
|
72 | + $module_handler = xoops_gethandler('module'); |
|
73 | + $target_module = $module_handler->get((int)$_GET['mod']); |
|
74 | 74 | } else { |
75 | - $target_module =& $xoopsModule ; |
|
75 | + $target_module = & $xoopsModule; |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | // set page title |
79 | 79 | $xoopsTpl->assign(array('xoops_pagetitle' => $target_module->getVar('name'), 'xoops_modulename' => $target_module->getVar('name'), 'xoops_dirname' => $target_module->getVar('dirname'))); |
80 | 80 | |
81 | 81 | // xoops_breadcrumbs |
82 | - $breadcrumbsObj =& AltsysBreadcrumbs::getInstance() ; |
|
82 | + $breadcrumbsObj = & AltsysBreadcrumbs::getInstance(); |
|
83 | 83 | if ($breadcrumbsObj->hasPaths()) { |
84 | - $xoops_breadcrumbs = $breadcrumbsObj->getXoopsBreadcrumbs() ; |
|
84 | + $xoops_breadcrumbs = $breadcrumbsObj->getXoopsBreadcrumbs(); |
|
85 | 85 | } else { |
86 | - $mod_url = XOOPS_URL.'/modules/'.$target_module->getVar('dirname') ; |
|
87 | - $mod_path = XOOPS_ROOT_PATH.'/modules/'.$target_module->getVar('dirname') ; |
|
88 | - $modinfo = $target_module->getInfo() ; |
|
89 | - $xoops_breadcrumbs = array() ; |
|
90 | - if (! empty($modinfo['hasMain'])) { |
|
86 | + $mod_url = XOOPS_URL.'/modules/'.$target_module->getVar('dirname'); |
|
87 | + $mod_path = XOOPS_ROOT_PATH.'/modules/'.$target_module->getVar('dirname'); |
|
88 | + $modinfo = $target_module->getInfo(); |
|
89 | + $xoops_breadcrumbs = array(); |
|
90 | + if (!empty($modinfo['hasMain'])) { |
|
91 | 91 | $xoops_breadcrumbs[] = array( |
92 | - 'url' => $mod_url.'/' , |
|
92 | + 'url' => $mod_url.'/', |
|
93 | 93 | 'name' => sprintf(_MD_A_AINTHEME_FMT_PUBLICTOP, $target_module->getVar('name')) |
94 | - ) ; |
|
94 | + ); |
|
95 | 95 | } |
96 | - if (! empty($modinfo['adminindex'])) { |
|
96 | + if (!empty($modinfo['adminindex'])) { |
|
97 | 97 | $xoops_breadcrumbs[] = array( |
98 | - 'url' => $mod_url.'/'.$modinfo['adminindex'] , |
|
98 | + 'url' => $mod_url.'/'.$modinfo['adminindex'], |
|
99 | 99 | 'name' => sprintf(_MD_A_AINTHEME_FMT_ADMINTOP, $target_module->getVar('name')) |
100 | - ) ; |
|
100 | + ); |
|
101 | 101 | } |
102 | - if (! empty($GLOBALS['altsysAdminPageTitle'])) { |
|
103 | - $xoops_breadcrumbs[] = array( 'name' => htmlspecialchars($GLOBALS['altsysAdminPageTitle'], ENT_QUOTES) ) ; |
|
104 | - } elseif (! empty($modinfo['adminmenu'])) { |
|
105 | - @include $mod_path.'/'.$modinfo['adminmenu'] ; |
|
102 | + if (!empty($GLOBALS['altsysAdminPageTitle'])) { |
|
103 | + $xoops_breadcrumbs[] = array('name' => htmlspecialchars($GLOBALS['altsysAdminPageTitle'], ENT_QUOTES)); |
|
104 | + } elseif (!empty($modinfo['adminmenu'])) { |
|
105 | + @include $mod_path.'/'.$modinfo['adminmenu']; |
|
106 | 106 | if (is_array(@$adminmenu)) { |
107 | 107 | foreach ($adminmenu as $eachmenu) { |
108 | 108 | if (strstr($_SERVER['REQUEST_URI'], $eachmenu['link'])) { |
109 | - $xoops_breadcrumbs[] = array( 'name' => $eachmenu['title'] ) ; |
|
110 | - break ; |
|
109 | + $xoops_breadcrumbs[] = array('name' => $eachmenu['title']); |
|
110 | + break; |
|
111 | 111 | } |
112 | 112 | } |
113 | 113 | } |
@@ -116,21 +116,21 @@ discard block |
||
116 | 116 | |
117 | 117 | //$block_arr =& $xoopsblock->getAllByGroupModule($xoopsUser->getGroups(), $target_module->getVar('mid'), false, XOOPS_BLOCK_VISIBLE); |
118 | 118 | } else { |
119 | - $xoopsTpl->assign(array( 'xoops_pagetitle' => _CPHOME )) ; |
|
119 | + $xoopsTpl->assign(array('xoops_pagetitle' => _CPHOME)); |
|
120 | 120 | $xoops_breadcrumbs = array( |
121 | 121 | array( |
122 | - 'url' => XOOPS_URL.'/admin.php' , |
|
122 | + 'url' => XOOPS_URL.'/admin.php', |
|
123 | 123 | 'name' => _CPHOME |
124 | 124 | ) |
125 | - ) ; |
|
125 | + ); |
|
126 | 126 | } |
127 | 127 | } else { |
128 | - exit ; |
|
128 | + exit; |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | // get block_arr |
132 | - $db = XoopsDatabaseFactory::getDatabaseConnection() ; |
|
133 | - $sql = 'SELECT DISTINCT gperm_itemid FROM ' . $db->prefix('group_permission') . " WHERE gperm_name = 'block_read' AND gperm_modid = 1 AND gperm_groupid IN (" . implode(',', $xoopsUser->getGroups()) . ')'; |
|
132 | + $db = XoopsDatabaseFactory::getDatabaseConnection(); |
|
133 | + $sql = 'SELECT DISTINCT gperm_itemid FROM '.$db->prefix('group_permission')." WHERE gperm_name = 'block_read' AND gperm_modid = 1 AND gperm_groupid IN (".implode(',', $xoopsUser->getGroups()).')'; |
|
134 | 134 | $result = $db->query($sql); |
135 | 135 | |
136 | 136 | $blockids = array(); |
@@ -138,30 +138,30 @@ discard block |
||
138 | 138 | $blockids[] = (int)$blockid; |
139 | 139 | } |
140 | 140 | |
141 | - global $block_arr , $i ; // for piCal :-) |
|
142 | - $block_arr = array() ; |
|
141 | + global $block_arr, $i; // for piCal :-) |
|
142 | + $block_arr = array(); |
|
143 | 143 | if (!empty($blockids)) { |
144 | - $sql = 'SELECT b.* FROM '.$db->prefix('newblocks').' b, '.$db->prefix('block_module_link').' m WHERE m.block_id=b.bid AND b.isactive=1 AND b.visible=1 AND m.module_id=' . (int)$altsysModuleId |
|
145 | - . ' AND b.bid IN (' . implode(',', $blockids) . ') ORDER BY b.weight,b.bid' ; |
|
144 | + $sql = 'SELECT b.* FROM '.$db->prefix('newblocks').' b, '.$db->prefix('block_module_link').' m WHERE m.block_id=b.bid AND b.isactive=1 AND b.visible=1 AND m.module_id='.(int)$altsysModuleId |
|
145 | + . ' AND b.bid IN ('.implode(',', $blockids).') ORDER BY b.weight,b.bid'; |
|
146 | 146 | $result = $db->query($sql); |
147 | 147 | while ($myrow = $db->fetchArray($result)) { |
148 | 148 | |
149 | 149 | //HACK by domifara |
150 | 150 | if (defined('XOOPS_CUBE_LEGACY')) { |
151 | - $block =& $handler->create(false) ; |
|
151 | + $block = & $handler->create(false); |
|
152 | 152 | $block->assignVars($myrow); |
153 | 153 | } else { |
154 | - $block = new XoopsBlock($myrow) ; |
|
154 | + $block = new XoopsBlock($myrow); |
|
155 | 155 | } |
156 | 156 | |
157 | - $block_arr[ $myrow['bid'] ] = $block ; |
|
157 | + $block_arr[$myrow['bid']] = $block; |
|
158 | 158 | } |
159 | 159 | } |
160 | 160 | |
161 | - $adminmenublock_exists = false ; |
|
161 | + $adminmenublock_exists = false; |
|
162 | 162 | foreach (array_keys($block_arr) as $i) { |
163 | 163 | if ($block_arr[$i]->getVar('show_func') == 'b_altsys_admin_menu_show') { |
164 | - $adminmenublock_exists = true ; |
|
164 | + $adminmenublock_exists = true; |
|
165 | 165 | } |
166 | 166 | $bcachetime = $block_arr[$i]->getVar('bcachetime'); |
167 | 167 | if (empty($bcachetime)) { |
@@ -242,15 +242,15 @@ discard block |
||
242 | 242 | } |
243 | 243 | |
244 | 244 | // FALLBACK inserting admin_menu_block in admin side |
245 | - if (! $adminmenublock_exists) { |
|
246 | - require_once XOOPS_ROOT_PATH.'/modules/altsys/blocks/blocks.php' ; |
|
247 | - $admin_menu_block = array( b_altsys_admin_menu_show(array( 'altsys' )) ) ; |
|
248 | - $admin_menu_block[0]['title'] = 'Admin Menu' ; |
|
249 | - $lblocks =& $xoopsTpl->get_template_vars('xoops_lblocks') ; |
|
250 | - if (! is_array($lblocks)) { |
|
251 | - $lblocks = array() ; |
|
245 | + if (!$adminmenublock_exists) { |
|
246 | + require_once XOOPS_ROOT_PATH.'/modules/altsys/blocks/blocks.php'; |
|
247 | + $admin_menu_block = array(b_altsys_admin_menu_show(array('altsys'))); |
|
248 | + $admin_menu_block[0]['title'] = 'Admin Menu'; |
|
249 | + $lblocks = & $xoopsTpl->get_template_vars('xoops_lblocks'); |
|
250 | + if (!is_array($lblocks)) { |
|
251 | + $lblocks = array(); |
|
252 | 252 | } |
253 | - $xoopsTpl->assign('xoops_lblocks', array_merge($admin_menu_block, $lblocks)) ; |
|
253 | + $xoopsTpl->assign('xoops_lblocks', array_merge($admin_menu_block, $lblocks)); |
|
254 | 254 | } |
255 | 255 | |
256 | 256 | //unset($block_arr); |
@@ -1,11 +1,11 @@ discard block |
||
1 | 1 | <?php |
2 | -require_once dirname(__DIR__).'/class/altsysUtils.class.php' ; |
|
2 | +require_once dirname(__DIR__).'/class/altsysUtils.class.php'; |
|
3 | 3 | |
4 | -define('ALTSYS_ADMINMENU_FILE', XOOPS_CACHE_PATH.'/adminmenu.php') ; |
|
5 | -define('ALTSYS_ADMINMENU_HACK_NONE', 0) ; |
|
6 | -define('ALTSYS_ADMINMENU_HACK_2COL', 1) ; |
|
7 | -define('ALTSYS_ADMINMENU_HACK_NOIMG', 2) ; |
|
8 | -define('ALTSYS_ADMINMENU_HACK_XCSTY', 3) ; |
|
4 | +define('ALTSYS_ADMINMENU_FILE', XOOPS_CACHE_PATH.'/adminmenu.php'); |
|
5 | +define('ALTSYS_ADMINMENU_HACK_NONE', 0); |
|
6 | +define('ALTSYS_ADMINMENU_HACK_2COL', 1); |
|
7 | +define('ALTSYS_ADMINMENU_HACK_NOIMG', 2); |
|
8 | +define('ALTSYS_ADMINMENU_HACK_XCSTY', 3); |
|
9 | 9 | |
10 | 10 | |
11 | 11 | // |
@@ -13,73 +13,73 @@ discard block |
||
13 | 13 | // |
14 | 14 | function altsys_adminmenu_insert_mymenu(&$module) |
15 | 15 | { |
16 | - global $altsysModuleConfig ; |
|
16 | + global $altsysModuleConfig; |
|
17 | 17 | |
18 | 18 | if (empty($altsysModuleConfig['adminmenu_insert_mymenu'])) { |
19 | - return ; |
|
19 | + return; |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | if (altsys_get_core_type() < ALTSYS_CORE_TYPE_ORE) { |
23 | - altsys_adminmenu_insert_mymenu_x20($module) ; |
|
23 | + altsys_adminmenu_insert_mymenu_x20($module); |
|
24 | 24 | } |
25 | 25 | } |
26 | 26 | |
27 | 27 | function altsys_adminmenu_insert_mymenu_x20(&$module) |
28 | 28 | { |
29 | 29 | // read |
30 | - if (! file_exists(ALTSYS_ADMINMENU_FILE)) { |
|
31 | - redirect_header(XOOPS_URL.'/admin.php', 1, 'Rebuild adminmenu') ; |
|
32 | - exit ; |
|
30 | + if (!file_exists(ALTSYS_ADMINMENU_FILE)) { |
|
31 | + redirect_header(XOOPS_URL.'/admin.php', 1, 'Rebuild adminmenu'); |
|
32 | + exit; |
|
33 | 33 | } |
34 | - $not_inside_cp_functions = true ; |
|
35 | - include ALTSYS_ADMINMENU_FILE ; |
|
34 | + $not_inside_cp_functions = true; |
|
35 | + include ALTSYS_ADMINMENU_FILE; |
|
36 | 36 | |
37 | - $dirname = $module->getVar('dirname') ; |
|
38 | - $mid = $module->getVar('mid') ; |
|
39 | - $anchor = '<!-- ALTSYS ANCHOR '.$dirname.' -->' ; |
|
37 | + $dirname = $module->getVar('dirname'); |
|
38 | + $mid = $module->getVar('mid'); |
|
39 | + $anchor = '<!-- ALTSYS ANCHOR '.$dirname.' -->'; |
|
40 | 40 | |
41 | 41 | // fetch popup_no |
42 | 42 | if (empty($xoops_admin_menu_ft[$mid])) { |
43 | - return ; |
|
43 | + return; |
|
44 | 44 | } |
45 | - if (! preg_match('/popUpL(\d+)/', $xoops_admin_menu_ft[$mid], $regs)) { |
|
46 | - return ; |
|
45 | + if (!preg_match('/popUpL(\d+)/', $xoops_admin_menu_ft[$mid], $regs)) { |
|
46 | + return; |
|
47 | 47 | } |
48 | 48 | $popup_no = (int)$regs[1]; |
49 | 49 | |
50 | 50 | // replace |
51 | - $search = '<img src=\''.XOOPS_URL.'/images/pointer.gif\' width=\'8\' height=\'8\' alt=\'\' /> <a href=\''.XOOPS_URL.'/modules/system/admin.php?fct=preferences&op=showmod&mod='.$mid.'\'' ; |
|
52 | - $replace = $anchor.'<img src=\''.XOOPS_URL.'/images/pointer.gif\' width=\'8\' height=\'8\' alt=\'\' /> <a href=\''.XOOPS_URL.'/modules/'.$dirname.'/admin/index.php?mode=admin&lib=altsys&page=mypreferences\'' ; |
|
51 | + $search = '<img src=\''.XOOPS_URL.'/images/pointer.gif\' width=\'8\' height=\'8\' alt=\'\' /> <a href=\''.XOOPS_URL.'/modules/system/admin.php?fct=preferences&op=showmod&mod='.$mid.'\''; |
|
52 | + $replace = $anchor.'<img src=\''.XOOPS_URL.'/images/pointer.gif\' width=\'8\' height=\'8\' alt=\'\' /> <a href=\''.XOOPS_URL.'/modules/'.$dirname.'/admin/index.php?mode=admin&lib=altsys&page=mypreferences\''; |
|
53 | 53 | |
54 | 54 | // do replacement |
55 | - $new_xoops_admin_menu_dv = preg_replace('#'.preg_quote($search).'#', $replace, $xoops_admin_menu_dv) ; |
|
55 | + $new_xoops_admin_menu_dv = preg_replace('#'.preg_quote($search).'#', $replace, $xoops_admin_menu_dv); |
|
56 | 56 | |
57 | 57 | if ($xoops_admin_menu_dv == $new_xoops_admin_menu_dv) { |
58 | - return ; |
|
58 | + return; |
|
59 | 59 | } |
60 | - $xoops_admin_menu_dv = $new_xoops_admin_menu_dv ; |
|
60 | + $xoops_admin_menu_dv = $new_xoops_admin_menu_dv; |
|
61 | 61 | |
62 | - $insert = '' ; |
|
62 | + $insert = ''; |
|
63 | 63 | |
64 | 64 | // insert blocksadmin |
65 | 65 | if ($dirname != 'altsys') { |
66 | - $blocksadmin_title = defined('_MD_A_MYMENU_MYBLOCKSADMIN') ? _MD_A_MYMENU_MYBLOCKSADMIN : 'blocksadmin' ; |
|
67 | - $insert .= '<img src=\''.XOOPS_URL.'/images/pointer.gif\' width=\'8\' height=\'8\' alt=\'\' /> <a href=\''.XOOPS_URL.'/modules/'.$dirname.'/admin/index.php?mode=admin&lib=altsys&page=myblocksadmin\'>'.$blocksadmin_title.'</a><br />'."\n" ; |
|
66 | + $blocksadmin_title = defined('_MD_A_MYMENU_MYBLOCKSADMIN') ? _MD_A_MYMENU_MYBLOCKSADMIN : 'blocksadmin'; |
|
67 | + $insert .= '<img src=\''.XOOPS_URL.'/images/pointer.gif\' width=\'8\' height=\'8\' alt=\'\' /> <a href=\''.XOOPS_URL.'/modules/'.$dirname.'/admin/index.php?mode=admin&lib=altsys&page=myblocksadmin\'>'.$blocksadmin_title.'</a><br />'."\n"; |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | // insert tplsadmin |
71 | - $db = XoopsDatabaseFactory::getDatabaseConnection() ; |
|
72 | - list($count) = $db->fetchRow($db->query('SELECT COUNT(*) FROM ' . $db->prefix('tplfile') . " WHERE tpl_module='$dirname'")) ; |
|
71 | + $db = XoopsDatabaseFactory::getDatabaseConnection(); |
|
72 | + list($count) = $db->fetchRow($db->query('SELECT COUNT(*) FROM '.$db->prefix('tplfile')." WHERE tpl_module='$dirname'")); |
|
73 | 73 | if ($count > 0) { |
74 | - $tplsadmin_title = defined('_MD_A_MYMENU_MYTPLSADMIN') ? _MD_A_MYMENU_MYTPLSADMIN : 'tplsadmin' ; |
|
75 | - $insert = '<img src=\''.XOOPS_URL.'/images/pointer.gif\' width=\'8\' height=\'8\' alt=\'\' /> <a href=\''.XOOPS_URL.'/modules/'.$dirname.'/admin/index.php?mode=admin&lib=altsys&page=mytplsadmin\'>'.$tplsadmin_title.'</a><br />'."\n".$insert ; |
|
74 | + $tplsadmin_title = defined('_MD_A_MYMENU_MYTPLSADMIN') ? _MD_A_MYMENU_MYTPLSADMIN : 'tplsadmin'; |
|
75 | + $insert = '<img src=\''.XOOPS_URL.'/images/pointer.gif\' width=\'8\' height=\'8\' alt=\'\' /> <a href=\''.XOOPS_URL.'/modules/'.$dirname.'/admin/index.php?mode=admin&lib=altsys&page=mytplsadmin\'>'.$tplsadmin_title.'</a><br />'."\n".$insert; |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | // do insertion |
79 | - $xoops_admin_menu_dv = preg_replace('#'.preg_quote($anchor).'#', $anchor.$insert, $xoops_admin_menu_dv) ; |
|
79 | + $xoops_admin_menu_dv = preg_replace('#'.preg_quote($anchor).'#', $anchor.$insert, $xoops_admin_menu_dv); |
|
80 | 80 | |
81 | 81 | // write back |
82 | - altsys_adminmenu_save_x20(array( 'xoops_admin_menu_js' => $xoops_admin_menu_js, 'xoops_admin_menu_ml' => $xoops_admin_menu_ml, 'xoops_admin_menu_sd' => $xoops_admin_menu_sd, 'xoops_admin_menu_ft' => $xoops_admin_menu_ft, 'xoops_admin_menu_dv' => $xoops_admin_menu_dv, 'altsys_adminmenu_ft_hacked' => (int)(@$altsys_adminmenu_ft_hacked), 'altsys_adminmenu_dv_updated' => true )) ; |
|
82 | + altsys_adminmenu_save_x20(array('xoops_admin_menu_js' => $xoops_admin_menu_js, 'xoops_admin_menu_ml' => $xoops_admin_menu_ml, 'xoops_admin_menu_sd' => $xoops_admin_menu_sd, 'xoops_admin_menu_ft' => $xoops_admin_menu_ft, 'xoops_admin_menu_dv' => $xoops_admin_menu_dv, 'altsys_adminmenu_ft_hacked' => (int)(@$altsys_adminmenu_ft_hacked), 'altsys_adminmenu_dv_updated' => true)); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | // |
@@ -87,184 +87,184 @@ discard block |
||
87 | 87 | // |
88 | 88 | function altsys_adminmenu_hack_ft() |
89 | 89 | { |
90 | - global $altsysModuleConfig ; |
|
90 | + global $altsysModuleConfig; |
|
91 | 91 | |
92 | 92 | if (altsys_get_core_type() >= ALTSYS_CORE_TYPE_ORE) { |
93 | - return ; |
|
93 | + return; |
|
94 | 94 | } |
95 | 95 | if (empty($altsysModuleConfig['adminmenu_hack_ft'])) { |
96 | - return ; |
|
96 | + return; |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | if ($altsysModuleConfig['adminmenu_hack_ft'] == ALTSYS_ADMINMENU_HACK_2COL) { |
100 | - altsys_adminmenu_hack_ft_2col_x20() ; |
|
100 | + altsys_adminmenu_hack_ft_2col_x20(); |
|
101 | 101 | } elseif ($altsysModuleConfig['adminmenu_hack_ft'] == ALTSYS_ADMINMENU_HACK_NOIMG) { |
102 | - altsys_adminmenu_hack_ft_noimg_x20() ; |
|
102 | + altsys_adminmenu_hack_ft_noimg_x20(); |
|
103 | 103 | } elseif ($altsysModuleConfig['adminmenu_hack_ft'] == ALTSYS_ADMINMENU_HACK_XCSTY) { |
104 | - altsys_adminmenu_hack_ft_xcsty_x20() ; |
|
104 | + altsys_adminmenu_hack_ft_xcsty_x20(); |
|
105 | 105 | } |
106 | 106 | } |
107 | 107 | |
108 | 108 | function altsys_adminmenu_hack_ft_2col_x20() |
109 | 109 | { |
110 | 110 | // read |
111 | - if (! file_exists(ALTSYS_ADMINMENU_FILE)) { |
|
112 | - redirect_header(XOOPS_URL.'/admin.php', 1, 'Rebuild adminmenu') ; |
|
113 | - exit ; |
|
111 | + if (!file_exists(ALTSYS_ADMINMENU_FILE)) { |
|
112 | + redirect_header(XOOPS_URL.'/admin.php', 1, 'Rebuild adminmenu'); |
|
113 | + exit; |
|
114 | 114 | } |
115 | - $not_inside_cp_functions = true ; |
|
116 | - include ALTSYS_ADMINMENU_FILE ; |
|
115 | + $not_inside_cp_functions = true; |
|
116 | + include ALTSYS_ADMINMENU_FILE; |
|
117 | 117 | |
118 | 118 | // check previous hack |
119 | - if (! empty($altsys_adminmenu_ft_hacked)) { |
|
119 | + if (!empty($altsys_adminmenu_ft_hacked)) { |
|
120 | 120 | if ($altsys_adminmenu_ft_hacked == ALTSYS_ADMINMENU_HACK_2COL) { |
121 | 121 | // skip |
122 | - return ; |
|
122 | + return; |
|
123 | 123 | } else { |
124 | 124 | // rebuild adminmenu |
125 | - require_once XOOPS_ROOT_PATH.'/include/cp_functions.php' ; |
|
126 | - xoops_module_write_admin_menu(xoops_module_get_admin_menu()) ; |
|
125 | + require_once XOOPS_ROOT_PATH.'/include/cp_functions.php'; |
|
126 | + xoops_module_write_admin_menu(xoops_module_get_admin_menu()); |
|
127 | 127 | // backup $xoops_admin_menu_dv |
128 | - $backup_admin_menu_dv = $xoops_admin_menu_dv ; |
|
128 | + $backup_admin_menu_dv = $xoops_admin_menu_dv; |
|
129 | 129 | // include new adminmenu |
130 | - include ALTSYS_ADMINMENU_FILE ; |
|
130 | + include ALTSYS_ADMINMENU_FILE; |
|
131 | 131 | // restore $xoops_admin_menu_dv |
132 | - $xoops_admin_menu_dv = $backup_admin_menu_dv ; |
|
132 | + $xoops_admin_menu_dv = $backup_admin_menu_dv; |
|
133 | 133 | } |
134 | 134 | } |
135 | 135 | |
136 | - $search = ' alt=\'\' /></a><br />' ; |
|
137 | - $replace_fmt = ' alt="%s" /></a>' ; |
|
136 | + $search = ' alt=\'\' /></a><br />'; |
|
137 | + $replace_fmt = ' alt="%s" /></a>'; |
|
138 | 138 | |
139 | - $is_left = true ; |
|
140 | - $module_handler = xoops_gethandler('module') ; |
|
141 | - $mids = array_keys($xoops_admin_menu_ft) ; |
|
142 | - $last_mid = $mids[count($mids) - 1 ] ; |
|
139 | + $is_left = true; |
|
140 | + $module_handler = xoops_gethandler('module'); |
|
141 | + $mids = array_keys($xoops_admin_menu_ft); |
|
142 | + $last_mid = $mids[count($mids) - 1]; |
|
143 | 143 | foreach ($mids as $mid) { |
144 | - $module = $module_handler->get($mid) ; |
|
145 | - $new_menu_ft = preg_replace('#'.preg_quote($search).'#', sprintf($replace_fmt, $module->getVar('name')), $xoops_admin_menu_ft[$mid]) ; |
|
144 | + $module = $module_handler->get($mid); |
|
145 | + $new_menu_ft = preg_replace('#'.preg_quote($search).'#', sprintf($replace_fmt, $module->getVar('name')), $xoops_admin_menu_ft[$mid]); |
|
146 | 146 | if ($is_left) { |
147 | 147 | if ($mid == $last_mid) { |
148 | - $xoops_admin_menu_ft[$mid] = $new_menu_ft . '</td><td>' ; |
|
148 | + $xoops_admin_menu_ft[$mid] = $new_menu_ft.'</td><td>'; |
|
149 | 149 | } else { |
150 | - $left_body = $new_menu_ft ; |
|
151 | - $left_key = $mid ; |
|
152 | - $xoops_admin_menu_ml[$mid] = str_replace(',105);', ',85);', $xoops_admin_menu_ml[$mid]) ; |
|
150 | + $left_body = $new_menu_ft; |
|
151 | + $left_key = $mid; |
|
152 | + $xoops_admin_menu_ml[$mid] = str_replace(',105);', ',85);', $xoops_admin_menu_ml[$mid]); |
|
153 | 153 | } |
154 | 154 | } else { |
155 | - $xoops_admin_menu_ft[$mid] = $left_body . '</td><td>' . $new_menu_ft ; |
|
156 | - unset($xoops_admin_menu_ft[$left_key]) ; |
|
157 | - $xoops_admin_menu_ml[$mid] = str_replace(',105);', ',185);', $xoops_admin_menu_ml[$mid]) ; |
|
155 | + $xoops_admin_menu_ft[$mid] = $left_body.'</td><td>'.$new_menu_ft; |
|
156 | + unset($xoops_admin_menu_ft[$left_key]); |
|
157 | + $xoops_admin_menu_ml[$mid] = str_replace(',105);', ',185);', $xoops_admin_menu_ml[$mid]); |
|
158 | 158 | } |
159 | - $is_left = ! $is_left ; |
|
159 | + $is_left = !$is_left; |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | // write back |
163 | - altsys_adminmenu_save_x20(array( 'xoops_admin_menu_js' => $xoops_admin_menu_js, 'xoops_admin_menu_ml' => $xoops_admin_menu_ml, 'xoops_admin_menu_sd' => $xoops_admin_menu_sd, 'xoops_admin_menu_ft' => $xoops_admin_menu_ft, 'xoops_admin_menu_dv' => $xoops_admin_menu_dv, 'altsys_adminmenu_ft_hacked' => ALTSYS_ADMINMENU_HACK_2COL )) ; |
|
163 | + altsys_adminmenu_save_x20(array('xoops_admin_menu_js' => $xoops_admin_menu_js, 'xoops_admin_menu_ml' => $xoops_admin_menu_ml, 'xoops_admin_menu_sd' => $xoops_admin_menu_sd, 'xoops_admin_menu_ft' => $xoops_admin_menu_ft, 'xoops_admin_menu_dv' => $xoops_admin_menu_dv, 'altsys_adminmenu_ft_hacked' => ALTSYS_ADMINMENU_HACK_2COL)); |
|
164 | 164 | } |
165 | 165 | |
166 | 166 | |
167 | 167 | function altsys_adminmenu_hack_ft_noimg_x20() |
168 | 168 | { |
169 | 169 | // read |
170 | - if (! file_exists(ALTSYS_ADMINMENU_FILE)) { |
|
171 | - redirect_header(XOOPS_URL.'/admin.php', 1, 'Rebuild adminmenu') ; |
|
172 | - exit ; |
|
170 | + if (!file_exists(ALTSYS_ADMINMENU_FILE)) { |
|
171 | + redirect_header(XOOPS_URL.'/admin.php', 1, 'Rebuild adminmenu'); |
|
172 | + exit; |
|
173 | 173 | } |
174 | - $not_inside_cp_functions = true ; |
|
175 | - include ALTSYS_ADMINMENU_FILE ; |
|
174 | + $not_inside_cp_functions = true; |
|
175 | + include ALTSYS_ADMINMENU_FILE; |
|
176 | 176 | |
177 | 177 | // check previous hack |
178 | - if (! empty($altsys_adminmenu_ft_hacked)) { |
|
178 | + if (!empty($altsys_adminmenu_ft_hacked)) { |
|
179 | 179 | if ($altsys_adminmenu_ft_hacked == ALTSYS_ADMINMENU_HACK_NOIMG) { |
180 | 180 | // skip |
181 | - return ; |
|
181 | + return; |
|
182 | 182 | } else { |
183 | 183 | // rebuild adminmenu |
184 | - require_once XOOPS_ROOT_PATH.'/include/cp_functions.php' ; |
|
185 | - xoops_module_write_admin_menu(xoops_module_get_admin_menu()) ; |
|
184 | + require_once XOOPS_ROOT_PATH.'/include/cp_functions.php'; |
|
185 | + xoops_module_write_admin_menu(xoops_module_get_admin_menu()); |
|
186 | 186 | // backup $xoops_admin_menu_dv |
187 | - $backup_admin_menu_dv = $xoops_admin_menu_dv ; |
|
187 | + $backup_admin_menu_dv = $xoops_admin_menu_dv; |
|
188 | 188 | // include new adminmenu |
189 | - include ALTSYS_ADMINMENU_FILE ; |
|
189 | + include ALTSYS_ADMINMENU_FILE; |
|
190 | 190 | // restore $xoops_admin_menu_dv |
191 | - $xoops_admin_menu_dv = $backup_admin_menu_dv ; |
|
191 | + $xoops_admin_menu_dv = $backup_admin_menu_dv; |
|
192 | 192 | } |
193 | 193 | } |
194 | 194 | |
195 | - $module_handler = xoops_gethandler('module') ; |
|
196 | - $mids = array_keys($xoops_admin_menu_ft) ; |
|
195 | + $module_handler = xoops_gethandler('module'); |
|
196 | + $mids = array_keys($xoops_admin_menu_ft); |
|
197 | 197 | foreach ($mids as $mid) { |
198 | - $module = $module_handler->get($mid) ; |
|
199 | - $xoops_admin_menu_ft[$mid] = preg_replace('/\<img src\=.*$/', $module->getVar('name').'</a>', $xoops_admin_menu_ft[$mid]) ; |
|
200 | - $xoops_admin_menu_ft[$mid] = '<div style="text-align:'._GLOBAL_LEFT.';background-color:#CCC;" title="'.$module->getVar('dirname').'">'.$xoops_admin_menu_ft[$mid].'</div>' ; |
|
201 | - $xoops_admin_menu_ml[$mid] = str_replace(',105);', ',45);', $xoops_admin_menu_ml[$mid]) ; |
|
198 | + $module = $module_handler->get($mid); |
|
199 | + $xoops_admin_menu_ft[$mid] = preg_replace('/\<img src\=.*$/', $module->getVar('name').'</a>', $xoops_admin_menu_ft[$mid]); |
|
200 | + $xoops_admin_menu_ft[$mid] = '<div style="text-align:'._GLOBAL_LEFT.';background-color:#CCC;" title="'.$module->getVar('dirname').'">'.$xoops_admin_menu_ft[$mid].'</div>'; |
|
201 | + $xoops_admin_menu_ml[$mid] = str_replace(',105);', ',45);', $xoops_admin_menu_ml[$mid]); |
|
202 | 202 | } |
203 | 203 | |
204 | 204 | // write back |
205 | - altsys_adminmenu_save_x20(array( 'xoops_admin_menu_js' => $xoops_admin_menu_js, 'xoops_admin_menu_ml' => $xoops_admin_menu_ml, 'xoops_admin_menu_sd' => $xoops_admin_menu_sd, 'xoops_admin_menu_ft' => $xoops_admin_menu_ft, 'xoops_admin_menu_dv' => $xoops_admin_menu_dv, 'altsys_adminmenu_ft_hacked' => ALTSYS_ADMINMENU_HACK_NOIMG )) ; |
|
205 | + altsys_adminmenu_save_x20(array('xoops_admin_menu_js' => $xoops_admin_menu_js, 'xoops_admin_menu_ml' => $xoops_admin_menu_ml, 'xoops_admin_menu_sd' => $xoops_admin_menu_sd, 'xoops_admin_menu_ft' => $xoops_admin_menu_ft, 'xoops_admin_menu_dv' => $xoops_admin_menu_dv, 'altsys_adminmenu_ft_hacked' => ALTSYS_ADMINMENU_HACK_NOIMG)); |
|
206 | 206 | } |
207 | 207 | |
208 | 208 | |
209 | 209 | function altsys_adminmenu_hack_ft_xcsty_x20() |
210 | 210 | { |
211 | 211 | // read |
212 | - if (! file_exists(ALTSYS_ADMINMENU_FILE)) { |
|
213 | - redirect_header(XOOPS_URL.'/admin.php', 1, 'Rebuild adminmenu') ; |
|
214 | - exit ; |
|
212 | + if (!file_exists(ALTSYS_ADMINMENU_FILE)) { |
|
213 | + redirect_header(XOOPS_URL.'/admin.php', 1, 'Rebuild adminmenu'); |
|
214 | + exit; |
|
215 | 215 | } |
216 | - $not_inside_cp_functions = true ; |
|
217 | - include ALTSYS_ADMINMENU_FILE ; |
|
216 | + $not_inside_cp_functions = true; |
|
217 | + include ALTSYS_ADMINMENU_FILE; |
|
218 | 218 | |
219 | 219 | // check previous hack |
220 | - if (! empty($altsys_adminmenu_ft_hacked)) { |
|
220 | + if (!empty($altsys_adminmenu_ft_hacked)) { |
|
221 | 221 | if ($altsys_adminmenu_ft_hacked == ALTSYS_ADMINMENU_HACK_XCSTY && empty($altsys_adminmenu_dv_updated)) { |
222 | 222 | // skip |
223 | - return ; |
|
223 | + return; |
|
224 | 224 | } else { |
225 | 225 | // rebuild adminmenu |
226 | - require_once XOOPS_ROOT_PATH.'/include/cp_functions.php' ; |
|
227 | - $fp = fopen(ALTSYS_ADMINMENU_FILE, 'wb') ; |
|
228 | - fwrite($fp, xoops_module_get_admin_menu()) ; |
|
229 | - fclose($fp) ; |
|
226 | + require_once XOOPS_ROOT_PATH.'/include/cp_functions.php'; |
|
227 | + $fp = fopen(ALTSYS_ADMINMENU_FILE, 'wb'); |
|
228 | + fwrite($fp, xoops_module_get_admin_menu()); |
|
229 | + fclose($fp); |
|
230 | 230 | // backup $xoops_admin_menu_dv |
231 | - $backup_admin_menu_dv = $xoops_admin_menu_dv ; |
|
231 | + $backup_admin_menu_dv = $xoops_admin_menu_dv; |
|
232 | 232 | // include new adminmenu |
233 | - include ALTSYS_ADMINMENU_FILE ; |
|
233 | + include ALTSYS_ADMINMENU_FILE; |
|
234 | 234 | // restore $xoops_admin_menu_dv |
235 | - $xoops_admin_menu_dv = $backup_admin_menu_dv ; |
|
235 | + $xoops_admin_menu_dv = $backup_admin_menu_dv; |
|
236 | 236 | } |
237 | 237 | } |
238 | 238 | |
239 | - $module_handler = xoops_gethandler('module') ; |
|
240 | - $mids = array_keys($xoops_admin_menu_ft) ; |
|
239 | + $module_handler = xoops_gethandler('module'); |
|
240 | + $mids = array_keys($xoops_admin_menu_ft); |
|
241 | 241 | foreach ($mids as $mid) { |
242 | - $module = $module_handler->get($mid) ; |
|
243 | - $submenuitems = array() ; |
|
242 | + $module = $module_handler->get($mid); |
|
243 | + $submenuitems = array(); |
|
244 | 244 | if (preg_match('/popUpL\d+/', $xoops_admin_menu_ft[$mid], $regs)) { |
245 | - $popup = $regs[0] ; |
|
246 | - preg_match_all('#\<a href.*'.$popup.'\(\).*\</a>#U', $xoops_admin_menu_dv, $regs) ; |
|
245 | + $popup = $regs[0]; |
|
246 | + preg_match_all('#\<a href.*'.$popup.'\(\).*\</a>#U', $xoops_admin_menu_dv, $regs); |
|
247 | 247 | foreach ($regs[0] as $submenuitem) { |
248 | - $submenuitems[] = str_replace($popup.'();', '', $submenuitem) ; |
|
248 | + $submenuitems[] = str_replace($popup.'();', '', $submenuitem); |
|
249 | 249 | } |
250 | 250 | } else { |
251 | - return ; |
|
251 | + return; |
|
252 | 252 | } |
253 | 253 | // module icon |
254 | 254 | if (preg_match('#\<img .*/\>#U', $xoops_admin_menu_ft[$mid], $regs)) { |
255 | - $icon_img = str_replace("alt=''", 'alt="'.$module->getVar('name').'"', $regs[0]) ; |
|
255 | + $icon_img = str_replace("alt=''", 'alt="'.$module->getVar('name').'"', $regs[0]); |
|
256 | 256 | } else { |
257 | - $icon_img = '' ; |
|
257 | + $icon_img = ''; |
|
258 | 258 | } |
259 | 259 | // version number |
260 | - $icon_img .= '<span class="version" style="">' . sprintf('%.2f', $module->getVar('version') / 100.0) . '</span>' ; |
|
261 | - $newline = preg_replace('/ onmouseover.*$/', '', $xoops_admin_menu_ft[$mid]) ; |
|
262 | - $newline = "\n".'<!-- '.$popup.' --><div id="adminmenu_ft'.$mid.'" style="text-align:'._GLOBAL_LEFT.';background-color:#CCC;" title="'.$module->getVar('dirname').'"><a id="adminmenu_ftpoint'.$mid.'" href="javascript:void(0);" onclick="submenuToggle('.$mid.');">+</a> '.$newline.'>'.$module->getVar('name').'</a></div><div id="adminmenu_ftsub'.$mid.'" style="display:none;"><ul>' ; |
|
260 | + $icon_img .= '<span class="version" style="">'.sprintf('%.2f', $module->getVar('version') / 100.0).'</span>'; |
|
261 | + $newline = preg_replace('/ onmouseover.*$/', '', $xoops_admin_menu_ft[$mid]); |
|
262 | + $newline = "\n".'<!-- '.$popup.' --><div id="adminmenu_ft'.$mid.'" style="text-align:'._GLOBAL_LEFT.';background-color:#CCC;" title="'.$module->getVar('dirname').'"><a id="adminmenu_ftpoint'.$mid.'" href="javascript:void(0);" onclick="submenuToggle('.$mid.');">+</a> '.$newline.'>'.$module->getVar('name').'</a></div><div id="adminmenu_ftsub'.$mid.'" style="display:none;"><ul>'; |
|
263 | 263 | foreach ($submenuitems as $submenuitem) { |
264 | - $newline .= '<li>'.$submenuitem.'</li>' ; |
|
264 | + $newline .= '<li>'.$submenuitem.'</li>'; |
|
265 | 265 | } |
266 | - $newline .= '</ul>'.$icon_img.'</div>' ; |
|
267 | - $xoops_admin_menu_ft[$mid] = $newline ; |
|
266 | + $newline .= '</ul>'.$icon_img.'</div>'; |
|
267 | + $xoops_admin_menu_ft[$mid] = $newline; |
|
268 | 268 | } |
269 | 269 | |
270 | 270 | $xoops_admin_menu_js = " |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | }" ; |
281 | 281 | |
282 | 282 | // write back |
283 | - altsys_adminmenu_save_x20(array( 'xoops_admin_menu_js' => $xoops_admin_menu_js, 'xoops_admin_menu_ml' => array(), 'xoops_admin_menu_sd' => array(), 'xoops_admin_menu_ft' => $xoops_admin_menu_ft, 'xoops_admin_menu_dv' => $xoops_admin_menu_dv, 'altsys_adminmenu_ft_hacked' => ALTSYS_ADMINMENU_HACK_XCSTY )) ; |
|
283 | + altsys_adminmenu_save_x20(array('xoops_admin_menu_js' => $xoops_admin_menu_js, 'xoops_admin_menu_ml' => array(), 'xoops_admin_menu_sd' => array(), 'xoops_admin_menu_ft' => $xoops_admin_menu_ft, 'xoops_admin_menu_dv' => $xoops_admin_menu_dv, 'altsys_adminmenu_ft_hacked' => ALTSYS_ADMINMENU_HACK_XCSTY)); |
|
284 | 284 | } |
285 | 285 | |
286 | 286 | |
@@ -291,18 +291,18 @@ discard block |
||
291 | 291 | function altsys_adminmenu_save_x20($xoops_admin_vars) |
292 | 292 | { |
293 | 293 | // variable definitions |
294 | - ob_start() ; |
|
295 | - echo "<?php\n// modified by altsys\nif( ! defined('XOOPS_ROOT_PATH') ) exit ;\n" ; |
|
294 | + ob_start(); |
|
295 | + echo "<?php\n// modified by altsys\nif( ! defined('XOOPS_ROOT_PATH') ) exit ;\n"; |
|
296 | 296 | foreach ($xoops_admin_vars as $key => $val) { |
297 | - echo '$' . $key . " = \n" ; |
|
298 | - @var_export($val) ; |
|
299 | - echo " ;\n" ; |
|
297 | + echo '$'.$key." = \n"; |
|
298 | + @var_export($val); |
|
299 | + echo " ;\n"; |
|
300 | 300 | } |
301 | - $output = ob_get_contents() ; |
|
302 | - ob_end_clean() ; |
|
301 | + $output = ob_get_contents(); |
|
302 | + ob_end_clean(); |
|
303 | 303 | |
304 | 304 | // embedding logics |
305 | - if (in_array(@$xoops_admin_vars['altsys_adminmenu_ft_hacked'], array( ALTSYS_ADMINMENU_HACK_NOIMG, ALTSYS_ADMINMENU_HACK_XCSTY ))) { |
|
305 | + if (in_array(@$xoops_admin_vars['altsys_adminmenu_ft_hacked'], array(ALTSYS_ADMINMENU_HACK_NOIMG, ALTSYS_ADMINMENU_HACK_XCSTY))) { |
|
306 | 306 | $output .= ' |
307 | 307 | |
308 | 308 | if( is_object( @$GLOBALS["xoopsModule"] ) && empty( $not_inside_cp_functions ) ) { |
@@ -317,13 +317,13 @@ discard block |
||
317 | 317 | } |
318 | 318 | |
319 | 319 | // termination |
320 | - $output .= "\n\n?>" ; |
|
320 | + $output .= "\n\n?>"; |
|
321 | 321 | |
322 | 322 | // replace into XOOPS_URL |
323 | - $output = str_replace(XOOPS_URL, "'.XOOPS_URL.'", $output) ; |
|
323 | + $output = str_replace(XOOPS_URL, "'.XOOPS_URL.'", $output); |
|
324 | 324 | |
325 | 325 | // output |
326 | - $fp = fopen(ALTSYS_ADMINMENU_FILE, 'wb') ; |
|
327 | - fwrite($fp, $output) ; |
|
328 | - fclose($fp) ; |
|
326 | + $fp = fopen(ALTSYS_ADMINMENU_FILE, 'wb'); |
|
327 | + fwrite($fp, $output); |
|
328 | + fclose($fp); |
|
329 | 329 | } |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (! defined('XOOPS_ROOT_PATH')) { |
|
4 | - exit ; |
|
3 | +if (!defined('XOOPS_ROOT_PATH')) { |
|
4 | + exit; |
|
5 | 5 | } |
6 | 6 | |
7 | 7 | function myDeleteByModule($DB, $gperm_modid, $gperm_name = null, $gperm_itemid = null) |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | $criteria->add(new Criteria('gperm_itemid', (int)$gperm_itemid)); |
14 | 14 | } |
15 | 15 | } |
16 | - $sql = 'DELETE FROM ' . $DB->prefix('group_permission') . ' ' . $criteria->renderWhere(); |
|
16 | + $sql = 'DELETE FROM '.$DB->prefix('group_permission').' '.$criteria->renderWhere(); |
|
17 | 17 | if (!$result = $DB->query($sql)) { |
18 | 18 | return false; |
19 | 19 | } |
@@ -27,27 +27,27 @@ discard block |
||
27 | 27 | |
28 | 28 | if ($modid == 1) { |
29 | 29 | // check by the permission of eather 'altsys' or 'system' |
30 | - $module_handler = xoops_gethandler('module') ; |
|
31 | - $module =& $module_handler->getByDirname('altsys') ; |
|
32 | - if (! is_object($module)) { |
|
33 | - $module =& $module_handler->getByDirname('system') ; |
|
34 | - if (! is_object($module)) { |
|
35 | - die('there is no altsys nor system.') ; |
|
30 | + $module_handler = xoops_gethandler('module'); |
|
31 | + $module = & $module_handler->getByDirname('altsys'); |
|
32 | + if (!is_object($module)) { |
|
33 | + $module = & $module_handler->getByDirname('system'); |
|
34 | + if (!is_object($module)) { |
|
35 | + die('there is no altsys nor system.'); |
|
36 | 36 | } |
37 | 37 | } |
38 | - $moduleperm_handler = xoops_gethandler('groupperm') ; |
|
39 | - if (! is_object(@$GLOBALS['xoopsUser']) || ! $moduleperm_handler->checkRight('module_admin', $module->getVar('mid'), $GLOBALS['xoopsUser']->getGroups())) { |
|
40 | - die('only admin of altsys can access this area') ; |
|
38 | + $moduleperm_handler = xoops_gethandler('groupperm'); |
|
39 | + if (!is_object(@$GLOBALS['xoopsUser']) || !$moduleperm_handler->checkRight('module_admin', $module->getVar('mid'), $GLOBALS['xoopsUser']->getGroups())) { |
|
40 | + die('only admin of altsys can access this area'); |
|
41 | 41 | } |
42 | 42 | } else { |
43 | 43 | // check the permission of 'module_admin' of the module |
44 | 44 | if ($modid <= 0 || !is_object($GLOBALS['xoopsUser']) || !$GLOBALS['xoopsUser']->isAdmin($modid)) { |
45 | - die(_NOPERM) ; |
|
45 | + die(_NOPERM); |
|
46 | 46 | } |
47 | 47 | $module_handler = xoops_gethandler('module'); |
48 | 48 | $module = $module_handler->get($modid); |
49 | 49 | if (!is_object($module) || !$module->getVar('isactive')) { |
50 | - die(_MODULENOEXIST) ; |
|
50 | + die(_MODULENOEXIST); |
|
51 | 51 | } |
52 | 52 | } |
53 | 53 | |
@@ -56,18 +56,18 @@ discard block |
||
56 | 56 | if (!empty($_POST['perms']) && is_array($_POST['perms'])) { |
57 | 57 | $gperm_handler = xoops_gethandler('groupperm'); |
58 | 58 | foreach ($_POST['perms'] as $perm_name => $perm_data) { |
59 | - foreach ($perm_data['itemname' ] as $item_id => $item_name) { |
|
59 | + foreach ($perm_data['itemname'] as $item_id => $item_name) { |
|
60 | 60 | // checking code |
61 | 61 | // echo "<pre>" ; |
62 | 62 | // var_dump( $_POST['perms'] ) ; |
63 | 63 | // exit ; |
64 | 64 | if (false != myDeleteByModule($gperm_handler->db, $modid, $perm_name, $item_id)) { |
65 | 65 | if (empty($perm_data['groups'])) { |
66 | - continue ; |
|
66 | + continue; |
|
67 | 67 | } |
68 | 68 | foreach ($perm_data['groups'] as $group_id => $item_ids) { |
69 | 69 | // foreach ($item_ids as $item_id => $selected) { |
70 | - $selected = isset($item_ids[ $item_id ]) ? $item_ids[ $item_id ] : 0 ; |
|
70 | + $selected = isset($item_ids[$item_id]) ? $item_ids[$item_id] : 0; |
|
71 | 71 | if ($selected == 1) { |
72 | 72 | // make sure that all parent ids are selected as well |
73 | 73 | if ($perm_data['parents'][$item_id] != '') { |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | } |
81 | 81 | } |
82 | 82 | } |
83 | - $gperm =& $gperm_handler->create(); |
|
83 | + $gperm = & $gperm_handler->create(); |
|
84 | 84 | $gperm->setVar('gperm_groupid', $group_id); |
85 | 85 | $gperm->setVar('gperm_name', $perm_name); |
86 | 86 | $gperm->setVar('gperm_modid', $modid); |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | /** |
45 | 45 | * Parent |
46 | 46 | */ |
47 | -include_once XOOPS_ROOT_PATH . '/class/xoopsform/formcheckbox.php'; |
|
47 | +include_once XOOPS_ROOT_PATH.'/class/xoopsform/formcheckbox.php'; |
|
48 | 48 | |
49 | 49 | /** |
50 | 50 | * A checkbox field with a choice of available groups |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | * @param bool $include_anon Include group "anonymous"? |
66 | 66 | * @param mixed $value Pre-selected value (or array of them). |
67 | 67 | */ |
68 | - public function __construct($caption, $name, $include_anon=false, $value=null) |
|
68 | + public function __construct($caption, $name, $include_anon = false, $value = null) |
|
69 | 69 | { |
70 | 70 | parent::__construct($caption, $name, $value); |
71 | 71 | $member_handler = xoops_gethandler('member'); |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | $options = $member_handler->getGroupList(); |
76 | 76 | } |
77 | 77 | foreach ($options as $k => $v) { |
78 | - $options[$k] = $v . '<br />'; |
|
78 | + $options[$k] = $v.'<br />'; |
|
79 | 79 | } |
80 | 80 | $this->addOptionArray($options); |
81 | 81 | } |
@@ -29,8 +29,8 @@ discard block |
||
29 | 29 | // Project: The XOOPS Project // |
30 | 30 | // ------------------------------------------------------------------------- // |
31 | 31 | |
32 | -if (! defined('XOOPS_ROOT_PATH')) { |
|
33 | - exit ; |
|
32 | +if (!defined('XOOPS_ROOT_PATH')) { |
|
33 | + exit; |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | require_once XOOPS_ROOT_PATH.'/class/xoopsform/formelement.php'; |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | * Tree structure of items |
61 | 61 | * @var array |
62 | 62 | */ |
63 | - public $_itemTree = array() ; |
|
63 | + public $_itemTree = array(); |
|
64 | 64 | /** |
65 | 65 | * Name of permission |
66 | 66 | * @var string |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | * Appendix |
76 | 76 | * @var array ('permname'=>,'itemid'=>,'itemname'=>,'selected'=>) |
77 | 77 | */ |
78 | - public $_appendix = array() ; |
|
78 | + public $_appendix = array(); |
|
79 | 79 | |
80 | 80 | /** |
81 | 81 | * Constructor |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | */ |
116 | 116 | public function addAppendix($permName, $itemId, $itemName) |
117 | 117 | { |
118 | - $this->_appendix[] = array('permname'=>$permName,'itemid'=>$itemId,'itemname'=>$itemName,'selected'=>false); |
|
118 | + $this->_appendix[] = array('permname'=>$permName, 'itemid'=>$itemId, 'itemname'=>$itemName, 'selected'=>false); |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | /** |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | */ |
150 | 150 | public function render() |
151 | 151 | { |
152 | - global $xoopsGTicket ; |
|
152 | + global $xoopsGTicket; |
|
153 | 153 | |
154 | 154 | // load all child ids for javascript codes |
155 | 155 | foreach (array_keys($this->_itemTree) as $item_id) { |
@@ -166,11 +166,11 @@ discard block |
||
166 | 166 | $ele->setOptionTree($this->_itemTree); |
167 | 167 | |
168 | 168 | // GIJ start |
169 | - $ele->setDescription('<input type="checkbox" onclick="with(document.groupperm_form){for(i=0;i<length;i++){if(elements[i].name.match(/^perms\[(module_admin|module_read|block_read)\]\[groups\]\['.$i.'\]/)){elements[i].checked=this.checked;}}};">') ; |
|
169 | + $ele->setDescription('<input type="checkbox" onclick="with(document.groupperm_form){for(i=0;i<length;i++){if(elements[i].name.match(/^perms\[(module_admin|module_read|block_read)\]\[groups\]\['.$i.'\]/)){elements[i].checked=this.checked;}}};">'); |
|
170 | 170 | // GIJ_end |
171 | 171 | |
172 | 172 | foreach ($this->_appendix as $key => $append) { |
173 | - $this->_appendix[$key]['selected'] = $gperm_handler->checkRight($append['permname'], $append['itemid'], $i, $this->_modid) ; |
|
173 | + $this->_appendix[$key]['selected'] = $gperm_handler->checkRight($append['permname'], $append['itemid'], $i, $this->_modid); |
|
174 | 174 | } |
175 | 175 | $ele->setAppendix($this->_appendix); |
176 | 176 | $this->addElement($ele); |
@@ -180,11 +180,11 @@ discard block |
||
180 | 180 | // GIJ start |
181 | 181 | $jstray = new XoopsFormElementTray(' '); |
182 | 182 | $jsuncheckbutton = new XoopsFormButton('', 'none', _NONE, 'button'); |
183 | - $jsuncheckbutton->setExtra("onclick=\"with(document.groupperm_form){for(i=0;i<length;i++){if(elements[i].type=='checkbox'){elements[i].checked=false;}}}\"") ; |
|
183 | + $jsuncheckbutton->setExtra("onclick=\"with(document.groupperm_form){for(i=0;i<length;i++){if(elements[i].type=='checkbox'){elements[i].checked=false;}}}\""); |
|
184 | 184 | $jscheckbutton = new XoopsFormButton('', 'all', _ALL, 'button'); |
185 | - $jscheckbutton->setExtra("onclick=\"with(document.groupperm_form){for(i=0;i<length;i++){if(elements[i].type=='checkbox' && (elements[i].name.indexOf('module_admin')<0 || elements[i].name.indexOf('[groups][1]')>=0)){elements[i].checked=true;}}}\"") ; |
|
186 | - $jstray->addElement($jsuncheckbutton) ; |
|
187 | - $jstray->addElement($jscheckbutton) ; |
|
185 | + $jscheckbutton->setExtra("onclick=\"with(document.groupperm_form){for(i=0;i<length;i++){if(elements[i].type=='checkbox' && (elements[i].name.indexOf('module_admin')<0 || elements[i].name.indexOf('[groups][1]')>=0)){elements[i].checked=true;}}}\""); |
|
186 | + $jstray->addElement($jsuncheckbutton); |
|
187 | + $jstray->addElement($jscheckbutton); |
|
188 | 188 | $this->addElement($jstray); |
189 | 189 | // GIJ end |
190 | 190 | |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | |
196 | 196 | $ret = '<h4>'.$this->getTitle().'</h4>'.$this->_permDesc.'<br />'; |
197 | 197 | $ret .= "<form name='".$this->getName()."' id='".$this->getName()."' action='".$this->getAction()."' method='".$this->getMethod()."'".$this->getExtra().">\n<table width='100%' class='outer' cellspacing='1'>\n"; |
198 | - $elements =& $this->getElements(); |
|
198 | + $elements = & $this->getElements(); |
|
199 | 199 | foreach (array_keys($elements) as $i) { |
200 | 200 | if (!is_object($elements[$i])) { |
201 | 201 | $ret .= $elements[$i]; |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | $ret .= $elements[$i]->render(); |
212 | 212 | } |
213 | 213 | } |
214 | - $ret .= '</table>' . $xoopsGTicket->getTicketHtml(__LINE__, 1800, 'myblocksadmin') . '</form>'; |
|
214 | + $ret .= '</table>'.$xoopsGTicket->getTicketHtml(__LINE__, 1800, 'myblocksadmin').'</form>'; |
|
215 | 215 | return $ret; |
216 | 216 | } |
217 | 217 | } |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | * Appendix |
248 | 248 | * @var array ('permname'=>,'itemid'=>,'itemname'=>,'selected'=>) |
249 | 249 | */ |
250 | - public $_appendix = array() ; |
|
250 | + public $_appendix = array(); |
|
251 | 251 | |
252 | 252 | /** |
253 | 253 | * Constructor |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | */ |
288 | 288 | public function setOptionTree(&$optionTree) |
289 | 289 | { |
290 | - $this->_optionTree =& $optionTree; |
|
290 | + $this->_optionTree = & $optionTree; |
|
291 | 291 | } |
292 | 292 | |
293 | 293 | /** |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | */ |
298 | 298 | public function setAppendix($appendix) |
299 | 299 | { |
300 | - $this->_appendix = $appendix ; |
|
300 | + $this->_appendix = $appendix; |
|
301 | 301 | } |
302 | 302 | |
303 | 303 | /** |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | */ |
309 | 309 | public function render() |
310 | 310 | { |
311 | - $ret = '' ; |
|
311 | + $ret = ''; |
|
312 | 312 | |
313 | 313 | if (count($this->_appendix) > 0) { |
314 | 314 | $ret .= '<table class="outer"><tr>'; |
@@ -318,11 +318,11 @@ discard block |
||
318 | 318 | $ret .= '</tr><tr>'; |
319 | 319 | $cols = 1; |
320 | 320 | } |
321 | - $checked = $append['selected'] ? 'checked="checked"' : '' ; |
|
322 | - $name = 'perms['.$append['permname'].']' ; |
|
323 | - $itemid = $append['itemid'] ; |
|
324 | - $itemid = $append['itemid'] ; |
|
325 | - $ret .= "<td class=\"odd\"><input type=\"checkbox\" name=\"{$name}[groups][$this->_groupId][$itemid]\" id=\"{$name}[groups][$this->_groupId][$itemid]\" value=\"1\" $checked />{$append['itemname']}<input type=\"hidden\" name=\"{$name}[parents][$itemid]\" value=\"\" /><input type=\"hidden\" name=\"{$name}[itemname][$itemid]\" value=\"{$append['itemname']}\" /><br /></td>" ; |
|
321 | + $checked = $append['selected'] ? 'checked="checked"' : ''; |
|
322 | + $name = 'perms['.$append['permname'].']'; |
|
323 | + $itemid = $append['itemid']; |
|
324 | + $itemid = $append['itemid']; |
|
325 | + $ret .= "<td class=\"odd\"><input type=\"checkbox\" name=\"{$name}[groups][$this->_groupId][$itemid]\" id=\"{$name}[groups][$this->_groupId][$itemid]\" value=\"1\" $checked />{$append['itemname']}<input type=\"hidden\" name=\"{$name}[parents][$itemid]\" value=\"\" /><input type=\"hidden\" name=\"{$name}[itemname][$itemid]\" value=\"{$append['itemname']}\" /><br /></td>"; |
|
326 | 326 | $cols++; |
327 | 327 | } |
328 | 328 | $ret .= '</tr></table>'; |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | |
331 | 331 | $ret .= '<table class="outer"><tr>'; |
332 | 332 | $cols = 1; |
333 | - if (! empty($this->_optionTree[0]['children'])) { |
|
333 | + if (!empty($this->_optionTree[0]['children'])) { |
|
334 | 334 | foreach ($this->_optionTree[0]['children'] as $topitem) { |
335 | 335 | if ($cols > 4) { |
336 | 336 | $ret .= '</tr><tr>'; |
@@ -358,8 +358,8 @@ discard block |
||
358 | 358 | */ |
359 | 359 | public function _renderOptionTree(&$tree, $option, $prefix, $parentIds = array()) |
360 | 360 | { |
361 | - $tree .= $prefix."<input type=\"checkbox\" name=\"".$this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . "]\" id=\"" . $this->getName() . '[groups][' . $this->_groupId . '][' |
|
362 | - . $option['id'] . "]\" onclick=\""; |
|
361 | + $tree .= $prefix."<input type=\"checkbox\" name=\"".$this->getName().'[groups]['.$this->_groupId.']['.$option['id']."]\" id=\"".$this->getName().'[groups]['.$this->_groupId.'][' |
|
362 | + . $option['id']."]\" onclick=\""; |
|
363 | 363 | // If there are parent elements, add javascript that will |
364 | 364 | // make them selecteded when this element is checked to make |
365 | 365 | // sure permissions to parent items are added as well. |
@@ -379,8 +379,8 @@ discard block |
||
379 | 379 | if (isset($this->_value) && in_array($option['id'], $this->_value)) { |
380 | 380 | $tree .= ' checked="checked"'; |
381 | 381 | } |
382 | - $tree .= ' />' . $option['name'] . "<input type=\"hidden\" name=\"" . $this->getName() . '[parents][' . $option['id'] . "]\" value=\"" . implode(':', $parentIds) . "\" /><input type=\"hidden\" name=\"" . $this->getName() . '[itemname][' |
|
383 | - . $option['id'] . "]\" value=\"" . htmlspecialchars($option['name']) . "\" /><br />\n"; |
|
382 | + $tree .= ' />'.$option['name']."<input type=\"hidden\" name=\"".$this->getName().'[parents]['.$option['id']."]\" value=\"".implode(':', $parentIds)."\" /><input type=\"hidden\" name=\"".$this->getName().'[itemname][' |
|
383 | + . $option['id']."]\" value=\"".htmlspecialchars($option['name'])."\" /><br />\n"; |
|
384 | 384 | if (isset($option['children'])) { |
385 | 385 | foreach ($option['children'] as $child) { |
386 | 386 | array_push($parentIds, $option['id']); |
@@ -1,51 +1,51 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (! defined('XOOPS_MODULE_PATH')) { |
|
4 | - define('XOOPS_MODULE_PATH', XOOPS_ROOT_PATH . '/modules'); |
|
3 | +if (!defined('XOOPS_MODULE_PATH')) { |
|
4 | + define('XOOPS_MODULE_PATH', XOOPS_ROOT_PATH.'/modules'); |
|
5 | 5 | } |
6 | -if (! defined('XOOPS_MODULE_URL')) { |
|
7 | - define('XOOPS_MODULE_URL', XOOPS_URL . '/modules'); |
|
6 | +if (!defined('XOOPS_MODULE_URL')) { |
|
7 | + define('XOOPS_MODULE_URL', XOOPS_URL.'/modules'); |
|
8 | 8 | } |
9 | 9 | |
10 | 10 | |
11 | -require_once __DIR__.'/class/AltsysBreadcrumbs.class.php' ; |
|
12 | -require_once __DIR__.'/include/altsys_functions.php' ; |
|
11 | +require_once __DIR__.'/class/AltsysBreadcrumbs.class.php'; |
|
12 | +require_once __DIR__.'/include/altsys_functions.php'; |
|
13 | 13 | |
14 | 14 | |
15 | 15 | if (empty($xoopsModule)) { |
16 | - $moduleperm_handler = xoops_gethandler('module') ; |
|
17 | - $xoopsModule =& $moduleperm_handler->getByDirname('altsys') ; |
|
16 | + $moduleperm_handler = xoops_gethandler('module'); |
|
17 | + $xoopsModule = & $moduleperm_handler->getByDirname('altsys'); |
|
18 | 18 | } |
19 | 19 | |
20 | -require XOOPS_ROOT_PATH.'/include/cp_functions.php' ; |
|
20 | +require XOOPS_ROOT_PATH.'/include/cp_functions.php'; |
|
21 | 21 | |
22 | 22 | // breadcrumbs |
23 | -$breadcrumbsObj =& AltsysBreadcrumbs::getInstance() ; |
|
24 | -$breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php', $GLOBALS['xoopsModule']->getVar('name')) ; |
|
23 | +$breadcrumbsObj = & AltsysBreadcrumbs::getInstance(); |
|
24 | +$breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php', $GLOBALS['xoopsModule']->getVar('name')); |
|
25 | 25 | |
26 | 26 | // get page |
27 | -$page = preg_replace('/[^a-zA-Z0-9_-]/', '', @$_GET['page']) ; |
|
28 | -require __DIR__.'/controllers.php' ; |
|
29 | -if (! in_array($page, $controllers)) { |
|
30 | - $_GET['page'] = $page = 'myblocksadmin' ; |
|
31 | - $_SERVER['REQUEST_URI'] = '/admin/index.php?mode=admin&lib=altsys&page=myblocksadmin' ; |
|
27 | +$page = preg_replace('/[^a-zA-Z0-9_-]/', '', @$_GET['page']); |
|
28 | +require __DIR__.'/controllers.php'; |
|
29 | +if (!in_array($page, $controllers)) { |
|
30 | + $_GET['page'] = $page = 'myblocksadmin'; |
|
31 | + $_SERVER['REQUEST_URI'] = '/admin/index.php?mode=admin&lib=altsys&page=myblocksadmin'; |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | |
35 | 35 | // half measure ... (TODO) |
36 | 36 | if (empty($_GET['dirname'])) { |
37 | - $module_handler = xoops_gethandler('module') ; |
|
38 | - list($top_module) = $module_handler->getObjects(new Criteria('isactive', 1)) ; |
|
39 | - $_GET['dirname'] = $top_module->getVar('dirname') ; |
|
37 | + $module_handler = xoops_gethandler('module'); |
|
38 | + list($top_module) = $module_handler->getObjects(new Criteria('isactive', 1)); |
|
39 | + $_GET['dirname'] = $top_module->getVar('dirname'); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | // language file |
43 | -altsys_include_language_file($page) ; |
|
43 | +altsys_include_language_file($page); |
|
44 | 44 | |
45 | 45 | // branch to each pages |
46 | -$mytrustdirpath = __DIR__ ; |
|
46 | +$mytrustdirpath = __DIR__; |
|
47 | 47 | if (file_exists(XOOPS_TRUST_PATH.'/libs/altsys/'.$page.'.php')) { |
48 | - include XOOPS_TRUST_PATH.'/libs/altsys/'.$page.'.php' ; |
|
48 | + include XOOPS_TRUST_PATH.'/libs/altsys/'.$page.'.php'; |
|
49 | 49 | } else { |
50 | - die('wrong request') ; |
|
50 | + die('wrong request'); |
|
51 | 51 | } |
@@ -5,33 +5,33 @@ discard block |
||
5 | 5 | // GIJOE <http://www.peak.ne.jp/> // |
6 | 6 | // ------------------------------------------------------------------------- // |
7 | 7 | |
8 | -require_once __DIR__.'/class/AltsysBreadcrumbs.class.php' ; |
|
9 | -include_once __DIR__.'/include/gtickets.php' ; |
|
10 | -include_once __DIR__.'/include/altsys_functions.php' ; |
|
8 | +require_once __DIR__.'/class/AltsysBreadcrumbs.class.php'; |
|
9 | +include_once __DIR__.'/include/gtickets.php'; |
|
10 | +include_once __DIR__.'/include/altsys_functions.php'; |
|
11 | 11 | |
12 | 12 | // check access right (needs module_admin of this module) |
13 | -if (! is_object($xoopsUser) || ! is_object($xoopsModule) || ! $xoopsUser->isAdmin($xoopsModule->mid())) { |
|
14 | - die('Access Denied') ; |
|
13 | +if (!is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid())) { |
|
14 | + die('Access Denied'); |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | |
18 | 18 | // initials |
19 | 19 | $db = XoopsDatabaseFactory::getDatabaseConnection(); |
20 | -(method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || $myts = MyTextSanitizer::getInstance() ; |
|
20 | +(method_exists('MyTextSanitizer', 'sGetInstance') and $myts = & MyTextSanitizer::sGetInstance()) || $myts = MyTextSanitizer::getInstance(); |
|
21 | 21 | |
22 | 22 | // language file |
23 | -altsys_include_language_file('mypreferences') ; |
|
23 | +altsys_include_language_file('mypreferences'); |
|
24 | 24 | |
25 | 25 | |
26 | -$op = empty($_GET['op']) ? 'showmod' : preg_replace('/[^a-zA-Z0-9_-]/', '', $_GET['op']) ; |
|
26 | +$op = empty($_GET['op']) ? 'showmod' : preg_replace('/[^a-zA-Z0-9_-]/', '', $_GET['op']); |
|
27 | 27 | |
28 | 28 | if ($op == 'showmod') { |
29 | 29 | $config_handler = xoops_gethandler('config'); |
30 | - $mod = $xoopsModule->mid() ; |
|
30 | + $mod = $xoopsModule->mid(); |
|
31 | 31 | $config = $config_handler->getConfigs(new Criteria('conf_modid', $mod)); |
32 | 32 | $count = count($config); |
33 | 33 | if ($count < 1) { |
34 | - die('no configs') ; |
|
34 | + die('no configs'); |
|
35 | 35 | } |
36 | 36 | include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
37 | 37 | $form = new XoopsThemeForm(_MD_A_MYPREFERENCES_FORMTITLE, 'pref_form', 'index.php?mode=admin&lib=altsys&page=mypreferences&op=save'); |
@@ -39,30 +39,30 @@ discard block |
||
39 | 39 | $module = $module_handler->get($mod); |
40 | 40 | |
41 | 41 | // language |
42 | - $language = empty($xoopsConfig['language']) ? 'english' : $xoopsConfig['language'] ; |
|
42 | + $language = empty($xoopsConfig['language']) ? 'english' : $xoopsConfig['language']; |
|
43 | 43 | |
44 | 44 | // load modinfo.php if necessary (judged by a specific constant is defined) |
45 | - if (! defined('_MYMENU_CONSTANT_IN_MODINFO') || ! defined(_MYMENU_CONSTANT_IN_MODINFO)) { |
|
45 | + if (!defined('_MYMENU_CONSTANT_IN_MODINFO') || !defined(_MYMENU_CONSTANT_IN_MODINFO)) { |
|
46 | 46 | if (file_exists("$mydirpath/language/$language/modinfo.php")) { |
47 | 47 | // user customized language file |
48 | - include_once "$mydirpath/language/$language/modinfo.php" ; |
|
48 | + include_once "$mydirpath/language/$language/modinfo.php"; |
|
49 | 49 | } elseif (file_exists("$mytrustdirpath/language/$language/modinfo.php")) { |
50 | 50 | // default language file |
51 | - include_once "$mytrustdirpath/language/$language/modinfo.php" ; |
|
51 | + include_once "$mytrustdirpath/language/$language/modinfo.php"; |
|
52 | 52 | } else { |
53 | 53 | // fallback english |
54 | - include_once "$mytrustdirpath/language/english/modinfo.php" ; |
|
54 | + include_once "$mytrustdirpath/language/english/modinfo.php"; |
|
55 | 55 | } |
56 | 56 | } |
57 | 57 | |
58 | 58 | // if has comments feature, need comment lang file |
59 | - if ($module->getVar('hascomments') == 1 && ! defined('_CM_TITLE')) { |
|
59 | + if ($module->getVar('hascomments') == 1 && !defined('_CM_TITLE')) { |
|
60 | 60 | include_once XOOPS_ROOT_PATH.'/language/'.$xoopsConfig['language'].'/comment.php'; |
61 | 61 | } |
62 | 62 | |
63 | 63 | // RMV-NOTIFY |
64 | 64 | // if has notification feature, need notification lang file |
65 | - if ($module->getVar('hasnotification') == 1 && ! defined('_NOT_NOTIFICATIONOPTIONS')) { |
|
65 | + if ($module->getVar('hasnotification') == 1 && !defined('_NOT_NOTIFICATIONOPTIONS')) { |
|
66 | 66 | include_once XOOPS_ROOT_PATH.'/language/'.$xoopsConfig['language'].'/notification.php'; |
67 | 67 | } |
68 | 68 | |
@@ -72,12 +72,12 @@ discard block |
||
72 | 72 | // $form->addElement(new XoopsFormHidden('redirect', XOOPS_URL.'/modules/'.$module->getVar('dirname').'/'.$module->getInfo('adminindex'))); |
73 | 73 | // } |
74 | 74 | for ($i = 0; $i < $count; $i++) { |
75 | - $title_icon = ($config[$i]->getVar('conf_valuetype') === 'encrypt')? '<img src="'.XOOPS_MODULE_URL.'/legacy/admin/theme/icons/textfield_key.png" alt="Encrypted">' : ''; // support XCL 2.2.3 'encrypt' of 'conf_valuetype' |
|
75 | + $title_icon = ($config[$i]->getVar('conf_valuetype') === 'encrypt') ? '<img src="'.XOOPS_MODULE_URL.'/legacy/admin/theme/icons/textfield_key.png" alt="Encrypted">' : ''; // support XCL 2.2.3 'encrypt' of 'conf_valuetype' |
|
76 | 76 | $title4tray = (!defined($config[$i]->getVar('conf_desc')) || constant($config[$i]->getVar('conf_desc')) == '') ? (constant($config[$i]->getVar('conf_title')).$title_icon) : (constant($config[$i]->getVar('conf_title')).$title_icon.'<br /><br /><span style="font-weight:normal;">'.constant($config[$i]->getVar('conf_desc')).'</span>'); // GIJ |
77 | - $title = '' ; // GIJ |
|
77 | + $title = ''; // GIJ |
|
78 | 78 | switch ($config[$i]->getVar('conf_formtype')) { |
79 | 79 | case 'textarea': |
80 | - (method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || $myts = MyTextSanitizer::getInstance(); |
|
80 | + (method_exists('MyTextSanitizer', 'sGetInstance') and $myts = & MyTextSanitizer::sGetInstance()) || $myts = MyTextSanitizer::getInstance(); |
|
81 | 81 | if ($config[$i]->getVar('conf_valuetype') == 'array') { |
82 | 82 | // this is exceptional.. only when value type is arrayneed a smarter way for this |
83 | 83 | $ele = ($config[$i]->getVar('conf_value') != '') ? new XoopsFormTextArea($title, $config[$i]->getVar('conf_name'), $myts->htmlspecialchars(implode('|', $config[$i]->getConfValueForOutput())), 5, 50) : new XoopsFormTextArea($title, $config[$i]->getVar('conf_name'), '', 5, 50); |
@@ -145,35 +145,35 @@ discard block |
||
145 | 145 | $ele = new XoopsFormSelectUser($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 5, true); |
146 | 146 | break; |
147 | 147 | case 'password': |
148 | - (method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || $myts = MyTextSanitizer::getInstance(); |
|
148 | + (method_exists('MyTextSanitizer', 'sGetInstance') and $myts = & MyTextSanitizer::sGetInstance()) || $myts = MyTextSanitizer::getInstance(); |
|
149 | 149 | $ele = new XoopsFormPassword($title, $config[$i]->getVar('conf_name'), 50, 255, $myts->htmlspecialchars($config[$i]->getConfValueForOutput())); |
150 | 150 | break; |
151 | 151 | case 'textbox': |
152 | 152 | default: |
153 | - (method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || $myts = MyTextSanitizer::getInstance(); |
|
153 | + (method_exists('MyTextSanitizer', 'sGetInstance') and $myts = & MyTextSanitizer::sGetInstance()) || $myts = MyTextSanitizer::getInstance(); |
|
154 | 154 | $ele = new XoopsFormText($title, $config[$i]->getVar('conf_name'), 50, 255, $myts->htmlspecialchars($config[$i]->getConfValueForOutput())); |
155 | 155 | break; |
156 | 156 | } |
157 | 157 | $hidden = new XoopsFormHidden('conf_ids[]', $config[$i]->getVar('conf_id')); |
158 | - $ele_tray = new XoopsFormElementTray($title4tray, '') ; |
|
158 | + $ele_tray = new XoopsFormElementTray($title4tray, ''); |
|
159 | 159 | $ele_tray->addElement($ele); |
160 | 160 | $ele_tray->addElement($hidden); |
161 | - $form->addElement($ele_tray) ; |
|
161 | + $form->addElement($ele_tray); |
|
162 | 162 | unset($ele_tray, $ele, $hidden); |
163 | 163 | } |
164 | 164 | // $button_tray->addElement(new XoopsFormHidden('op', 'save')); |
165 | - $xoopsGTicket->addTicketXoopsFormElement($button_tray, __LINE__, 1800, 'mypreferences') ; |
|
165 | + $xoopsGTicket->addTicketXoopsFormElement($button_tray, __LINE__, 1800, 'mypreferences'); |
|
166 | 166 | $button_tray->addElement(new XoopsFormButton('', 'button', _GO, 'submit')); |
167 | - $form->addElement($button_tray) ; |
|
167 | + $form->addElement($button_tray); |
|
168 | 168 | xoops_cp_header(); |
169 | 169 | |
170 | 170 | // GIJ patch start |
171 | - altsys_include_mymenu() ; |
|
172 | - $breadcrumbsObj =& AltsysBreadcrumbs::getInstance() ; |
|
171 | + altsys_include_mymenu(); |
|
172 | + $breadcrumbsObj = & AltsysBreadcrumbs::getInstance(); |
|
173 | 173 | if ($breadcrumbsObj->hasPaths()) { |
174 | - $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&lib=altsys&page=mypreferences', _PREFERENCES) ; |
|
174 | + $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&lib=altsys&page=mypreferences', _PREFERENCES); |
|
175 | 175 | } |
176 | - echo "<h3 style='text-align:"._GLOBAL_LEFT.";'>".$module->getvar('name').' '._PREFERENCES."</h3>\n" ; |
|
176 | + echo "<h3 style='text-align:"._GLOBAL_LEFT.";'>".$module->getvar('name').' '._PREFERENCES."</h3>\n"; |
|
177 | 177 | // GIJ patch end |
178 | 178 | |
179 | 179 | $form->display(); |
@@ -185,10 +185,10 @@ discard block |
||
185 | 185 | //if ( !admin_refcheck("/modules/$admin_mydirname/admin/") ) { |
186 | 186 | // exit('Invalid referer'); |
187 | 187 | //} |
188 | - if (! $xoopsGTicket->check(true, 'mypreferences')) { |
|
188 | + if (!$xoopsGTicket->check(true, 'mypreferences')) { |
|
189 | 189 | redirect_header(XOOPS_URL.'/', 3, $xoopsGTicket->getErrors()); |
190 | 190 | } |
191 | - require_once XOOPS_ROOT_PATH.'/class/template.php' ; |
|
191 | + require_once XOOPS_ROOT_PATH.'/class/template.php'; |
|
192 | 192 | $xoopsTpl = new XoopsTpl(); |
193 | 193 | //HACK by domifara for new XOOPS and XCL etc. |
194 | 194 | //old xoops |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | if ($count > 0) { |
210 | 210 | for ($i = 0; $i < $count; $i++) { |
211 | 211 | $config = $config_handler->getConfig($conf_ids[$i]); |
212 | - $new_value =& $_POST[$config->getVar('conf_name')]; |
|
212 | + $new_value = & $_POST[$config->getVar('conf_name')]; |
|
213 | 213 | if (is_array($new_value) || $new_value != $config->getVar('conf_value')) { |
214 | 214 | // if language has been changed |
215 | 215 | if (!$lang_updated && $config->getVar('conf_catid') == XOOPS_CONF && $config->getVar('conf_name') == 'language') { |
@@ -238,13 +238,13 @@ discard block |
||
238 | 238 | // generate compiled files for the new theme |
239 | 239 | // block files only for now.. |
240 | 240 | $tplfile_handler = xoops_gethandler('tplfile'); |
241 | - $dtemplates =& $tplfile_handler->find('default', 'block'); |
|
241 | + $dtemplates = & $tplfile_handler->find('default', 'block'); |
|
242 | 242 | $dcount = count($dtemplates); |
243 | 243 | |
244 | 244 | // need to do this to pass to xoops_template_touch function |
245 | 245 | $GLOBALS['xoopsConfig']['template_set'] = $newtplset; |
246 | 246 | |
247 | - altsys_clear_templates_c() ; |
|
247 | + altsys_clear_templates_c(); |
|
248 | 248 | |
249 | 249 | /* for ($i = 0; $i < $dcount; $i++) { |
250 | 250 | $found =& $tplfile_handler->find($newtplset, 'block', $dtemplates[$i]->getVar('tpl_refid'), null); |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | |
260 | 260 | // generate image cache files from image binary data, save them under cache/ |
261 | 261 | $image_handler = xoops_gethandler('imagesetimg'); |
262 | - $imagefiles =& $image_handler->getObjects(new Criteria('tplset_name', $newtplset), true); |
|
262 | + $imagefiles = & $image_handler->getObjects(new Criteria('tplset_name', $newtplset), true); |
|
263 | 263 | foreach (array_keys($imagefiles) as $i) { |
264 | 264 | if (!$fp = fopen(XOOPS_CACHE_PATH.'/'.$newtplset.'_'.$imagefiles[$i]->getVar('imgsetimg_file'), 'wb')) { |
265 | 265 | } else { |
@@ -272,12 +272,12 @@ discard block |
||
272 | 272 | } |
273 | 273 | |
274 | 274 | // add read permission for the start module to all groups |
275 | - if (!$startmod_updated && $new_value != '--' && $config->getVar('conf_catid') == XOOPS_CONF && $config->getVar('conf_name') == 'startpage') { |
|
275 | + if (!$startmod_updated && $new_value != '--' && $config->getVar('conf_catid') == XOOPS_CONF && $config->getVar('conf_name') == 'startpage') { |
|
276 | 276 | $member_handler = xoops_gethandler('member'); |
277 | - $groups =& $member_handler->getGroupList(); |
|
277 | + $groups = & $member_handler->getGroupList(); |
|
278 | 278 | $moduleperm_handler = xoops_gethandler('groupperm'); |
279 | 279 | $module_handler = xoops_gethandler('module'); |
280 | - $module =& $module_handler->getByDirname($new_value); |
|
280 | + $module = & $module_handler->getByDirname($new_value); |
|
281 | 281 | foreach ($groups as $groupid => $groupname) { |
282 | 282 | if (!$moduleperm_handler->checkRight('module_read', $module->getVar('mid'), $groupid)) { |
283 | 283 | $moduleperm_handler->addRight('module_read', $module->getVar('mid'), $groupid); |
@@ -293,5 +293,5 @@ discard block |
||
293 | 293 | } |
294 | 294 | } |
295 | 295 | |
296 | - redirect_header('index.php?mode=admin&lib=altsys&page=mypreferences', 2, _MD_A_MYPREFERENCES_UPDATED) ; |
|
296 | + redirect_header('index.php?mode=admin&lib=altsys&page=mypreferences', 2, _MD_A_MYPREFERENCES_UPDATED); |
|
297 | 297 | } |
@@ -1,147 +1,147 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -require_once dirname(__DIR__).'/include/altsys_functions.php' ; |
|
3 | +require_once dirname(__DIR__).'/include/altsys_functions.php'; |
|
4 | 4 | |
5 | 5 | function b_altsys_admin_menu_show($options) |
6 | 6 | { |
7 | - global $xoopsUser ; |
|
7 | + global $xoopsUser; |
|
8 | 8 | |
9 | - $mydirname = empty($options[0]) ? 'altsys' : $options[0] ; |
|
10 | - $this_template = empty($options[1]) ? 'db:'.$mydirname.'_block_admin_menu.html' : trim($options[1]) ; |
|
9 | + $mydirname = empty($options[0]) ? 'altsys' : $options[0]; |
|
10 | + $this_template = empty($options[1]) ? 'db:'.$mydirname.'_block_admin_menu.html' : trim($options[1]); |
|
11 | 11 | |
12 | 12 | if (preg_match('/[^0-9a-zA-Z_-]/', $mydirname)) { |
13 | - die('Invalid mydirname') ; |
|
13 | + die('Invalid mydirname'); |
|
14 | 14 | } |
15 | - if (! is_object(@$xoopsUser)) { |
|
16 | - return array() ; |
|
15 | + if (!is_object(@$xoopsUser)) { |
|
16 | + return array(); |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | // coretype |
20 | - $coretype = altsys_get_core_type() ; |
|
20 | + $coretype = altsys_get_core_type(); |
|
21 | 21 | |
22 | 22 | // mid_selected |
23 | 23 | if (is_object(@$GLOBALS['xoopsModule'])) { |
24 | - $mid_selected = $GLOBALS['xoopsModule']->getVar('mid') ; |
|
24 | + $mid_selected = $GLOBALS['xoopsModule']->getVar('mid'); |
|
25 | 25 | // for system->preferences |
26 | - if ($mid_selected == 1 && @$_GET['fct'] == 'preferences' && @$_GET['op'] == 'showmod' && ! empty($_GET['mod'])) { |
|
26 | + if ($mid_selected == 1 && @$_GET['fct'] == 'preferences' && @$_GET['op'] == 'showmod' && !empty($_GET['mod'])) { |
|
27 | 27 | $mid_selected = (int)$_GET['mod']; |
28 | 28 | } |
29 | 29 | } else { |
30 | - $mid_selected = 0 ; |
|
30 | + $mid_selected = 0; |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | $db = XoopsDatabaseFactory::getDatabaseConnection(); |
34 | - (method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || $myts = MyTextSanitizer::getInstance(); |
|
34 | + (method_exists('MyTextSanitizer', 'sGetInstance') and $myts = & MyTextSanitizer::sGetInstance()) || $myts = MyTextSanitizer::getInstance(); |
|
35 | 35 | |
36 | 36 | $module_handler = xoops_gethandler('module'); |
37 | - $current_module =& $module_handler->getByDirname($mydirname); |
|
37 | + $current_module = & $module_handler->getByDirname($mydirname); |
|
38 | 38 | $config_handler = xoops_gethandler('config'); |
39 | - $current_configs = $config_handler->getConfigList($current_module->mid()) ; |
|
39 | + $current_configs = $config_handler->getConfigList($current_module->mid()); |
|
40 | 40 | $moduleperm_handler = xoops_gethandler('groupperm'); |
41 | 41 | $admin_mids = $moduleperm_handler->getItemIds('module_admin', $xoopsUser->getGroups()); |
42 | - $modules = $module_handler->getObjects(new Criteria('mid', '('.implode(',', $admin_mids) . ')', 'IN'), true) ; |
|
42 | + $modules = $module_handler->getObjects(new Criteria('mid', '('.implode(',', $admin_mids).')', 'IN'), true); |
|
43 | 43 | |
44 | 44 | $block = array( |
45 | - 'mydirname' => $mydirname , |
|
46 | - 'mod_url' => XOOPS_URL.'/modules/'.$mydirname , |
|
47 | - 'mod_imageurl' => XOOPS_URL.'/modules/'.$mydirname.'/'.$current_configs['images_dir'] , |
|
45 | + 'mydirname' => $mydirname, |
|
46 | + 'mod_url' => XOOPS_URL.'/modules/'.$mydirname, |
|
47 | + 'mod_imageurl' => XOOPS_URL.'/modules/'.$mydirname.'/'.$current_configs['images_dir'], |
|
48 | 48 | 'mod_config' => $current_configs |
49 | - ) ; |
|
49 | + ); |
|
50 | 50 | |
51 | 51 | foreach ($modules as $mod) { |
52 | 52 | $mid = (int)$mod->getVar('mid'); |
53 | - $dirname = $mod->getVar('dirname') ; |
|
54 | - $modinfo = $mod->getInfo() ; |
|
55 | - $submenus4assign = array() ; |
|
56 | - $adminmenu = array() ; |
|
57 | - $adminmenu4altsys = array() ; |
|
58 | - unset($adminmenu_use_altsys) ; |
|
59 | - @include XOOPS_ROOT_PATH.'/modules/'.$dirname.'/'.@$modinfo['adminmenu'] ; |
|
53 | + $dirname = $mod->getVar('dirname'); |
|
54 | + $modinfo = $mod->getInfo(); |
|
55 | + $submenus4assign = array(); |
|
56 | + $adminmenu = array(); |
|
57 | + $adminmenu4altsys = array(); |
|
58 | + unset($adminmenu_use_altsys); |
|
59 | + @include XOOPS_ROOT_PATH.'/modules/'.$dirname.'/'.@$modinfo['adminmenu']; |
|
60 | 60 | // from admin_menu.php etc. |
61 | - $adminmenu = array_merge($adminmenu, $adminmenu4altsys) ; |
|
61 | + $adminmenu = array_merge($adminmenu, $adminmenu4altsys); |
|
62 | 62 | foreach ($adminmenu as $sub) { |
63 | - $link = empty($sub['altsys_link']) ? $sub['link'] : $sub['altsys_link'] ; |
|
63 | + $link = empty($sub['altsys_link']) ? $sub['link'] : $sub['altsys_link']; |
|
64 | 64 | if (isset($sub['show']) && $sub['show'] === false) { |
65 | - continue ; |
|
65 | + continue; |
|
66 | 66 | } |
67 | 67 | $submenus4assign[] = array( |
68 | - 'title' => $myts->makeTboxData4Show($sub['title']) , |
|
68 | + 'title' => $myts->makeTboxData4Show($sub['title']), |
|
69 | 69 | 'url' => XOOPS_URL.'/modules/'.$dirname.'/'.htmlspecialchars($link, ENT_QUOTES) |
70 | - ) ; |
|
70 | + ); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | // for modules overriding Module.class.php (eg. Analyzer for XC) |
74 | - if (empty($submenus4assign) && defined('XOOPS_CUBE_LEGACY') && ! empty($modinfo['cube_style'])) { |
|
74 | + if (empty($submenus4assign) && defined('XOOPS_CUBE_LEGACY') && !empty($modinfo['cube_style'])) { |
|
75 | 75 | $module_handler = xoops_gethandler('module'); |
76 | 76 | $module = $module_handler->get($mid); |
77 | - $moduleObj =& Legacy_Utils::createModule($module); |
|
78 | - $modinfo['adminindex'] = $moduleObj->getAdminIndex() ; |
|
79 | - $modinfo['adminindex_absolute'] = true ; |
|
77 | + $moduleObj = & Legacy_Utils::createModule($module); |
|
78 | + $modinfo['adminindex'] = $moduleObj->getAdminIndex(); |
|
79 | + $modinfo['adminindex_absolute'] = true; |
|
80 | 80 | foreach ($moduleObj->getAdminMenu() as $sub) { |
81 | 81 | if (@$sub['show'] === false) { |
82 | - continue ; |
|
82 | + continue; |
|
83 | 83 | } |
84 | 84 | $submenus4assign[] = array( |
85 | - 'title' => $myts->makeTboxData4Show($sub['title']) , |
|
85 | + 'title' => $myts->makeTboxData4Show($sub['title']), |
|
86 | 86 | 'url' => strncmp($sub['link'], 'http', 4) === 0 ? htmlspecialchars($sub['link'], ENT_QUOTES) : XOOPS_URL.'/modules/'.$dirname.'/'.htmlspecialchars($sub['link'], ENT_QUOTES) |
87 | - ) ; |
|
87 | + ); |
|
88 | 88 | } |
89 | 89 | } elseif (empty($adminmenu4altsys)) { |
90 | 90 | |
91 | 91 | // add preferences |
92 | - if ($mod->getVar('hasconfig') && ! in_array($mod->getVar('dirname'), array( 'system', 'legacy' ))) { |
|
92 | + if ($mod->getVar('hasconfig') && !in_array($mod->getVar('dirname'), array('system', 'legacy'))) { |
|
93 | 93 | $submenus4assign[] = array( |
94 | - 'title' => _PREFERENCES , |
|
94 | + 'title' => _PREFERENCES, |
|
95 | 95 | 'url' => htmlspecialchars(altsys_get_link2modpreferences($mid, $coretype), ENT_QUOTES) |
96 | - ) ; |
|
96 | + ); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | // add help |
100 | - if (defined('XOOPS_CUBE_LEGACY') && ! empty($modinfo['help'])) { |
|
100 | + if (defined('XOOPS_CUBE_LEGACY') && !empty($modinfo['help'])) { |
|
101 | 101 | $submenus4assign[] = array( |
102 | - 'title' => _HELP , |
|
102 | + 'title' => _HELP, |
|
103 | 103 | 'url' => XOOPS_URL.'/modules/legacy/admin/index.php?action=Help&dirname='.$dirname |
104 | - ) ; |
|
104 | + ); |
|
105 | 105 | } |
106 | 106 | } |
107 | 107 | |
108 | 108 | $module4assign = array( |
109 | - 'mid' => $mid , |
|
110 | - 'dirname' => $dirname , |
|
111 | - 'name' => $mod->getVar('name') , |
|
112 | - 'version_in_db' => sprintf('%.2f', $mod->getVar('version') / 100.0) , |
|
113 | - 'version_in_file' => sprintf('%.2f', $modinfo['version']) , |
|
114 | - 'description' => htmlspecialchars(@$modinfo['description'], ENT_QUOTES) , |
|
115 | - 'image' => htmlspecialchars($modinfo['image'], ENT_QUOTES) , |
|
116 | - 'isactive' => $mod->getVar('isactive') , |
|
117 | - 'hasmain' => $mod->getVar('hasmain') , |
|
118 | - 'hasadmin' => $mod->getVar('hasadmin') , |
|
119 | - 'hasconfig' => $mod->getVar('hasconfig') , |
|
120 | - 'weight' => $mod->getVar('weight') , |
|
121 | - 'adminindex' => htmlspecialchars(@$modinfo['adminindex'], ENT_QUOTES) , |
|
122 | - 'adminindex_absolute' => @$modinfo['adminindex_absolute'] , |
|
123 | - 'submenu' => $submenus4assign , |
|
124 | - 'selected' => $mid == $mid_selected ? true : false , |
|
109 | + 'mid' => $mid, |
|
110 | + 'dirname' => $dirname, |
|
111 | + 'name' => $mod->getVar('name'), |
|
112 | + 'version_in_db' => sprintf('%.2f', $mod->getVar('version') / 100.0), |
|
113 | + 'version_in_file' => sprintf('%.2f', $modinfo['version']), |
|
114 | + 'description' => htmlspecialchars(@$modinfo['description'], ENT_QUOTES), |
|
115 | + 'image' => htmlspecialchars($modinfo['image'], ENT_QUOTES), |
|
116 | + 'isactive' => $mod->getVar('isactive'), |
|
117 | + 'hasmain' => $mod->getVar('hasmain'), |
|
118 | + 'hasadmin' => $mod->getVar('hasadmin'), |
|
119 | + 'hasconfig' => $mod->getVar('hasconfig'), |
|
120 | + 'weight' => $mod->getVar('weight'), |
|
121 | + 'adminindex' => htmlspecialchars(@$modinfo['adminindex'], ENT_QUOTES), |
|
122 | + 'adminindex_absolute' => @$modinfo['adminindex_absolute'], |
|
123 | + 'submenu' => $submenus4assign, |
|
124 | + 'selected' => $mid == $mid_selected ? true : false, |
|
125 | 125 | 'dot_suffix' => $mid == $mid_selected ? 'selected_opened' : 'closed' |
126 | - ) ; |
|
127 | - $block['modules'][] = $module4assign ; |
|
126 | + ); |
|
127 | + $block['modules'][] = $module4assign; |
|
128 | 128 | } |
129 | 129 | |
130 | - require_once XOOPS_TRUST_PATH.'/libs/altsys/class/D3Tpl.class.php' ; |
|
131 | - $tpl = new D3Tpl() ; |
|
132 | - $tpl->assign('block', $block) ; |
|
133 | - $ret['content'] = $tpl->fetch($this_template) ; |
|
134 | - return $ret ; |
|
130 | + require_once XOOPS_TRUST_PATH.'/libs/altsys/class/D3Tpl.class.php'; |
|
131 | + $tpl = new D3Tpl(); |
|
132 | + $tpl->assign('block', $block); |
|
133 | + $ret['content'] = $tpl->fetch($this_template); |
|
134 | + return $ret; |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | |
138 | 138 | function b_altsys_admin_menu_edit($options) |
139 | 139 | { |
140 | - $mydirname = empty($options[0]) ? 'd3forum' : $options[0] ; |
|
141 | - $this_template = empty($options[1]) ? 'db:'.$mydirname.'_block_admin_menu.html' : trim($options[1]) ; |
|
140 | + $mydirname = empty($options[0]) ? 'd3forum' : $options[0]; |
|
141 | + $this_template = empty($options[1]) ? 'db:'.$mydirname.'_block_admin_menu.html' : trim($options[1]); |
|
142 | 142 | |
143 | 143 | if (preg_match('/[^0-9a-zA-Z_-]/', $mydirname)) { |
144 | - die('Invalid mydirname') ; |
|
144 | + die('Invalid mydirname'); |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | $form = " |
@@ -1,14 +1,14 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -include_once __DIR__.'/include/altsys_functions.php' ; |
|
3 | +include_once __DIR__.'/include/altsys_functions.php'; |
|
4 | 4 | |
5 | 5 | // language file (modinfo.php) |
6 | -altsys_include_language_file('modinfo') ; |
|
6 | +altsys_include_language_file('modinfo'); |
|
7 | 7 | |
8 | -$modversion['name'] = _MI_ALTSYS_MODULENAME ; |
|
9 | -$modversion['version'] = '0.83' ; |
|
10 | -$modversion['detailed_version'] = '0.83.0' ; |
|
11 | -$modversion['description'] = _MI_ALTSYS_MODULEDESC ; |
|
8 | +$modversion['name'] = _MI_ALTSYS_MODULENAME; |
|
9 | +$modversion['version'] = '0.83'; |
|
10 | +$modversion['detailed_version'] = '0.83.0'; |
|
11 | +$modversion['description'] = _MI_ALTSYS_MODULEDESC; |
|
12 | 12 | $modversion['credits'] = 'PEAK Corp.'; |
13 | 13 | $modversion['author'] = 'GIJ=CHECKMATE<br />PEAK Corp.(http://www.peak.ne.jp/), XOOPS X Distribution(https://github.com/XoopsX)'; |
14 | 14 | $modversion['license'] = 'GPL see LICENSE'; |
@@ -26,18 +26,18 @@ discard block |
||
26 | 26 | $modversion['adminmenu'] = 'admin/admin_menu.php'; |
27 | 27 | |
28 | 28 | // All Templates can't be touched by modulesadmin. |
29 | -$modversion['templates'] = array() ; |
|
29 | +$modversion['templates'] = array(); |
|
30 | 30 | |
31 | 31 | // Blocks |
32 | 32 | $modversion['blocks'][1] = array( |
33 | - 'file' => 'blocks.php' , |
|
34 | - 'name' => _MI_ALTSYS_BNAME_ADMIN_MENU , |
|
35 | - 'description' => '' , |
|
36 | - 'show_func' => 'b_altsys_admin_menu_show' , |
|
37 | - 'edit_func' => 'b_altsys_admin_menu_edit' , |
|
38 | - 'options' => "$mydirname" , |
|
39 | - 'template' => '' , // use "module" template instead |
|
40 | -) ; |
|
33 | + 'file' => 'blocks.php', |
|
34 | + 'name' => _MI_ALTSYS_BNAME_ADMIN_MENU, |
|
35 | + 'description' => '', |
|
36 | + 'show_func' => 'b_altsys_admin_menu_show', |
|
37 | + 'edit_func' => 'b_altsys_admin_menu_edit', |
|
38 | + 'options' => "$mydirname", |
|
39 | + 'template' => '', // use "module" template instead |
|
40 | +); |
|
41 | 41 | |
42 | 42 | // Menu |
43 | 43 | $modversion['hasMain'] = 1; |
@@ -50,64 +50,64 @@ discard block |
||
50 | 50 | |
51 | 51 | // Configurations |
52 | 52 | $modversion['config'][1] = array( |
53 | - 'name' => 'adminmenu_hack_ft' , |
|
54 | - 'title' => '_MI_ALTSYS_ADMINMENU_HFT' , |
|
55 | - 'description' => '_MI_ALTSYS_ADMINMENU_HFTDSC' , |
|
56 | - 'formtype' => 'select' , |
|
57 | - 'valuetype' => 'int' , |
|
58 | - 'default' => 0 , |
|
59 | - 'options' => array( '_NONE' => 0 , '_MI_ALTSYS_AMHFT_OPT_2COL' => 1 , '_MI_ALTSYS_AMHFT_OPT_NOIMG' => 2 , '_MI_ALTSYS_AMHFT_OPT_XCSTY' => 3 ) |
|
60 | -) ; |
|
53 | + 'name' => 'adminmenu_hack_ft', |
|
54 | + 'title' => '_MI_ALTSYS_ADMINMENU_HFT', |
|
55 | + 'description' => '_MI_ALTSYS_ADMINMENU_HFTDSC', |
|
56 | + 'formtype' => 'select', |
|
57 | + 'valuetype' => 'int', |
|
58 | + 'default' => 0, |
|
59 | + 'options' => array('_NONE' => 0, '_MI_ALTSYS_AMHFT_OPT_2COL' => 1, '_MI_ALTSYS_AMHFT_OPT_NOIMG' => 2, '_MI_ALTSYS_AMHFT_OPT_XCSTY' => 3) |
|
60 | +); |
|
61 | 61 | |
62 | 62 | $modversion['config'][] = array( |
63 | - 'name' => 'adminmenu_insert_mymenu' , |
|
64 | - 'title' => '_MI_ALTSYS_ADMINMENU_IM' , |
|
65 | - 'description' => '_MI_ALTSYS_ADMINMENU_IMDSC' , |
|
66 | - 'formtype' => 'yesno' , |
|
67 | - 'valuetype' => 'int' , |
|
68 | - 'default' => 0 , |
|
63 | + 'name' => 'adminmenu_insert_mymenu', |
|
64 | + 'title' => '_MI_ALTSYS_ADMINMENU_IM', |
|
65 | + 'description' => '_MI_ALTSYS_ADMINMENU_IMDSC', |
|
66 | + 'formtype' => 'yesno', |
|
67 | + 'valuetype' => 'int', |
|
68 | + 'default' => 0, |
|
69 | 69 | 'options' => array() |
70 | -) ; |
|
70 | +); |
|
71 | 71 | |
72 | 72 | $modversion['config'][] = array( |
73 | - 'name' => 'admin_in_theme' , |
|
74 | - 'title' => '_MI_ALTSYS_ADMIN_IN_THEME' , |
|
75 | - 'description' => '_MI_ALTSYS_ADMIN_IN_THEMEDSC' , |
|
76 | - 'formtype' => 'textbox' , |
|
77 | - 'valuetype' => 'text' , |
|
78 | - 'default' => 'default' , |
|
73 | + 'name' => 'admin_in_theme', |
|
74 | + 'title' => '_MI_ALTSYS_ADMIN_IN_THEME', |
|
75 | + 'description' => '_MI_ALTSYS_ADMIN_IN_THEMEDSC', |
|
76 | + 'formtype' => 'textbox', |
|
77 | + 'valuetype' => 'text', |
|
78 | + 'default' => 'default', |
|
79 | 79 | 'options' => array() |
80 | -) ; |
|
80 | +); |
|
81 | 81 | |
82 | 82 | $modversion['config'][] = array( |
83 | - 'name' => 'enable_force_clone' , |
|
84 | - 'title' => '_MI_ALTSYS_ENABLEFORCECLONE' , |
|
85 | - 'description' => '_MI_ALTSYS_ENABLEFORCECLONEDSC' , |
|
86 | - 'formtype' => 'yesno' , |
|
87 | - 'valuetype' => 'int' , |
|
88 | - 'default' => 1 , |
|
83 | + 'name' => 'enable_force_clone', |
|
84 | + 'title' => '_MI_ALTSYS_ENABLEFORCECLONE', |
|
85 | + 'description' => '_MI_ALTSYS_ENABLEFORCECLONEDSC', |
|
86 | + 'formtype' => 'yesno', |
|
87 | + 'valuetype' => 'int', |
|
88 | + 'default' => 1, |
|
89 | 89 | 'options' => array() |
90 | -) ; |
|
90 | +); |
|
91 | 91 | |
92 | 92 | $modversion['config'][] = array( |
93 | - 'name' => 'images_dir' , |
|
94 | - 'title' => '_MI_ALTSYS_IMAGES_DIR' , |
|
95 | - 'description' => '_MI_ALTSYS_IMAGES_DIRDSC' , |
|
96 | - 'formtype' => 'textbox' , |
|
97 | - 'valuetype' => 'text' , |
|
98 | - 'default' => 'images' , |
|
93 | + 'name' => 'images_dir', |
|
94 | + 'title' => '_MI_ALTSYS_IMAGES_DIR', |
|
95 | + 'description' => '_MI_ALTSYS_IMAGES_DIRDSC', |
|
96 | + 'formtype' => 'textbox', |
|
97 | + 'valuetype' => 'text', |
|
98 | + 'default' => 'images', |
|
99 | 99 | 'options' => array() |
100 | -) ; |
|
100 | +); |
|
101 | 101 | |
102 | 102 | // Notification |
103 | 103 | |
104 | 104 | $modversion['hasNotification'] = 0; |
105 | 105 | |
106 | -$modversion['onInstall'] = 'include/oninstall.php' ; |
|
107 | -$modversion['onUpdate'] = 'include/onupdate.php' ; |
|
108 | -$modversion['onUninstall'] = 'include/onuninstall.php' ; |
|
106 | +$modversion['onInstall'] = 'include/oninstall.php'; |
|
107 | +$modversion['onUpdate'] = 'include/onupdate.php'; |
|
108 | +$modversion['onUninstall'] = 'include/onuninstall.php'; |
|
109 | 109 | |
110 | 110 | // keep block's options |
111 | -if (! defined('XOOPS_CUBE_LEGACY') && substr(XOOPS_VERSION, 6, 3) < 2.1 && ! empty($_POST['fct']) && ! empty($_POST['op']) && $_POST['fct'] == 'modulesadmin' && $_POST['op'] == 'update_ok' && $_POST['dirname'] == $modversion['dirname']) { |
|
112 | - include __DIR__.'/include/x20_keepblockoptions.inc.php' ; |
|
111 | +if (!defined('XOOPS_CUBE_LEGACY') && substr(XOOPS_VERSION, 6, 3) < 2.1 && !empty($_POST['fct']) && !empty($_POST['op']) && $_POST['fct'] == 'modulesadmin' && $_POST['op'] == 'update_ok' && $_POST['dirname'] == $modversion['dirname']) { |
|
112 | + include __DIR__.'/include/x20_keepblockoptions.inc.php'; |
|
113 | 113 | } |