Completed
Branch master (5c4e1a)
by Michael
46s
created
xoops_trust_path/libs/altsys/controllers.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -4,10 +4,10 @@
 block discarded – undo
4 4
 //$langman = D3LanguageManager::getInstance() ;
5 5
 //$langman->read( 'modinfo.php' , 'altsys' , 'altsys' ) ;
6 6
 
7
-if (file_exists(__DIR__ . '/language/' . $GLOBALS['xoopsConfig']['language'] . '/modinfo.php')) {
8
-    require_once __DIR__ . '/language/' . $GLOBALS['xoopsConfig']['language'] . '/modinfo.php';
9
-} elseif (file_exists(__DIR__ . '/language/english/modinfo.php')) {
10
-    require_once __DIR__ . '/language/english/modinfo.php';
7
+if (file_exists(__DIR__.'/language/'.$GLOBALS['xoopsConfig']['language'].'/modinfo.php')) {
8
+    require_once __DIR__.'/language/'.$GLOBALS['xoopsConfig']['language'].'/modinfo.php';
9
+} elseif (file_exists(__DIR__.'/language/english/modinfo.php')) {
10
+    require_once __DIR__.'/language/english/modinfo.php';
11 11
 }
12 12
 
13 13
 $controllers = [
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/mymenusub/mylangadmin.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -7,29 +7,29 @@
 block discarded – undo
7 7
 $current_dirname = preg_replace('/[^0-9a-zA-Z_-]/', '', @$_GET['dirname']);
8 8
 
9 9
 $db = XoopsDatabaseFactory::getDatabaseConnection();
10
-$mrs = $db->query('SELECT m.name,m.dirname,COUNT(l.mid) FROM ' . $db->prefix('modules') . ' m LEFT JOIN ' . $db->prefix('altsys_language_constants') . ' l ON m.mid=l.mid WHERE m.isactive GROUP BY m.mid ORDER BY m.weight,m.mid');
10
+$mrs = $db->query('SELECT m.name,m.dirname,COUNT(l.mid) FROM '.$db->prefix('modules').' m LEFT JOIN '.$db->prefix('altsys_language_constants').' l ON m.mid=l.mid WHERE m.isactive GROUP BY m.mid ORDER BY m.weight,m.mid');
11 11
 
12 12
 $adminmenu = [];
13 13
 while ([$name, $dirname, $count] = $db->fetchRow($mrs)) {
14 14
     if ($dirname == $current_dirname) {
15 15
         $adminmenu[] = [
16 16
             'selected' => true,
17
-            'title' => $name . " ($count)",
18
-            'link' => '?mode=admin&lib=altsys&page=mylangadmin&dirname=' . $dirname,
17
+            'title' => $name." ($count)",
18
+            'link' => '?mode=admin&lib=altsys&page=mylangadmin&dirname='.$dirname,
19 19
         ];
20 20
 
21 21
     //$GLOBALS['altsysXoopsBreadcrumbs'][] = array( 'name' => htmlspecialchars( $name , ENT_QUOTES ) ) ;
22 22
     } else {
23 23
         $adminmenu[] = [
24 24
             'selected' => false,
25
-            'title' => $name . " ($count)",
26
-            'link' => '?mode=admin&lib=altsys&page=mylangadmin&dirname=' . $dirname,
25
+            'title' => $name." ($count)",
26
+            'link' => '?mode=admin&lib=altsys&page=mylangadmin&dirname='.$dirname,
27 27
         ];
28 28
     }
29 29
 }
30 30
 
31 31
 // display
32
-require_once XOOPS_TRUST_PATH . '/libs/altsys/class/D3Tpl.class.php';
32
+require_once XOOPS_TRUST_PATH.'/libs/altsys/class/D3Tpl.class.php';
33 33
 $tpl = new D3Tpl();
34 34
 $tpl->assign([
35 35
                  'adminmenu' => $adminmenu,
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/mymenusub/mytplsadmin.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 $db = XoopsDatabaseFactory::getDatabaseConnection();
10 10
 
11 11
 // get custom templates
12
-[$count] = $db->fetchRow($db->query('SELECT COUNT(t.tpl_module) AS tpl_count FROM ' . $db->prefix('tplfile') . " t WHERE t.tpl_type='custom'"));
12
+[$count] = $db->fetchRow($db->query('SELECT COUNT(t.tpl_module) AS tpl_count FROM '.$db->prefix('tplfile')." t WHERE t.tpl_type='custom'"));
13 13
 if ('_custom' == $current_dirname) {
14 14
     //  $GLOBALS['altsysXoopsBreadcrumbs'][] = array( 'name' => _MYTPLSADMIN_CUSTOMTEMPLATE ) ;
15 15
 
@@ -21,35 +21,35 @@  discard block
 block discarded – undo
21 21
 $adminmenu = [
22 22
     [
23 23
         'selected' => $custom_selected,
24
-        'title' => _MYTPLSADMIN_CUSTOMTEMPLATE . " ($count)",
24
+        'title' => _MYTPLSADMIN_CUSTOMTEMPLATE." ($count)",
25 25
         'link' => '?mode=admin&lib=altsys&page=mytplsadmin&dirname=_custom',
26 26
     ],
27 27
 ];
28 28
 
29 29
 // get modules/templates
30
-$mrs = $db->query('SELECT m.name,m.dirname,COUNT(t.tpl_module) AS tpl_count FROM ' . $db->prefix('modules') . ' m LEFT JOIN ' . $db->prefix('tplfile') . ' t ON m.dirname=t.tpl_module WHERE m.isactive GROUP BY m.mid HAVING tpl_count>0 ORDER BY m.weight,m.mid');
30
+$mrs = $db->query('SELECT m.name,m.dirname,COUNT(t.tpl_module) AS tpl_count FROM '.$db->prefix('modules').' m LEFT JOIN '.$db->prefix('tplfile').' t ON m.dirname=t.tpl_module WHERE m.isactive GROUP BY m.mid HAVING tpl_count>0 ORDER BY m.weight,m.mid');
31 31
 
32 32
 // module loop
33 33
 while ([$name, $dirname, $count] = $db->fetchRow($mrs)) {
34 34
     if ($dirname == $current_dirname) {
35 35
         $adminmenu[] = [
36 36
             'selected' => true,
37
-            'title' => $name . " ($count)",
38
-            'link' => '?mode=admin&lib=altsys&page=mytplsadmin&dirname=' . $dirname,
37
+            'title' => $name." ($count)",
38
+            'link' => '?mode=admin&lib=altsys&page=mytplsadmin&dirname='.$dirname,
39 39
         ];
40 40
 
41 41
     //$GLOBALS['altsysXoopsBreadcrumbs'][] = array( 'name' => htmlspecialchars( $name , ENT_QUOTES ) ) ;
42 42
     } else {
43 43
         $adminmenu[] = [
44 44
             'selected' => false,
45
-            'title' => $name . " ($count)",
46
-            'link' => '?mode=admin&lib=altsys&page=mytplsadmin&dirname=' . $dirname,
45
+            'title' => $name." ($count)",
46
+            'link' => '?mode=admin&lib=altsys&page=mytplsadmin&dirname='.$dirname,
47 47
         ];
48 48
     }
49 49
 }
50 50
 
51 51
 // display
52
-require_once XOOPS_TRUST_PATH . '/libs/altsys/class/D3Tpl.class.php';
52
+require_once XOOPS_TRUST_PATH.'/libs/altsys/class/D3Tpl.class.php';
53 53
 $tpl = new D3Tpl();
54 54
 $tpl->assign([
55 55
                  'adminmenu' => $adminmenu,
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/mymenusub/myblocksadmin.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -27,9 +27,9 @@  discard block
 block discarded – undo
27 27
     // get block info
28 28
 
29 29
     if (ALTSYS_CORE_TYPE_X22 != $core_type) {
30
-        [$block_count_all] = $db->fetchRow($db->query('SELECT COUNT(*) FROM ' . $db->prefix('newblocks') . ' WHERE mid=' . $m4menu->getVar('mid')));
30
+        [$block_count_all] = $db->fetchRow($db->query('SELECT COUNT(*) FROM '.$db->prefix('newblocks').' WHERE mid='.$m4menu->getVar('mid')));
31 31
 
32
-        [$block_count_visible] = $db->fetchRow($db->query('SELECT COUNT(*) FROM ' . $db->prefix('newblocks') . ' WHERE mid=' . $m4menu->getVar('mid') . ' AND visible>0'));
32
+        [$block_count_visible] = $db->fetchRow($db->query('SELECT COUNT(*) FROM '.$db->prefix('newblocks').' WHERE mid='.$m4menu->getVar('mid').' AND visible>0'));
33 33
 
34 34
         // $block_desc = " $block_count_all($block_count_visible)" ;
35 35
 
@@ -41,22 +41,22 @@  discard block
 block discarded – undo
41 41
     if ($m4menu->getVar('dirname') == $current_dirname) {
42 42
         $adminmenu[] = [
43 43
             'selected' => true,
44
-            'title' => $m4menu->getVar('name', 'n') . $block_desc,
45
-            'link' => '?mode=admin&lib=altsys&page=myblocksadmin&dirname=' . $m4menu->getVar('dirname', 'n'),
44
+            'title' => $m4menu->getVar('name', 'n').$block_desc,
45
+            'link' => '?mode=admin&lib=altsys&page=myblocksadmin&dirname='.$m4menu->getVar('dirname', 'n'),
46 46
         ];
47 47
 
48 48
     //$GLOBALS['altsysXoopsBreadcrumbs'][] = array( 'name' => $m4menu->getVar('name') ) ;
49 49
     } else {
50 50
         $adminmenu[] = [
51 51
             'selected' => false,
52
-            'title' => $m4menu->getVar('name', 'n') . $block_desc,
53
-            'link' => '?mode=admin&lib=altsys&page=myblocksadmin&dirname=' . $m4menu->getVar('dirname', 'n'),
52
+            'title' => $m4menu->getVar('name', 'n').$block_desc,
53
+            'link' => '?mode=admin&lib=altsys&page=myblocksadmin&dirname='.$m4menu->getVar('dirname', 'n'),
54 54
         ];
55 55
     }
56 56
 }
57 57
 
58 58
 // display
59
-require_once XOOPS_TRUST_PATH . '/libs/altsys/class/D3Tpl.class.php';
59
+require_once XOOPS_TRUST_PATH.'/libs/altsys/class/D3Tpl.class.php';
60 60
 $tpl = new D3Tpl();
61 61
 $tpl->assign([
62 62
                  'adminmenu' => $adminmenu,
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/mymenusub/mytplsform.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,2 +1,2 @@
 block discarded – undo
1 1
 <?php declare(strict_types=1);
2
-require __DIR__ . '/mytplsadmin.php';
2
+require __DIR__.'/mytplsadmin.php';
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/mypreferences.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -5,9 +5,9 @@  discard block
 block discarded – undo
5 5
 //                     GIJOE <https://www.peak.ne.jp>                        //
6 6
 // ------------------------------------------------------------------------- //
7 7
 
8
-require_once __DIR__ . '/class/AltsysBreadcrumbs.class.php';
9
-require_once __DIR__ . '/include/gtickets.php';
10
-require_once __DIR__ . '/include/altsys_functions.php';
8
+require_once __DIR__.'/class/AltsysBreadcrumbs.class.php';
9
+require_once __DIR__.'/include/gtickets.php';
10
+require_once __DIR__.'/include/altsys_functions.php';
11 11
 
12 12
 // check access right (needs module_admin of this module)
13 13
 if (!is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid())) {
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
         die('no configs');
39 39
     }
40 40
 
41
-    require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
41
+    require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
42 42
 
43 43
     $form = new \XoopsThemeForm(_MD_A_MYPREFERENCES_FORMTITLE, 'pref_form', 'index.php?mode=admin&lib=altsys&page=mypreferences&op=save');
44 44
 
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
     // if has comments feature, need comment lang file
72 72
 
73 73
     if (1 == $module->getVar('hascomments') && !defined('_CM_TITLE')) {
74
-        require_once XOOPS_ROOT_PATH . '/language/' . $xoopsConfig['language'] . '/comment.php';
74
+        require_once XOOPS_ROOT_PATH.'/language/'.$xoopsConfig['language'].'/comment.php';
75 75
     }
76 76
 
77 77
     // RMV-NOTIFY
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
     // if has notification feature, need notification lang file
80 80
 
81 81
     if (1 == $module->getVar('hasnotification') && !defined('_NOT_NOTIFICATIONOPTIONS')) {
82
-        require_once XOOPS_ROOT_PATH . '/language/' . $xoopsConfig['language'] . '/notification.php';
82
+        require_once XOOPS_ROOT_PATH.'/language/'.$xoopsConfig['language'].'/notification.php';
83 83
     }
84 84
 
85 85
     $modname = $module->getVar('name');
@@ -93,9 +93,9 @@  discard block
 block discarded – undo
93 93
     // }
94 94
 
95 95
     for ($i = 0; $i < $count; ++$i) {
96
-        $title_icon = ('encrypt' === $config[$i]->getVar('conf_valuetype')) ? '<img src="' . XOOPS_MODULE_URL . '/legacy/admin/theme/icons/textfield_key.png" alt="Encrypted">' : ''; // support XCL 2.2.3 'encrypt' of 'conf_valuetype'
96
+        $title_icon = ('encrypt' === $config[$i]->getVar('conf_valuetype')) ? '<img src="'.XOOPS_MODULE_URL.'/legacy/admin/theme/icons/textfield_key.png" alt="Encrypted">' : ''; // support XCL 2.2.3 'encrypt' of 'conf_valuetype'
97 97
 
98
-        $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'))
98
+        $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'))
99 99
                                                                                                                                                                                         . $title_icon
100 100
                                                                                                                                                                                         . '<br><br><span style="font-weight:normal;">'
101 101
                                                                                                                                                                                         . constant($config[$i]->getVar('conf_desc'))
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 
131 131
                     $optkey = defined($options[$j]->getVar('confop_name')) ? constant($options[$j]->getVar('confop_name')) : $options[$j]->getVar('confop_name');
132 132
 
133
-                    $ele->addOption($optval, $optkey . $addBr);
133
+                    $ele->addOption($optval, $optkey.$addBr);
134 134
                 }
135 135
                 break;
136 136
             case 'select_multi':
@@ -151,31 +151,31 @@  discard block
 block discarded – undo
151 151
 
152 152
                     $optkey = defined($options[$j]->getVar('confop_name')) ? constant($options[$j]->getVar('confop_name')) : $options[$j]->getVar('confop_name');
153 153
 
154
-                    $ele->addOption($optval, $optkey . $addBr);
154
+                    $ele->addOption($optval, $optkey.$addBr);
155 155
                 }
156 156
                 break;
157 157
             case 'yesno':
158 158
                 $ele = new \XoopsFormRadioYN($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput(), _YES, _NO);
159 159
                 break;
160 160
             case 'group':
161
-                require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
161
+                require_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
162 162
                 $ele = new \XoopsFormSelectGroup($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 1, false);
163 163
                 break;
164 164
             case 'group_multi':
165
-                require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
165
+                require_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
166 166
                 $ele = new \XoopsFormSelectGroup($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 5, true);
167 167
                 break;
168 168
             case 'group_checkbox':
169
-                require_once __DIR__ . '/include/formcheckboxgroup.php';
169
+                require_once __DIR__.'/include/formcheckboxgroup.php';
170 170
                 $ele = new AltsysFormCheckboxGroup($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput());
171 171
                 break;
172 172
             // RMV-NOTIFY: added 'user' and 'user_multi'
173 173
             case 'user':
174
-                require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
174
+                require_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
175 175
                 $ele = new \XoopsFormSelectUser($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 1, false);
176 176
                 break;
177 177
             case 'user_multi':
178
-                require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
178
+                require_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
179 179
                 $ele = new \XoopsFormSelectUser($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 5, true);
180 180
                 break;
181 181
             case 'password':
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
             case 'textbox':
186 186
             default:
187 187
                 (method_exists('MyTextSanitizer', 'sGetInstance') && $myts = MyTextSanitizer::sGetInstance()) || $myts = MyTextSanitizer::getInstance();
188
-                $ele = new \XoopsFormText($title, $config[$i]->getVar('conf_name'), 50, 255, htmlspecialchars((string) $config[$i]->getConfValueForOutput()));
188
+                $ele = new \XoopsFormText($title, $config[$i]->getVar('conf_name'), 50, 255, htmlspecialchars((string)$config[$i]->getConfValueForOutput()));
189 189
                 break;
190 190
         }
191 191
 
@@ -219,10 +219,10 @@  discard block
 block discarded – undo
219 219
     $breadcrumbsObj = AltsysBreadcrumbs::getInstance();
220 220
 
221 221
     if ($breadcrumbsObj->hasPaths()) {
222
-        $breadcrumbsObj->appendPath(XOOPS_URL . '/modules/altsys/admin/index.php?mode=admin&amp;lib=altsys&amp;page=mypreferences', _PREFERENCES);
222
+        $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&amp;lib=altsys&amp;page=mypreferences', _PREFERENCES);
223 223
     }
224 224
 
225
-    echo "<h3 style='text-align:" . _GLOBAL_LEFT . ";'>" . $module->getVar('name') . ' &nbsp; ' . _PREFERENCES . "</h3>\n";
225
+    echo "<h3 style='text-align:"._GLOBAL_LEFT.";'>".$module->getVar('name').' &nbsp; '._PREFERENCES."</h3>\n";
226 226
 
227 227
     // GIJ patch end
228 228
 
@@ -241,10 +241,10 @@  discard block
 block discarded – undo
241 241
     //}
242 242
 
243 243
     if (!$xoopsGTicket->check(true, 'mypreferences')) {
244
-        redirect_header(XOOPS_URL . '/', 3, $xoopsGTicket->getErrors());
244
+        redirect_header(XOOPS_URL.'/', 3, $xoopsGTicket->getErrors());
245 245
     }
246 246
 
247
-    require_once XOOPS_ROOT_PATH . '/class/template.php';
247
+    require_once XOOPS_ROOT_PATH.'/class/template.php';
248 248
 
249 249
     $xoopsTpl = new \XoopsTpl();
250 250
 
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
 
253 253
     //old xoops
254 254
 
255
-    $core_type = (int) altsys_get_core_type();
255
+    $core_type = (int)altsys_get_core_type();
256 256
 
257 257
     if ($core_type <= 10) {
258 258
         $xoopsTpl->clear_all_cache();
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
                         $imagefiles = &$imageHandler->getObjects(new \Criteria('tplset_name', $newtplset), true);
352 352
 
353 353
                         foreach (array_keys($imagefiles) as $i) {
354
-                            if (!$fp = fopen(XOOPS_CACHE_PATH . '/' . $newtplset . '_' . $imagefiles[$i]->getVar('imgsetimg_file'), 'wb')) {
354
+                            if (!$fp = fopen(XOOPS_CACHE_PATH.'/'.$newtplset.'_'.$imagefiles[$i]->getVar('imgsetimg_file'), 'wb')) {
355 355
                             } else {
356 356
                                 fwrite($fp, $imagefiles[$i]->getVar('imgsetimg_body'));
357 357
 
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/mylangadmin.php 2 patches
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -339,24 +339,24 @@
 block discarded – undo
339 339
 require_once XOOPS_TRUST_PATH . '/libs/altsys/class/D3Tpl.class.php';
340 340
 $tpl = new D3Tpl();
341 341
 $tpl->assign([
342
-                 'target_dirname' => $target_dirname,
343
-                 'target_mname' => $target_mname,
344
-                 'target_lang' => $target_lang,
345
-                 'languages' => $languages,
346
-                 'languages4disp' => $languages4disp,
347
-                 'target_file' => $target_file,
348
-                 'lang_files' => $lang_files,
349
-                 'langfile_constants' => $langfile_constants,
350
-                 'mylang_constants' => $mylang_constants,
351
-                 'use_my_language' => mb_strlen($langman->my_language) > 0,
352
-                 'mylang_file_name' => htmlspecialchars($mylang_unique_path, ENT_QUOTES | ENT_HTML5),
353
-                 'cache_file_name' => htmlspecialchars($cache_file_name, ENT_QUOTES | ENT_HTML5),
354
-                 'cache_file_mtime' => (int) $cache_file_mtime,
355
-                 'timezone_offset' => xoops_getUserTimestamp(0),
356
-                 'notice' => $notice4disp,
357
-                 'already_read' => $already_read,
358
-                 'gticket_hidden' => $xoopsGTicket->getTicketHtml(__LINE__, 1800, 'altsys'),
359
-             ]);
342
+                    'target_dirname' => $target_dirname,
343
+                    'target_mname' => $target_mname,
344
+                    'target_lang' => $target_lang,
345
+                    'languages' => $languages,
346
+                    'languages4disp' => $languages4disp,
347
+                    'target_file' => $target_file,
348
+                    'lang_files' => $lang_files,
349
+                    'langfile_constants' => $langfile_constants,
350
+                    'mylang_constants' => $mylang_constants,
351
+                    'use_my_language' => mb_strlen($langman->my_language) > 0,
352
+                    'mylang_file_name' => htmlspecialchars($mylang_unique_path, ENT_QUOTES | ENT_HTML5),
353
+                    'cache_file_name' => htmlspecialchars($cache_file_name, ENT_QUOTES | ENT_HTML5),
354
+                    'cache_file_mtime' => (int) $cache_file_mtime,
355
+                    'timezone_offset' => xoops_getUserTimestamp(0),
356
+                    'notice' => $notice4disp,
357
+                    'already_read' => $already_read,
358
+                    'gticket_hidden' => $xoopsGTicket->getTicketHtml(__LINE__, 1800, 'altsys'),
359
+                ]);
360 360
 $tpl->display('db:altsys_main_mylangadmin.tpl');
361 361
 
362 362
 xoops_cp_footer();
Please login to merge, or discard this patch.
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -5,11 +5,11 @@  discard block
 block discarded – undo
5 5
 //                       GIJOE <https://www.peak.ne.jp>                      //
6 6
 // ------------------------------------------------------------------------- //
7 7
 
8
-require_once __DIR__ . '/class/AltsysBreadcrumbs.class.php';
9
-require_once __DIR__ . '/include/gtickets.php';
10
-require_once __DIR__ . '/include/altsys_functions.php';
11
-require_once __DIR__ . '/include/lang_functions.php';
12
-require_once __DIR__ . '/class/D3LanguageManager.class.php';
8
+require_once __DIR__.'/class/AltsysBreadcrumbs.class.php';
9
+require_once __DIR__.'/include/gtickets.php';
10
+require_once __DIR__.'/include/altsys_functions.php';
11
+require_once __DIR__.'/include/lang_functions.php';
12
+require_once __DIR__.'/class/D3LanguageManager.class.php';
13 13
 
14 14
 // only groups have 'module_admin' of 'altsys' can do that.
15 15
 $moduleHandler = xoops_getHandler('module');
@@ -32,13 +32,13 @@  discard block
 block discarded – undo
32 32
 
33 33
 // check $xoopsModule
34 34
 if (!is_object($xoopsModule)) {
35
-    redirect_header(XOOPS_URL . '/user.php', 1, _NOPERM);
35
+    redirect_header(XOOPS_URL.'/user.php', 1, _NOPERM);
36 36
 }
37 37
 
38 38
 // set target_module if specified by $_GET['dirname']
39 39
 $moduleHandler = xoops_getHandler('module');
40 40
 if (!empty($_GET['dirname'])) {
41
-    $dirname = preg_replace('/[^0-9a-zA-Z_-]/', '', $_GET['dirname']??'');
41
+    $dirname = preg_replace('/[^0-9a-zA-Z_-]/', '', $_GET['dirname'] ?? '');
42 42
 
43 43
     $target_module = $moduleHandler->getByDirname($dirname);
44 44
 }
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     $target_dirname4sql = addslashes($target_dirname);
54 54
 
55 55
 //    $target_mname = $target_module->getVar('name') . '&nbsp;' . sprintf('(%2.2f)', $target_module->getVar('version') / 100.0);
56
-    $target_mname = $target_module->getVar('name') . '&nbsp;' . sprintf('(%2.2f)', $target_module->getVar('version'));
56
+    $target_mname = $target_module->getVar('name').'&nbsp;'.sprintf('(%2.2f)', $target_module->getVar('version'));
57 57
 
58 58
 //    BrazilGoldIsAwesome
59 59
 
@@ -73,20 +73,20 @@  discard block
 block discarded – undo
73 73
 }
74 74
 
75 75
 // basic GET variables
76
-$target_lang = preg_replace('/[^0-9a-zA-Z_-]/', '', @$_GET['target_lang']??'');
76
+$target_lang = preg_replace('/[^0-9a-zA-Z_-]/', '', @$_GET['target_lang'] ?? '');
77 77
 if (empty($target_lang)) {
78 78
     $target_lang = $GLOBALS['xoopsConfig']['language'];
79 79
 }
80 80
 $target_lang4sql = addslashes($target_lang);
81
-$target_file = preg_replace('/[^0-9a-zA-Z_.-]/', '', @$_GET['target_file']??'');
81
+$target_file = preg_replace('/[^0-9a-zA-Z_.-]/', '', @$_GET['target_file'] ?? '');
82 82
 if (empty($target_file)) {
83 83
     $target_file = 'main.php';
84 84
 }
85 85
 
86 86
 // get $target_trustdirname
87 87
 $mytrustdirname = '';
88
-if (file_exists(XOOPS_ROOT_PATH . '/modules/' . $target_dirname . '/mytrustdirname.php')) {
89
-    require XOOPS_ROOT_PATH . '/modules/' . $target_dirname . '/mytrustdirname.php';
88
+if (file_exists(XOOPS_ROOT_PATH.'/modules/'.$target_dirname.'/mytrustdirname.php')) {
89
+    require XOOPS_ROOT_PATH.'/modules/'.$target_dirname.'/mytrustdirname.php';
90 90
 }
91 91
 $target_trustdirname = $mytrustdirname;
92 92
 
@@ -94,11 +94,11 @@  discard block
 block discarded – undo
94 94
 if (empty($target_trustdirname)) {
95 95
     // conventinal module
96 96
 
97
-    $baseDir = XOOPS_ROOT_PATH . '/modules/' . $target_dirname . '/language';
97
+    $baseDir = XOOPS_ROOT_PATH.'/modules/'.$target_dirname.'/language';
98 98
 } else {
99 99
     // D3 module
100 100
 
101
-    $baseDir = XOOPS_TRUST_PATH . '/modules/' . $target_trustdirname . '/language';
101
+    $baseDir = XOOPS_TRUST_PATH.'/modules/'.$target_trustdirname.'/language';
102 102
 }
103 103
 
104 104
 // make list of language and check $target_lang
@@ -115,11 +115,11 @@  discard block
 block discarded – undo
115 115
         }
116 116
 
117 117
         if (is_dir("$baseDir/$file")) {
118
-            [$count] = $db->fetchRow($db->query('SELECT COUNT(*) FROM ' . $db->prefix('altsys_language_constants') . " WHERE mid=$target_mid AND language='" . addslashes($file) . "'"));
118
+            [$count] = $db->fetchRow($db->query('SELECT COUNT(*) FROM '.$db->prefix('altsys_language_constants')." WHERE mid=$target_mid AND language='".addslashes($file)."'"));
119 119
 
120 120
             $languages[] = $file;
121 121
 
122
-            $languages4disp[] = $file . " ($count)";
122
+            $languages4disp[] = $file." ($count)";
123 123
         }
124 124
     }
125 125
 }
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 }
130 130
 
131 131
 // get base directory seleced language
132
-$lang_base_dir = $baseDir . '/' . $target_lang;
132
+$lang_base_dir = $baseDir.'/'.$target_lang;
133 133
 if (!is_dir($lang_base_dir)) {
134 134
     altsys_mylangadmin_errordie($target_mname, _MYLANGADMIN_ERR_MODLANGINCOMPATIBLE);
135 135
 }
@@ -173,14 +173,14 @@  discard block
 block discarded – undo
173 173
 // get user_values should be overridden
174 174
 $langfile_constants = [];
175 175
 foreach ($langfile_names as $name) {
176
-    [$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) . "'"));
176
+    [$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)."'"));
177 177
 
178 178
     $langfile_constants[$name] = $value;
179 179
 }
180 180
 
181 181
 // constants defined in XOOPS_ROOT_PATH/my_language/(dirname)/...
182 182
 if ($langman->my_language) {
183
-    $mylang_unique_path = $langman->my_language . '/modules/' . $target_dirname . '/' . $target_lang . '/' . $target_file;
183
+    $mylang_unique_path = $langman->my_language.'/modules/'.$target_dirname.'/'.$target_lang.'/'.$target_file;
184 184
 
185 185
     $mylang_constants = array_map('htmlspecialchars', altsys_mylangadmin_get_constants_by_pcre($mylang_unique_path));
186 186
 
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
     // Ticket Check
207 207
     global $xoopsGTicket;
208 208
     if (!$xoopsGTicket->check(true, 'altsys')) {
209
-        redirect_header(XOOPS_URL . '/', 3, $xoopsGTicket->getErrors());
209
+        redirect_header(XOOPS_URL.'/', 3, $xoopsGTicket->getErrors());
210 210
     }
211 211
 
212 212
     // read original file
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 
216 216
     // insert fingerprint of langfile_unique_path
217 217
 
218
-    $langfile_fingerprint = '_MYLANGADMIN_' . md5($langfile_unique_path);
218
+    $langfile_fingerprint = '_MYLANGADMIN_'.md5($langfile_unique_path);
219 219
 
220 220
     $file_contents = str_replace('<?php', "<?php\nif(!defined('$langfile_fingerprint'))define('$langfile_fingerprint',1);", $file_contents);
221 221
 
@@ -224,30 +224,30 @@  discard block
 block discarded – undo
224 224
     $overrides_counter = 0;
225 225
 
226 226
     foreach (array_reverse($langfile_names) as $name) {
227
-        $user_value = (@$_POST[$name]);//TODO Request
227
+        $user_value = (@$_POST[$name]); //TODO Request
228 228
 
229
-        $db->query('DELETE FROM ' . $db->prefix('altsys_language_constants') . " WHERE mid=$target_mid AND language='$target_lang4sql' AND name='" . addslashes($name) . "'");
229
+        $db->query('DELETE FROM '.$db->prefix('altsys_language_constants')." WHERE mid=$target_mid AND language='$target_lang4sql' AND name='".addslashes($name)."'");
230 230
 
231 231
         if ('' !== $user_value) {
232 232
             $overrides_counter++;
233 233
 
234 234
             // Update table
235 235
 
236
-            $db->query('INSERT INTO ' . $db->prefix('altsys_language_constants') . " (mid,language,name,value) VALUES ($target_mid,'$target_lang4sql','" . addslashes($name) . "','" . addslashes($user_value) . "')");
236
+            $db->query('INSERT INTO '.$db->prefix('altsys_language_constants')." (mid,language,name,value) VALUES ($target_mid,'$target_lang4sql','".addslashes($name)."','".addslashes($user_value)."')");
237 237
 
238 238
             // rewrite script for cache
239 239
 
240 240
             // comment-out the line of define()
241 241
 
242 242
             if (empty($constpref)) {
243
-                $from = '/.*define\s?\(\s*(["\'])' . preg_quote($name) . '(\\1).*\;.*/';
243
+                $from = '/.*define\s?\(\s*(["\'])'.preg_quote($name).'(\\1).*\;.*/';
244 244
             } else {
245
-                $from = '/.*define\s?\(\s*\$constpref\s*\.\s*(["\'])' . preg_quote(mb_substr($name, mb_strlen($constpref))) . '(\\1).*\;.*/';
245
+                $from = '/.*define\s?\(\s*\$constpref\s*\.\s*(["\'])'.preg_quote(mb_substr($name, mb_strlen($constpref))).'(\\1).*\;.*/';
246 246
             }
247 247
 
248
-            $to = '//$0' . "\ndefine('" . addslashes($name) . "','" . addslashes($user_value) . "');";
248
+            $to = '//$0'."\ndefine('".addslashes($name)."','".addslashes($user_value)."');";
249 249
 
250
-            $file_contents = preg_replace($from, $to, $file_contents??'');
250
+            $file_contents = preg_replace($from, $to, $file_contents ?? '');
251 251
         }
252 252
     }
253 253
 
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
         unlink($cache_file_name);
272 272
     }
273 273
 
274
-    redirect_header('?mode=admin&lib=altsys&page=mylangadmin&dirname=' . $target_dirname . '&target_lang=' . rawurlencode($target_lang) . '&target_file=' . rawurlencode($target_file), 1, _MYLANGADMIN_CACHEUPDATED);
274
+    redirect_header('?mode=admin&lib=altsys&page=mylangadmin&dirname='.$target_dirname.'&target_lang='.rawurlencode($target_lang).'&target_file='.rawurlencode($target_file), 1, _MYLANGADMIN_CACHEUPDATED);
275 275
 
276 276
     exit;
277 277
 }
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
 } else {
301 301
     // X2 core etc.
302 302
 
303
-    $notice4disp = _MYLANGADMIN_MSG_HOWTOENABLED3LANGMAN4X2 . '<br>';
303
+    $notice4disp = _MYLANGADMIN_MSG_HOWTOENABLED3LANGMAN4X2.'<br>';
304 304
 
305 305
     $notice4disp .= '
306 306
         <h4>include/common.php</h4>
@@ -331,12 +331,12 @@  discard block
 block discarded – undo
331 331
 // breadcrumbs
332 332
 $breadcrumbsObj = AltsysBreadcrumbs::getInstance();
333 333
 if ($breadcrumbsObj->hasPaths()) {
334
-    $breadcrumbsObj->appendPath(XOOPS_URL . '/modules/altsys/admin/index.php?mode=admin&amp;lib=altsys&amp;page=mylangadmin', _MI_ALTSYS_MENU_MYLANGADMIN);
334
+    $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&amp;lib=altsys&amp;page=mylangadmin', _MI_ALTSYS_MENU_MYLANGADMIN);
335 335
 
336 336
     $breadcrumbsObj->appendPath('', $target_mname);
337 337
 }
338 338
 
339
-require_once XOOPS_TRUST_PATH . '/libs/altsys/class/D3Tpl.class.php';
339
+require_once XOOPS_TRUST_PATH.'/libs/altsys/class/D3Tpl.class.php';
340 340
 $tpl = new D3Tpl();
341 341
 $tpl->assign([
342 342
                  'target_dirname' => $target_dirname,
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
                  'use_my_language' => mb_strlen($langman->my_language) > 0,
352 352
                  'mylang_file_name' => htmlspecialchars($mylang_unique_path, ENT_QUOTES | ENT_HTML5),
353 353
                  'cache_file_name' => htmlspecialchars($cache_file_name, ENT_QUOTES | ENT_HTML5),
354
-                 'cache_file_mtime' => (int) $cache_file_mtime,
354
+                 'cache_file_mtime' => (int)$cache_file_mtime,
355 355
                  'timezone_offset' => xoops_getUserTimestamp(0),
356 356
                  'notice' => $notice4disp,
357 357
                  'already_read' => $already_read,
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/mytplsadmin.php 2 patches
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -444,18 +444,18 @@  discard block
 block discarded – undo
444 444
             }
445 445
 
446 446
             echo "<td class='{$evenodd}{$class}'>"
447
-                 . formatTimestamp($tpl['tpl_lastmodified'], 'm')
448
-                 . '<br>'
449
-                 . mb_substr($fingerprint, 0, 16)
450
-                 . "<br><input type='checkbox' name='{$tplset4disp}_check[{$tpl_file}]' value='1'> &nbsp; <a href='?mode=admin&amp;lib=altsys&amp;page=mytplsform&amp;tpl_file="
451
-                 . htmlspecialchars($tpl['tpl_file'], ENT_QUOTES | ENT_HTML5)
452
-                 . '&amp;tpl_tplset='
453
-                 . htmlspecialchars($tpl['tpl_tplset'], ENT_QUOTES | ENT_HTML5)
454
-                 . '&amp;dirname='
455
-                 . htmlspecialchars($target_dirname, ENT_QUOTES | ENT_HTML5)
456
-                 . "'>"
457
-                 . _EDIT
458
-                 . "</a> ($numrows)</td>\n";
447
+                    . formatTimestamp($tpl['tpl_lastmodified'], 'm')
448
+                    . '<br>'
449
+                    . mb_substr($fingerprint, 0, 16)
450
+                    . "<br><input type='checkbox' name='{$tplset4disp}_check[{$tpl_file}]' value='1'> &nbsp; <a href='?mode=admin&amp;lib=altsys&amp;page=mytplsform&amp;tpl_file="
451
+                    . htmlspecialchars($tpl['tpl_file'], ENT_QUOTES | ENT_HTML5)
452
+                    . '&amp;tpl_tplset='
453
+                    . htmlspecialchars($tpl['tpl_tplset'], ENT_QUOTES | ENT_HTML5)
454
+                    . '&amp;dirname='
455
+                    . htmlspecialchars($target_dirname, ENT_QUOTES | ENT_HTML5)
456
+                    . "'>"
457
+                    . _EDIT
458
+                    . "</a> ($numrows)</td>\n";
459 459
         }
460 460
     }
461 461
 
@@ -490,10 +490,10 @@  discard block
 block discarded – undo
490 490
 
491 491
     echo "\t\t<td class='head'>
492 492
             " . ('default' == $tplset && '_custom' != $target_dirname ? '' : "<input name='del_do[{$tplset4disp}]' type='submit' value='"
493
-                                                                             . _DELETE
494
-                                                                             . "' onclick='return altsys_mytpladmin_check_copy_submit(\""
495
-                                                                             . _MYTPLSADMIN_CNF_DELETE_SELECTED_TEMPLATES
496
-                                                                             . "\", \"{$tplset4disp}_\", false);'><br><br>") . '
493
+                                                                                . _DELETE
494
+                                                                                . "' onclick='return altsys_mytpladmin_check_copy_submit(\""
495
+                                                                                . _MYTPLSADMIN_CNF_DELETE_SELECTED_TEMPLATES
496
+                                                                                . "\", \"{$tplset4disp}_\", false);'><br><br>") . '
497 497
             ' . _MYTPLSADMIN_CAPTION_COPYTO . ":
498 498
             <select name='copy_to[{$tplset4disp}]'>
499 499
                 " . str_replace('<option value=\'' . $tplset4disp . '\'>' . $tplset4disp . '</option>', '', $tplset_options) . "
Please login to merge, or discard this patch.
Spacing   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -5,10 +5,10 @@  discard block
 block discarded – undo
5 5
 //                      GIJOE <https://www.peak.ne.jp>                       //
6 6
 // ------------------------------------------------------------------------- //
7 7
 
8
-require_once __DIR__ . '/class/AltsysBreadcrumbs.class.php';
9
-require_once __DIR__ . '/include/gtickets.php';
10
-require_once __DIR__ . '/include/altsys_functions.php';
11
-require_once __DIR__ . '/include/tpls_functions.php';
8
+require_once __DIR__.'/class/AltsysBreadcrumbs.class.php';
9
+require_once __DIR__.'/include/gtickets.php';
10
+require_once __DIR__.'/include/altsys_functions.php';
11
+require_once __DIR__.'/include/tpls_functions.php';
12 12
 
13 13
 // only groups have 'module_admin' of 'altsys' can do that.
14 14
 $moduleHandler = xoops_getHandler('module');
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 
31 31
 // check $xoopsModule
32 32
 if (!is_object($xoopsModule)) {
33
-    redirect_header(XOOPS_URL . '/user.php', 1, _NOPERM);
33
+    redirect_header(XOOPS_URL.'/user.php', 1, _NOPERM);
34 34
 }
35 35
 
36 36
 // set target_module if specified by $_GET['dirname']
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 
51 51
     $target_dirname4sql = addslashes($target_dirname);
52 52
 
53
-    $target_mname = $target_module->getVar('name') . '&nbsp;' . sprintf('(%2.2f)', $target_module->getVar('version') / 100.0);
53
+    $target_mname = $target_module->getVar('name').'&nbsp;'.sprintf('(%2.2f)', $target_module->getVar('version') / 100.0);
54 54
 
55 55
 //$query4redirect = '?dirname='.urlencode(strip_tags($_GET['dirname'])) ;
56 56
 } elseif ('_custom' == @$_GET['dirname']) {
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
     // Ticket Check
89 89
 
90 90
     if (!$xoopsGTicket->check()) {
91
-        redirect_header(XOOPS_URL . '/', 3, $xoopsGTicket->getErrors());
91
+        redirect_header(XOOPS_URL.'/', 3, $xoopsGTicket->getErrors());
92 92
     }
93 93
 
94 94
     $tplset_from = ($_POST['clone_tplset_from']);
@@ -105,13 +105,13 @@  discard block
 block discarded – undo
105 105
         tplsadmin_die(_MYTPLSADMIN_ERR_INVALIDSETNAME, $target_dirname);
106 106
     }
107 107
 
108
-    [$is_exist] = $db->fetchRow($db->query('SELECT COUNT(*) FROM ' . $db->prefix('tplfile') . " WHERE tpl_tplset='" . addslashes($tplset_to) . "'"));
108
+    [$is_exist] = $db->fetchRow($db->query('SELECT COUNT(*) FROM '.$db->prefix('tplfile')." WHERE tpl_tplset='".addslashes($tplset_to)."'"));
109 109
 
110 110
     if ($is_exist) {
111 111
         tplsadmin_die(_MYTPLSADMIN_ERR_DUPLICATEDSETNAME, $target_dirname);
112 112
     }
113 113
 
114
-    [$is_exist] = $db->fetchRow($db->query('SELECT COUNT(*) FROM ' . $db->prefix('tplset') . " WHERE tplset_name='" . addslashes($tplset_to) . "'"));
114
+    [$is_exist] = $db->fetchRow($db->query('SELECT COUNT(*) FROM '.$db->prefix('tplset')." WHERE tplset_name='".addslashes($tplset_to)."'"));
115 115
 
116 116
     if ($is_exist) {
117 117
         tplsadmin_die(_MYTPLSADMIN_ERR_DUPLICATEDSETNAME, $target_dirname);
@@ -119,11 +119,11 @@  discard block
 block discarded – undo
119 119
 
120 120
     // insert tplset table
121 121
 
122
-    $db->query('INSERT INTO ' . $db->prefix('tplset') . " SET tplset_name='" . addslashes($tplset_to) . "', tplset_desc='Created by tplsadmin', tplset_created=UNIX_TIMESTAMP()");
122
+    $db->query('INSERT INTO '.$db->prefix('tplset')." SET tplset_name='".addslashes($tplset_to)."', tplset_desc='Created by tplsadmin', tplset_created=UNIX_TIMESTAMP()");
123 123
 
124 124
     tplsadmin_copy_templates_db2db($tplset_from, $tplset_to, "tpl_module='$target_dirname4sql'");
125 125
 
126
-    redirect_header('?mode=admin&lib=altsys&page=mytplsadmin&dirname=' . $target_dirname, 1, _MYTPLSADMIN_DBUPDATED);
126
+    redirect_header('?mode=admin&lib=altsys&page=mytplsadmin&dirname='.$target_dirname, 1, _MYTPLSADMIN_DBUPDATED);
127 127
 
128 128
     exit;
129 129
 }
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
             // Ticket Check
136 136
 
137 137
             if (!$xoopsGTicket->check()) {
138
-                redirect_header(XOOPS_URL . '/', 3, $xoopsGTicket->getErrors());
138
+                redirect_header(XOOPS_URL.'/', 3, $xoopsGTicket->getErrors());
139 139
             }
140 140
 
141 141
             $tplset_from = ($tplset_from_tmp);
@@ -157,10 +157,10 @@  discard block
 block discarded – undo
157 157
 
158 158
                 $tplfile = ($tplfile_tmp);
159 159
 
160
-                tplsadmin_copy_templates_db2db($tplset_from, $tplset_to, "tpl_file='" . addslashes($tplfile) . "'");
160
+                tplsadmin_copy_templates_db2db($tplset_from, $tplset_to, "tpl_file='".addslashes($tplfile)."'");
161 161
             }
162 162
 
163
-            redirect_header('?mode=admin&lib=altsys&page=mytplsadmin&dirname=' . $target_dirname, 1, _MYTPLSADMIN_DBUPDATED);
163
+            redirect_header('?mode=admin&lib=altsys&page=mytplsadmin&dirname='.$target_dirname, 1, _MYTPLSADMIN_DBUPDATED);
164 164
 
165 165
             exit;
166 166
         }
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
     // Ticket Check
173 173
 
174 174
     if (!$xoopsGTicket->check()) {
175
-        redirect_header(XOOPS_URL . '/', 3, $xoopsGTicket->getErrors());
175
+        redirect_header(XOOPS_URL.'/', 3, $xoopsGTicket->getErrors());
176 176
     }
177 177
 
178 178
     if (empty($_POST['copyf2db_to'])) {
@@ -192,10 +192,10 @@  discard block
 block discarded – undo
192 192
 
193 193
         $tplfile = ($tplfile_tmp);
194 194
 
195
-        tplsadmin_copy_templates_f2db($tplset_to, "tpl_file='" . addslashes($tplfile) . "'");
195
+        tplsadmin_copy_templates_f2db($tplset_to, "tpl_file='".addslashes($tplfile)."'");
196 196
     }
197 197
 
198
-    redirect_header('?mode=admin&lib=altsys&page=mytplsadmin&dirname=' . $target_dirname, 1, _MYTPLSADMIN_DBUPDATED);
198
+    redirect_header('?mode=admin&lib=altsys&page=mytplsadmin&dirname='.$target_dirname, 1, _MYTPLSADMIN_DBUPDATED);
199 199
 
200 200
     exit;
201 201
 }
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
             // Ticket Check
208 208
 
209 209
             if (!$xoopsGTicket->check()) {
210
-                redirect_header(XOOPS_URL . '/', 3, $xoopsGTicket->getErrors());
210
+                redirect_header(XOOPS_URL.'/', 3, $xoopsGTicket->getErrors());
211 211
             }
212 212
 
213 213
             $tplset_from = ($tplset_from_tmp);
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
                 tplsadmin_die(_MYTPLSADMIN_ERR_NOTPLFILE, $target_dirname);
221 221
             }
222 222
 
223
-            require_once XOOPS_ROOT_PATH . '/class/template.php';
223
+            require_once XOOPS_ROOT_PATH.'/class/template.php';
224 224
 
225 225
             $tpl = new \XoopsTpl();
226 226
 
@@ -233,24 +233,24 @@  discard block
 block discarded – undo
233 233
 
234 234
                 $tplfile = ($tplfile_tmp);
235 235
 
236
-                $result = $db->query('SELECT tpl_id FROM ' . $db->prefix('tplfile') . " WHERE tpl_tplset='" . addslashes($tplset_from) . "' AND tpl_file='" . addslashes($tplfile) . "'");
236
+                $result = $db->query('SELECT tpl_id FROM '.$db->prefix('tplfile')." WHERE tpl_tplset='".addslashes($tplset_from)."' AND tpl_file='".addslashes($tplfile)."'");
237 237
 
238 238
                 while ([$tpl_id] = $db->fetchRow($result)) {
239
-                    $tpl_id = (int) $tpl_id;
239
+                    $tpl_id = (int)$tpl_id;
240 240
 
241
-                    $db->query('DELETE FROM ' . $db->prefix('tplfile') . " WHERE tpl_id=$tpl_id");
241
+                    $db->query('DELETE FROM '.$db->prefix('tplfile')." WHERE tpl_id=$tpl_id");
242 242
 
243
-                    $db->query('DELETE FROM ' . $db->prefix('tplsource') . " WHERE tpl_id=$tpl_id");
243
+                    $db->query('DELETE FROM '.$db->prefix('tplsource')." WHERE tpl_id=$tpl_id");
244 244
                 }
245 245
 
246 246
                 // remove templates_c
247 247
 
248
-                $tpl->clearCache('db:' . $tplfile);
248
+                $tpl->clearCache('db:'.$tplfile);
249 249
 
250
-                $tpl->clearCompiledTemplate('db:' . $tplfile);
250
+                $tpl->clearCompiledTemplate('db:'.$tplfile);
251 251
             }
252 252
 
253
-            redirect_header('?mode=admin&lib=altsys&page=mytplsadmin&dirname=' . $target_dirname, 1, _MYTPLSADMIN_DBUPDATED);
253
+            redirect_header('?mode=admin&lib=altsys&page=mytplsadmin&dirname='.$target_dirname, 1, _MYTPLSADMIN_DBUPDATED);
254 254
 
255 255
             exit;
256 256
         }
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
 // get tplsets
294 294
 $tplsetHandler = xoops_getHandler('tplset');
295 295
 $tplsets = array_keys($tplsetHandler->getList());
296
-$sql = 'SELECT DISTINCT tpl_tplset FROM ' . $db->prefix('tplfile') . " ORDER BY tpl_tplset='default' DESC,tpl_tplset";
296
+$sql = 'SELECT DISTINCT tpl_tplset FROM '.$db->prefix('tplfile')." ORDER BY tpl_tplset='default' DESC,tpl_tplset";
297 297
 $srs = $db->query($sql);
298 298
 while ([$tplset] = $db->fetchRow($srs)) {
299 299
     if (!in_array($tplset, $tplsets, true)) {
@@ -322,18 +322,18 @@  discard block
 block discarded – undo
322 322
 }
323 323
 
324 324
 // get tpl_file owned by the module
325
-$sql = 'SELECT tpl_file,tpl_desc,tpl_type,COUNT(tpl_id) FROM ' . $db->prefix('tplfile') . " WHERE tpl_module='$target_dirname4sql' GROUP BY tpl_file, tpl_desc,tpl_type,tpl_id ORDER BY tpl_file ";
325
+$sql = 'SELECT tpl_file,tpl_desc,tpl_type,COUNT(tpl_id) FROM '.$db->prefix('tplfile')." WHERE tpl_module='$target_dirname4sql' GROUP BY tpl_file, tpl_desc,tpl_type,tpl_id ORDER BY tpl_file ";
326 326
 $frs = $db->query($sql);
327 327
 
328 328
 if (!$frs instanceof \mysqli_result) {
329
-    \trigger_error($db->errno() . ' ' . $db->error(), \E_USER_ERROR);
329
+    \trigger_error($db->errno().' '.$db->error(), \E_USER_ERROR);
330 330
 }
331 331
 
332 332
 
333 333
 xoops_cp_header();
334 334
 
335 335
 // css display
336
-require_once XOOPS_TRUST_PATH . '/libs/altsys/class/D3Tpl.class.php';
336
+require_once XOOPS_TRUST_PATH.'/libs/altsys/class/D3Tpl.class.php';
337 337
 $tpl = new D3Tpl();
338 338
 echo '<style scoped="scoped">';
339 339
 $tpl->display('db:altsys_inc_mytplsadmin.css');
@@ -348,27 +348,27 @@  discard block
 block discarded – undo
348 348
 // breadcrumbs
349 349
 $breadcrumbsObj = AltsysBreadcrumbs::getInstance();
350 350
 if ($breadcrumbsObj->hasPaths()) {
351
-    $breadcrumbsObj->appendPath(XOOPS_URL . '/modules/altsys/admin/index.php?mode=admin&amp;lib=altsys&amp;page=mytplsadmin', _MI_ALTSYS_MENU_MYTPLSADMIN);
351
+    $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&amp;lib=altsys&amp;page=mytplsadmin', _MI_ALTSYS_MENU_MYTPLSADMIN);
352 352
 
353 353
     $breadcrumbsObj->appendPath('', $target_mname);
354 354
 }
355 355
 
356
-echo "<h3 style='text-align:" . _GLOBAL_LEFT . ";'>" . _MYTPLSADMIN_H3_MODULE . " : $target_mname</h3>\n";
356
+echo "<h3 style='text-align:"._GLOBAL_LEFT.";'>"._MYTPLSADMIN_H3_MODULE." : $target_mname</h3>\n";
357 357
 
358 358
 // link to create a new custom template
359 359
 if ('_custom' == $target_dirname) {
360
-    echo "<a href='index.php?mode=admin&lib=altsys&page=mytplsform&tpl_tplset=default'>" . _MYTPLSADMIN_CREATENEWCUSTOMTEMPLATE . "</a>\n";
360
+    echo "<a href='index.php?mode=admin&lib=altsys&page=mytplsform&tpl_tplset=default'>"._MYTPLSADMIN_CREATENEWCUSTOMTEMPLATE."</a>\n";
361 361
 }
362 362
 
363 363
 // beggining of table & form
364 364
 echo "
365
-    <form name='MainForm' action='?mode=admin&amp;lib=altsys&amp;page=mytplsadmin&amp;dirname=" . htmlspecialchars($target_dirname, ENT_QUOTES | ENT_HTML5) . "' method='post'>
366
-    " . $xoopsGTicket->getTicketHtml(__LINE__) . "
365
+    <form name='MainForm' action='?mode=admin&amp;lib=altsys&amp;page=mytplsadmin&amp;dirname=" . htmlspecialchars($target_dirname, ENT_QUOTES | ENT_HTML5)."' method='post'>
366
+    " . $xoopsGTicket->getTicketHtml(__LINE__)."
367 367
     <table class='outer altsys_mytplsadmin'>
368 368
         <tr>
369
-            <th>" . _MYTPLSADMIN_TH_NAME . '</th>
370
-            <th>' . _MYTPLSADMIN_TH_TYPE . "</th>
371
-            <th><input type='checkbox' title=" . _MYTPLSADMIN_TITLE_CHECKALL . " onclick=\"with(document.MainForm){for(i=0;i<length;i++){if(elements[i].type==='checkbox'&&elements[i].name.indexOf('basecheck')>=0){elements[i].checked=this.checked;}}}\">" . _MYTPLSADMIN_TH_FILE . "</th>
369
+            <th>" . _MYTPLSADMIN_TH_NAME.'</th>
370
+            <th>' . _MYTPLSADMIN_TH_TYPE."</th>
371
+            <th><input type='checkbox' title=" . _MYTPLSADMIN_TITLE_CHECKALL." onclick=\"with(document.MainForm){for(i=0;i<length;i++){if(elements[i].type==='checkbox'&&elements[i].name.indexOf('basecheck')>=0){elements[i].checked=this.checked;}}}\">"._MYTPLSADMIN_TH_FILE."</th>
372 372
             $tplsets_th4disp
373 373
         </tr>\n";
374 374
 
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
 
378 378
 
379 379
 if (!$frs instanceof \mysqli_result) {
380
-    \trigger_error($db->errno() . ' ' . $db->error(), \E_USER_ERROR);
380
+    \trigger_error($db->errno().' '.$db->error(), \E_USER_ERROR);
381 381
 }
382 382
 // template ROWS
383 383
 while (false !== ([$tpl_file, $tpl_desc, $type, $count] = $db->fetchRow($frs))) {
@@ -391,11 +391,11 @@  discard block
 block discarded – undo
391 391
         <tr>
392 392
             <td class='$evenodd'>
393 393
                 <dl>
394
-                    <dt>" . htmlspecialchars($tpl_file, ENT_QUOTES | ENT_HTML5) . '</dt>
395
-                    <dd>' . htmlspecialchars($tpl_desc, ENT_QUOTES | ENT_HTML5) . "</dd>
394
+                    <dt>".htmlspecialchars($tpl_file, ENT_QUOTES | ENT_HTML5).'</dt>
395
+                    <dd>' . htmlspecialchars($tpl_desc, ENT_QUOTES | ENT_HTML5)."</dd>
396 396
                 </dl>
397 397
             </td>
398
-            <td class='$evenodd'>" . $type . '<br>(' . $count . ")</td>\n";
398
+            <td class='$evenodd'>".$type.'<br>('.$count.")</td>\n";
399 399
 
400 400
     // the base file template column
401 401
 
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
 
407 407
         $fingerprints[$fingerprint] = '';
408 408
 
409
-        echo "<td class='$evenodd'>" . formatTimestamp(filemtime($basefilepath), 'm') . '<br>' . mb_substr($fingerprint, 0, 16) . "<br><input type='checkbox' name='basecheck[$tpl_file]' value='1'></td>\n";
409
+        echo "<td class='$evenodd'>".formatTimestamp(filemtime($basefilepath), 'm').'<br>'.mb_substr($fingerprint, 0, 16)."<br><input type='checkbox' name='basecheck[$tpl_file]' value='1'></td>\n";
410 410
 
411 411
         $fingerprint_class_count = 0;
412 412
     } else {
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
 
423 423
         // query for templates in db
424 424
 
425
-        $drs = $db->query('SELECT * FROM ' . $db->prefix('tplfile') . ' f NATURAL LEFT JOIN ' . $db->prefix('tplsource') . " s WHERE tpl_file='" . addslashes($tpl_file) . "' AND tpl_tplset='" . addslashes($tplset) . "'");
425
+        $drs = $db->query('SELECT * FROM '.$db->prefix('tplfile').' f NATURAL LEFT JOIN '.$db->prefix('tplsource')." s WHERE tpl_file='".addslashes($tpl_file)."' AND tpl_tplset='".addslashes($tplset)."'");
426 426
 
427 427
         $numrows = $db->getRowsNum($drs);
428 428
 
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
         if (empty($tpl['tpl_id'])) {
432 432
             echo "<td class='$evenodd'>($numrows)</td>\n";
433 433
         } else {
434
-            $fingerprint = tplsadmin_get_fingerprint(explode("\n", $tpl['tpl_source']??''));
434
+            $fingerprint = tplsadmin_get_fingerprint(explode("\n", $tpl['tpl_source'] ?? ''));
435 435
 
436 436
             if (isset($fingerprints[$fingerprint])) {
437 437
                 $class = $fingerprints[$fingerprint];
@@ -466,23 +466,23 @@  discard block
 block discarded – undo
466 466
 echo "
467 467
     <tr>
468 468
         <td class='head'>
469
-            " . _MYTPLSADMIN_CREATE_NEW_TPLSET . ': <br>
470
-            ' . _MYTPLSADMIN_CAPTION_BASE . ":
469
+            " . _MYTPLSADMIN_CREATE_NEW_TPLSET.': <br>
470
+            ' . _MYTPLSADMIN_CAPTION_BASE.":
471 471
             <select name='clone_tplset_from'>
472 472
                 $tplset_options
473
-                <option value='_blank_'>" . _MYTPLSADMIN_OPT_BLANKSET . '</option>
473
+                <option value='_blank_'>"._MYTPLSADMIN_OPT_BLANKSET.'</option>
474 474
             </select>
475 475
             <br>
476
-            ' . _MYTPLSADMIN_CAPTION_SETNAME . ": <input type='text' name='clone_tplset_to' size='8' maxlength='16'> <input type='submit' name='clone_tplset_do' value='" . _MYTPLSADMIN_BTN_NEWTPLSET . "'>
476
+            ' . _MYTPLSADMIN_CAPTION_SETNAME.": <input type='text' name='clone_tplset_to' size='8' maxlength='16'> <input type='submit' name='clone_tplset_do' value='"._MYTPLSADMIN_BTN_NEWTPLSET."'>
477 477
         </td>
478 478
         <td class='head'></td>
479 479
         <td class='head'>
480
-            " . _MYTPLSADMIN_CAPTION_COPYTO . ":
480
+            " . _MYTPLSADMIN_CAPTION_COPYTO.":
481 481
             <select name='copyf2db_to'>
482 482
                 $tplset_options
483 483
             </select>
484 484
             <br>
485
-            <input name='copyf2db_do' type='submit' value='" . _MYTPLSADMIN_BTN_COPY . "' onclick='return altsys_mytpladmin_check_copy_submit(\"" . _MYTPLSADMIN_CNF_COPY_SELECTED_TEMPLATES . "\", \"base\", true);'>
485
+            <input name='copyf2db_do' type='submit' value='"._MYTPLSADMIN_BTN_COPY."' onclick='return altsys_mytpladmin_check_copy_submit(\""._MYTPLSADMIN_CNF_COPY_SELECTED_TEMPLATES."\", \"base\", true);'>
486 486
         </td>\n";
487 487
 
488 488
 foreach ($tplsets as $tplset) {
@@ -493,12 +493,12 @@  discard block
 block discarded – undo
493 493
                                                                              . _DELETE
494 494
                                                                              . "' onclick='return altsys_mytpladmin_check_copy_submit(\""
495 495
                                                                              . _MYTPLSADMIN_CNF_DELETE_SELECTED_TEMPLATES
496
-                                                                             . "\", \"{$tplset4disp}_\", false);'><br><br>") . '
497
-            ' . _MYTPLSADMIN_CAPTION_COPYTO . ":
496
+                                                                             . "\", \"{$tplset4disp}_\", false);'><br><br>").'
497
+            ' . _MYTPLSADMIN_CAPTION_COPYTO.":
498 498
             <select name='copy_to[{$tplset4disp}]'>
499
-                " . str_replace('<option value=\'' . $tplset4disp . '\'>' . $tplset4disp . '</option>', '', $tplset_options) . "
499
+                ".str_replace('<option value=\''.$tplset4disp.'\'>'.$tplset4disp.'</option>', '', $tplset_options)."
500 500
             </select>
501
-            <input name='copy_do[{$tplset4disp}]' type='submit' value='" . _MYTPLSADMIN_BTN_COPY . "' onclick='return altsys_mytpladmin_check_copy_submit(\"" . _MYTPLSADMIN_CNF_COPY_SELECTED_TEMPLATES . "\", \"{$tplset4disp}_\", true);'>
501
+            <input name='copy_do[{$tplset4disp}]' type='submit' value='"._MYTPLSADMIN_BTN_COPY."' onclick='return altsys_mytpladmin_check_copy_submit(\""._MYTPLSADMIN_CNF_COPY_SELECTED_TEMPLATES."\", \"{$tplset4disp}_\", true);'>
502 502
         </td>\n";
503 503
 }
504 504
 
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/myblocksadmin.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -5,11 +5,11 @@  discard block
 block discarded – undo
5 5
 //                       GIJOE <https://www.peak.ne.jp>                      //
6 6
 // ------------------------------------------------------------------------- //
7 7
 
8
-require_once __DIR__ . '/class/AltsysBreadcrumbs.class.php';
9
-require_once __DIR__ . '/include/gtickets.php';
10
-require_once __DIR__ . '/include/altsys_functions.php';
11
-require_once __DIR__ . '/include/mygrouppermform.php';
12
-require_once XOOPS_ROOT_PATH . '/class/xoopsblock.php';
8
+require_once __DIR__.'/class/AltsysBreadcrumbs.class.php';
9
+require_once __DIR__.'/include/gtickets.php';
10
+require_once __DIR__.'/include/altsys_functions.php';
11
+require_once __DIR__.'/include/mygrouppermform.php';
12
+require_once XOOPS_ROOT_PATH.'/class/xoopsblock.php';
13 13
 
14 14
 include_once $GLOBALS['xoops']->path('class/xoopsformloader.php');
15 15
 
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 //        $myba = MyBlocksAdminForX20S::getInstance();
41 41
 //        break;
42 42
     default:
43
-        require_once __DIR__ . '/class/MyBlocksAdmin.class.php';
43
+        require_once __DIR__.'/class/MyBlocksAdmin.class.php';
44 44
         $myba = MyBlocksAdmin::getInstance();
45 45
         break;
46 46
 }
Please login to merge, or discard this patch.