Completed
Push — master ( 0881bb...3a6ebc )
by Michael
04:47
created
xoops_trust_path/libs/altsys/mymenu.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -2,30 +2,30 @@  discard block
 block discarded – undo
2 2
 
3 3
 /********* mymenu only for ALTSYS ********/
4 4
 
5
-if (! defined('XOOPS_ROOT_PATH')) {
6
-    exit ;
5
+if (!defined('XOOPS_ROOT_PATH')) {
6
+    exit;
7 7
 }
8 8
 
9 9
 // Skip for ORETEKI XOOPS
10 10
 if (defined('XOOPS_ORETEKI')) {
11
-    return ;
11
+    return;
12 12
 }
13 13
 
14
-if (! isset($module) || ! is_object($module)) {
15
-    $module = $xoopsModule ;
16
-} elseif (! is_object($xoopsModule)) {
17
-    die('$xoopsModule is not set')  ;
14
+if (!isset($module) || !is_object($module)) {
15
+    $module = $xoopsModule;
16
+} elseif (!is_object($xoopsModule)) {
17
+    die('$xoopsModule is not set');
18 18
 }
19 19
 
20 20
 // language files (modinfo.php)
21
-altsys_include_language_file('modinfo') ;
21
+altsys_include_language_file('modinfo');
22 22
 
23
-include __DIR__.'/admin_menu.php' ;
23
+include __DIR__.'/admin_menu.php';
24 24
 
25
-$adminmenu = array_merge($adminmenu, $adminmenu4altsys) ;
25
+$adminmenu = array_merge($adminmenu, $adminmenu4altsys);
26 26
 
27
-$mymenu_uri = empty($mymenu_fake_uri) ? $_SERVER['REQUEST_URI'] : $mymenu_fake_uri ;
28
-$mymenu_link = substr(strstr($mymenu_uri, '/admin/'), 1) ;
27
+$mymenu_uri = empty($mymenu_fake_uri) ? $_SERVER['REQUEST_URI'] : $mymenu_fake_uri;
28
+$mymenu_link = substr(strstr($mymenu_uri, '/admin/'), 1);
29 29
 
30 30
 // xoops_breadcrumbs
31 31
 // $GLOBALS['altsysXoopsBreadcrumbs'] = array( array( 'url' => XOOPS_URL.'/modules/altsys/admin/index.php' , 'name' => $xoopsModule->getVar('name') ) ) ;
@@ -33,19 +33,19 @@  discard block
 block discarded – undo
33 33
 // highlight
34 34
 foreach (array_keys($adminmenu) as $i) {
35 35
     if ($mymenu_link == $adminmenu[$i]['link']) {
36
-        $adminmenu[$i]['selected'] = true ;
37
-        $adminmenu_hilighted = true ;
36
+        $adminmenu[$i]['selected'] = true;
37
+        $adminmenu_hilighted = true;
38 38
 //		$GLOBALS['altsysXoopsBreadcrumbs'][] = array( 'url' => XOOPS_URL."/modules/altsys/".htmlspecialchars($adminmenu[$i]['link'],ENT_QUOTES) , 'name' => htmlspecialchars( $adminmenu[$i]['title'] , ENT_QUOTES ) ) ;
39 39
     } else {
40
-        $adminmenu[$i]['selected'] = false ;
40
+        $adminmenu[$i]['selected'] = false;
41 41
     }
42 42
 }
43 43
 if (empty($adminmenu_hilighted)) {
44 44
     foreach (array_keys($adminmenu) as $i) {
45 45
         if (stristr($mymenu_uri, $adminmenu[$i]['link'])) {
46
-            $adminmenu[$i]['selected'] = true ;
46
+            $adminmenu[$i]['selected'] = true;
47 47
 //			$GLOBALS['altsysXoopsBreadcrumbs'][] = array( 'url' => XOOPS_URL."/modules/altsys/".htmlspecialchars($adminmenu[$i]['link'],ENT_QUOTES) , 'name' => htmlspecialchars( $adminmenu[$i]['title'] , ENT_QUOTES ) ) ;
48
-            break ;
48
+            break;
49 49
         }
50 50
     }
51 51
 }
@@ -53,20 +53,20 @@  discard block
 block discarded – undo
53 53
 // link conversion from relative to absolute
54 54
 foreach (array_keys($adminmenu) as $i) {
55 55
     if (stristr($adminmenu[$i]['link'], XOOPS_URL) === false) {
56
-        $adminmenu[$i]['link'] = XOOPS_URL."/modules/$mydirname/" . $adminmenu[$i]['link'] ;
56
+        $adminmenu[$i]['link'] = XOOPS_URL."/modules/$mydirname/".$adminmenu[$i]['link'];
57 57
     }
58 58
 }
59 59
 
60 60
 // display
61
-require_once XOOPS_TRUST_PATH.'/libs/altsys/class/D3Tpl.class.php' ;
62
-$tpl = new D3Tpl() ;
61
+require_once XOOPS_TRUST_PATH.'/libs/altsys/class/D3Tpl.class.php';
62
+$tpl = new D3Tpl();
63 63
 $tpl->assign(array(
64 64
     'adminmenu' => $adminmenu
65
-)) ;
66
-$tpl->display('db:altsys_inc_mymenu.html') ;
65
+));
66
+$tpl->display('db:altsys_inc_mymenu.html');
67 67
 
68 68
 // submenu
69
-$page = preg_replace('/[^0-9a-zA-Z_-]/', '', @$_GET['page']) ;
69
+$page = preg_replace('/[^0-9a-zA-Z_-]/', '', @$_GET['page']);
70 70
 if (file_exists(__DIR__.'/mymenusub/'.$page.'.php')) {
71
-    include __DIR__.'/mymenusub/'.$page.'.php' ;
71
+    include __DIR__.'/mymenusub/'.$page.'.php';
72 72
 }
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/mylangadmin.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -302,7 +302,7 @@
 block discarded – undo
302 302
     'use_my_language' => strlen($langman->my_language) > 0,
303 303
     'mylang_file_name' => htmlspecialchars($mylang_unique_path, ENT_QUOTES),
304 304
     'cache_file_name' => htmlspecialchars($cache_file_name, ENT_QUOTES),
305
-     'cache_file_mtime' => (int)$cache_file_mtime,
305
+        'cache_file_mtime' => (int)$cache_file_mtime,
306 306
     'timezone_offset' => xoops_getUserTimestamp(0),
307 307
     'notice' => $notice4disp,
308 308
     'already_read' => $already_read,
Please login to merge, or discard this patch.
Spacing   +116 added lines, -116 removed lines patch added patch discarded remove patch
@@ -5,170 +5,170 @@  discard block
 block discarded – undo
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' ;
11
-include_once __DIR__.'/include/lang_functions.php' ;
12
-include_once __DIR__.'/class/D3LanguageManager.class.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
+include_once __DIR__.'/include/lang_functions.php';
12
+include_once __DIR__.'/class/D3LanguageManager.class.php';
13 13
 
14 14
 
15 15
 // only groups have 'module_admin' of 'altsys' can do that.
16
-$module_handler =& xoops_gethandler('module') ;
17
-$module =& $module_handler->getByDirname('altsys') ;
18
-if (! is_object($module)) {
19
-    die('install altsys') ;
16
+$module_handler = & xoops_gethandler('module');
17
+$module = & $module_handler->getByDirname('altsys');
18
+if (!is_object($module)) {
19
+    die('install altsys');
20 20
 }
21
-$moduleperm_handler =& xoops_gethandler('groupperm') ;
22
-if (! is_object(@$xoopsUser) || ! $moduleperm_handler->checkRight('module_admin', $module->getVar('mid'), $xoopsUser->getGroups())) {
23
-    die('only admin of altsys can access this area') ;
21
+$moduleperm_handler = & xoops_gethandler('groupperm');
22
+if (!is_object(@$xoopsUser) || !$moduleperm_handler->checkRight('module_admin', $module->getVar('mid'), $xoopsUser->getGroups())) {
23
+    die('only admin of altsys can access this area');
24 24
 }
25 25
 
26 26
 
27 27
 // initials
28
-$db =& XoopsDatabaseFactory::getDatabaseConnection();
29
-(method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || $myts =& MyTextSanitizer::getInstance() ;
30
-$langman =& D3LanguageManager::getInstance() ;
28
+$db = & XoopsDatabaseFactory::getDatabaseConnection();
29
+(method_exists('MyTextSanitizer', 'sGetInstance') and $myts = & MyTextSanitizer::sGetInstance()) || $myts = & MyTextSanitizer::getInstance();
30
+$langman = & D3LanguageManager::getInstance();
31 31
 
32 32
 // language file of this controller
33
-altsys_include_language_file('mylangadmin') ;
33
+altsys_include_language_file('mylangadmin');
34 34
 
35 35
 // check $xoopsModule
36
-if (! is_object($xoopsModule)) {
37
-    redirect_header(XOOPS_URL.'/user.php', 1, _NOPERM) ;
36
+if (!is_object($xoopsModule)) {
37
+    redirect_header(XOOPS_URL.'/user.php', 1, _NOPERM);
38 38
 }
39 39
 
40 40
 // set target_module if specified by $_GET['dirname']
41
-$module_handler =& xoops_gethandler('module');
42
-if (! empty($_GET['dirname'])) {
43
-    $dirname = preg_replace('/[^0-9a-zA-Z_-]/', '', $_GET['dirname']) ;
44
-    $target_module =& $module_handler->getByDirname($dirname) ;
41
+$module_handler = & xoops_gethandler('module');
42
+if (!empty($_GET['dirname'])) {
43
+    $dirname = preg_replace('/[^0-9a-zA-Z_-]/', '', $_GET['dirname']);
44
+    $target_module = & $module_handler->getByDirname($dirname);
45 45
 }
46 46
 
47
-if (! empty($target_module) && is_object($target_module)) {
47
+if (!empty($target_module) && is_object($target_module)) {
48 48
     // specified by dirname (for langadmin as an independent module)
49
-    $target_mid = $target_module->getVar('mid') ;
50
-    $target_dirname = $target_module->getVar('dirname') ;
51
-    $target_dirname4sql = addslashes($target_dirname) ;
52
-    $target_mname = $target_module->getVar('name') . '&nbsp;' . sprintf('(%2.2f)', $target_module->getVar('version') / 100.0) ;
49
+    $target_mid = $target_module->getVar('mid');
50
+    $target_dirname = $target_module->getVar('dirname');
51
+    $target_dirname4sql = addslashes($target_dirname);
52
+    $target_mname = $target_module->getVar('name').'&nbsp;'.sprintf('(%2.2f)', $target_module->getVar('version') / 100.0);
53 53
     //$query4redirect = '?dirname='.urlencode(strip_tags($_GET['dirname'])) ;
54 54
 } else {
55 55
     // not specified by dirname (for 3rd party modules as mylangadmin)
56
-    $target_mid = $xoopsModule->getVar('mid') ;
57
-    $target_dirname = $xoopsModule->getVar('dirname') ;
58
-    $target_dirname4sql = addslashes($target_dirname) ;
59
-    $target_mname = $xoopsModule->getVar('name') ;
56
+    $target_mid = $xoopsModule->getVar('mid');
57
+    $target_dirname = $xoopsModule->getVar('dirname');
58
+    $target_dirname4sql = addslashes($target_dirname);
59
+    $target_mname = $xoopsModule->getVar('name');
60 60
     //$query4redirect = '' ;
61 61
 }
62 62
 
63 63
 // basic GET variables
64
-$target_lang = preg_replace('/[^0-9a-zA-Z_-]/', '', @$_GET['target_lang']) ;
64
+$target_lang = preg_replace('/[^0-9a-zA-Z_-]/', '', @$_GET['target_lang']);
65 65
 if (empty($target_lang)) {
66
-    $target_lang = $GLOBALS['xoopsConfig']['language'] ;
66
+    $target_lang = $GLOBALS['xoopsConfig']['language'];
67 67
 }
68
-$target_lang4sql = addslashes($target_lang) ;
69
-$target_file = preg_replace('/[^0-9a-zA-Z_.-]/', '', @$_GET['target_file']) ;
68
+$target_lang4sql = addslashes($target_lang);
69
+$target_file = preg_replace('/[^0-9a-zA-Z_.-]/', '', @$_GET['target_file']);
70 70
 if (empty($target_file)) {
71
-    $target_file = 'main.php' ;
71
+    $target_file = 'main.php';
72 72
 }
73 73
 
74 74
 // get $target_trustdirname
75
-$mytrustdirname = '' ;
75
+$mytrustdirname = '';
76 76
 if (file_exists(XOOPS_ROOT_PATH.'/modules/'.$target_dirname.'/mytrustdirname.php')) {
77
-    require XOOPS_ROOT_PATH.'/modules/'.$target_dirname.'/mytrustdirname.php' ;
77
+    require XOOPS_ROOT_PATH.'/modules/'.$target_dirname.'/mytrustdirname.php';
78 78
 }
79
-$target_trustdirname = $mytrustdirname ;
79
+$target_trustdirname = $mytrustdirname;
80 80
 
81 81
 // get base directory
82 82
 if (empty($target_trustdirname)) {
83 83
     // conventinal module
84
-    $base_dir = XOOPS_ROOT_PATH.'/modules/'.$target_dirname.'/language' ;
84
+    $base_dir = XOOPS_ROOT_PATH.'/modules/'.$target_dirname.'/language';
85 85
 } else {
86 86
     // D3 module
87
-    $base_dir = XOOPS_TRUST_PATH.'/modules/'.$target_trustdirname.'/language' ;
87
+    $base_dir = XOOPS_TRUST_PATH.'/modules/'.$target_trustdirname.'/language';
88 88
 }
89 89
 
90 90
 // make list of language and check $target_lang
91
-$languages = array() ;
92
-$languages4disp = array() ;
93
-if (! is_dir($base_dir)) {
94
-    altsys_mylangadmin_errordie($target_mname, _MYLANGADMIN_ERR_MODNOLANGUAGE) ;
91
+$languages = array();
92
+$languages4disp = array();
93
+if (!is_dir($base_dir)) {
94
+    altsys_mylangadmin_errordie($target_mname, _MYLANGADMIN_ERR_MODNOLANGUAGE);
95 95
 }
96
-$dh = opendir($base_dir) ;
96
+$dh = opendir($base_dir);
97 97
 if ($dh) {
98 98
     while ($file = readdir($dh)) {
99 99
         if (substr($file, 0, 1) == '.') {
100
-            continue ;
100
+            continue;
101 101
         }
102 102
         if (is_dir("$base_dir/$file")) {
103
-            list($count) = $db->fetchRow($db->query('SELECT COUNT(*) FROM ' . $db->prefix('altsys_language_constants') . " WHERE mid=$target_mid AND language='" . addslashes($file) . "'")) ;
104
-            $languages[] = $file ;
105
-            $languages4disp[] = $file . " ($count)" ;
103
+            list($count) = $db->fetchRow($db->query('SELECT COUNT(*) FROM '.$db->prefix('altsys_language_constants')." WHERE mid=$target_mid AND language='".addslashes($file)."'"));
104
+            $languages[] = $file;
105
+            $languages4disp[] = $file." ($count)";
106 106
         }
107 107
     }
108 108
 }
109
-closedir($dh) ;
110
-if (! in_array($target_lang, $languages)) {
111
-    $target_lang = $languages[0] ;
109
+closedir($dh);
110
+if (!in_array($target_lang, $languages)) {
111
+    $target_lang = $languages[0];
112 112
 }
113 113
 
114 114
 // get base directory seleced language
115
-$lang_base_dir = $base_dir.'/'.$target_lang ;
116
-if (! is_dir($lang_base_dir)) {
117
-    altsys_mylangadmin_errordie($target_mname, _MYLANGADMIN_ERR_MODLANGINCOMPATIBLE) ;
115
+$lang_base_dir = $base_dir.'/'.$target_lang;
116
+if (!is_dir($lang_base_dir)) {
117
+    altsys_mylangadmin_errordie($target_mname, _MYLANGADMIN_ERR_MODLANGINCOMPATIBLE);
118 118
 }
119 119
 
120 120
 // make list of files and check $target_file
121
-$lang_files = array() ;
122
-$dh = opendir($lang_base_dir) ;
121
+$lang_files = array();
122
+$dh = opendir($lang_base_dir);
123 123
 if ($dh) {
124 124
     while ($file = readdir($dh)) {
125 125
         if (substr($file, 0, 1) == '.') {
126
-            continue ;
126
+            continue;
127 127
         }
128 128
         if ($file == 'index.html') {
129
-            continue ;
129
+            continue;
130 130
         }
131 131
     //if( $file == 'modinfo.php' ) continue ; // TODO(?)
132 132
     //if( $file == 'global.php' ) continue ; // TODO(?)
133 133
     if (is_file("$lang_base_dir/$file")) {
134
-        $lang_files[] = $file ;
134
+        $lang_files[] = $file;
135 135
     }
136 136
     }
137 137
 }
138
-closedir($dh) ;
138
+closedir($dh);
139 139
 if (empty($lang_files)) {
140
-    altsys_mylangadmin_errordie($target_mname, _MYLANGADMIN_ERR_MODEMPTYLANGDIR) ;
140
+    altsys_mylangadmin_errordie($target_mname, _MYLANGADMIN_ERR_MODEMPTYLANGDIR);
141 141
 }
142
-if (! in_array($target_file, $lang_files)) {
143
-    $target_file = $lang_files[0] ;
142
+if (!in_array($target_file, $lang_files)) {
143
+    $target_file = $lang_files[0];
144 144
 }
145 145
 
146 146
 // get unique path of language_file
147
-$langfile_unique_path = "$lang_base_dir/$target_file" ;
147
+$langfile_unique_path = "$lang_base_dir/$target_file";
148 148
 
149 149
 // get constants defined by the target_file
150
-list($langfile_names, $constpref, $already_read) = altsys_mylangadmin_get_constant_names($langfile_unique_path, $target_dirname) ;
150
+list($langfile_names, $constpref, $already_read) = altsys_mylangadmin_get_constant_names($langfile_unique_path, $target_dirname);
151 151
 
152 152
 // get user_values should be overridden
153
-$langfile_constants = array() ;
153
+$langfile_constants = array();
154 154
 foreach ($langfile_names as $name) {
155
-    list($value) = $db->fetchRow($db->query('SELECT value FROM ' . $db->prefix('altsys_language_constants') . " WHERE mid=$target_mid AND language='$target_lang4sql' AND name='" . addslashes($name) . "'")) ;
156
-    $langfile_constants[ $name ] = $value ;
155
+    list($value) = $db->fetchRow($db->query('SELECT value FROM '.$db->prefix('altsys_language_constants')." WHERE mid=$target_mid AND language='$target_lang4sql' AND name='".addslashes($name)."'"));
156
+    $langfile_constants[$name] = $value;
157 157
 }
158 158
 
159 159
 // constants defined in XOOPS_ROOT_PATH/my_language/(dirname)/...
160 160
 if ($langman->my_language) {
161
-    $mylang_unique_path = $langman->my_language.'/modules/'.$target_dirname.'/'.$target_lang.'/'.$target_file ;
162
-    $mylang_constants = array_map('htmlspecialchars', altsys_mylangadmin_get_constants_by_pcre($mylang_unique_path)) ;
161
+    $mylang_unique_path = $langman->my_language.'/modules/'.$target_dirname.'/'.$target_lang.'/'.$target_file;
162
+    $mylang_constants = array_map('htmlspecialchars', altsys_mylangadmin_get_constants_by_pcre($mylang_unique_path));
163 163
     foreach ($mylang_constants as $key => $val) {
164
-        if (! in_array($key, array_keys($langfile_constants))) {
165
-            $langfile_constants[ $key ] = null ;
166
-            define($key, _MYLANGADMIN_NOTE_ADDEDBYMYLANG) ;
164
+        if (!in_array($key, array_keys($langfile_constants))) {
165
+            $langfile_constants[$key] = null;
166
+            define($key, _MYLANGADMIN_NOTE_ADDEDBYMYLANG);
167 167
         }
168 168
     }
169 169
 } else {
170
-    $mylang_unique_path = '' ;
171
-    $mylang_constants = array() ;
170
+    $mylang_unique_path = '';
171
+    $mylang_constants = array();
172 172
 }
173 173
 
174 174
 
@@ -177,57 +177,57 @@  discard block
 block discarded – undo
177 177
 //
178 178
 
179 179
 // Update language table and cache file
180
-if (! empty($_POST['do_update'])) {
180
+if (!empty($_POST['do_update'])) {
181 181
     // Ticket Check
182
-    if (! $xoopsGTicket->check(true, 'altsys')) {
182
+    if (!$xoopsGTicket->check(true, 'altsys')) {
183 183
         redirect_header(XOOPS_URL.'/', 3, $xoopsGTicket->getErrors());
184 184
     }
185 185
 
186 186
     // read original file
187
-    $file_contents = file_get_contents($langfile_unique_path) ;
187
+    $file_contents = file_get_contents($langfile_unique_path);
188 188
 
189 189
     // insert fingerprint of langfile_unique_path
190
-    $langfile_fingerprint = '_MYLANGADMIN_'.md5($langfile_unique_path) ;
191
-    $file_contents = str_replace('<?php', "<?php\nif(!defined('$langfile_fingerprint'))define('$langfile_fingerprint',1);", $file_contents) ;
190
+    $langfile_fingerprint = '_MYLANGADMIN_'.md5($langfile_unique_path);
191
+    $file_contents = str_replace('<?php', "<?php\nif(!defined('$langfile_fingerprint'))define('$langfile_fingerprint',1);", $file_contents);
192 192
 
193 193
     // constants loop
194
-    $overrides_counter = 0 ;
194
+    $overrides_counter = 0;
195 195
     foreach (array_reverse($langfile_names) as $name) {
196
-        $user_value = $myts->stripSlashesGPC(@$_POST[$name]) ;
197
-        $db->query('DELETE FROM ' . $db->prefix('altsys_language_constants') . " WHERE mid=$target_mid AND language='$target_lang4sql' AND name='" . addslashes($name) . "'") ;
196
+        $user_value = $myts->stripSlashesGPC(@$_POST[$name]);
197
+        $db->query('DELETE FROM '.$db->prefix('altsys_language_constants')." WHERE mid=$target_mid AND language='$target_lang4sql' AND name='".addslashes($name)."'");
198 198
         if ($user_value !== '') {
199
-            $overrides_counter ++ ;
199
+            $overrides_counter++;
200 200
             // Update table
201
-            $db->query('INSERT INTO ' . $db->prefix('altsys_language_constants') . " (mid,language,name,value) VALUES ($target_mid,'$target_lang4sql','" . addslashes($name) . "','" . addslashes($user_value) . "')") ;
201
+            $db->query('INSERT INTO '.$db->prefix('altsys_language_constants')." (mid,language,name,value) VALUES ($target_mid,'$target_lang4sql','".addslashes($name)."','".addslashes($user_value)."')");
202 202
             // rewrite script for cache
203 203
             // comment-out the line of define()
204 204
             if (empty($constpref)) {
205
-                $from = '/.*define\s?\(\s*(["\'])'.preg_quote($name).'(\\1).*\;.*/' ;
205
+                $from = '/.*define\s?\(\s*(["\'])'.preg_quote($name).'(\\1).*\;.*/';
206 206
             } else {
207
-                $from = '/.*define\s?\(\s*\$constpref\s*\.\s*(["\'])'.preg_quote(substr($name, strlen($constpref))).'(\\1).*\;.*/' ;
207
+                $from = '/.*define\s?\(\s*\$constpref\s*\.\s*(["\'])'.preg_quote(substr($name, strlen($constpref))).'(\\1).*\;.*/';
208 208
             }
209
-            $to = '//$0'."\ndefine('".addslashes($name)."','".addslashes($user_value)."');" ;
210
-            $file_contents = preg_replace($from, $to, $file_contents) ;
209
+            $to = '//$0'."\ndefine('".addslashes($name)."','".addslashes($user_value)."');";
210
+            $file_contents = preg_replace($from, $to, $file_contents);
211 211
         }
212 212
     }
213 213
 
214 214
     // get the file name for caching
215
-    $cache_file_name = $langman->getCacheFileName($target_file, $target_dirname, $target_lang) ;
215
+    $cache_file_name = $langman->getCacheFileName($target_file, $target_dirname, $target_lang);
216 216
 
217 217
     // Create language cache file
218 218
     if ($overrides_counter > 0) {
219
-        $fp = fopen($cache_file_name, 'wb') ;
220
-        if (! $fp) {
221
-            die('Invalid Cache Directory. (Set XOOPS_TRUST_PATH/cache writable)') ;
219
+        $fp = fopen($cache_file_name, 'wb');
220
+        if (!$fp) {
221
+            die('Invalid Cache Directory. (Set XOOPS_TRUST_PATH/cache writable)');
222 222
         }
223
-        fwrite($fp, $file_contents) ;
224
-        fclose($fp) ;
223
+        fwrite($fp, $file_contents);
224
+        fclose($fp);
225 225
     } else {
226
-        unlink($cache_file_name) ;
226
+        unlink($cache_file_name);
227 227
     }
228 228
 
229
-    redirect_header('?mode=admin&lib=altsys&page=mylangadmin&dirname='.$target_dirname.'&target_lang='.rawurlencode($target_lang).'&target_file='.rawurlencode($target_file), 1, _MYLANGADMIN_CACHEUPDATED) ;
230
-    exit ;
229
+    redirect_header('?mode=admin&lib=altsys&page=mylangadmin&dirname='.$target_dirname.'&target_lang='.rawurlencode($target_lang).'&target_file='.rawurlencode($target_file), 1, _MYLANGADMIN_CACHEUPDATED);
230
+    exit;
231 231
 }
232 232
 
233 233
 
@@ -236,22 +236,22 @@  discard block
 block discarded – undo
236 236
 //
237 237
 
238 238
 // check cache file
239
-$cache_file_name = $langman->getCacheFileName($target_file, $target_dirname, $target_lang) ;
240
-$cache_file_mtime = file_exists($cache_file_name) ? filemtime($cache_file_name) : 0 ;
239
+$cache_file_name = $langman->getCacheFileName($target_file, $target_dirname, $target_lang);
240
+$cache_file_mtime = file_exists($cache_file_name) ? filemtime($cache_file_name) : 0;
241 241
 
242 242
 // check core version and generate message to enable D3LanguageManager
243 243
 if (altsys_get_core_type() == ALTSYS_CORE_TYPE_XCL21) {
244 244
     // XoopsCube Legacy without preload
245 245
     if (class_exists('AltsysLangMgr_LanguageManager')) {
246 246
         // the preload enabled
247
-        $notice4disp = _MYLANGADMIN_MSG_D3LANGMANENABLED ;
247
+        $notice4disp = _MYLANGADMIN_MSG_D3LANGMANENABLED;
248 248
     } else {
249 249
         // the preload disabled
250
-        $notice4disp = sprintf(_MYLANGADMIN_FMT_HOWTOENABLED3LANGMAN4XCL, 'SetupAltsysLangMgr.class.php', 'XOOPS_ROOT_PATH/preload') ;
250
+        $notice4disp = sprintf(_MYLANGADMIN_FMT_HOWTOENABLED3LANGMAN4XCL, 'SetupAltsysLangMgr.class.php', 'XOOPS_ROOT_PATH/preload');
251 251
     }
252 252
 } else {
253 253
     // X2 core etc.
254
-    $notice4disp = _MYLANGADMIN_MSG_HOWTOENABLED3LANGMAN4X2.'<br />' ;
254
+    $notice4disp = _MYLANGADMIN_MSG_HOWTOENABLED3LANGMAN4X2.'<br />';
255 255
     $notice4disp .= '
256 256
 		<h4>include/common.php</h4>
257 257
 		<pre>
@@ -275,20 +275,20 @@  discard block
 block discarded – undo
275 275
 //
276 276
 
277 277
 
278
-xoops_cp_header() ;
278
+xoops_cp_header();
279 279
 
280 280
 // mymenu
281
-altsys_include_mymenu() ;
281
+altsys_include_mymenu();
282 282
 
283 283
 // breadcrumbs
284
-$breadcrumbsObj =& AltsysBreadcrumbs::getInstance() ;
284
+$breadcrumbsObj = & AltsysBreadcrumbs::getInstance();
285 285
 if ($breadcrumbsObj->hasPaths()) {
286
-    $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&amp;lib=altsys&amp;page=mylangadmin', _MI_ALTSYS_MENU_MYLANGADMIN) ;
287
-    $breadcrumbsObj->appendPath('', $target_mname) ;
286
+    $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&amp;lib=altsys&amp;page=mylangadmin', _MI_ALTSYS_MENU_MYLANGADMIN);
287
+    $breadcrumbsObj->appendPath('', $target_mname);
288 288
 }
289 289
 
290
-require_once XOOPS_TRUST_PATH.'/libs/altsys/class/D3Tpl.class.php' ;
291
-$tpl = new D3Tpl() ;
290
+require_once XOOPS_TRUST_PATH.'/libs/altsys/class/D3Tpl.class.php';
291
+$tpl = new D3Tpl();
292 292
 $tpl->assign(array(
293 293
     'target_dirname' => $target_dirname,
294 294
     'target_mname' => $target_mname,
@@ -307,8 +307,8 @@  discard block
 block discarded – undo
307 307
     'notice' => $notice4disp,
308 308
     'already_read' => $already_read,
309 309
     'gticket_hidden' => $xoopsGTicket->getTicketHtml(__LINE__, 1800, 'altsys')
310
-)) ;
311
-$tpl->display('db:altsys_main_mylangadmin.html') ;
310
+));
311
+$tpl->display('db:altsys_main_mylangadmin.html');
312 312
 
313
-xoops_cp_footer() ;
314
-exit ;
313
+xoops_cp_footer();
314
+exit;
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/index.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -1,51 +1,51 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/include/formcheckboxgroup.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
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,17 +65,17 @@  discard block
 block discarded – undo
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
-        $member_handler =& xoops_gethandler('member');
71
+        $member_handler = & xoops_gethandler('member');
72 72
         if (!$include_anon) {
73 73
             $options = $member_handler->getGroupList(new Criteria('groupid', XOOPS_GROUP_ANONYMOUS, '!='));
74 74
         } else {
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
     }
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/include/x20_keepblockoptions.inc.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -3,9 +3,9 @@  discard block
 block discarded – undo
3 3
 
4 4
 // Keep Block option values when update (by nobunobu) for XOOPS 2.0.x
5 5
 global $xoopsDB;
6
-$query = 'SELECT mid FROM ' . $xoopsDB->prefix('modules') . " WHERE dirname='" . $modversion['dirname'] . "' ";
6
+$query = 'SELECT mid FROM '.$xoopsDB->prefix('modules')." WHERE dirname='".$modversion['dirname']."' ";
7 7
 $result = $xoopsDB->query($query);
8
-$record= $xoopsDB->fetcharray($result);
8
+$record = $xoopsDB->fetcharray($result);
9 9
 if ($record) {
10 10
     $mid = $record['mid'];
11 11
     $count = count($modversion['blocks']);
@@ -53,40 +53,40 @@  discard block
 block discarded – undo
53 53
         }
54 54
     } */
55 55
     
56
-    $sql = 'SELECT * FROM ' . $xoopsDB->prefix('newblocks') . ' WHERE mid=' . $mid . " AND block_type <>'D' AND func_num > $count";
56
+    $sql = 'SELECT * FROM '.$xoopsDB->prefix('newblocks').' WHERE mid='.$mid." AND block_type <>'D' AND func_num > $count";
57 57
     $fresult = $xoopsDB->query($sql);
58 58
     while ($fblock = $xoopsDB->fetchArray($fresult)) {
59
-        $local_msgs[] = 'Non Defined Block <b>' . $fblock['name'] . '</b> will be deleted';
60
-        $sql = 'DELETE FROM ' . $xoopsDB->prefix('newblocks') . " WHERE bid='" . $fblock['bid'] . "'";
59
+        $local_msgs[] = 'Non Defined Block <b>'.$fblock['name'].'</b> will be deleted';
60
+        $sql = 'DELETE FROM '.$xoopsDB->prefix('newblocks')." WHERE bid='".$fblock['bid']."'";
61 61
         $iret = $xoopsDB->query($sql);
62 62
     }
63 63
     
64
-    for ($i = 1 ; $i <= $count ; $i++) {
65
-        $sql = 'SELECT name,options FROM ' . $xoopsDB->prefix('newblocks') . ' WHERE mid=' . $mid . ' AND func_num=' . $i . " AND show_func='" . addslashes($modversion['blocks'][$i]['show_func']) . "' AND func_file='" . addslashes($modversion['blocks'][$i]['file']) . "'";
64
+    for ($i = 1; $i <= $count; $i++) {
65
+        $sql = 'SELECT name,options FROM '.$xoopsDB->prefix('newblocks').' WHERE mid='.$mid.' AND func_num='.$i." AND show_func='".addslashes($modversion['blocks'][$i]['show_func'])."' AND func_file='".addslashes($modversion['blocks'][$i]['file'])."'";
66 66
         $fresult = $xoopsDB->query($sql);
67 67
         $fblock = $xoopsDB->fetchArray($fresult);
68 68
         if (isset($fblock['options'])) {
69
-            $old_vals=explode('|', $fblock['options']);
70
-            $def_vals=explode('|', $modversion['blocks'][$i]['options']);
69
+            $old_vals = explode('|', $fblock['options']);
70
+            $def_vals = explode('|', $modversion['blocks'][$i]['options']);
71 71
             if (count($old_vals) == count($def_vals)) {
72 72
                 $modversion['blocks'][$i]['options'] = $fblock['options'];
73
-                $local_msgs[] = "Option's values of the block <b>".$fblock['name'] . '</b> will be kept. (value = <b>' . $fblock['options'] . '</b>)';
73
+                $local_msgs[] = "Option's values of the block <b>".$fblock['name'].'</b> will be kept. (value = <b>'.$fblock['options'].'</b>)';
74 74
             } elseif (count($old_vals) < count($def_vals)) {
75
-                for ($j=0; $j < count($old_vals); $j++) {
75
+                for ($j = 0; $j < count($old_vals); $j++) {
76 76
                     $def_vals[$j] = $old_vals[$j];
77 77
                 }
78 78
                 $modversion['blocks'][$i]['options'] = implode('|', $def_vals);
79
-                $local_msgs[] = "Option's values of the block <b>".$fblock['name'] . '</b> will be kept and new option(s) are added. (value = <b>' . $modversion['blocks'][$i]['options'] . '</b>)';
79
+                $local_msgs[] = "Option's values of the block <b>".$fblock['name'].'</b> will be kept and new option(s) are added. (value = <b>'.$modversion['blocks'][$i]['options'].'</b>)';
80 80
             } else {
81
-                $local_msgs[] = "Option's values of the block <b>".$fblock['name'] . '</b> will be reset to the default, because of some decrease of options. (value = <b>'
82
-                                . $modversion['blocks'][$i]['options'] . '</b>)';
81
+                $local_msgs[] = "Option's values of the block <b>".$fblock['name'].'</b> will be reset to the default, because of some decrease of options. (value = <b>'
82
+                                . $modversion['blocks'][$i]['options'].'</b>)';
83 83
             }
84 84
         }
85 85
     }
86 86
 }
87 87
 
88
-global $msgs , $myblocksadmin_parsed_updateblock ;
89
-if (! empty($msgs) && ! empty($local_msgs) && empty($myblocksadmin_parsed_updateblock)) {
90
-    $msgs = array_merge($msgs, $local_msgs) ;
91
-    $myblocksadmin_parsed_updateblock = true ;
88
+global $msgs, $myblocksadmin_parsed_updateblock;
89
+if (!empty($msgs) && !empty($local_msgs) && empty($myblocksadmin_parsed_updateblock)) {
90
+    $msgs = array_merge($msgs, $local_msgs);
91
+    $myblocksadmin_parsed_updateblock = true;
92 92
 }
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/include/tpls_functions.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
60 60
 
61 61
     // get tplfile and tplsource
62 62
     $result = $db->query("SELECT tpl_refid,tpl_module,'".addslashes($tplset_to)."',tpl_file,tpl_desc,tpl_lastmodified,tpl_lastimported,tpl_type,tpl_source FROM ".$db->prefix('tplfile') . ' NATURAL LEFT JOIN '
63
-                         . $db->prefix('tplsource') . " WHERE tpl_tplset='" . addslashes($tplset_from) . "' AND ($whr_append)") ;
63
+                            . $db->prefix('tplsource') . " WHERE tpl_tplset='" . addslashes($tplset_from) . "' AND ($whr_append)") ;
64 64
 
65 65
     while ($row = $db->fetchArray($result)) {
66 66
         $tpl_source = array_pop($row) ;
Please login to merge, or discard this patch.
Spacing   +60 added lines, -60 removed lines patch added patch discarded remove patch
@@ -1,41 +1,41 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 include_once XOOPS_ROOT_PATH.'/class/template.php';
4
-include_once __DIR__.'/altsys_functions.php' ;
4
+include_once __DIR__.'/altsys_functions.php';
5 5
 
6 6
 function tplsadmin_import_data($tplset, $tpl_file, $tpl_source, $lastmodified = 0)
7 7
 {
8
-    $db = XoopsDatabaseFactory::getDatabaseConnection() ;
8
+    $db = XoopsDatabaseFactory::getDatabaseConnection();
9 9
 
10 10
     // check the file is valid template
11
-    list($count) = $db->fetchRow($db->query('SELECT COUNT(*) FROM ' . $db->prefix('tplfile') . " WHERE tpl_tplset='default' AND tpl_file='" . addslashes($tpl_file) . "'")) ;
12
-    if (! $count) {
13
-        return false ;
11
+    list($count) = $db->fetchRow($db->query('SELECT COUNT(*) FROM '.$db->prefix('tplfile')." WHERE tpl_tplset='default' AND tpl_file='".addslashes($tpl_file)."'"));
12
+    if (!$count) {
13
+        return false;
14 14
     }
15 15
 
16 16
     // check the template exists in the tplset
17 17
     if ($tplset != 'default') {
18
-        list($count) = $db->fetchRow($db->query('SELECT COUNT(*) FROM ' . $db->prefix('tplfile') . " WHERE tpl_tplset='" . addslashes($tplset) . "' AND tpl_file='" . addslashes($tpl_file) . "'")) ;
18
+        list($count) = $db->fetchRow($db->query('SELECT COUNT(*) FROM '.$db->prefix('tplfile')." WHERE tpl_tplset='".addslashes($tplset)."' AND tpl_file='".addslashes($tpl_file)."'"));
19 19
         if ($count <= 0) {
20 20
             // copy from 'default' to the tplset
21
-            $result = $db->query('SELECT * FROM ' . $db->prefix('tplfile') . " WHERE tpl_tplset='default' AND tpl_file='" . addslashes($tpl_file) . "'") ;
21
+            $result = $db->query('SELECT * FROM '.$db->prefix('tplfile')." WHERE tpl_tplset='default' AND tpl_file='".addslashes($tpl_file)."'");
22 22
             while ($row = $db->fetchArray($result)) {
23
-                $db->queryF('INSERT INTO ' . $db->prefix('tplfile') . " SET tpl_refid='" . addslashes($row['tpl_refid']) . "',tpl_module='" . addslashes($row['tpl_module']) . "',tpl_tplset='" . addslashes($tplset) . "',tpl_file='" . addslashes($tpl_file) . "',tpl_desc='" . addslashes($row['tpl_desc']) . "',tpl_type='" . addslashes($row['tpl_type']) . "'") ;
24
-                $tpl_id = $db->getInsertId() ;
25
-                $db->queryF('INSERT INTO ' . $db->prefix('tplsource') . " SET tpl_id='$tpl_id', tpl_source=''") ;
23
+                $db->queryF('INSERT INTO '.$db->prefix('tplfile')." SET tpl_refid='".addslashes($row['tpl_refid'])."',tpl_module='".addslashes($row['tpl_module'])."',tpl_tplset='".addslashes($tplset)."',tpl_file='".addslashes($tpl_file)."',tpl_desc='".addslashes($row['tpl_desc'])."',tpl_type='".addslashes($row['tpl_type'])."'");
24
+                $tpl_id = $db->getInsertId();
25
+                $db->queryF('INSERT INTO '.$db->prefix('tplsource')." SET tpl_id='$tpl_id', tpl_source=''");
26 26
             }
27 27
         }
28 28
     }
29 29
 
30 30
     // UPDATE just tpl_lastmodified and tpl_source
31
-    $drs = $db->query('SELECT tpl_id FROM ' . $db->prefix('tplfile') . " WHERE tpl_tplset='" . addslashes($tplset) . "' AND tpl_file='" . addslashes($tpl_file) . "'") ;
31
+    $drs = $db->query('SELECT tpl_id FROM '.$db->prefix('tplfile')." WHERE tpl_tplset='".addslashes($tplset)."' AND tpl_file='".addslashes($tpl_file)."'");
32 32
     while (list($tpl_id) = $db->fetchRow($drs)) {
33
-        $db->queryF('UPDATE ' . $db->prefix('tplfile') . " SET tpl_lastmodified='" . addslashes($lastmodified) . "',tpl_lastimported=UNIX_TIMESTAMP() WHERE tpl_id='$tpl_id'") ;
34
-        $db->queryF('UPDATE ' . $db->prefix('tplsource') . " SET tpl_source='" . addslashes($tpl_source) . "' WHERE tpl_id='$tpl_id'") ;
35
-        altsys_template_touch($tpl_id) ;
33
+        $db->queryF('UPDATE '.$db->prefix('tplfile')." SET tpl_lastmodified='".addslashes($lastmodified)."',tpl_lastimported=UNIX_TIMESTAMP() WHERE tpl_id='$tpl_id'");
34
+        $db->queryF('UPDATE '.$db->prefix('tplsource')." SET tpl_source='".addslashes($tpl_source)."' WHERE tpl_id='$tpl_id'");
35
+        altsys_template_touch($tpl_id);
36 36
     }
37 37
 
38
-    return true ;
38
+    return true;
39 39
 }
40 40
 
41 41
 
@@ -43,46 +43,46 @@  discard block
 block discarded – undo
43 43
 
44 44
 function tplsadmin_get_fingerprint($lines)
45 45
 {
46
-    $str = '' ;
46
+    $str = '';
47 47
     foreach ($lines as $line) {
48 48
         if (trim($line)) {
49
-            $str .= md5(trim($line)) ;
49
+            $str .= md5(trim($line));
50 50
         }
51 51
     }
52
-    return md5($str) ;
52
+    return md5($str);
53 53
 }
54 54
 
55 55
 
56 56
 
57 57
 function tplsadmin_copy_templates_db2db($tplset_from, $tplset_to, $whr_append = '1')
58 58
 {
59
-    global $db ;
59
+    global $db;
60 60
 
61 61
     // get tplfile and tplsource
62
-    $result = $db->query("SELECT tpl_refid,tpl_module,'".addslashes($tplset_to)."',tpl_file,tpl_desc,tpl_lastmodified,tpl_lastimported,tpl_type,tpl_source FROM ".$db->prefix('tplfile') . ' NATURAL LEFT JOIN '
63
-                         . $db->prefix('tplsource') . " WHERE tpl_tplset='" . addslashes($tplset_from) . "' AND ($whr_append)") ;
62
+    $result = $db->query("SELECT tpl_refid,tpl_module,'".addslashes($tplset_to)."',tpl_file,tpl_desc,tpl_lastmodified,tpl_lastimported,tpl_type,tpl_source FROM ".$db->prefix('tplfile').' NATURAL LEFT JOIN '
63
+                         . $db->prefix('tplsource')." WHERE tpl_tplset='".addslashes($tplset_from)."' AND ($whr_append)");
64 64
 
65 65
     while ($row = $db->fetchArray($result)) {
66
-        $tpl_source = array_pop($row) ;
66
+        $tpl_source = array_pop($row);
67 67
 
68
-        $drs = $db->query('SELECT tpl_id FROM ' . $db->prefix('tplfile') . " WHERE tpl_tplset='" . addslashes($tplset_to) . "' AND ($whr_append) AND tpl_file='" . addslashes($row['tpl_file']) . "' AND tpl_refid='" . addslashes($row['tpl_refid']) . "'") ;
68
+        $drs = $db->query('SELECT tpl_id FROM '.$db->prefix('tplfile')." WHERE tpl_tplset='".addslashes($tplset_to)."' AND ($whr_append) AND tpl_file='".addslashes($row['tpl_file'])."' AND tpl_refid='".addslashes($row['tpl_refid'])."'");
69 69
 
70
-        if (! $db->getRowsNum($drs)) {
70
+        if (!$db->getRowsNum($drs)) {
71 71
             // INSERT mode
72
-            $sql = 'INSERT INTO ' . $db->prefix('tplfile') . ' (tpl_refid,tpl_module,tpl_tplset,tpl_file,tpl_desc,tpl_lastmodified,tpl_lastimported,tpl_type) VALUES (';
72
+            $sql = 'INSERT INTO '.$db->prefix('tplfile').' (tpl_refid,tpl_module,tpl_tplset,tpl_file,tpl_desc,tpl_lastmodified,tpl_lastimported,tpl_type) VALUES (';
73 73
             foreach ($row as $colval) {
74
-                $sql .= "'".addslashes($colval)."'," ;
74
+                $sql .= "'".addslashes($colval)."',";
75 75
             }
76
-            $db->query(substr($sql, 0, -1) . ')') ;
77
-            $tpl_id = $db->getInsertId() ;
78
-            $db->query('INSERT INTO ' . $db->prefix('tplsource') . " SET tpl_id='$tpl_id', tpl_source='" . addslashes($tpl_source) . "'") ;
79
-            altsys_template_touch($tpl_id) ;
76
+            $db->query(substr($sql, 0, -1).')');
77
+            $tpl_id = $db->getInsertId();
78
+            $db->query('INSERT INTO '.$db->prefix('tplsource')." SET tpl_id='$tpl_id', tpl_source='".addslashes($tpl_source)."'");
79
+            altsys_template_touch($tpl_id);
80 80
         } else {
81 81
             while (list($tpl_id) = $db->fetchRow($drs)) {
82 82
                 // UPDATE mode
83
-                $db->query('UPDATE ' . $db->prefix('tplfile') . " SET tpl_refid='" . addslashes($row['tpl_refid']) . "',tpl_desc='" . addslashes($row['tpl_desc']) . "',tpl_lastmodified='" . addslashes($row['tpl_lastmodified']) . "',tpl_lastimported='" . addslashes($row['tpl_lastimported']) . "',tpl_type='" . addslashes($row['tpl_type']) . "' WHERE tpl_id='$tpl_id'") ;
84
-                $db->query('UPDATE ' . $db->prefix('tplsource') . " SET tpl_source='" . addslashes($tpl_source) . "' WHERE tpl_id='$tpl_id'") ;
85
-                altsys_template_touch($tpl_id) ;
83
+                $db->query('UPDATE '.$db->prefix('tplfile')." SET tpl_refid='".addslashes($row['tpl_refid'])."',tpl_desc='".addslashes($row['tpl_desc'])."',tpl_lastmodified='".addslashes($row['tpl_lastmodified'])."',tpl_lastimported='".addslashes($row['tpl_lastimported'])."',tpl_type='".addslashes($row['tpl_type'])."' WHERE tpl_id='$tpl_id'");
84
+                $db->query('UPDATE '.$db->prefix('tplsource')." SET tpl_source='".addslashes($tpl_source)."' WHERE tpl_id='$tpl_id'");
85
+                altsys_template_touch($tpl_id);
86 86
             }
87 87
         }
88 88
     }
@@ -92,31 +92,31 @@  discard block
 block discarded – undo
92 92
 
93 93
 function tplsadmin_copy_templates_f2db($tplset_to, $whr_append = '1')
94 94
 {
95
-    global $db ;
95
+    global $db;
96 96
 
97 97
     // get tplsource
98
-    $result = $db->query('SELECT * FROM ' . $db->prefix('tplfile') . "  WHERE tpl_tplset='default' AND ($whr_append)") ;
98
+    $result = $db->query('SELECT * FROM '.$db->prefix('tplfile')."  WHERE tpl_tplset='default' AND ($whr_append)");
99 99
 
100 100
     while ($row = $db->fetchArray($result)) {
101
-        $basefilepath = tplsadmin_get_basefilepath($row['tpl_module'], $row['tpl_type'], $row['tpl_file']) ;
102
-        $tpl_source = rtrim(implode('', file($basefilepath))) ;
103
-        $lastmodified = filemtime($basefilepath) ;
101
+        $basefilepath = tplsadmin_get_basefilepath($row['tpl_module'], $row['tpl_type'], $row['tpl_file']);
102
+        $tpl_source = rtrim(implode('', file($basefilepath)));
103
+        $lastmodified = filemtime($basefilepath);
104 104
 
105
-        $drs = $db->query('SELECT tpl_id FROM ' . $db->prefix('tplfile') . " WHERE tpl_tplset='" . addslashes($tplset_to) . "' AND ($whr_append) AND tpl_file='" . addslashes($row['tpl_file']) . "' AND tpl_refid='" . addslashes($row['tpl_refid']) . "'") ;
105
+        $drs = $db->query('SELECT tpl_id FROM '.$db->prefix('tplfile')." WHERE tpl_tplset='".addslashes($tplset_to)."' AND ($whr_append) AND tpl_file='".addslashes($row['tpl_file'])."' AND tpl_refid='".addslashes($row['tpl_refid'])."'");
106 106
 
107
-        if (! $db->getRowsNum($drs)) {
107
+        if (!$db->getRowsNum($drs)) {
108 108
             // INSERT mode
109
-            $sql = 'INSERT INTO ' . $db->prefix('tplfile') . " SET tpl_refid='" . addslashes($row['tpl_refid']) . "',tpl_desc='" . addslashes($row['tpl_desc']) . "',tpl_lastmodified='" . addslashes($lastmodified) . "',tpl_type='" . addslashes($row['tpl_type']) . "',tpl_tplset='" . addslashes($tplset_to) . "',tpl_file='" . addslashes($row['tpl_file']) . "',tpl_module='" . addslashes($row['tpl_module']) . "'" ;
110
-            $db->query($sql) ;
111
-            $tpl_id = $db->getInsertId() ;
112
-            $db->query('INSERT INTO ' . $db->prefix('tplsource') . " SET tpl_id='$tpl_id', tpl_source='" . addslashes($tpl_source) . "'") ;
113
-            altsys_template_touch($tpl_id) ;
109
+            $sql = 'INSERT INTO '.$db->prefix('tplfile')." SET tpl_refid='".addslashes($row['tpl_refid'])."',tpl_desc='".addslashes($row['tpl_desc'])."',tpl_lastmodified='".addslashes($lastmodified)."',tpl_type='".addslashes($row['tpl_type'])."',tpl_tplset='".addslashes($tplset_to)."',tpl_file='".addslashes($row['tpl_file'])."',tpl_module='".addslashes($row['tpl_module'])."'";
110
+            $db->query($sql);
111
+            $tpl_id = $db->getInsertId();
112
+            $db->query('INSERT INTO '.$db->prefix('tplsource')." SET tpl_id='$tpl_id', tpl_source='".addslashes($tpl_source)."'");
113
+            altsys_template_touch($tpl_id);
114 114
         } else {
115 115
             while (list($tpl_id) = $db->fetchRow($drs)) {
116 116
                 // UPDATE mode
117
-                $db->query('UPDATE ' . $db->prefix('tplfile') . " SET tpl_lastmodified='" . addslashes($lastmodified) . "' WHERE tpl_id='$tpl_id'") ;
118
-                $db->query('UPDATE ' . $db->prefix('tplsource') . " SET tpl_source='" . addslashes($tpl_source) . "' WHERE tpl_id='$tpl_id'") ;
119
-                altsys_template_touch($tpl_id) ;
117
+                $db->query('UPDATE '.$db->prefix('tplfile')." SET tpl_lastmodified='".addslashes($lastmodified)."' WHERE tpl_id='$tpl_id'");
118
+                $db->query('UPDATE '.$db->prefix('tplsource')." SET tpl_source='".addslashes($tpl_source)."' WHERE tpl_id='$tpl_id'");
119
+                altsys_template_touch($tpl_id);
120 120
             }
121 121
         }
122 122
     }
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 function tplsadmin_get_basefilepath($dirname, $type, $tpl_file)
128 128
 {
129 129
     // module instance
130
-    $path = $basefilepath = XOOPS_ROOT_PATH.'/modules/'.$dirname.'/templates/'.($type=='block'?'blocks/':'').$tpl_file ;
130
+    $path = $basefilepath = XOOPS_ROOT_PATH.'/modules/'.$dirname.'/templates/'.($type == 'block' ? 'blocks/' : '').$tpl_file;
131 131
 
132 132
     if (is_callable('Legacy_Utils::getTrustDirnameByDirname')) {
133 133
         $mytrustdirname = Legacy_Utils::getTrustDirnameByDirname($dirname);
@@ -135,33 +135,33 @@  discard block
 block discarded – undo
135 135
 
136 136
     if (defined('ALTSYS_TPLSADMIN_BASEPATH')) {
137 137
         // Special hook
138
-        $path = ALTSYS_TPLSADMIN_BASEPATH.'/'.substr($tpl_file, strlen($dirname) + 1) ;
138
+        $path = ALTSYS_TPLSADMIN_BASEPATH.'/'.substr($tpl_file, strlen($dirname) + 1);
139 139
     } elseif ($mytrustdirname || @include(XOOPS_ROOT_PATH.'/modules/'.$dirname.'/mytrustdirname.php')) {
140 140
         // D3 module base
141
-        if (! empty($mytrustdirname)) {
142
-            $mid_path = $mytrustdirname == 'altsys' ? '/libs/' : '/modules/' ;
141
+        if (!empty($mytrustdirname)) {
142
+            $mid_path = $mytrustdirname == 'altsys' ? '/libs/' : '/modules/';
143 143
 
144
-            $path = XOOPS_TRUST_PATH.$mid_path.$mytrustdirname.'/templates/'.($type=='block'?'blocks/':'').substr($tpl_file, strlen($dirname) + 1) ;
144
+            $path = XOOPS_TRUST_PATH.$mid_path.$mytrustdirname.'/templates/'.($type == 'block' ? 'blocks/' : '').substr($tpl_file, strlen($dirname) + 1);
145 145
             //new for xcck etc.other trust_module
146
-            if (! file_exists($path)) {
147
-                $path = XOOPS_TRUST_PATH.$mid_path.$mytrustdirname.'/templates/'.($type=='block'?'blocks/':'').$tpl_file ;
148
-                if (! file_exists($path)) {
146
+            if (!file_exists($path)) {
147
+                $path = XOOPS_TRUST_PATH.$mid_path.$mytrustdirname.'/templates/'.($type == 'block' ? 'blocks/' : '').$tpl_file;
148
+                if (!file_exists($path)) {
149 149
                     $path = $basefilepath;
150 150
                 }
151 151
             }
152 152
         }
153 153
     }
154 154
 
155
-    return $path ;
155
+    return $path;
156 156
 }
157 157
 
158 158
 
159 159
 function tplsadmin_die($msg, $target_dirname = '', $wait = 2)
160 160
 {
161 161
     if (strtolower($_SERVER['REQUEST_METHOD']) === 'post') {
162
-        redirect_header('?mode=admin&lib=altsys&page=mytplsadmin&dirname='.$target_dirname, $wait, $msg) ;
163
-        exit ;
162
+        redirect_header('?mode=admin&lib=altsys&page=mytplsadmin&dirname='.$target_dirname, $wait, $msg);
163
+        exit;
164 164
     } else {
165
-        die($msg) ;
165
+        die($msg);
166 166
     }
167 167
 }
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/include/admin_in_theme.inc.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -2,29 +2,29 @@
 block discarded – undo
2 2
 
3 3
 // render admin in theme.html
4 4
 if (is_object($xoopsUser)) {
5
-    $xoops_subpath = substr($_SERVER['REQUEST_URI'], strpos(strrev(XOOPS_URL), strrev($_SERVER['HTTP_HOST']))) ;
5
+    $xoops_subpath = substr($_SERVER['REQUEST_URI'], strpos(strrev(XOOPS_URL), strrev($_SERVER['HTTP_HOST'])));
6 6
     if (preg_match('#(^/admin.php|^/modules/system/|^/modules/[a-zA-Z0-9_.-]+/admin/)#', $xoops_subpath)) {
7 7
         // The request looks like admin
8
-        require_once __DIR__.'/altsys_functions.php' ;
9
-        if (! empty($GLOBALS['altsysModuleConfig']['admin_in_theme']) && file_exists(XOOPS_THEME_PATH.'/'.$GLOBALS['altsysModuleConfig']['admin_in_theme'].'/theme.html')) {
8
+        require_once __DIR__.'/altsys_functions.php';
9
+        if (!empty($GLOBALS['altsysModuleConfig']['admin_in_theme']) && file_exists(XOOPS_THEME_PATH.'/'.$GLOBALS['altsysModuleConfig']['admin_in_theme'].'/theme.html')) {
10 10
             // configs OK
11
-            require_once __DIR__.'/admin_in_theme_functions.php' ;
11
+            require_once __DIR__.'/admin_in_theme_functions.php';
12 12
 
13 13
             // for security with register_globals=1
14
-            unset($GLOBALS['altsysAdminPageTitle'], /* $GLOBALS['altsysXoopsBreadcrumbs'] ,*/ $GLOBALS['xoops_admin_contents']) ;
14
+            unset($GLOBALS['altsysAdminPageTitle'], /* $GLOBALS['altsysXoopsBreadcrumbs'] ,*/ $GLOBALS['xoops_admin_contents']);
15 15
 
16 16
             // disable error handler without XOOPS 2.0.14/15/16
17
-            if (! (is_object(@$xoopsLogger) && method_exists($xoopsLogger, 'render') && in_array($xoopsConfig['debug_mode'], array( 1, 2 )))) {
18
-                restore_error_handler() ;
17
+            if (!(is_object(@$xoopsLogger) && method_exists($xoopsLogger, 'render') && in_array($xoopsConfig['debug_mode'], array(1, 2)))) {
18
+                restore_error_handler();
19 19
             }
20 20
 
21 21
             // to prepend Notice with 2.0.14/15/16 with PHP4
22
-            if (! defined('E_STRICT')) {
23
-                define('E_STRICT', 2048) ;
22
+            if (!defined('E_STRICT')) {
23
+                define('E_STRICT', 2048);
24 24
             }
25 25
 
26
-            register_shutdown_function('altsys_admin_in_theme_in_last') ;
27
-            ob_start('altsys_admin_in_theme') ;
26
+            register_shutdown_function('altsys_admin_in_theme_in_last');
27
+            ob_start('altsys_admin_in_theme');
28 28
         }
29 29
     }
30 30
 }
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/include/mygroupperm.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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,47 +27,47 @@  discard block
 block discarded – undo
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
-    $module_handler =& xoops_gethandler('module');
48
-    $module =& $module_handler->get($modid);
47
+    $module_handler = & xoops_gethandler('module');
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
 
54
-$member_handler =& xoops_gethandler('member');
54
+$member_handler = & xoops_gethandler('member');
55 55
 $group_list = $member_handler->getGroupList();
56 56
 if (!empty($_POST['perms']) && is_array($_POST['perms'])) {
57
-    $gperm_handler =& xoops_gethandler('groupperm');
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/include/admin_in_theme_functions.php 1 patch
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -2,94 +2,94 @@  discard block
 block discarded – undo
2 2
 
3 3
 function altsys_admin_in_theme($s)
4 4
 {
5
-    global $xoops_admin_contents ;
5
+    global $xoops_admin_contents;
6 6
 
7
-    $xoops_admin_contents = '' ;
7
+    $xoops_admin_contents = '';
8 8
 
9 9
     if (defined('ALTSYS_DONT_USE_ADMIN_IN_THEME')) {
10
-        return $s ;
10
+        return $s;
11 11
     }
12 12
 
13 13
     // check whether cp_functions.php is loaded
14
-    if (! defined('XOOPS_CPFUNC_LOADED')) {
15
-        define('ALTSYS_DONT_USE_ADMIN_IN_THEME', 1) ;
16
-        return $s ;
14
+    if (!defined('XOOPS_CPFUNC_LOADED')) {
15
+        define('ALTSYS_DONT_USE_ADMIN_IN_THEME', 1);
16
+        return $s;
17 17
     }
18 18
 
19 19
     // redirect
20 20
     if (strstr($s, '<meta http-equiv="Refresh" ')) {
21
-        define('ALTSYS_DONT_USE_ADMIN_IN_THEME', 1) ;
22
-        return $s ;
21
+        define('ALTSYS_DONT_USE_ADMIN_IN_THEME', 1);
22
+        return $s;
23 23
     }
24 24
 
25 25
     // outputs before cp_header()
26
-    @list($former_outputs, $tmp_s) = explode('<!DOCTYPE', $s, 2) ;
26
+    @list($former_outputs, $tmp_s) = explode('<!DOCTYPE', $s, 2);
27 27
     if (empty($tmp_s)) {
28
-        $tmp_s = $s ;
28
+        $tmp_s = $s;
29 29
     }
30 30
 
31
-    @list(, $tmp_s) = explode("<div class='content'>", $tmp_s, 2) ;
31
+    @list(, $tmp_s) = explode("<div class='content'>", $tmp_s, 2);
32 32
     if (empty($tmp_s)) {
33
-        define('ALTSYS_DONT_USE_ADMIN_IN_THEME', 1) ;
34
-        return $s ;
33
+        define('ALTSYS_DONT_USE_ADMIN_IN_THEME', 1);
34
+        return $s;
35 35
     }
36 36
 
37
-    list($tmp_s, $tmp_after) = explode("<td width='1%' background='".XOOPS_URL."/modules/system/images/bg_content.gif'>", $tmp_s) ;
37
+    list($tmp_s, $tmp_after) = explode("<td width='1%' background='".XOOPS_URL."/modules/system/images/bg_content.gif'>", $tmp_s);
38 38
     if (empty($tmp_after)) {
39
-        define('ALTSYS_DONT_USE_ADMIN_IN_THEME', 1) ;
40
-        return $s ;
39
+        define('ALTSYS_DONT_USE_ADMIN_IN_THEME', 1);
40
+        return $s;
41 41
     }
42 42
 
43
-    $xoops_admin_contents = $former_outputs . substr(strrev(strstr(strrev($tmp_s), strrev('</div>'))), 0, -6) ;
43
+    $xoops_admin_contents = $former_outputs.substr(strrev(strstr(strrev($tmp_s), strrev('</div>'))), 0, -6);
44 44
 
45
-    return '' ;
45
+    return '';
46 46
 }
47 47
 
48 48
 
49 49
 function altsys_admin_in_theme_in_last($contents = null)
50 50
 {
51
-    global $xoops_admin_contents , $xoopsConfig , $xoopsModule , $xoopsUser , $xoopsUserIsAdmin , $xoopsLogger , $altsysModuleConfig , $altsysModuleId ;
51
+    global $xoops_admin_contents, $xoopsConfig, $xoopsModule, $xoopsUser, $xoopsUserIsAdmin, $xoopsLogger, $altsysModuleConfig, $altsysModuleId;
52 52
 
53
-    if (! isset($contents)) {
53
+    if (!isset($contents)) {
54 54
         while (ob_get_level()) {
55
-            ob_end_flush() ;
55
+            ob_end_flush();
56 56
         }
57 57
     } else {
58
-        $xoops_admin_contents = $contents ;
58
+        $xoops_admin_contents = $contents;
59 59
     }
60 60
 
61
-    if (! isset($xoops_admin_contents)) {
62
-        return ;
61
+    if (!isset($xoops_admin_contents)) {
62
+        return;
63 63
     }
64 64
     if (defined('ALTSYS_DONT_USE_ADMIN_IN_THEME')) {
65
-        return ;
65
+        return;
66 66
     }
67 67
 
68
-    if (! is_object($xoopsUser)) {
69
-        exit ;
68
+    if (!is_object($xoopsUser)) {
69
+        exit;
70 70
     }
71 71
 
72 72
     // language files
73 73
     if (file_exists(dirname(__DIR__).'/language/'.$xoopsConfig['language'].'/admin_in_theme.php')) {
74
-        include_once dirname(__DIR__).'/language/'.$xoopsConfig['language'].'/admin_in_theme.php' ;
74
+        include_once dirname(__DIR__).'/language/'.$xoopsConfig['language'].'/admin_in_theme.php';
75 75
     } else {
76
-        include_once dirname(__DIR__).'/language/english/admin_in_theme.php' ;
76
+        include_once dirname(__DIR__).'/language/english/admin_in_theme.php';
77 77
     }
78 78
 
79 79
     // set the theme
80
-    $xoopsConfig['theme_set'] = $altsysModuleConfig['admin_in_theme'] ;
80
+    $xoopsConfig['theme_set'] = $altsysModuleConfig['admin_in_theme'];
81 81
 
82 82
     // language files under the theme
83
-    $original_error_level = error_reporting() ;
84
-    error_reporting($original_error_level & ~ E_NOTICE) ;
83
+    $original_error_level = error_reporting();
84
+    error_reporting($original_error_level & ~ E_NOTICE);
85 85
     if (file_exists(XOOPS_THEME_PATH.'/'.$xoopsConfig['theme_set'].'/language/'.$xoopsConfig['language'].'.php')) {
86
-        include_once XOOPS_THEME_PATH.'/'.$xoopsConfig['theme_set'].'/language/'.$xoopsConfig['language'].'.php' ;
86
+        include_once XOOPS_THEME_PATH.'/'.$xoopsConfig['theme_set'].'/language/'.$xoopsConfig['language'].'.php';
87 87
     } elseif (file_exists(XOOPS_THEME_PATH.'/'.$xoopsConfig['theme_set'].'/language/english.php')) {
88
-        include_once XOOPS_THEME_PATH.'/'.$xoopsConfig['theme_set'].'/language/english.php' ;
88
+        include_once XOOPS_THEME_PATH.'/'.$xoopsConfig['theme_set'].'/language/english.php';
89 89
     }
90
-    error_reporting($original_error_level) ;
90
+    error_reporting($original_error_level);
91 91
 
92
-    include __DIR__.'/admin_in_theme_header.inc.php' ;
92
+    include __DIR__.'/admin_in_theme_header.inc.php';
93 93
 
94 94
 /*	// include adminmenu
95 95
     include XOOPS_CACHE_PATH.'/adminmenu.php' ;
@@ -125,11 +125,11 @@  discard block
 block discarded – undo
125 125
         function shutdown() {'.implode("\n",$xoops_admin_menu_sd).'}' ; */
126 126
 
127 127
     // appendix (core specific css etc)
128
-    $xoops_module_header = '' ;
128
+    $xoops_module_header = '';
129 129
     if (altsys_get_core_type() == ALTSYS_CORE_TYPE_XCL21) {
130
-        $xoops_module_header .= '<link rel="stylesheet" type="text/css" media="all" href="'.XOOPS_URL.'/modules/legacyRender/admin/css.php?file=style.css" />'."\n" ;
130
+        $xoops_module_header .= '<link rel="stylesheet" type="text/css" media="all" href="'.XOOPS_URL.'/modules/legacyRender/admin/css.php?file=style.css" />'."\n";
131 131
         if (is_object(@$xoopsModule)) {
132
-            $xoops_module_header .= '<link rel="stylesheet" type="text/css" media="all" href="'.XOOPS_URL.'/modules/legacyRender/admin/css.php?file=module.css&amp;dirname='.$xoopsModule->getVar('dirname').'" />'."\n" ;
132
+            $xoops_module_header .= '<link rel="stylesheet" type="text/css" media="all" href="'.XOOPS_URL.'/modules/legacyRender/admin/css.php?file=module.css&amp;dirname='.$xoopsModule->getVar('dirname').'" />'."\n";
133 133
         }
134 134
     }
135 135
 
@@ -148,14 +148,14 @@  discard block
 block discarded – undo
148 148
         'xoops_slogan' => htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES),
149 149
         'xoops_contents' => $xoops_admin_contents, //. '<div id="adminmenu_layers">' . $xoops_admin_menu_dv . '</div>' ,
150 150
         'xoops_module_header' => $xoops_module_header
151
-    )) ;
151
+    ));
152 152
 
153 153
     // rendering
154
-    $xoopsTpl->display($xoopsConfig['theme_set'].'/theme.html') ;
154
+    $xoopsTpl->display($xoopsConfig['theme_set'].'/theme.html');
155 155
 
156 156
     // for XOOPS 2.0.14/15/16 from xoops.org
157
-    if (is_object(@$xoopsLogger) && method_exists($xoopsLogger, 'render') && in_array($xoopsConfig['debug_mode'], array( 1, 2 ))) {
158
-        $xoopsLogger->activated = true ;
159
-        echo $xoopsLogger->render('') ;
157
+    if (is_object(@$xoopsLogger) && method_exists($xoopsLogger, 'render') && in_array($xoopsConfig['debug_mode'], array(1, 2))) {
158
+        $xoopsLogger->activated = true;
159
+        echo $xoopsLogger->render('');
160 160
     }
161 161
 }
Please login to merge, or discard this patch.