@@ -1,45 +1,45 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (! $xoopsConfig['theme_fromfile']) { |
|
4 | - return ; |
|
3 | +if (!$xoopsConfig['theme_fromfile']) { |
|
4 | + return; |
|
5 | 5 | } |
6 | 6 | |
7 | 7 | // templates/ under modules |
8 | 8 | // $tplsadmin_autoupdate_path = XOOPS_THEME_PATH . '/' . $xoopsConfig['theme_set'] . '/templates' ; |
9 | 9 | |
10 | -if (! is_array(@$tplsadmin_autoupdate_dirnames)) { |
|
11 | - return ; |
|
10 | +if (!is_array(@$tplsadmin_autoupdate_dirnames)) { |
|
11 | + return; |
|
12 | 12 | } |
13 | 13 | |
14 | 14 | foreach ($tplsadmin_autoupdate_dirnames as $dirname) { |
15 | - $dirname = preg_replace('/[^a-zA-Z0-9_-]/', '', $dirname) ; |
|
16 | - $tplsadmin_autoupdate_path = XOOPS_ROOT_PATH . '/modules/' . $dirname . '/templates' ; |
|
15 | + $dirname = preg_replace('/[^a-zA-Z0-9_-]/', '', $dirname); |
|
16 | + $tplsadmin_autoupdate_path = XOOPS_ROOT_PATH.'/modules/'.$dirname.'/templates'; |
|
17 | 17 | |
18 | 18 | // modules |
19 | - if ($handler = @opendir($tplsadmin_autoupdate_path . '/')) { |
|
19 | + if ($handler = @opendir($tplsadmin_autoupdate_path.'/')) { |
|
20 | 20 | while (($file = readdir($handler)) !== false) { |
21 | - $file_path = $tplsadmin_autoupdate_path . '/' . $file ; |
|
21 | + $file_path = $tplsadmin_autoupdate_path.'/'.$file; |
|
22 | 22 | if (is_file($file_path) && substr($file, -5) == '.html') { |
23 | 23 | $mtime = (int)(@filemtime($file_path)); |
24 | - list($count) = $xoopsDB->fetchRow($xoopsDB->query('SELECT COUNT(*) FROM ' . $xoopsDB->prefix('tplfile') . " WHERE tpl_tplset='" . addslashes($xoopsConfig['template_set']) . "' AND tpl_file='" . addslashes($file) . "' AND tpl_lastmodified >= $mtime")) ; |
|
24 | + list($count) = $xoopsDB->fetchRow($xoopsDB->query('SELECT COUNT(*) FROM '.$xoopsDB->prefix('tplfile')." WHERE tpl_tplset='".addslashes($xoopsConfig['template_set'])."' AND tpl_file='".addslashes($file)."' AND tpl_lastmodified >= $mtime")); |
|
25 | 25 | if ($count <= 0) { |
26 | - include_once XOOPS_TRUST_PATH.'/libs/altsys/include/tpls_functions.php' ; |
|
27 | - tplsadmin_import_data($xoopsConfig['template_set'], $file, implode('', file($file_path)), $mtime) ; |
|
26 | + include_once XOOPS_TRUST_PATH.'/libs/altsys/include/tpls_functions.php'; |
|
27 | + tplsadmin_import_data($xoopsConfig['template_set'], $file, implode('', file($file_path)), $mtime); |
|
28 | 28 | } |
29 | 29 | } |
30 | 30 | } |
31 | 31 | } |
32 | 32 | |
33 | 33 | // blocks |
34 | - if ($handler = @opendir($tplsadmin_autoupdate_path . '/blocks/')) { |
|
34 | + if ($handler = @opendir($tplsadmin_autoupdate_path.'/blocks/')) { |
|
35 | 35 | while (($file = readdir($handler)) !== false) { |
36 | - $file_path = $tplsadmin_autoupdate_path . '/blocks/' . $file ; |
|
36 | + $file_path = $tplsadmin_autoupdate_path.'/blocks/'.$file; |
|
37 | 37 | if (is_file($file_path) && substr($file, -5) == '.html') { |
38 | 38 | $mtime = (int)(@filemtime($file_path)); |
39 | - list($count) = $xoopsDB->fetchRow($xoopsDB->query('SELECT COUNT(*) FROM ' . $xoopsDB->prefix('tplfile') . " WHERE tpl_tplset='" . addslashes($xoopsConfig['template_set']) . "' AND tpl_file='" . addslashes($file) . "' AND tpl_lastmodified >= $mtime")) ; |
|
39 | + list($count) = $xoopsDB->fetchRow($xoopsDB->query('SELECT COUNT(*) FROM '.$xoopsDB->prefix('tplfile')." WHERE tpl_tplset='".addslashes($xoopsConfig['template_set'])."' AND tpl_file='".addslashes($file)."' AND tpl_lastmodified >= $mtime")); |
|
40 | 40 | if ($count <= 0) { |
41 | - include_once XOOPS_TRUST_PATH.'/libs/altsys/include/tpls_functions.php' ; |
|
42 | - tplsadmin_import_data($xoopsConfig['template_set'], $file, implode('', file($file_path)), $mtime) ; |
|
41 | + include_once XOOPS_TRUST_PATH.'/libs/altsys/include/tpls_functions.php'; |
|
42 | + tplsadmin_import_data($xoopsConfig['template_set'], $file, implode('', file($file_path)), $mtime); |
|
43 | 43 | } |
44 | 44 | } |
45 | 45 | } |
@@ -1,21 +1,21 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (! $xoopsConfig['theme_fromfile']) { |
|
4 | - return ; |
|
3 | +if (!$xoopsConfig['theme_fromfile']) { |
|
4 | + return; |
|
5 | 5 | } |
6 | 6 | |
7 | 7 | // templates/ under the theme |
8 | -$tplsadmin_autoupdate_path = XOOPS_THEME_PATH . '/' . $xoopsConfig['theme_set'] . '/templates' ; |
|
8 | +$tplsadmin_autoupdate_path = XOOPS_THEME_PATH.'/'.$xoopsConfig['theme_set'].'/templates'; |
|
9 | 9 | |
10 | -if ($handler = @opendir($tplsadmin_autoupdate_path . '/')) { |
|
10 | +if ($handler = @opendir($tplsadmin_autoupdate_path.'/')) { |
|
11 | 11 | while (($file = readdir($handler)) !== false) { |
12 | - $file_path = $tplsadmin_autoupdate_path . '/' . $file ; |
|
12 | + $file_path = $tplsadmin_autoupdate_path.'/'.$file; |
|
13 | 13 | if (is_file($file_path) && substr($file, -5) == '.html') { |
14 | 14 | $mtime = (int)(@filemtime($file_path)); |
15 | - list($count) = $xoopsDB->fetchRow($xoopsDB->query('SELECT COUNT(*) FROM ' . $xoopsDB->prefix('tplfile') . " WHERE tpl_tplset='" . addslashes($xoopsConfig['template_set']) . "' AND tpl_file='" . addslashes($file) . "' AND tpl_lastmodified >= $mtime")) ; |
|
15 | + list($count) = $xoopsDB->fetchRow($xoopsDB->query('SELECT COUNT(*) FROM '.$xoopsDB->prefix('tplfile')." WHERE tpl_tplset='".addslashes($xoopsConfig['template_set'])."' AND tpl_file='".addslashes($file)."' AND tpl_lastmodified >= $mtime")); |
|
16 | 16 | if ($count <= 0) { |
17 | - include_once XOOPS_TRUST_PATH.'/libs/altsys/include/tpls_functions.php' ; |
|
18 | - tplsadmin_import_data($xoopsConfig['template_set'], $file, implode('', file($file_path)), $mtime) ; |
|
17 | + include_once XOOPS_TRUST_PATH.'/libs/altsys/include/tpls_functions.php'; |
|
18 | + tplsadmin_import_data($xoopsConfig['template_set'], $file, implode('', file($file_path)), $mtime); |
|
19 | 19 | } |
20 | 20 | } |
21 | 21 | } |
@@ -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 | } |
@@ -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 | } |
@@ -76,83 +76,83 @@ |
||
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 | 77 | $title = '' ; // GIJ |
78 | 78 | switch ($config[$i]->getVar('conf_formtype')) { |
79 | - case 'textarea': |
|
80 | - (method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || $myts = MyTextSanitizer::getInstance(); |
|
81 | - if ($config[$i]->getVar('conf_valuetype') == 'array') { |
|
82 | - // this is exceptional.. only when value type is arrayneed a smarter way for this |
|
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); |
|
84 | - } else { |
|
85 | - $ele = new XoopsFormTextArea($title, $config[$i]->getVar('conf_name'), $myts->htmlspecialchars($config[$i]->getConfValueForOutput()), 5, 50); |
|
86 | - } |
|
87 | - break; |
|
88 | - case 'select': |
|
89 | - case 'radio': |
|
90 | - if ($config[$i]->getVar('conf_formtype') === 'select') { |
|
91 | - $ele = new XoopsFormSelect($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput()); |
|
92 | - $addBr = ''; |
|
93 | - } else { |
|
94 | - $ele = new XoopsFormRadio($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput()); |
|
95 | - $addBr = '<br />'; |
|
96 | - } |
|
97 | - $options = $config_handler->getConfigOptions(new Criteria('conf_id', $config[$i]->getVar('conf_id'))); |
|
98 | - $opcount = count($options); |
|
99 | - for ($j = 0; $j < $opcount; $j++) { |
|
100 | - $optval = defined($options[$j]->getVar('confop_value')) ? constant($options[$j]->getVar('confop_value')) : $options[$j]->getVar('confop_value'); |
|
101 | - $optkey = defined($options[$j]->getVar('confop_name')) ? constant($options[$j]->getVar('confop_name')) : $options[$j]->getVar('confop_name'); |
|
102 | - $ele->addOption($optval, $optkey.$addBr); |
|
103 | - } |
|
104 | - break; |
|
105 | - case 'select_multi': |
|
106 | - case 'checkbox': |
|
107 | - if ($config[$i]->getVar('conf_formtype') === 'select_multi') { |
|
108 | - $ele = new XoopsFormSelect($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput(), 5, true); |
|
109 | - $addBr = ''; |
|
110 | - } else { |
|
111 | - $ele = new XoopsFormCheckBox($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput()); |
|
112 | - $addBr = '<br />'; |
|
113 | - } |
|
114 | - $options = $config_handler->getConfigOptions(new Criteria('conf_id', $config[$i]->getVar('conf_id'))); |
|
115 | - $opcount = count($options); |
|
116 | - for ($j = 0; $j < $opcount; $j++) { |
|
117 | - $optval = defined($options[$j]->getVar('confop_value')) ? constant($options[$j]->getVar('confop_value')) : $options[$j]->getVar('confop_value'); |
|
118 | - $optkey = defined($options[$j]->getVar('confop_name')) ? constant($options[$j]->getVar('confop_name')) : $options[$j]->getVar('confop_name'); |
|
79 | + case 'textarea': |
|
80 | + (method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || $myts = MyTextSanitizer::getInstance(); |
|
81 | + if ($config[$i]->getVar('conf_valuetype') == 'array') { |
|
82 | + // this is exceptional.. only when value type is arrayneed a smarter way for this |
|
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); |
|
84 | + } else { |
|
85 | + $ele = new XoopsFormTextArea($title, $config[$i]->getVar('conf_name'), $myts->htmlspecialchars($config[$i]->getConfValueForOutput()), 5, 50); |
|
86 | + } |
|
87 | + break; |
|
88 | + case 'select': |
|
89 | + case 'radio': |
|
90 | + if ($config[$i]->getVar('conf_formtype') === 'select') { |
|
91 | + $ele = new XoopsFormSelect($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput()); |
|
92 | + $addBr = ''; |
|
93 | + } else { |
|
94 | + $ele = new XoopsFormRadio($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput()); |
|
95 | + $addBr = '<br />'; |
|
96 | + } |
|
97 | + $options = $config_handler->getConfigOptions(new Criteria('conf_id', $config[$i]->getVar('conf_id'))); |
|
98 | + $opcount = count($options); |
|
99 | + for ($j = 0; $j < $opcount; $j++) { |
|
100 | + $optval = defined($options[$j]->getVar('confop_value')) ? constant($options[$j]->getVar('confop_value')) : $options[$j]->getVar('confop_value'); |
|
101 | + $optkey = defined($options[$j]->getVar('confop_name')) ? constant($options[$j]->getVar('confop_name')) : $options[$j]->getVar('confop_name'); |
|
102 | + $ele->addOption($optval, $optkey.$addBr); |
|
103 | + } |
|
104 | + break; |
|
105 | + case 'select_multi': |
|
106 | + case 'checkbox': |
|
107 | + if ($config[$i]->getVar('conf_formtype') === 'select_multi') { |
|
108 | + $ele = new XoopsFormSelect($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput(), 5, true); |
|
109 | + $addBr = ''; |
|
110 | + } else { |
|
111 | + $ele = new XoopsFormCheckBox($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput()); |
|
112 | + $addBr = '<br />'; |
|
113 | + } |
|
114 | + $options = $config_handler->getConfigOptions(new Criteria('conf_id', $config[$i]->getVar('conf_id'))); |
|
115 | + $opcount = count($options); |
|
116 | + for ($j = 0; $j < $opcount; $j++) { |
|
117 | + $optval = defined($options[$j]->getVar('confop_value')) ? constant($options[$j]->getVar('confop_value')) : $options[$j]->getVar('confop_value'); |
|
118 | + $optkey = defined($options[$j]->getVar('confop_name')) ? constant($options[$j]->getVar('confop_name')) : $options[$j]->getVar('confop_name'); |
|
119 | 119 | |
120 | - $ele->addOption($optval, $optkey.$addBr); |
|
121 | - } |
|
122 | - break; |
|
123 | - case 'yesno': |
|
124 | - $ele = new XoopsFormRadioYN($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput(), _YES, _NO); |
|
125 | - break; |
|
126 | - case 'group': |
|
127 | - include_once XOOPS_ROOT_PATH.'/class/xoopslists.php'; |
|
128 | - $ele = new XoopsFormSelectGroup($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 1, false); |
|
129 | - break; |
|
130 | - case 'group_multi': |
|
131 | - include_once XOOPS_ROOT_PATH.'/class/xoopslists.php'; |
|
132 | - $ele = new XoopsFormSelectGroup($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 5, true); |
|
133 | - break; |
|
134 | - case 'group_checkbox': |
|
135 | - include_once __DIR__.'/include/formcheckboxgroup.php'; |
|
136 | - $ele = new AltsysFormCheckboxGroup($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput()); |
|
137 | - break; |
|
138 | - // RMV-NOTIFY: added 'user' and 'user_multi' |
|
139 | - case 'user': |
|
140 | - include_once XOOPS_ROOT_PATH.'/class/xoopslists.php'; |
|
141 | - $ele = new XoopsFormSelectUser($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 1, false); |
|
142 | - break; |
|
143 | - case 'user_multi': |
|
144 | - include_once XOOPS_ROOT_PATH.'/class/xoopslists.php'; |
|
145 | - $ele = new XoopsFormSelectUser($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 5, true); |
|
146 | - break; |
|
147 | - case 'password': |
|
148 | - (method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || $myts = MyTextSanitizer::getInstance(); |
|
149 | - $ele = new XoopsFormPassword($title, $config[$i]->getVar('conf_name'), 50, 255, $myts->htmlspecialchars($config[$i]->getConfValueForOutput())); |
|
150 | - break; |
|
151 | - case 'textbox': |
|
152 | - default: |
|
153 | - (method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || $myts = MyTextSanitizer::getInstance(); |
|
154 | - $ele = new XoopsFormText($title, $config[$i]->getVar('conf_name'), 50, 255, $myts->htmlspecialchars($config[$i]->getConfValueForOutput())); |
|
155 | - break; |
|
120 | + $ele->addOption($optval, $optkey.$addBr); |
|
121 | + } |
|
122 | + break; |
|
123 | + case 'yesno': |
|
124 | + $ele = new XoopsFormRadioYN($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput(), _YES, _NO); |
|
125 | + break; |
|
126 | + case 'group': |
|
127 | + include_once XOOPS_ROOT_PATH.'/class/xoopslists.php'; |
|
128 | + $ele = new XoopsFormSelectGroup($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 1, false); |
|
129 | + break; |
|
130 | + case 'group_multi': |
|
131 | + include_once XOOPS_ROOT_PATH.'/class/xoopslists.php'; |
|
132 | + $ele = new XoopsFormSelectGroup($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 5, true); |
|
133 | + break; |
|
134 | + case 'group_checkbox': |
|
135 | + include_once __DIR__.'/include/formcheckboxgroup.php'; |
|
136 | + $ele = new AltsysFormCheckboxGroup($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput()); |
|
137 | + break; |
|
138 | + // RMV-NOTIFY: added 'user' and 'user_multi' |
|
139 | + case 'user': |
|
140 | + include_once XOOPS_ROOT_PATH.'/class/xoopslists.php'; |
|
141 | + $ele = new XoopsFormSelectUser($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 1, false); |
|
142 | + break; |
|
143 | + case 'user_multi': |
|
144 | + include_once XOOPS_ROOT_PATH.'/class/xoopslists.php'; |
|
145 | + $ele = new XoopsFormSelectUser($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 5, true); |
|
146 | + break; |
|
147 | + case 'password': |
|
148 | + (method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || $myts = MyTextSanitizer::getInstance(); |
|
149 | + $ele = new XoopsFormPassword($title, $config[$i]->getVar('conf_name'), 50, 255, $myts->htmlspecialchars($config[$i]->getConfValueForOutput())); |
|
150 | + break; |
|
151 | + case 'textbox': |
|
152 | + default: |
|
153 | + (method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || $myts = MyTextSanitizer::getInstance(); |
|
154 | + $ele = new XoopsFormText($title, $config[$i]->getVar('conf_name'), 50, 255, $myts->htmlspecialchars($config[$i]->getConfValueForOutput())); |
|
155 | + break; |
|
156 | 156 | } |
157 | 157 | $hidden = new XoopsFormHidden('conf_ids[]', $config[$i]->getVar('conf_id')); |
158 | 158 | $ele_tray = new XoopsFormElementTray($title4tray, '') ; |
@@ -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 | } |