Completed
Push — master ( 0881bb...3a6ebc )
by Michael
04:47
created
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.
xoops_trust_path/libs/altsys/include/altsys_functions.php 1 patch
Spacing   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -1,46 +1,46 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-altsys_set_module_config() ;
3
+altsys_set_module_config();
4 4
 
5 5
 function altsys_set_module_config()
6 6
 {
7
-    global $altsysModuleConfig , $altsysModuleId ;
7
+    global $altsysModuleConfig, $altsysModuleId;
8 8
 
9
-    $module_handler =& xoops_gethandler('module') ;
10
-    $module =& $module_handler->getByDirname('altsys') ;
9
+    $module_handler = & xoops_gethandler('module');
10
+    $module = & $module_handler->getByDirname('altsys');
11 11
     if (is_object($module)) {
12
-        $config_handler =& xoops_gethandler('config') ;
13
-        $altsysModuleConfig = $config_handler->getConfigList($module->getVar('mid')) ;
14
-        $altsysModuleId = $module->getVar('mid') ;
12
+        $config_handler = & xoops_gethandler('config');
13
+        $altsysModuleConfig = $config_handler->getConfigList($module->getVar('mid'));
14
+        $altsysModuleId = $module->getVar('mid');
15 15
     } else {
16
-        $altsysModuleConfig = array() ;
17
-        $altsysModuleId = 0 ;
16
+        $altsysModuleConfig = array();
17
+        $altsysModuleId = 0;
18 18
     }
19 19
 
20 20
     // for RTL users
21
-    @define('_GLOBAL_LEFT', @_ADM_USE_RTL == 1 ? 'right' : 'left') ;
22
-    @define('_GLOBAL_RIGHT', @_ADM_USE_RTL == 1 ? 'left' : 'right') ;
21
+    @define('_GLOBAL_LEFT', @_ADM_USE_RTL == 1 ? 'right' : 'left');
22
+    @define('_GLOBAL_RIGHT', @_ADM_USE_RTL == 1 ? 'left' : 'right');
23 23
 }
24 24
 
25 25
 
26 26
 function altsys_include_mymenu()
27 27
 {
28
-    global $xoopsModule , $xoopsConfig , $mydirname , $mydirpath , $mytrustdirname , $mytrustdirpath , $mymenu_fake_uri ;
28
+    global $xoopsModule, $xoopsConfig, $mydirname, $mydirpath, $mytrustdirname, $mytrustdirpath, $mymenu_fake_uri;
29 29
 
30 30
     $mymenu_find_paths = array(
31
-        $mydirpath.'/admin/mymenu.php' ,
32
-        $mydirpath.'/mymenu.php' ,
33
-        $mytrustdirpath.'/admin/mymenu.php' ,
31
+        $mydirpath.'/admin/mymenu.php',
32
+        $mydirpath.'/mymenu.php',
33
+        $mytrustdirpath.'/admin/mymenu.php',
34 34
         $mytrustdirpath.'/mymenu.php'
35
-    ) ;
35
+    );
36 36
 
37 37
     foreach ($mymenu_find_paths as $mymenu_find_path) {
38 38
         if (file_exists($mymenu_find_path)) {
39
-            include $mymenu_find_path ;
40
-            include_once __DIR__.'/adminmenu_functions.php' ;
41
-            altsys_adminmenu_insert_mymenu($xoopsModule) ;
42
-            altsys_adminmenu_hack_ft() ;
43
-            break ;
39
+            include $mymenu_find_path;
40
+            include_once __DIR__.'/adminmenu_functions.php';
41
+            altsys_adminmenu_insert_mymenu($xoopsModule);
42
+            altsys_adminmenu_hack_ft();
43
+            break;
44 44
         }
45 45
     }
46 46
 }
@@ -48,58 +48,58 @@  discard block
 block discarded – undo
48 48
 
49 49
 function altsys_include_language_file($type)
50 50
 {
51
-    $mylang = $GLOBALS['xoopsConfig']['language'] ;
51
+    $mylang = $GLOBALS['xoopsConfig']['language'];
52 52
 
53 53
     if (file_exists(XOOPS_ROOT_PATH.'/modules/altsys/language/'.$mylang.'/'.$type.'.php')) {
54
-        include_once XOOPS_ROOT_PATH.'/modules/altsys/language/'.$mylang.'/'.$type.'.php' ;
54
+        include_once XOOPS_ROOT_PATH.'/modules/altsys/language/'.$mylang.'/'.$type.'.php';
55 55
     } elseif (file_exists(XOOPS_TRUST_PATH.'/libs/altsys/language/'.$mylang.'/'.$type.'.php')) {
56
-        include_once XOOPS_TRUST_PATH.'/libs/altsys/language/'.$mylang.'/'.$type.'.php' ;
56
+        include_once XOOPS_TRUST_PATH.'/libs/altsys/language/'.$mylang.'/'.$type.'.php';
57 57
     } elseif (file_exists(XOOPS_ROOT_PATH.'/modules/altsys/language/english/'.$type.'.php')) {
58
-        include_once XOOPS_ROOT_PATH.'/modules/altsys/language/english/'.$type.'.php' ;
58
+        include_once XOOPS_ROOT_PATH.'/modules/altsys/language/english/'.$type.'.php';
59 59
     } elseif (file_exists(XOOPS_TRUST_PATH.'/libs/altsys/language/english/'.$type.'.php')) {
60
-        include_once XOOPS_TRUST_PATH.'/libs/altsys/language/english/'.$type.'.php' ;
60
+        include_once XOOPS_TRUST_PATH.'/libs/altsys/language/english/'.$type.'.php';
61 61
     }
62 62
 }
63 63
 
64 64
 
65
-define('ALTSYS_CORE_TYPE_X20', 1) ; // 2.0.0-2.0.13 and 2.0.x-JP
66
-define('ALTSYS_CORE_TYPE_X20S', 2) ; // 2.0.14- from xoops.org (Skalpa's S)
67
-define('ALTSYS_CORE_TYPE_ORE', 4) ; // ORETEKI by marijuana
68
-define('ALTSYS_CORE_TYPE_X22', 8) ; // 2.2 from xoops.org
69
-define('ALTSYS_CORE_TYPE_X23P', 10) ; // 2.3 from xoops.org (phppp's P)
70
-define('ALTSYS_CORE_TYPE_X25', 11) ; // 2.5 from xoops.org
71
-define('ALTSYS_CORE_TYPE_ICMS', 12) ; // ImpressCMS
72
-define('ALTSYS_CORE_TYPE_XCL21', 16) ; // XOOPS Cube 2.1 Legacy
65
+define('ALTSYS_CORE_TYPE_X20', 1); // 2.0.0-2.0.13 and 2.0.x-JP
66
+define('ALTSYS_CORE_TYPE_X20S', 2); // 2.0.14- from xoops.org (Skalpa's S)
67
+define('ALTSYS_CORE_TYPE_ORE', 4); // ORETEKI by marijuana
68
+define('ALTSYS_CORE_TYPE_X22', 8); // 2.2 from xoops.org
69
+define('ALTSYS_CORE_TYPE_X23P', 10); // 2.3 from xoops.org (phppp's P)
70
+define('ALTSYS_CORE_TYPE_X25', 11); // 2.5 from xoops.org
71
+define('ALTSYS_CORE_TYPE_ICMS', 12); // ImpressCMS
72
+define('ALTSYS_CORE_TYPE_XCL21', 16); // XOOPS Cube 2.1 Legacy
73 73
 
74 74
 function altsys_get_core_type()
75 75
 {
76
-    static $result = null ;
76
+    static $result = null;
77 77
 
78 78
     if (empty($result)) {
79 79
         if (defined('XOOPS_ORETEKI')) {
80
-            $result = ALTSYS_CORE_TYPE_ORE ;
80
+            $result = ALTSYS_CORE_TYPE_ORE;
81 81
         } elseif (defined('XOOPS_CUBE_LEGACY')) {
82
-            $result = ALTSYS_CORE_TYPE_XCL21 ;
82
+            $result = ALTSYS_CORE_TYPE_XCL21;
83 83
         } elseif (defined('ICMS_VERSION_NAME')) {
84
-            $result = ALTSYS_CORE_TYPE_ICMS ;
84
+            $result = ALTSYS_CORE_TYPE_ICMS;
85 85
         } elseif (strstr(XOOPS_VERSION, 'JP')) {
86
-            $result = ALTSYS_CORE_TYPE_X20 ;
86
+            $result = ALTSYS_CORE_TYPE_X20;
87 87
         } else {
88
-            $versions = array_map('intval', explode('.', preg_replace('/[^0-9.]/', '', XOOPS_VERSION))) ;
88
+            $versions = array_map('intval', explode('.', preg_replace('/[^0-9.]/', '', XOOPS_VERSION)));
89 89
             if ($versions[0] == 2 && $versions[1] == 2) {
90
-                $result = ALTSYS_CORE_TYPE_X22 ;
90
+                $result = ALTSYS_CORE_TYPE_X22;
91 91
             } elseif ($versions[0] == 2 && $versions[1] == 0 && $versions[2] > 13) {
92
-                $result = ALTSYS_CORE_TYPE_X20S ;
92
+                $result = ALTSYS_CORE_TYPE_X20S;
93 93
             } elseif ($versions[0] == 2 && $versions[1] >= 5) {
94
-                $result = ALTSYS_CORE_TYPE_X25 ;
94
+                $result = ALTSYS_CORE_TYPE_X25;
95 95
             } elseif ($versions[0] == 2 && $versions[1] > 2) {
96
-                $result = ALTSYS_CORE_TYPE_X23P ;
96
+                $result = ALTSYS_CORE_TYPE_X23P;
97 97
             } else {
98
-                $result = ALTSYS_CORE_TYPE_X20 ;
98
+                $result = ALTSYS_CORE_TYPE_X20;
99 99
             }
100 100
         }
101 101
     }
102
-    return $result ;
102
+    return $result;
103 103
 }
104 104
 
105 105
 
@@ -113,36 +113,36 @@  discard block
 block discarded – undo
113 113
         case ALTSYS_CORE_TYPE_X23P :
114 114
         case ALTSYS_CORE_TYPE_ICMS :
115 115
         default :
116
-            return XOOPS_URL.'/modules/system/admin.php?fct=preferences&op=showmod&mod='.$mid ;
116
+            return XOOPS_URL.'/modules/system/admin.php?fct=preferences&op=showmod&mod='.$mid;
117 117
         case ALTSYS_CORE_TYPE_XCL21 :
118
-            return XOOPS_URL.'/modules/legacy/admin/index.php?action=PreferenceEdit&confmod_id='.$mid ;
118
+            return XOOPS_URL.'/modules/legacy/admin/index.php?action=PreferenceEdit&confmod_id='.$mid;
119 119
     }
120 120
 }
121 121
 
122 122
 
123 123
 function altsys_template_touch($tpl_id)
124 124
 {
125
-    if (in_array(altsys_get_core_type(), array( ALTSYS_CORE_TYPE_X20S, ALTSYS_CORE_TYPE_X23P, ALTSYS_CORE_TYPE_X25 ))) {
125
+    if (in_array(altsys_get_core_type(), array(ALTSYS_CORE_TYPE_X20S, ALTSYS_CORE_TYPE_X23P, ALTSYS_CORE_TYPE_X25))) {
126 126
         // need to delete all files under templates_c/
127
-        altsys_clear_templates_c() ;
127
+        altsys_clear_templates_c();
128 128
     } else {
129 129
         // just touch the template
130
-        xoops_template_touch($tpl_id) ;
130
+        xoops_template_touch($tpl_id);
131 131
     }
132 132
 }
133 133
 
134 134
 
135 135
 function altsys_clear_templates_c()
136 136
 {
137
-    $dh = opendir(XOOPS_COMPILE_PATH) ;
137
+    $dh = opendir(XOOPS_COMPILE_PATH);
138 138
     while ($file = readdir($dh)) {
139 139
         if (substr($file, 0, 1) == '.') {
140
-            continue ;
140
+            continue;
141 141
         }
142 142
         if (substr($file, -4) != '.php') {
143
-            continue ;
143
+            continue;
144 144
         }
145
-        @unlink(XOOPS_COMPILE_PATH.'/'.$file) ;
145
+        @unlink(XOOPS_COMPILE_PATH.'/'.$file);
146 146
     }
147
-    closedir($dh) ;
147
+    closedir($dh);
148 148
 }
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/include/autoupdate_from_d3module.inc.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,33 +1,33 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (! $xoopsConfig['theme_fromfile']) {
4
-    return ;
3
+if (!$xoopsConfig['theme_fromfile']) {
4
+    return;
5 5
 }
6 6
 
7 7
 // templates/ under modules
8 8
 // $tplsadmin_autoupdate_path = XOOPS_THEME_PATH . '/' . $xoopsConfig['theme_set'] . '/templates' ;
9 9
 
10
-if (! is_array(@$tplsadmin_autoupdate_mydirnames)) {
11
-    return ;
10
+if (!is_array(@$tplsadmin_autoupdate_mydirnames)) {
11
+    return;
12 12
 }
13 13
 
14 14
 foreach ($tplsadmin_autoupdate_mydirnames as $tplsadmin_mydirname) {
15
-    $tplsadmin_mydirname = preg_replace('/[^a-zA-Z0-9_-]/', '', $tplsadmin_mydirname) ;
16
-    require XOOPS_ROOT_PATH . '/modules/' . $tplsadmin_mydirname . '/mytrustdirname.php' ;
17
-    $altsys_mid_path = $mytrustdirname == 'altsys' ? '/libs/' : '/modules/' ;
18
-    $tplsadmin_autoupdate_path = XOOPS_TRUST_PATH . $altsys_mid_path . $mytrustdirname . '/templates' ;
15
+    $tplsadmin_mydirname = preg_replace('/[^a-zA-Z0-9_-]/', '', $tplsadmin_mydirname);
16
+    require XOOPS_ROOT_PATH.'/modules/'.$tplsadmin_mydirname.'/mytrustdirname.php';
17
+    $altsys_mid_path = $mytrustdirname == 'altsys' ? '/libs/' : '/modules/';
18
+    $tplsadmin_autoupdate_path = XOOPS_TRUST_PATH.$altsys_mid_path.$mytrustdirname.'/templates';
19 19
 
20 20
     // modules
21
-    if ($handler = @opendir($tplsadmin_autoupdate_path . '/')) {
21
+    if ($handler = @opendir($tplsadmin_autoupdate_path.'/')) {
22 22
         while (($file = readdir($handler)) !== false) {
23
-            $file_path = $tplsadmin_autoupdate_path . '/' . $file ;
23
+            $file_path = $tplsadmin_autoupdate_path.'/'.$file;
24 24
             if (is_file($file_path)) {
25 25
                 $mtime = (int)(@filemtime($file_path));
26
-                $tpl_file = $tplsadmin_mydirname . '_' . $file ;
27
-                list($count) = $xoopsDB->fetchRow($xoopsDB->query('SELECT COUNT(*) FROM ' . $xoopsDB->prefix('tplfile') . " WHERE tpl_tplset='" . addslashes($xoopsConfig['template_set']) . "' AND tpl_file='" . addslashes($tpl_file) . "' AND tpl_lastmodified >= $mtime")) ;
26
+                $tpl_file = $tplsadmin_mydirname.'_'.$file;
27
+                list($count) = $xoopsDB->fetchRow($xoopsDB->query('SELECT COUNT(*) FROM '.$xoopsDB->prefix('tplfile')." WHERE tpl_tplset='".addslashes($xoopsConfig['template_set'])."' AND tpl_file='".addslashes($tpl_file)."' AND tpl_lastmodified >= $mtime"));
28 28
                 if ($count <= 0) {
29
-                    include_once XOOPS_TRUST_PATH.'/libs/altsys/include/tpls_functions.php' ;
30
-                    tplsadmin_import_data($xoopsConfig['template_set'], $tpl_file, implode('', file($file_path)), $mtime) ;
29
+                    include_once XOOPS_TRUST_PATH.'/libs/altsys/include/tpls_functions.php';
30
+                    tplsadmin_import_data($xoopsConfig['template_set'], $tpl_file, implode('', file($file_path)), $mtime);
31 31
                 }
32 32
             }
33 33
         }
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/include/adminmenu_functions.php 1 patch
Spacing   +132 added lines, -132 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
1 1
 <?php
2
-require_once dirname(__DIR__).'/class/altsysUtils.class.php' ;
2
+require_once dirname(__DIR__).'/class/altsysUtils.class.php';
3 3
 
4
-define('ALTSYS_ADMINMENU_FILE', XOOPS_CACHE_PATH.'/adminmenu.php') ;
5
-define('ALTSYS_ADMINMENU_HACK_NONE', 0) ;
6
-define('ALTSYS_ADMINMENU_HACK_2COL', 1) ;
7
-define('ALTSYS_ADMINMENU_HACK_NOIMG', 2) ;
8
-define('ALTSYS_ADMINMENU_HACK_XCSTY', 3) ;
4
+define('ALTSYS_ADMINMENU_FILE', XOOPS_CACHE_PATH.'/adminmenu.php');
5
+define('ALTSYS_ADMINMENU_HACK_NONE', 0);
6
+define('ALTSYS_ADMINMENU_HACK_2COL', 1);
7
+define('ALTSYS_ADMINMENU_HACK_NOIMG', 2);
8
+define('ALTSYS_ADMINMENU_HACK_XCSTY', 3);
9 9
 
10 10
 
11 11
 //
@@ -13,73 +13,73 @@  discard block
 block discarded – undo
13 13
 //
14 14
 function altsys_adminmenu_insert_mymenu(&$module)
15 15
 {
16
-    global $altsysModuleConfig ;
16
+    global $altsysModuleConfig;
17 17
 
18 18
     if (empty($altsysModuleConfig['adminmenu_insert_mymenu'])) {
19
-        return ;
19
+        return;
20 20
     }
21 21
 
22 22
     if (altsys_get_core_type() < ALTSYS_CORE_TYPE_ORE) {
23
-        altsys_adminmenu_insert_mymenu_x20($module) ;
23
+        altsys_adminmenu_insert_mymenu_x20($module);
24 24
     }
25 25
 }
26 26
 
27 27
 function altsys_adminmenu_insert_mymenu_x20(&$module)
28 28
 {
29 29
     // read
30
-    if (! file_exists(ALTSYS_ADMINMENU_FILE)) {
31
-        redirect_header(XOOPS_URL.'/admin.php', 1, 'Rebuild adminmenu') ;
32
-        exit ;
30
+    if (!file_exists(ALTSYS_ADMINMENU_FILE)) {
31
+        redirect_header(XOOPS_URL.'/admin.php', 1, 'Rebuild adminmenu');
32
+        exit;
33 33
     }
34
-    $not_inside_cp_functions = true ;
35
-    include ALTSYS_ADMINMENU_FILE ;
34
+    $not_inside_cp_functions = true;
35
+    include ALTSYS_ADMINMENU_FILE;
36 36
 
37
-    $dirname = $module->getVar('dirname') ;
38
-    $mid = $module->getVar('mid') ;
39
-    $anchor = '<!-- ALTSYS ANCHOR '.$dirname.' -->' ;
37
+    $dirname = $module->getVar('dirname');
38
+    $mid = $module->getVar('mid');
39
+    $anchor = '<!-- ALTSYS ANCHOR '.$dirname.' -->';
40 40
 
41 41
     // fetch popup_no
42 42
     if (empty($xoops_admin_menu_ft[$mid])) {
43
-        return ;
43
+        return;
44 44
     }
45
-    if (! preg_match('/popUpL(\d+)/', $xoops_admin_menu_ft[$mid], $regs)) {
46
-        return ;
45
+    if (!preg_match('/popUpL(\d+)/', $xoops_admin_menu_ft[$mid], $regs)) {
46
+        return;
47 47
     }
48 48
     $popup_no = (int)$regs[1];
49 49
 
50 50
     // replace
51
-    $search  = '<img src=\''.XOOPS_URL.'/images/pointer.gif\' width=\'8\' height=\'8\' alt=\'\' />&nbsp;<a href=\''.XOOPS_URL.'/modules/system/admin.php?fct=preferences&amp;op=showmod&amp;mod='.$mid.'\'' ;
52
-    $replace = $anchor.'<img src=\''.XOOPS_URL.'/images/pointer.gif\' width=\'8\' height=\'8\' alt=\'\' />&nbsp;<a href=\''.XOOPS_URL.'/modules/'.$dirname.'/admin/index.php?mode=admin&amp;lib=altsys&amp;page=mypreferences\'' ;
51
+    $search  = '<img src=\''.XOOPS_URL.'/images/pointer.gif\' width=\'8\' height=\'8\' alt=\'\' />&nbsp;<a href=\''.XOOPS_URL.'/modules/system/admin.php?fct=preferences&amp;op=showmod&amp;mod='.$mid.'\'';
52
+    $replace = $anchor.'<img src=\''.XOOPS_URL.'/images/pointer.gif\' width=\'8\' height=\'8\' alt=\'\' />&nbsp;<a href=\''.XOOPS_URL.'/modules/'.$dirname.'/admin/index.php?mode=admin&amp;lib=altsys&amp;page=mypreferences\'';
53 53
 
54 54
     // do replacement
55
-    $new_xoops_admin_menu_dv = preg_replace('#'.preg_quote($search).'#', $replace, $xoops_admin_menu_dv) ;
55
+    $new_xoops_admin_menu_dv = preg_replace('#'.preg_quote($search).'#', $replace, $xoops_admin_menu_dv);
56 56
 
57 57
     if ($xoops_admin_menu_dv == $new_xoops_admin_menu_dv) {
58
-        return ;
58
+        return;
59 59
     }
60
-    $xoops_admin_menu_dv = $new_xoops_admin_menu_dv ;
60
+    $xoops_admin_menu_dv = $new_xoops_admin_menu_dv;
61 61
 
62
-    $insert = '' ;
62
+    $insert = '';
63 63
 
64 64
     // insert blocksadmin
65 65
     if ($dirname != 'altsys') {
66
-        $blocksadmin_title = defined('_MD_A_MYMENU_MYBLOCKSADMIN') ? _MD_A_MYMENU_MYBLOCKSADMIN : 'blocksadmin' ;
67
-        $insert .= '<img src=\''.XOOPS_URL.'/images/pointer.gif\' width=\'8\' height=\'8\' alt=\'\' />&nbsp;<a href=\''.XOOPS_URL.'/modules/'.$dirname.'/admin/index.php?mode=admin&amp;lib=altsys&amp;page=myblocksadmin\'>'.$blocksadmin_title.'</a><br />'."\n" ;
66
+        $blocksadmin_title = defined('_MD_A_MYMENU_MYBLOCKSADMIN') ? _MD_A_MYMENU_MYBLOCKSADMIN : 'blocksadmin';
67
+        $insert .= '<img src=\''.XOOPS_URL.'/images/pointer.gif\' width=\'8\' height=\'8\' alt=\'\' />&nbsp;<a href=\''.XOOPS_URL.'/modules/'.$dirname.'/admin/index.php?mode=admin&amp;lib=altsys&amp;page=myblocksadmin\'>'.$blocksadmin_title.'</a><br />'."\n";
68 68
     }
69 69
 
70 70
     // insert tplsadmin
71
-    $db =& XoopsDatabaseFactory::getDatabaseConnection() ;
72
-    list($count) = $db->fetchRow($db->query('SELECT COUNT(*) FROM ' . $db->prefix('tplfile') . " WHERE tpl_module='$dirname'")) ;
71
+    $db = & XoopsDatabaseFactory::getDatabaseConnection();
72
+    list($count) = $db->fetchRow($db->query('SELECT COUNT(*) FROM '.$db->prefix('tplfile')." WHERE tpl_module='$dirname'"));
73 73
     if ($count > 0) {
74
-        $tplsadmin_title = defined('_MD_A_MYMENU_MYTPLSADMIN') ? _MD_A_MYMENU_MYTPLSADMIN : 'tplsadmin' ;
75
-        $insert = '<img src=\''.XOOPS_URL.'/images/pointer.gif\' width=\'8\' height=\'8\' alt=\'\' />&nbsp;<a href=\''.XOOPS_URL.'/modules/'.$dirname.'/admin/index.php?mode=admin&amp;lib=altsys&amp;page=mytplsadmin\'>'.$tplsadmin_title.'</a><br />'."\n".$insert ;
74
+        $tplsadmin_title = defined('_MD_A_MYMENU_MYTPLSADMIN') ? _MD_A_MYMENU_MYTPLSADMIN : 'tplsadmin';
75
+        $insert = '<img src=\''.XOOPS_URL.'/images/pointer.gif\' width=\'8\' height=\'8\' alt=\'\' />&nbsp;<a href=\''.XOOPS_URL.'/modules/'.$dirname.'/admin/index.php?mode=admin&amp;lib=altsys&amp;page=mytplsadmin\'>'.$tplsadmin_title.'</a><br />'."\n".$insert;
76 76
     }
77 77
 
78 78
     // do insertion
79
-    $xoops_admin_menu_dv = preg_replace('#'.preg_quote($anchor).'#', $anchor.$insert, $xoops_admin_menu_dv) ;
79
+    $xoops_admin_menu_dv = preg_replace('#'.preg_quote($anchor).'#', $anchor.$insert, $xoops_admin_menu_dv);
80 80
 
81 81
     // write back
82
-    altsys_adminmenu_save_x20(array( 'xoops_admin_menu_js' => $xoops_admin_menu_js, 'xoops_admin_menu_ml' => $xoops_admin_menu_ml, 'xoops_admin_menu_sd' => $xoops_admin_menu_sd, 'xoops_admin_menu_ft' => $xoops_admin_menu_ft, 'xoops_admin_menu_dv' => $xoops_admin_menu_dv, 'altsys_adminmenu_ft_hacked' => (int)(@$altsys_adminmenu_ft_hacked), 'altsys_adminmenu_dv_updated' => true )) ;
82
+    altsys_adminmenu_save_x20(array('xoops_admin_menu_js' => $xoops_admin_menu_js, 'xoops_admin_menu_ml' => $xoops_admin_menu_ml, 'xoops_admin_menu_sd' => $xoops_admin_menu_sd, 'xoops_admin_menu_ft' => $xoops_admin_menu_ft, 'xoops_admin_menu_dv' => $xoops_admin_menu_dv, 'altsys_adminmenu_ft_hacked' => (int)(@$altsys_adminmenu_ft_hacked), 'altsys_adminmenu_dv_updated' => true));
83 83
 }
84 84
 
85 85
 //
@@ -87,184 +87,184 @@  discard block
 block discarded – undo
87 87
 //
88 88
 function altsys_adminmenu_hack_ft()
89 89
 {
90
-    global $altsysModuleConfig ;
90
+    global $altsysModuleConfig;
91 91
 
92 92
     if (altsys_get_core_type() >= ALTSYS_CORE_TYPE_ORE) {
93
-        return ;
93
+        return;
94 94
     }
95 95
     if (empty($altsysModuleConfig['adminmenu_hack_ft'])) {
96
-        return ;
96
+        return;
97 97
     }
98 98
 
99 99
     if ($altsysModuleConfig['adminmenu_hack_ft'] == ALTSYS_ADMINMENU_HACK_2COL) {
100
-        altsys_adminmenu_hack_ft_2col_x20() ;
100
+        altsys_adminmenu_hack_ft_2col_x20();
101 101
     } elseif ($altsysModuleConfig['adminmenu_hack_ft'] == ALTSYS_ADMINMENU_HACK_NOIMG) {
102
-        altsys_adminmenu_hack_ft_noimg_x20() ;
102
+        altsys_adminmenu_hack_ft_noimg_x20();
103 103
     } elseif ($altsysModuleConfig['adminmenu_hack_ft'] == ALTSYS_ADMINMENU_HACK_XCSTY) {
104
-        altsys_adminmenu_hack_ft_xcsty_x20() ;
104
+        altsys_adminmenu_hack_ft_xcsty_x20();
105 105
     }
106 106
 }
107 107
 
108 108
 function altsys_adminmenu_hack_ft_2col_x20()
109 109
 {
110 110
     // read
111
-    if (! file_exists(ALTSYS_ADMINMENU_FILE)) {
112
-        redirect_header(XOOPS_URL.'/admin.php', 1, 'Rebuild adminmenu') ;
113
-        exit ;
111
+    if (!file_exists(ALTSYS_ADMINMENU_FILE)) {
112
+        redirect_header(XOOPS_URL.'/admin.php', 1, 'Rebuild adminmenu');
113
+        exit;
114 114
     }
115
-    $not_inside_cp_functions = true ;
116
-    include ALTSYS_ADMINMENU_FILE ;
115
+    $not_inside_cp_functions = true;
116
+    include ALTSYS_ADMINMENU_FILE;
117 117
 
118 118
     // check previous hack
119
-    if (! empty($altsys_adminmenu_ft_hacked)) {
119
+    if (!empty($altsys_adminmenu_ft_hacked)) {
120 120
         if ($altsys_adminmenu_ft_hacked == ALTSYS_ADMINMENU_HACK_2COL) {
121 121
             // skip
122
-            return ;
122
+            return;
123 123
         } else {
124 124
             // rebuild adminmenu
125
-            require_once XOOPS_ROOT_PATH.'/include/cp_functions.php' ;
126
-            xoops_module_write_admin_menu(xoops_module_get_admin_menu()) ;
125
+            require_once XOOPS_ROOT_PATH.'/include/cp_functions.php';
126
+            xoops_module_write_admin_menu(xoops_module_get_admin_menu());
127 127
             // backup $xoops_admin_menu_dv
128
-            $backup_admin_menu_dv = $xoops_admin_menu_dv ;
128
+            $backup_admin_menu_dv = $xoops_admin_menu_dv;
129 129
             // include new adminmenu
130
-            include ALTSYS_ADMINMENU_FILE ;
130
+            include ALTSYS_ADMINMENU_FILE;
131 131
             // restore $xoops_admin_menu_dv
132
-            $xoops_admin_menu_dv = $backup_admin_menu_dv ;
132
+            $xoops_admin_menu_dv = $backup_admin_menu_dv;
133 133
         }
134 134
     }
135 135
 
136
-    $search  = ' alt=\'\' /></a><br />' ;
137
-    $replace_fmt = ' alt="%s" /></a>' ;
136
+    $search  = ' alt=\'\' /></a><br />';
137
+    $replace_fmt = ' alt="%s" /></a>';
138 138
 
139
-    $is_left = true ;
140
-    $module_handler =& xoops_gethandler('module') ;
141
-    $mids = array_keys($xoops_admin_menu_ft) ;
142
-    $last_mid = $mids[count($mids) - 1 ] ;
139
+    $is_left = true;
140
+    $module_handler = & xoops_gethandler('module');
141
+    $mids = array_keys($xoops_admin_menu_ft);
142
+    $last_mid = $mids[count($mids) - 1];
143 143
     foreach ($mids as $mid) {
144
-        $module =& $module_handler->get($mid) ;
145
-        $new_menu_ft = preg_replace('#'.preg_quote($search).'#', sprintf($replace_fmt, $module->getVar('name')), $xoops_admin_menu_ft[$mid]) ;
144
+        $module = & $module_handler->get($mid);
145
+        $new_menu_ft = preg_replace('#'.preg_quote($search).'#', sprintf($replace_fmt, $module->getVar('name')), $xoops_admin_menu_ft[$mid]);
146 146
         if ($is_left) {
147 147
             if ($mid == $last_mid) {
148
-                $xoops_admin_menu_ft[$mid] = $new_menu_ft . '</td><td>' ;
148
+                $xoops_admin_menu_ft[$mid] = $new_menu_ft.'</td><td>';
149 149
             } else {
150
-                $left_body = $new_menu_ft ;
151
-                $left_key = $mid ;
152
-                $xoops_admin_menu_ml[$mid] = str_replace(',105);', ',85);', $xoops_admin_menu_ml[$mid]) ;
150
+                $left_body = $new_menu_ft;
151
+                $left_key = $mid;
152
+                $xoops_admin_menu_ml[$mid] = str_replace(',105);', ',85);', $xoops_admin_menu_ml[$mid]);
153 153
             }
154 154
         } else {
155
-            $xoops_admin_menu_ft[$mid] = $left_body . '</td><td>' . $new_menu_ft ;
156
-            unset($xoops_admin_menu_ft[$left_key]) ;
157
-            $xoops_admin_menu_ml[$mid] = str_replace(',105);', ',185);', $xoops_admin_menu_ml[$mid]) ;
155
+            $xoops_admin_menu_ft[$mid] = $left_body.'</td><td>'.$new_menu_ft;
156
+            unset($xoops_admin_menu_ft[$left_key]);
157
+            $xoops_admin_menu_ml[$mid] = str_replace(',105);', ',185);', $xoops_admin_menu_ml[$mid]);
158 158
         }
159
-        $is_left = ! $is_left ;
159
+        $is_left = !$is_left;
160 160
     }
161 161
 
162 162
     // write back
163
-    altsys_adminmenu_save_x20(array( 'xoops_admin_menu_js' => $xoops_admin_menu_js, 'xoops_admin_menu_ml' => $xoops_admin_menu_ml, 'xoops_admin_menu_sd' => $xoops_admin_menu_sd, 'xoops_admin_menu_ft' => $xoops_admin_menu_ft, 'xoops_admin_menu_dv' => $xoops_admin_menu_dv, 'altsys_adminmenu_ft_hacked' => ALTSYS_ADMINMENU_HACK_2COL )) ;
163
+    altsys_adminmenu_save_x20(array('xoops_admin_menu_js' => $xoops_admin_menu_js, 'xoops_admin_menu_ml' => $xoops_admin_menu_ml, 'xoops_admin_menu_sd' => $xoops_admin_menu_sd, 'xoops_admin_menu_ft' => $xoops_admin_menu_ft, 'xoops_admin_menu_dv' => $xoops_admin_menu_dv, 'altsys_adminmenu_ft_hacked' => ALTSYS_ADMINMENU_HACK_2COL));
164 164
 }
165 165
 
166 166
 
167 167
 function altsys_adminmenu_hack_ft_noimg_x20()
168 168
 {
169 169
     // read
170
-    if (! file_exists(ALTSYS_ADMINMENU_FILE)) {
171
-        redirect_header(XOOPS_URL.'/admin.php', 1, 'Rebuild adminmenu') ;
172
-        exit ;
170
+    if (!file_exists(ALTSYS_ADMINMENU_FILE)) {
171
+        redirect_header(XOOPS_URL.'/admin.php', 1, 'Rebuild adminmenu');
172
+        exit;
173 173
     }
174
-    $not_inside_cp_functions = true ;
175
-    include ALTSYS_ADMINMENU_FILE ;
174
+    $not_inside_cp_functions = true;
175
+    include ALTSYS_ADMINMENU_FILE;
176 176
 
177 177
     // check previous hack
178
-    if (! empty($altsys_adminmenu_ft_hacked)) {
178
+    if (!empty($altsys_adminmenu_ft_hacked)) {
179 179
         if ($altsys_adminmenu_ft_hacked == ALTSYS_ADMINMENU_HACK_NOIMG) {
180 180
             // skip
181
-            return ;
181
+            return;
182 182
         } else {
183 183
             // rebuild adminmenu
184
-            require_once XOOPS_ROOT_PATH.'/include/cp_functions.php' ;
185
-            xoops_module_write_admin_menu(xoops_module_get_admin_menu()) ;
184
+            require_once XOOPS_ROOT_PATH.'/include/cp_functions.php';
185
+            xoops_module_write_admin_menu(xoops_module_get_admin_menu());
186 186
             // backup $xoops_admin_menu_dv
187
-            $backup_admin_menu_dv = $xoops_admin_menu_dv ;
187
+            $backup_admin_menu_dv = $xoops_admin_menu_dv;
188 188
             // include new adminmenu
189
-            include ALTSYS_ADMINMENU_FILE ;
189
+            include ALTSYS_ADMINMENU_FILE;
190 190
             // restore $xoops_admin_menu_dv
191
-            $xoops_admin_menu_dv = $backup_admin_menu_dv ;
191
+            $xoops_admin_menu_dv = $backup_admin_menu_dv;
192 192
         }
193 193
     }
194 194
 
195
-    $module_handler =& xoops_gethandler('module') ;
196
-    $mids = array_keys($xoops_admin_menu_ft) ;
195
+    $module_handler = & xoops_gethandler('module');
196
+    $mids = array_keys($xoops_admin_menu_ft);
197 197
     foreach ($mids as $mid) {
198
-        $module =& $module_handler->get($mid) ;
199
-        $xoops_admin_menu_ft[$mid] = preg_replace('/\<img src\=.*$/', $module->getVar('name').'</a>', $xoops_admin_menu_ft[$mid]) ;
200
-        $xoops_admin_menu_ft[$mid] = '<div style="text-align:'._GLOBAL_LEFT.';background-color:#CCC;" title="'.$module->getVar('dirname').'">'.$xoops_admin_menu_ft[$mid].'</div>' ;
201
-        $xoops_admin_menu_ml[$mid] = str_replace(',105);', ',45);', $xoops_admin_menu_ml[$mid]) ;
198
+        $module = & $module_handler->get($mid);
199
+        $xoops_admin_menu_ft[$mid] = preg_replace('/\<img src\=.*$/', $module->getVar('name').'</a>', $xoops_admin_menu_ft[$mid]);
200
+        $xoops_admin_menu_ft[$mid] = '<div style="text-align:'._GLOBAL_LEFT.';background-color:#CCC;" title="'.$module->getVar('dirname').'">'.$xoops_admin_menu_ft[$mid].'</div>';
201
+        $xoops_admin_menu_ml[$mid] = str_replace(',105);', ',45);', $xoops_admin_menu_ml[$mid]);
202 202
     }
203 203
 
204 204
     // write back
205
-    altsys_adminmenu_save_x20(array( 'xoops_admin_menu_js' => $xoops_admin_menu_js, 'xoops_admin_menu_ml' => $xoops_admin_menu_ml, 'xoops_admin_menu_sd' => $xoops_admin_menu_sd, 'xoops_admin_menu_ft' => $xoops_admin_menu_ft, 'xoops_admin_menu_dv' => $xoops_admin_menu_dv, 'altsys_adminmenu_ft_hacked' => ALTSYS_ADMINMENU_HACK_NOIMG )) ;
205
+    altsys_adminmenu_save_x20(array('xoops_admin_menu_js' => $xoops_admin_menu_js, 'xoops_admin_menu_ml' => $xoops_admin_menu_ml, 'xoops_admin_menu_sd' => $xoops_admin_menu_sd, 'xoops_admin_menu_ft' => $xoops_admin_menu_ft, 'xoops_admin_menu_dv' => $xoops_admin_menu_dv, 'altsys_adminmenu_ft_hacked' => ALTSYS_ADMINMENU_HACK_NOIMG));
206 206
 }
207 207
 
208 208
 
209 209
 function altsys_adminmenu_hack_ft_xcsty_x20()
210 210
 {
211 211
     // read
212
-    if (! file_exists(ALTSYS_ADMINMENU_FILE)) {
213
-        redirect_header(XOOPS_URL.'/admin.php', 1, 'Rebuild adminmenu') ;
214
-        exit ;
212
+    if (!file_exists(ALTSYS_ADMINMENU_FILE)) {
213
+        redirect_header(XOOPS_URL.'/admin.php', 1, 'Rebuild adminmenu');
214
+        exit;
215 215
     }
216
-    $not_inside_cp_functions = true ;
217
-    include ALTSYS_ADMINMENU_FILE ;
216
+    $not_inside_cp_functions = true;
217
+    include ALTSYS_ADMINMENU_FILE;
218 218
 
219 219
     // check previous hack
220
-    if (! empty($altsys_adminmenu_ft_hacked)) {
220
+    if (!empty($altsys_adminmenu_ft_hacked)) {
221 221
         if ($altsys_adminmenu_ft_hacked == ALTSYS_ADMINMENU_HACK_XCSTY && empty($altsys_adminmenu_dv_updated)) {
222 222
             // skip
223
-            return ;
223
+            return;
224 224
         } else {
225 225
             // rebuild adminmenu
226
-            require_once XOOPS_ROOT_PATH.'/include/cp_functions.php' ;
227
-            $fp = fopen(ALTSYS_ADMINMENU_FILE, 'wb') ;
228
-            fwrite($fp, xoops_module_get_admin_menu()) ;
229
-            fclose($fp) ;
226
+            require_once XOOPS_ROOT_PATH.'/include/cp_functions.php';
227
+            $fp = fopen(ALTSYS_ADMINMENU_FILE, 'wb');
228
+            fwrite($fp, xoops_module_get_admin_menu());
229
+            fclose($fp);
230 230
             // backup $xoops_admin_menu_dv
231
-            $backup_admin_menu_dv = $xoops_admin_menu_dv ;
231
+            $backup_admin_menu_dv = $xoops_admin_menu_dv;
232 232
             // include new adminmenu
233
-            include ALTSYS_ADMINMENU_FILE ;
233
+            include ALTSYS_ADMINMENU_FILE;
234 234
             // restore $xoops_admin_menu_dv
235
-            $xoops_admin_menu_dv = $backup_admin_menu_dv ;
235
+            $xoops_admin_menu_dv = $backup_admin_menu_dv;
236 236
         }
237 237
     }
238 238
 
239
-    $module_handler =& xoops_gethandler('module') ;
240
-    $mids = array_keys($xoops_admin_menu_ft) ;
239
+    $module_handler = & xoops_gethandler('module');
240
+    $mids = array_keys($xoops_admin_menu_ft);
241 241
     foreach ($mids as $mid) {
242
-        $module =& $module_handler->get($mid) ;
243
-        $submenuitems = array() ;
242
+        $module = & $module_handler->get($mid);
243
+        $submenuitems = array();
244 244
         if (preg_match('/popUpL\d+/', $xoops_admin_menu_ft[$mid], $regs)) {
245
-            $popup = $regs[0] ;
246
-            preg_match_all('#\<a href.*'.$popup.'\(\).*\</a>#U', $xoops_admin_menu_dv, $regs) ;
245
+            $popup = $regs[0];
246
+            preg_match_all('#\<a href.*'.$popup.'\(\).*\</a>#U', $xoops_admin_menu_dv, $regs);
247 247
             foreach ($regs[0] as $submenuitem) {
248
-                $submenuitems[] = str_replace($popup.'();', '', $submenuitem) ;
248
+                $submenuitems[] = str_replace($popup.'();', '', $submenuitem);
249 249
             }
250 250
         } else {
251
-            return ;
251
+            return;
252 252
         }
253 253
         // module icon
254 254
         if (preg_match('#\<img .*/\>#U', $xoops_admin_menu_ft[$mid], $regs)) {
255
-            $icon_img = str_replace("alt=''", 'alt="'.$module->getVar('name').'"', $regs[0]) ;
255
+            $icon_img = str_replace("alt=''", 'alt="'.$module->getVar('name').'"', $regs[0]);
256 256
         } else {
257
-            $icon_img = '' ;
257
+            $icon_img = '';
258 258
         }
259 259
         // version number
260
-        $icon_img .= '<span class="version" style="">' . sprintf('%.2f', $module->getVar('version') / 100.0) . '</span>' ;
261
-        $newline = preg_replace('/ onmouseover.*$/', '', $xoops_admin_menu_ft[$mid]) ;
262
-        $newline = "\n".'<!-- '.$popup.' --><div id="adminmenu_ft'.$mid.'" style="text-align:'._GLOBAL_LEFT.';background-color:#CCC;" title="'.$module->getVar('dirname').'"><a id="adminmenu_ftpoint'.$mid.'" href="javascript:void(0);" onclick="submenuToggle('.$mid.');">+</a> '.$newline.'>'.$module->getVar('name').'</a></div><div id="adminmenu_ftsub'.$mid.'" style="display:none;"><ul>' ;
260
+        $icon_img .= '<span class="version" style="">'.sprintf('%.2f', $module->getVar('version') / 100.0).'</span>';
261
+        $newline = preg_replace('/ onmouseover.*$/', '', $xoops_admin_menu_ft[$mid]);
262
+        $newline = "\n".'<!-- '.$popup.' --><div id="adminmenu_ft'.$mid.'" style="text-align:'._GLOBAL_LEFT.';background-color:#CCC;" title="'.$module->getVar('dirname').'"><a id="adminmenu_ftpoint'.$mid.'" href="javascript:void(0);" onclick="submenuToggle('.$mid.');">+</a> '.$newline.'>'.$module->getVar('name').'</a></div><div id="adminmenu_ftsub'.$mid.'" style="display:none;"><ul>';
263 263
         foreach ($submenuitems as $submenuitem) {
264
-            $newline .= '<li>'.$submenuitem.'</li>' ;
264
+            $newline .= '<li>'.$submenuitem.'</li>';
265 265
         }
266
-        $newline .= '</ul>'.$icon_img.'</div>' ;
267
-        $xoops_admin_menu_ft[$mid] = $newline ;
266
+        $newline .= '</ul>'.$icon_img.'</div>';
267
+        $xoops_admin_menu_ft[$mid] = $newline;
268 268
     }
269 269
 
270 270
     $xoops_admin_menu_js = "
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 	}" ;
281 281
 
282 282
     // write back
283
-    altsys_adminmenu_save_x20(array( 'xoops_admin_menu_js' => $xoops_admin_menu_js, 'xoops_admin_menu_ml' => array(), 'xoops_admin_menu_sd' => array(), 'xoops_admin_menu_ft' => $xoops_admin_menu_ft, 'xoops_admin_menu_dv' => $xoops_admin_menu_dv, 'altsys_adminmenu_ft_hacked' => ALTSYS_ADMINMENU_HACK_XCSTY )) ;
283
+    altsys_adminmenu_save_x20(array('xoops_admin_menu_js' => $xoops_admin_menu_js, 'xoops_admin_menu_ml' => array(), 'xoops_admin_menu_sd' => array(), 'xoops_admin_menu_ft' => $xoops_admin_menu_ft, 'xoops_admin_menu_dv' => $xoops_admin_menu_dv, 'altsys_adminmenu_ft_hacked' => ALTSYS_ADMINMENU_HACK_XCSTY));
284 284
 }
285 285
 
286 286
 
@@ -291,18 +291,18 @@  discard block
 block discarded – undo
291 291
 function altsys_adminmenu_save_x20($xoops_admin_vars)
292 292
 {
293 293
     // variable definitions
294
-    ob_start() ;
295
-    echo "<?php\n// modified by altsys\nif( ! defined('XOOPS_ROOT_PATH') ) exit ;\n" ;
294
+    ob_start();
295
+    echo "<?php\n// modified by altsys\nif( ! defined('XOOPS_ROOT_PATH') ) exit ;\n";
296 296
     foreach ($xoops_admin_vars as $key => $val) {
297
-        echo '$' . $key . " = \n" ;
298
-        @var_export($val) ;
299
-        echo " ;\n" ;
297
+        echo '$'.$key." = \n";
298
+        @var_export($val);
299
+        echo " ;\n";
300 300
     }
301
-    $output = ob_get_contents() ;
302
-    ob_end_clean() ;
301
+    $output = ob_get_contents();
302
+    ob_end_clean();
303 303
 
304 304
     // embedding logics
305
-    if (in_array(@$xoops_admin_vars['altsys_adminmenu_ft_hacked'], array( ALTSYS_ADMINMENU_HACK_NOIMG, ALTSYS_ADMINMENU_HACK_XCSTY ))) {
305
+    if (in_array(@$xoops_admin_vars['altsys_adminmenu_ft_hacked'], array(ALTSYS_ADMINMENU_HACK_NOIMG, ALTSYS_ADMINMENU_HACK_XCSTY))) {
306 306
         $output .= '
307 307
 
308 308
 if( is_object( @$GLOBALS["xoopsModule"] ) && empty( $not_inside_cp_functions ) ) {
@@ -317,13 +317,13 @@  discard block
 block discarded – undo
317 317
     }
318 318
 
319 319
     // termination
320
-    $output .= "\n\n?>" ;
320
+    $output .= "\n\n?>";
321 321
 
322 322
     // replace into XOOPS_URL
323
-    $output = str_replace(XOOPS_URL, "'.XOOPS_URL.'", $output) ;
323
+    $output = str_replace(XOOPS_URL, "'.XOOPS_URL.'", $output);
324 324
 
325 325
     // output
326
-    $fp = fopen(ALTSYS_ADMINMENU_FILE, 'wb') ;
327
-    fwrite($fp, $output) ;
328
-    fclose($fp) ;
326
+    $fp = fopen(ALTSYS_ADMINMENU_FILE, 'wb');
327
+    fwrite($fp, $output);
328
+    fclose($fp);
329 329
 }
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/blocks.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,21 +1,21 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-$mytrustdirname = basename(__DIR__) ;
4
-$mytrustdirpath = __DIR__ ;
3
+$mytrustdirname = basename(__DIR__);
4
+$mytrustdirpath = __DIR__;
5 5
 
6 6
 // language files
7
-$language = empty($GLOBALS['xoopsConfig']['language']) ? 'english' : $GLOBALS['xoopsConfig']['language'] ;
7
+$language = empty($GLOBALS['xoopsConfig']['language']) ? 'english' : $GLOBALS['xoopsConfig']['language'];
8 8
 if (file_exists("$mydirpath/language/$language/blocks.php")) {
9 9
     // user customized language file (already read by class/xoopsblock.php etc)
10 10
     // include_once "$mydirpath/language/$language/blocks.php" ;
11 11
 } elseif (file_exists("$mytrustdirpath/language/$language/blocks_common.php")) {
12 12
     // default language file
13
-    include_once "$mytrustdirpath/language/$language/blocks_common.php" ;
14
-    include "$mytrustdirpath/language/$language/blocks_each.php" ;
13
+    include_once "$mytrustdirpath/language/$language/blocks_common.php";
14
+    include "$mytrustdirpath/language/$language/blocks_each.php";
15 15
 } else {
16 16
     // fallback english
17
-    include_once "$mytrustdirpath/language/english/blocks_common.php" ;
18
-    include "$mytrustdirpath/language/english/blocks_each.php" ;
17
+    include_once "$mytrustdirpath/language/english/blocks_common.php";
18
+    include "$mytrustdirpath/language/english/blocks_each.php";
19 19
 }
20 20
 
21
-require_once "$mytrustdirpath/blocks/block_functions.php" ;
21
+require_once "$mytrustdirpath/blocks/block_functions.php";
Please login to merge, or discard this patch.