Completed
Branch master (5c4e1a)
by Michael
46s
created
xoops_trust_path/libs/altsys/onupdate.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php declare(strict_types=1);
2 2
 
3
-eval(' function xoops_module_update_' . $mydirname . '( $module ) { return altsys_onupdate_base( $module , \'' . $mydirname . '\' ) ; } ');
3
+eval(' function xoops_module_update_'.$mydirname.'( $module ) { return altsys_onupdate_base( $module , \''.$mydirname.'\' ) ; } ');
4 4
 
5 5
 if (!function_exists('altsys_onupdate_base')) {
6 6
     /**
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
         if (defined('XOOPS_CUBE_LEGACY')) {
20 20
             $root = XCube_Root::getSingleton();
21 21
 
22
-            $root->mDelegateManager->add('Legacy.Admin.Event.ModuleUpdate.' . ucfirst($mydirname) . '.Success', 'altsys_message_append_onupdate');
22
+            $root->mDelegateManager->add('Legacy.Admin.Event.ModuleUpdate.'.ucfirst($mydirname).'.Success', 'altsys_message_append_onupdate');
23 23
 
24 24
             $msgs = [];
25 25
         } elseif (!is_array($msgs)) {
@@ -34,36 +34,36 @@  discard block
 block discarded – undo
34 34
 
35 35
         // configs (Though I know it is not a recommended way...)
36 36
 
37
-        $check_sql = 'SHOW COLUMNS FROM ' . $db->prefix('config') . " LIKE 'conf_title'";
37
+        $check_sql = 'SHOW COLUMNS FROM '.$db->prefix('config')." LIKE 'conf_title'";
38 38
 
39 39
         if (($result = $db->query($check_sql)) && ($myrow = $db->fetchArray($result)) && 'varchar(30)' == @$myrow['Type']) {
40
-            $db->queryF('ALTER TABLE ' . $db->prefix('config') . " MODIFY `conf_title` VARCHAR(255) NOT NULL DEFAULT '', MODIFY `conf_desc` VARCHAR(255) NOT NULL DEFAULT ''");
40
+            $db->queryF('ALTER TABLE '.$db->prefix('config')." MODIFY `conf_title` VARCHAR(255) NOT NULL DEFAULT '', MODIFY `conf_desc` VARCHAR(255) NOT NULL DEFAULT ''");
41 41
         }
42 42
 
43 43
         // 0.4 -> 0.5
44 44
 
45
-        $check_sql = 'SELECT COUNT(*) FROM ' . $db->prefix($mydirname . '_language_constants');
45
+        $check_sql = 'SELECT COUNT(*) FROM '.$db->prefix($mydirname.'_language_constants');
46 46
 
47 47
         if (!$db->query($check_sql)) {
48
-            $db->queryF('CREATE TABLE ' . $db->prefix($mydirname . '_language_constants') . " (mid SMALLINT(5) UNSIGNED NOT NULL DEFAULT 0,language VARCHAR(32) NOT NULL DEFAULT '',name VARCHAR(255) NOT NULL DEFAULT '',value TEXT,PRIMARY KEY (mid,language,name)) ENGINE=MyISAM");
48
+            $db->queryF('CREATE TABLE '.$db->prefix($mydirname.'_language_constants')." (mid SMALLINT(5) UNSIGNED NOT NULL DEFAULT 0,language VARCHAR(32) NOT NULL DEFAULT '',name VARCHAR(255) NOT NULL DEFAULT '',value TEXT,PRIMARY KEY (mid,language,name)) ENGINE=MyISAM");
49 49
         }
50 50
 
51 51
         // TEMPLATES (all templates have been already removed by modulesadmin)
52 52
 
53 53
         $tplfileHandler = xoops_getHandler('tplfile');
54 54
 
55
-        $tpl_path = __DIR__ . '/templates';
55
+        $tpl_path = __DIR__.'/templates';
56 56
 
57
-        if ($handler = @opendir($tpl_path . '/')) {
57
+        if ($handler = @opendir($tpl_path.'/')) {
58 58
             while (false !== ($file = readdir($handler))) {
59 59
                 if ('.' == mb_substr($file, 0, 1)) {
60 60
                     continue;
61 61
                 }
62 62
 
63
-                $file_path = $tpl_path . '/' . $file;
63
+                $file_path = $tpl_path.'/'.$file;
64 64
 
65 65
                 if (is_file($file_path)) {
66
-                    $mtime = (int) (@filemtime($file_path));
66
+                    $mtime = (int)(@filemtime($file_path));
67 67
 
68 68
                     $tplfile = $tplfileHandler->create();
69 69
 
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 
74 74
                     $tplfile->setVar('tpl_tplset', 'default');
75 75
 
76
-                    $tplfile->setVar('tpl_file', $mydirname . '_' . $file);
76
+                    $tplfile->setVar('tpl_file', $mydirname.'_'.$file);
77 77
 
78 78
                     $tplfile->setVar('tpl_desc', '', true);
79 79
 
@@ -86,15 +86,15 @@  discard block
 block discarded – undo
86 86
                     $tplfile->setVar('tpl_type', 'module');
87 87
 
88 88
                     if (!$tplfileHandler->insert($tplfile)) {
89
-                        $msgs[] = '<span style="color:#ff0000;">ERROR: Could not insert template <b>' . htmlspecialchars($mydirname . '_' . $file, ENT_QUOTES | ENT_HTML5) . '</b> to the database.</span>';
89
+                        $msgs[] = '<span style="color:#ff0000;">ERROR: Could not insert template <b>'.htmlspecialchars($mydirname.'_'.$file, ENT_QUOTES | ENT_HTML5).'</b> to the database.</span>';
90 90
                     } else {
91 91
                         $tplid = $tplfile->getVar('tpl_id');
92 92
 
93
-                        $msgs[] = 'Template <b>' . htmlspecialchars($mydirname . '_' . $file, ENT_QUOTES | ENT_HTML5) . '</b> added to the database. (ID: <b>' . $tplid . '</b>)';
93
+                        $msgs[] = 'Template <b>'.htmlspecialchars($mydirname.'_'.$file, ENT_QUOTES | ENT_HTML5).'</b> added to the database. (ID: <b>'.$tplid.'</b>)';
94 94
 
95 95
                         // generate compiled file
96 96
 
97
-                        require_once XOOPS_TRUST_PATH . '/libs/altsys/include/altsys_functions.php';
97
+                        require_once XOOPS_TRUST_PATH.'/libs/altsys/include/altsys_functions.php';
98 98
 
99 99
                         altsys_clear_templates_c();
100 100
 
@@ -111,9 +111,9 @@  discard block
 block discarded – undo
111 111
             closedir($handler);
112 112
         }
113 113
 
114
-        require_once XOOPS_ROOT_PATH . '/class/xoopsblock.php';
114
+        require_once XOOPS_ROOT_PATH.'/class/xoopsblock.php';
115 115
 
116
-        require_once XOOPS_ROOT_PATH . '/class/template.php';
116
+        require_once XOOPS_ROOT_PATH.'/class/template.php';
117 117
 
118 118
         xoops_template_clear_module_cache($mid);
119 119
 
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/onuninstall.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php declare(strict_types=1);
2 2
 
3
-eval(' function xoops_module_uninstall_' . $mydirname . '( $module ) { return altsys_onuninstall_base( $module , \'' . $mydirname . '\' ) ; } ');
3
+eval(' function xoops_module_uninstall_'.$mydirname.'( $module ) { return altsys_onuninstall_base( $module , \''.$mydirname.'\' ) ; } ');
4 4
 
5 5
 if (!function_exists('altsys_onuninstall_base')) {
6 6
     /**
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
         if (defined('XOOPS_CUBE_LEGACY')) {
20 20
             $root = XCube_Root::getSingleton();
21 21
 
22
-            $root->mDelegateManager->add('Legacy.Admin.Event.ModuleUninstall.' . ucfirst($mydirname) . '.Success', 'altsys_message_append_onuninstall');
22
+            $root->mDelegateManager->add('Legacy.Admin.Event.ModuleUninstall.'.ucfirst($mydirname).'.Success', 'altsys_message_append_onuninstall');
23 23
 
24 24
             $ret = [];
25 25
         } elseif (!is_array($ret)) {
@@ -32,23 +32,23 @@  discard block
 block discarded – undo
32 32
 
33 33
         // TABLES (loading mysql.sql)
34 34
 
35
-        $sql_file_path = __DIR__ . '/sql/mysql.sql';
35
+        $sql_file_path = __DIR__.'/sql/mysql.sql';
36 36
 
37
-        $prefix_mod = $db->prefix() . '_' . $mydirname;
37
+        $prefix_mod = $db->prefix().'_'.$mydirname;
38 38
 
39 39
         if (is_file($sql_file_path)) {
40
-            $ret[] = 'SQL file found at <b>' . htmlspecialchars($sql_file_path, ENT_QUOTES | ENT_HTML5) . '</b>.<br > Deleting tables...<br>';
40
+            $ret[] = 'SQL file found at <b>'.htmlspecialchars($sql_file_path, ENT_QUOTES | ENT_HTML5).'</b>.<br > Deleting tables...<br>';
41 41
 
42 42
             $sql_lines = file($sql_file_path);
43 43
 
44 44
             foreach ($sql_lines as $sql_line) {
45 45
                 if (preg_match('/^CREATE TABLE \`?([a-zA-Z0-9_-]+)\`? /i', $sql_line, $regs)) {
46
-                    $sql = 'DROP TABLE ' . addslashes($prefix_mod . '_' . $regs[1]);
46
+                    $sql = 'DROP TABLE '.addslashes($prefix_mod.'_'.$regs[1]);
47 47
 
48 48
                     if (!$db->query($sql)) {
49
-                        $ret[] = '<span style="color:#ff0000;">ERROR: Could not drop table <b>' . htmlspecialchars($prefix_mod . '_' . $regs[1], ENT_QUOTES | ENT_HTML5) . '<b>.</span><br>';
49
+                        $ret[] = '<span style="color:#ff0000;">ERROR: Could not drop table <b>'.htmlspecialchars($prefix_mod.'_'.$regs[1], ENT_QUOTES | ENT_HTML5).'<b>.</span><br>';
50 50
                     } else {
51
-                        $ret[] = 'Table <b>' . htmlspecialchars($prefix_mod . '_' . $regs[1], ENT_QUOTES | ENT_HTML5) . '</b> dropped.<br>';
51
+                        $ret[] = 'Table <b>'.htmlspecialchars($prefix_mod.'_'.$regs[1], ENT_QUOTES | ENT_HTML5).'</b> dropped.<br>';
52 52
                     }
53 53
                 }
54 54
             }
Please login to merge, or discard this patch.
html/modules/altsys/setup_xoops_trust_path.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -3,9 +3,9 @@  discard block
 block discarded – undo
3 3
 $xoopsOption['nocommon'] = 1;
4 4
 define('_LEGACY_PREVENT_LOAD_CORE_', 1);
5 5
 
6
-require \dirname(__DIR__, 2) . '/mainfile.php';
6
+require \dirname(__DIR__, 2).'/mainfile.php';
7 7
 
8
-if (defined('XOOPS_TRUST_PATH') && XOOPS_TRUST_PATH !== '' && file_exists(XOOPS_TRUST_PATH . '/libs/altsys')) {
8
+if (defined('XOOPS_TRUST_PATH') && XOOPS_TRUST_PATH !== '' && file_exists(XOOPS_TRUST_PATH.'/libs/altsys')) {
9 9
     exit('No problem with your XOOPS_TRUST_PATH');
10 10
 }
11 11
 
@@ -22,11 +22,11 @@  discard block
 block discarded – undo
22 22
                 if ('.' == mb_substr($file, 0, 1)) {
23 23
                     continue;
24 24
                 }
25
-                $fullpath = $baseDir . '/' . $file;
25
+                $fullpath = $baseDir.'/'.$file;
26 26
                 if (!is_dir($fullpath)) {
27 27
                     continue;
28 28
                 }
29
-                if (is_dir($fullpath . '/libs/altsys')) {
29
+                if (is_dir($fullpath.'/libs/altsys')) {
30 30
                     $xoops_trust_path = $fullpath;
31 31
                     break 2;
32 32
                 }
@@ -35,13 +35,13 @@  discard block
 block discarded – undo
35 35
     }
36 36
     // fall back
37 37
     if (empty($xoops_trust_path)) {
38
-        $xoops_trust_path = \dirname(XOOPS_ROOT_PATH) . '/xoops_trust_path';
38
+        $xoops_trust_path = \dirname(XOOPS_ROOT_PATH).'/xoops_trust_path';
39 39
     }
40 40
     // create the hint
41 41
     if (!defined('XOOPS_TRUST_PATH')) {
42
-        $hint = "Insert the red line.<br>define('XOOPS_ROOT_PATH', '" . htmlspecialchars(XOOPS_ROOT_PATH, ENT_QUOTES | ENT_HTML5) . "');<br><ins style='color:red;'>define('XOOPS_TRUST_PATH', '" . htmlspecialchars($xoops_trust_path, ENT_QUOTES | ENT_HTML5) . "');</ins>";
42
+        $hint = "Insert the red line.<br>define('XOOPS_ROOT_PATH', '".htmlspecialchars(XOOPS_ROOT_PATH, ENT_QUOTES | ENT_HTML5)."');<br><ins style='color:red;'>define('XOOPS_TRUST_PATH', '".htmlspecialchars($xoops_trust_path, ENT_QUOTES | ENT_HTML5)."');</ins>";
43 43
     } else {
44
-        $hint = "<del>define('XOOPS_TRUST_PATH', '');</del><br><ins style='color:red;'>define('XOOPS_TRUST_PATH', '" . htmlspecialchars($xoops_trust_path, ENT_QUOTES | ENT_HTML5) . "');</ins>";
44
+        $hint = "<del>define('XOOPS_TRUST_PATH', '');</del><br><ins style='color:red;'>define('XOOPS_TRUST_PATH', '".htmlspecialchars($xoops_trust_path, ENT_QUOTES | ENT_HTML5)."');</ins>";
45 45
     }
46 46
 }
47 47
 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
     <input type="submit" value="next">
61 61
 </form>
62 62
 <?php if ($hint) {
63
-    echo 'Edit mainfile.php like this: <blockquote style="border: black solid 1px;">' . $hint . '</blockquote>';
63
+    echo 'Edit mainfile.php like this: <blockquote style="border: black solid 1px;">'.$hint.'</blockquote>';
64 64
 } ?>
65 65
 </body>
66 66
 </html>
Please login to merge, or discard this patch.
html/modules/altsys/admin/index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php declare(strict_types=1);
2 2
 
3
-require \dirname(__DIR__, 3) . '/mainfile.php';
3
+require \dirname(__DIR__, 3).'/mainfile.php';
4 4
 if (!defined('XOOPS_TRUST_PATH')) {
5 5
     exit('set XOOPS_TRUST_PATH in mainfile.php');
6 6
 }
@@ -10,4 +10,4 @@  discard block
 block discarded – undo
10 10
 // require $mydirpath.'/mytrustdirname.php' ; // set $mytrustdirname
11 11
 $mytrustdirname = 'altsys';
12 12
 
13
-require XOOPS_TRUST_PATH . '/libs/' . $mytrustdirname . '/index.php';
13
+require XOOPS_TRUST_PATH.'/libs/'.$mytrustdirname.'/index.php';
Please login to merge, or discard this patch.