Completed
Push — master ( 4d9699...f6489b )
by Michael
03:33
created
xoops_trust_path/libs/altsys/include/tpls_functions.php 1 patch
Spacing   +61 added lines, -61 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);
@@ -137,33 +137,33 @@  discard block
 block discarded – undo
137 137
 
138 138
     if (defined('ALTSYS_TPLSADMIN_BASEPATH')) {
139 139
         // Special hook
140
-        $path = ALTSYS_TPLSADMIN_BASEPATH.'/'.substr($tpl_file, strlen($dirname) + 1) ;
141
-    } elseif ($mytrustdirname || @include XOOPS_ROOT_PATH . '/modules/' . $dirname . '/mytrustdirname.php') {
140
+        $path = ALTSYS_TPLSADMIN_BASEPATH.'/'.substr($tpl_file, strlen($dirname) + 1);
141
+    } elseif ($mytrustdirname || @include XOOPS_ROOT_PATH.'/modules/'.$dirname.'/mytrustdirname.php') {
142 142
         // D3 module base
143
-        if (! empty($mytrustdirname)) {
144
-            $mid_path = $mytrustdirname == 'altsys' ? '/libs/' : '/modules/' ;
143
+        if (!empty($mytrustdirname)) {
144
+            $mid_path = $mytrustdirname == 'altsys' ? '/libs/' : '/modules/';
145 145
 
146
-            $path = XOOPS_TRUST_PATH.$mid_path.$mytrustdirname.'/templates/'.($type=='block'?'blocks/':'').substr($tpl_file, strlen($dirname) + 1) ;
146
+            $path = XOOPS_TRUST_PATH.$mid_path.$mytrustdirname.'/templates/'.($type == 'block' ? 'blocks/' : '').substr($tpl_file, strlen($dirname) + 1);
147 147
             //new for xcck etc.other trust_module
148
-            if (! file_exists($path)) {
149
-                $path = XOOPS_TRUST_PATH.$mid_path.$mytrustdirname.'/templates/'.($type=='block'?'blocks/':'').$tpl_file ;
150
-                if (! file_exists($path)) {
148
+            if (!file_exists($path)) {
149
+                $path = XOOPS_TRUST_PATH.$mid_path.$mytrustdirname.'/templates/'.($type == 'block' ? 'blocks/' : '').$tpl_file;
150
+                if (!file_exists($path)) {
151 151
                     $path = $basefilepath;
152 152
                 }
153 153
             }
154 154
         }
155 155
     }
156 156
 
157
-    return $path ;
157
+    return $path;
158 158
 }
159 159
 
160 160
 
161 161
 function tplsadmin_die($msg, $target_dirname = '', $wait = 2)
162 162
 {
163 163
     if (strtolower($_SERVER['REQUEST_METHOD']) === 'post') {
164
-        redirect_header('?mode=admin&lib=altsys&page=mytplsadmin&dirname='.$target_dirname, $wait, $msg) ;
165
-        exit ;
164
+        redirect_header('?mode=admin&lib=altsys&page=mytplsadmin&dirname='.$target_dirname, $wait, $msg);
165
+        exit;
166 166
     } else {
167
-        die($msg) ;
167
+        die($msg);
168 168
     }
169 169
 }
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/include/mygrouppermform.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -17,8 +17,8 @@  discard block
 block discarded – undo
17 17
  * @author       XOOPS Development Team, Kazumi Ono (AKA onokazu)
18 18
  */
19 19
 
20
-if (! defined('XOOPS_ROOT_PATH')) {
21
-    exit ;
20
+if (!defined('XOOPS_ROOT_PATH')) {
21
+    exit;
22 22
 }
23 23
 
24 24
 require_once XOOPS_ROOT_PATH.'/class/xoopsform/formelement.php';
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
      * Tree structure of items
49 49
      * @var array
50 50
      */
51
-    public $_itemTree = array() ;
51
+    public $_itemTree = array();
52 52
     /**
53 53
      * Name of permission
54 54
      * @var string
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
      * Appendix
64 64
      * @var array ('permname'=>,'itemid'=>,'itemname'=>,'selected'=>)
65 65
      */
66
-    public $_appendix = array() ;
66
+    public $_appendix = array();
67 67
 
68 68
     /**
69 69
      * Constructor
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
      */
104 104
     public function addAppendix($permName, $itemId, $itemName)
105 105
     {
106
-        $this->_appendix[] = array('permname'=>$permName,'itemid'=>$itemId,'itemname'=>$itemName,'selected'=>false);
106
+        $this->_appendix[] = array('permname'=>$permName, 'itemid'=>$itemId, 'itemname'=>$itemName, 'selected'=>false);
107 107
     }
108 108
 
109 109
     /**
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
      */
138 138
     public function render()
139 139
     {
140
-        global $xoopsGTicket ;
140
+        global $xoopsGTicket;
141 141
 
142 142
         // load all child ids for javascript codes
143 143
         foreach (array_keys($this->_itemTree) as $item_id) {
@@ -154,11 +154,11 @@  discard block
 block discarded – undo
154 154
             $ele->setOptionTree($this->_itemTree);
155 155
 
156 156
             // GIJ start
157
-            $ele->setDescription('<input type="checkbox" onclick="with(document.groupperm_form){for(i=0;i<length;i++){if(elements[i].name.match(/^perms\[(module_admin|module_read|block_read)\]\[groups\]\['.$i.'\]/)){elements[i].checked=this.checked;}}};">') ;
157
+            $ele->setDescription('<input type="checkbox" onclick="with(document.groupperm_form){for(i=0;i<length;i++){if(elements[i].name.match(/^perms\[(module_admin|module_read|block_read)\]\[groups\]\['.$i.'\]/)){elements[i].checked=this.checked;}}};">');
158 158
             // GIJ_end
159 159
 
160 160
             foreach ($this->_appendix as $key => $append) {
161
-                $this->_appendix[$key]['selected'] = $gperm_handler->checkRight($append['permname'], $append['itemid'], $i, $this->_modid) ;
161
+                $this->_appendix[$key]['selected'] = $gperm_handler->checkRight($append['permname'], $append['itemid'], $i, $this->_modid);
162 162
             }
163 163
             $ele->setAppendix($this->_appendix);
164 164
             $this->addElement($ele);
@@ -168,11 +168,11 @@  discard block
 block discarded – undo
168 168
         // GIJ start
169 169
         $jstray = new XoopsFormElementTray(' &nbsp; ');
170 170
         $jsuncheckbutton = new XoopsFormButton('', 'none', _NONE, 'button');
171
-        $jsuncheckbutton->setExtra("onclick=\"with(document.groupperm_form){for(i=0;i<length;i++){if(elements[i].type=='checkbox'){elements[i].checked=false;}}}\"") ;
171
+        $jsuncheckbutton->setExtra("onclick=\"with(document.groupperm_form){for(i=0;i<length;i++){if(elements[i].type=='checkbox'){elements[i].checked=false;}}}\"");
172 172
         $jscheckbutton = new XoopsFormButton('', 'all', _ALL, 'button');
173
-        $jscheckbutton->setExtra("onclick=\"with(document.groupperm_form){for(i=0;i<length;i++){if(elements[i].type=='checkbox' && (elements[i].name.indexOf('module_admin')<0 || elements[i].name.indexOf('[groups][1]')>=0)){elements[i].checked=true;}}}\"") ;
174
-        $jstray->addElement($jsuncheckbutton) ;
175
-        $jstray->addElement($jscheckbutton) ;
173
+        $jscheckbutton->setExtra("onclick=\"with(document.groupperm_form){for(i=0;i<length;i++){if(elements[i].type=='checkbox' && (elements[i].name.indexOf('module_admin')<0 || elements[i].name.indexOf('[groups][1]')>=0)){elements[i].checked=true;}}}\"");
174
+        $jstray->addElement($jsuncheckbutton);
175
+        $jstray->addElement($jscheckbutton);
176 176
         $this->addElement($jstray);
177 177
         // GIJ end
178 178
 
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 
184 184
         $ret = '<h4>'.$this->getTitle().'</h4>'.$this->_permDesc.'<br />';
185 185
         $ret .= "<form name='".$this->getName()."' id='".$this->getName()."' action='".$this->getAction()."' method='".$this->getMethod()."'".$this->getExtra().">\n<table width='100%' class='outer' cellspacing='1'>\n";
186
-        $elements =& $this->getElements();
186
+        $elements = & $this->getElements();
187 187
         foreach (array_keys($elements) as $i) {
188 188
             if (!is_object($elements[$i])) {
189 189
                 $ret .= $elements[$i];
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
                 $ret .= $elements[$i]->render();
200 200
             }
201 201
         }
202
-        $ret .= '</table>' . $xoopsGTicket->getTicketHtml(__LINE__, 1800, 'myblocksadmin') . '</form>';
202
+        $ret .= '</table>'.$xoopsGTicket->getTicketHtml(__LINE__, 1800, 'myblocksadmin').'</form>';
203 203
         return $ret;
204 204
     }
205 205
 }
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
      * Appendix
236 236
      * @var array ('permname'=>,'itemid'=>,'itemname'=>,'selected'=>)
237 237
      */
238
-    public $_appendix = array() ;
238
+    public $_appendix = array();
239 239
 
240 240
     /**
241 241
      * Constructor
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
      */
286 286
     public function setAppendix($appendix)
287 287
     {
288
-        $this->_appendix = $appendix ;
288
+        $this->_appendix = $appendix;
289 289
     }
290 290
 
291 291
     /**
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
      */
297 297
     public function render()
298 298
     {
299
-        $ret = '' ;
299
+        $ret = '';
300 300
 
301 301
         if (count($this->_appendix) > 0) {
302 302
             $ret .= '<table class="outer"><tr>';
@@ -306,11 +306,11 @@  discard block
 block discarded – undo
306 306
                     $ret .= '</tr><tr>';
307 307
                     $cols = 1;
308 308
                 }
309
-                $checked = $append['selected'] ? 'checked="checked"' : '' ;
310
-                $name = 'perms['.$append['permname'].']' ;
311
-                $itemid = $append['itemid'] ;
312
-                $itemid = $append['itemid'] ;
313
-                $ret .= "<td class=\"odd\"><input type=\"checkbox\" name=\"{$name}[groups][$this->_groupId][$itemid]\" id=\"{$name}[groups][$this->_groupId][$itemid]\" value=\"1\" $checked />{$append['itemname']}<input type=\"hidden\" name=\"{$name}[parents][$itemid]\" value=\"\" /><input type=\"hidden\" name=\"{$name}[itemname][$itemid]\" value=\"{$append['itemname']}\" /><br /></td>" ;
309
+                $checked = $append['selected'] ? 'checked="checked"' : '';
310
+                $name = 'perms['.$append['permname'].']';
311
+                $itemid = $append['itemid'];
312
+                $itemid = $append['itemid'];
313
+                $ret .= "<td class=\"odd\"><input type=\"checkbox\" name=\"{$name}[groups][$this->_groupId][$itemid]\" id=\"{$name}[groups][$this->_groupId][$itemid]\" value=\"1\" $checked />{$append['itemname']}<input type=\"hidden\" name=\"{$name}[parents][$itemid]\" value=\"\" /><input type=\"hidden\" name=\"{$name}[itemname][$itemid]\" value=\"{$append['itemname']}\" /><br /></td>";
314 314
                 $cols++;
315 315
             }
316 316
             $ret .= '</tr></table>';
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
 
319 319
         $ret .= '<table class="outer"><tr>';
320 320
         $cols = 1;
321
-        if (! empty($this->_optionTree[0]['children'])) {
321
+        if (!empty($this->_optionTree[0]['children'])) {
322 322
             foreach ($this->_optionTree[0]['children'] as $topitem) {
323 323
                 if ($cols > 4) {
324 324
                     $ret .= '</tr><tr>';
@@ -346,8 +346,8 @@  discard block
 block discarded – undo
346 346
      */
347 347
     public function _renderOptionTree(&$tree, $option, $prefix, $parentIds = array())
348 348
     {
349
-        $tree .= $prefix."<input type=\"checkbox\" name=\"".$this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . "]\" id=\"" . $this->getName() . '[groups][' . $this->_groupId . ']['
350
-                 . $option['id'] . "]\" onclick=\"";
349
+        $tree .= $prefix."<input type=\"checkbox\" name=\"".$this->getName().'[groups]['.$this->_groupId.']['.$option['id']."]\" id=\"".$this->getName().'[groups]['.$this->_groupId.']['
350
+                 . $option['id']."]\" onclick=\"";
351 351
         // If there are parent elements, add javascript that will
352 352
         // make them selecteded when this element is checked to make
353 353
         // sure permissions to parent items are added as well.
@@ -367,8 +367,8 @@  discard block
 block discarded – undo
367 367
         if (isset($this->_value) && in_array($option['id'], $this->_value)) {
368 368
             $tree .= ' checked="checked"';
369 369
         }
370
-        $tree .= ' />' . $option['name'] . "<input type=\"hidden\" name=\"" . $this->getName() . '[parents][' . $option['id'] . "]\" value=\"" . implode(':', $parentIds) . "\" /><input type=\"hidden\" name=\"" . $this->getName() . '[itemname]['
371
-                 . $option['id'] . "]\" value=\"" . htmlspecialchars($option['name']) . "\" /><br />\n";
370
+        $tree .= ' />'.$option['name']."<input type=\"hidden\" name=\"".$this->getName().'[parents]['.$option['id']."]\" value=\"".implode(':', $parentIds)."\" /><input type=\"hidden\" name=\"".$this->getName().'[itemname]['
371
+                 . $option['id']."]\" value=\"".htmlspecialchars($option['name'])."\" /><br />\n";
372 372
         if (isset($option['children'])) {
373 373
             foreach ($option['children'] as $child) {
374 374
                 array_push($parentIds, $option['id']);
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/admin_in_theme_header.inc.php 1 patch
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 
20 20
 // This is a mimic file from header.php of 2.0.16-JP
21 21
 
22
-require_once dirname(__DIR__).'/class/AltsysBreadcrumbs.class.php' ;
22
+require_once dirname(__DIR__).'/class/AltsysBreadcrumbs.class.php';
23 23
 include_once XOOPS_ROOT_PATH.'/class/xoopsblock.php';
24 24
 
25 25
     $xoopsOption['theme_use_smarty'] = 1;
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 //HACK by domifara
49 49
     if (defined('XOOPS_CUBE_LEGACY')) {
50 50
         $handler = xoops_getHandler('block');
51
-        $xoopsblock = $handler->create(false) ;
51
+        $xoopsblock = $handler->create(false);
52 52
     } else {
53 53
         $xoopsblock = new XoopsBlock();
54 54
     }
@@ -58,46 +58,46 @@  discard block
 block discarded – undo
58 58
     if (is_object($xoopsUser)) {
59 59
         $xoopsTpl->assign(array('xoops_isuser' => true, 'xoops_userid' => $xoopsUser->getVar('uid'), 'xoops_uname' => $xoopsUser->getVar('uname'), 'xoops_isadmin' => $xoopsUserIsAdmin));
60 60
         if (is_object(@$xoopsModule)) {
61
-            if ($xoopsModule->getVar('mid') == 1 && @$_GET['fct'] == 'preferences' && @$_GET['op'] == 'showmod' && ! empty($_GET['mod'])) {
62
-                $module_handler = xoops_getHandler('module') ;
63
-                $target_module = $module_handler->get((int)$_GET['mod']) ;
61
+            if ($xoopsModule->getVar('mid') == 1 && @$_GET['fct'] == 'preferences' && @$_GET['op'] == 'showmod' && !empty($_GET['mod'])) {
62
+                $module_handler = xoops_getHandler('module');
63
+                $target_module = $module_handler->get((int)$_GET['mod']);
64 64
             } else {
65
-                $target_module = $xoopsModule ;
65
+                $target_module = $xoopsModule;
66 66
             }
67 67
 
68 68
             // set page title
69 69
             $xoopsTpl->assign(array('xoops_pagetitle' => $target_module->getVar('name'), 'xoops_modulename' => $target_module->getVar('name'), 'xoops_dirname' => $target_module->getVar('dirname')));
70 70
 
71 71
             // xoops_breadcrumbs
72
-            $breadcrumbsObj = AltsysBreadcrumbs::getInstance() ;
72
+            $breadcrumbsObj = AltsysBreadcrumbs::getInstance();
73 73
             if ($breadcrumbsObj->hasPaths()) {
74
-                $xoops_breadcrumbs = $breadcrumbsObj->getXoopsBreadcrumbs() ;
74
+                $xoops_breadcrumbs = $breadcrumbsObj->getXoopsBreadcrumbs();
75 75
             } else {
76
-                $mod_url = XOOPS_URL.'/modules/'.$target_module->getVar('dirname') ;
77
-                $mod_path = XOOPS_ROOT_PATH.'/modules/'.$target_module->getVar('dirname') ;
78
-                $modinfo =& $target_module->getInfo() ;
79
-                $xoops_breadcrumbs = array() ;
80
-                if (! empty($modinfo['hasMain'])) {
76
+                $mod_url = XOOPS_URL.'/modules/'.$target_module->getVar('dirname');
77
+                $mod_path = XOOPS_ROOT_PATH.'/modules/'.$target_module->getVar('dirname');
78
+                $modinfo = & $target_module->getInfo();
79
+                $xoops_breadcrumbs = array();
80
+                if (!empty($modinfo['hasMain'])) {
81 81
                     $xoops_breadcrumbs[] = array(
82
-                        'url' => $mod_url.'/' ,
82
+                        'url' => $mod_url.'/',
83 83
                         'name' => sprintf(_MD_A_AINTHEME_FMT_PUBLICTOP, $target_module->getVar('name'))
84
-                    ) ;
84
+                    );
85 85
                 }
86
-                if (! empty($modinfo['adminindex'])) {
86
+                if (!empty($modinfo['adminindex'])) {
87 87
                     $xoops_breadcrumbs[] = array(
88
-                        'url' => $mod_url.'/'.$modinfo['adminindex'] ,
88
+                        'url' => $mod_url.'/'.$modinfo['adminindex'],
89 89
                         'name' => sprintf(_MD_A_AINTHEME_FMT_ADMINTOP, $target_module->getVar('name'))
90
-                    ) ;
90
+                    );
91 91
                 }
92
-                if (! empty($GLOBALS['altsysAdminPageTitle'])) {
93
-                    $xoops_breadcrumbs[] = array( 'name' => htmlspecialchars($GLOBALS['altsysAdminPageTitle'], ENT_QUOTES) ) ;
94
-                } elseif (! empty($modinfo['adminmenu'])) {
95
-                    @include $mod_path.'/'.$modinfo['adminmenu'] ;
92
+                if (!empty($GLOBALS['altsysAdminPageTitle'])) {
93
+                    $xoops_breadcrumbs[] = array('name' => htmlspecialchars($GLOBALS['altsysAdminPageTitle'], ENT_QUOTES));
94
+                } elseif (!empty($modinfo['adminmenu'])) {
95
+                    @include $mod_path.'/'.$modinfo['adminmenu'];
96 96
                     if (is_array(@$adminmenu)) {
97 97
                         foreach ($adminmenu as $eachmenu) {
98 98
                             if (strstr($_SERVER['REQUEST_URI'], $eachmenu['link'])) {
99
-                                $xoops_breadcrumbs[] = array( 'name' => $eachmenu['title'] ) ;
100
-                                break ;
99
+                                $xoops_breadcrumbs[] = array('name' => $eachmenu['title']);
100
+                                break;
101 101
                             }
102 102
                         }
103 103
                     }
@@ -106,21 +106,21 @@  discard block
 block discarded – undo
106 106
 
107 107
             //$block_arr =& $xoopsblock->getAllByGroupModule($xoopsUser->getGroups(), $target_module->getVar('mid'), false, XOOPS_BLOCK_VISIBLE);
108 108
         } else {
109
-            $xoopsTpl->assign(array( 'xoops_pagetitle' => _CPHOME )) ;
109
+            $xoopsTpl->assign(array('xoops_pagetitle' => _CPHOME));
110 110
             $xoops_breadcrumbs = array(
111 111
                 array(
112
-                    'url' => XOOPS_URL.'/admin.php' ,
112
+                    'url' => XOOPS_URL.'/admin.php',
113 113
                     'name' => _CPHOME
114 114
                 )
115
-            ) ;
115
+            );
116 116
         }
117 117
     } else {
118
-        exit ;
118
+        exit;
119 119
     }
120 120
 
121 121
     // get block_arr
122
-    $db = XoopsDatabaseFactory::getDatabaseConnection() ;
123
-    $sql = 'SELECT DISTINCT gperm_itemid FROM ' . $db->prefix('group_permission') . " WHERE gperm_name = 'block_read' AND gperm_modid = 1 AND gperm_groupid IN (" . implode(',', $xoopsUser->getGroups()) . ')';
122
+    $db = XoopsDatabaseFactory::getDatabaseConnection();
123
+    $sql = 'SELECT DISTINCT gperm_itemid FROM '.$db->prefix('group_permission')." WHERE gperm_name = 'block_read' AND gperm_modid = 1 AND gperm_groupid IN (".implode(',', $xoopsUser->getGroups()).')';
124 124
     $result = $db->query($sql);
125 125
 
126 126
     $blockids = array();
@@ -128,30 +128,30 @@  discard block
 block discarded – undo
128 128
         $blockids[] = (int)$blockid;
129 129
     }
130 130
 
131
-    global $block_arr , $i ; // for piCal :-)
132
-    $block_arr = array() ;
131
+    global $block_arr, $i; // for piCal :-)
132
+    $block_arr = array();
133 133
     if (!empty($blockids)) {
134
-        $sql = 'SELECT b.* FROM '.$db->prefix('newblocks').' b, '.$db->prefix('block_module_link').' m WHERE m.block_id=b.bid AND b.isactive=1 AND b.visible=1 AND m.module_id=' . (int)$altsysModuleId
135
-               . ' AND b.bid IN (' . implode(',', $blockids) . ') ORDER BY b.weight,b.bid' ;
134
+        $sql = 'SELECT b.* FROM '.$db->prefix('newblocks').' b, '.$db->prefix('block_module_link').' m WHERE m.block_id=b.bid AND b.isactive=1 AND b.visible=1 AND m.module_id='.(int)$altsysModuleId
135
+               . ' AND b.bid IN ('.implode(',', $blockids).') ORDER BY b.weight,b.bid';
136 136
         $result = $db->query($sql);
137 137
         while ($myrow = $db->fetchArray($result)) {
138 138
 
139 139
 //HACK by domifara
140 140
             if (defined('XOOPS_CUBE_LEGACY')) {
141
-                $block = $handler->create(false) ;
141
+                $block = $handler->create(false);
142 142
                 $block->assignVars($myrow);
143 143
             } else {
144
-                $block = new XoopsBlock($myrow) ;
144
+                $block = new XoopsBlock($myrow);
145 145
             }
146 146
 
147
-            $block_arr[ $myrow['bid'] ] = $block ;
147
+            $block_arr[$myrow['bid']] = $block;
148 148
         }
149 149
     }
150 150
 
151
-    $adminmenublock_exists = false ;
151
+    $adminmenublock_exists = false;
152 152
     foreach (array_keys($block_arr) as $i) {
153 153
         if ($block_arr[$i]->getVar('show_func') == 'b_altsys_admin_menu_show') {
154
-            $adminmenublock_exists = true ;
154
+            $adminmenublock_exists = true;
155 155
         }
156 156
         $bcachetime = $block_arr[$i]->getVar('bcachetime');
157 157
         if (empty($bcachetime)) {
@@ -232,15 +232,15 @@  discard block
 block discarded – undo
232 232
     }
233 233
 
234 234
     // FALLBACK inserting admin_menu_block in admin side
235
-    if (! $adminmenublock_exists) {
236
-        require_once XOOPS_ROOT_PATH.'/modules/altsys/blocks/blocks.php' ;
237
-        $admin_menu_block = array( b_altsys_admin_menu_show(array( 'altsys' )) ) ;
238
-        $admin_menu_block[0]['title'] = 'Admin Menu' ;
239
-        $lblocks =& $xoopsTpl->get_template_vars('xoops_lblocks') ;
240
-        if (! is_array($lblocks)) {
241
-            $lblocks = array() ;
235
+    if (!$adminmenublock_exists) {
236
+        require_once XOOPS_ROOT_PATH.'/modules/altsys/blocks/blocks.php';
237
+        $admin_menu_block = array(b_altsys_admin_menu_show(array('altsys')));
238
+        $admin_menu_block[0]['title'] = 'Admin Menu';
239
+        $lblocks = & $xoopsTpl->get_template_vars('xoops_lblocks');
240
+        if (!is_array($lblocks)) {
241
+            $lblocks = array();
242 242
         }
243
-        $xoopsTpl->assign('xoops_lblocks', array_merge($admin_menu_block, $lblocks)) ;
243
+        $xoopsTpl->assign('xoops_lblocks', array_merge($admin_menu_block, $lblocks));
244 244
     }
245 245
 
246 246
     //unset($block_arr);
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/myblocksadmin.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -5,56 +5,56 @@  discard block
 block discarded – undo
5 5
 //                       GIJOE <http://www.peak.ne.jp/>                      //
6 6
 // ------------------------------------------------------------------------- //
7 7
 
8
-require_once __DIR__.'/class/AltsysBreadcrumbs.class.php' ;
9
-require_once __DIR__.'/include/gtickets.php' ;
10
-include_once __DIR__.'/include/altsys_functions.php' ;
11
-include_once __DIR__.'/include/mygrouppermform.php' ;
12
-include_once XOOPS_ROOT_PATH.'/class/xoopsblock.php' ;
8
+require_once __DIR__.'/class/AltsysBreadcrumbs.class.php';
9
+require_once __DIR__.'/include/gtickets.php';
10
+include_once __DIR__.'/include/altsys_functions.php';
11
+include_once __DIR__.'/include/mygrouppermform.php';
12
+include_once XOOPS_ROOT_PATH.'/class/xoopsblock.php';
13 13
 
14 14
 // language file
15
-altsys_include_language_file('myblocksadmin') ;
15
+altsys_include_language_file('myblocksadmin');
16 16
 
17 17
 // fork by core types
18 18
 switch (altsys_get_core_type()) {
19 19
     case ALTSYS_CORE_TYPE_X22:
20
-        include_once __DIR__.'/class/MyBlocksAdminForX22.class.php' ;
21
-        $myba = MyBlocksAdminForX22::getInstance() ;
22
-        break ;
20
+        include_once __DIR__.'/class/MyBlocksAdminForX22.class.php';
21
+        $myba = MyBlocksAdminForX22::getInstance();
22
+        break;
23 23
     case ALTSYS_CORE_TYPE_X25:
24
-        include_once __DIR__.'/class/MyBlocksAdminForX25.class.php' ;
25
-        $myba = MyBlocksAdminForX25::getInstance() ;
26
-        break ;
24
+        include_once __DIR__.'/class/MyBlocksAdminForX25.class.php';
25
+        $myba = MyBlocksAdminForX25::getInstance();
26
+        break;
27 27
     case ALTSYS_CORE_TYPE_XCL21:
28
-        include_once __DIR__.'/class/MyBlocksAdminForXCL21.class.php' ;
29
-        $myba = MyBlocksAdminForXCL21::getInstance() ;
30
-        break ;
28
+        include_once __DIR__.'/class/MyBlocksAdminForXCL21.class.php';
29
+        $myba = MyBlocksAdminForXCL21::getInstance();
30
+        break;
31 31
     case ALTSYS_CORE_TYPE_ICMS:
32
-        include_once __DIR__.'/class/MyBlocksAdminForICMS.class.php' ;
33
-        $myba = MyBlocksAdminForICMS::getInstance() ;
34
-        break ;
32
+        include_once __DIR__.'/class/MyBlocksAdminForICMS.class.php';
33
+        $myba = MyBlocksAdminForICMS::getInstance();
34
+        break;
35 35
     case ALTSYS_CORE_TYPE_X20S:
36 36
     case ALTSYS_CORE_TYPE_X23P:
37
-        include_once __DIR__.'/class/MyBlocksAdminForX20S.class.php' ;
38
-        $myba = MyBlocksAdminForX20S::getInstance() ;
39
-        break ;
37
+        include_once __DIR__.'/class/MyBlocksAdminForX20S.class.php';
38
+        $myba = MyBlocksAdminForX20S::getInstance();
39
+        break;
40 40
     default:
41
-        include_once __DIR__.'/class/MyBlocksAdmin.class.php' ;
42
-        $myba = MyBlocksAdmin::getInstance() ;
43
-        break ;
41
+        include_once __DIR__.'/class/MyBlocksAdmin.class.php';
42
+        $myba = MyBlocksAdmin::getInstance();
43
+        break;
44 44
 }
45 45
 // permission
46
-$myba->checkPermission() ;
46
+$myba->checkPermission();
47 47
 
48 48
 // set parameters target_mid , target_dirname etc.
49
-$myba->init($xoopsModule) ;
49
+$myba->init($xoopsModule);
50 50
 
51 51
 
52 52
 //
53 53
 // transaction stage
54 54
 //
55 55
 
56
-if (! empty($_POST)) {
57
-    $myba->processPost() ;
56
+if (!empty($_POST)) {
57
+    $myba->processPost();
58 58
 }
59 59
 
60 60
 //
@@ -62,12 +62,12 @@  discard block
 block discarded – undo
62 62
 //
63 63
 
64 64
 // header
65
-xoops_cp_header() ;
65
+xoops_cp_header();
66 66
 
67 67
 // mymenu
68
-altsys_include_mymenu() ;
68
+altsys_include_mymenu();
69 69
 
70
-$myba->processGet() ;
70
+$myba->processGet();
71 71
 
72 72
 // footer
73
-xoops_cp_footer() ;
73
+xoops_cp_footer();
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/index.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -1,51 +1,51 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (! defined('XOOPS_MODULE_PATH')) {
4
-    define('XOOPS_MODULE_PATH', XOOPS_ROOT_PATH . '/modules');
3
+if (!defined('XOOPS_MODULE_PATH')) {
4
+    define('XOOPS_MODULE_PATH', XOOPS_ROOT_PATH.'/modules');
5 5
 }
6
-if (! defined('XOOPS_MODULE_URL')) {
7
-    define('XOOPS_MODULE_URL', XOOPS_URL . '/modules');
6
+if (!defined('XOOPS_MODULE_URL')) {
7
+    define('XOOPS_MODULE_URL', XOOPS_URL.'/modules');
8 8
 }
9 9
 
10 10
  
11
-require_once __DIR__.'/class/AltsysBreadcrumbs.class.php' ;
12
-require_once __DIR__.'/include/altsys_functions.php' ;
11
+require_once __DIR__.'/class/AltsysBreadcrumbs.class.php';
12
+require_once __DIR__.'/include/altsys_functions.php';
13 13
 
14 14
 
15 15
 if (empty($xoopsModule)) {
16
-    $moduleperm_handler = xoops_getHandler('module') ;
17
-    $xoopsModule = $moduleperm_handler->getByDirname('altsys') ;
16
+    $moduleperm_handler = xoops_getHandler('module');
17
+    $xoopsModule = $moduleperm_handler->getByDirname('altsys');
18 18
 }
19 19
 
20
-require XOOPS_ROOT_PATH.'/include/cp_functions.php' ;
20
+require XOOPS_ROOT_PATH.'/include/cp_functions.php';
21 21
 
22 22
 // breadcrumbs
23
-$breadcrumbsObj = AltsysBreadcrumbs::getInstance() ;
24
-$breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php', $GLOBALS['xoopsModule']->getVar('name')) ;
23
+$breadcrumbsObj = AltsysBreadcrumbs::getInstance();
24
+$breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php', $GLOBALS['xoopsModule']->getVar('name'));
25 25
 
26 26
 // get page
27
-$page = preg_replace('/[^a-zA-Z0-9_-]/', '', @$_GET['page']) ;
28
-require __DIR__.'/controllers.php' ;
29
-if (! in_array($page, $controllers)) {
30
-    $_GET['page'] = $page = 'myblocksadmin' ;
31
-    $_SERVER['REQUEST_URI'] = '/admin/index.php?mode=admin&lib=altsys&page=myblocksadmin' ;
27
+$page = preg_replace('/[^a-zA-Z0-9_-]/', '', @$_GET['page']);
28
+require __DIR__.'/controllers.php';
29
+if (!in_array($page, $controllers)) {
30
+    $_GET['page'] = $page = 'myblocksadmin';
31
+    $_SERVER['REQUEST_URI'] = '/admin/index.php?mode=admin&lib=altsys&page=myblocksadmin';
32 32
 }
33 33
 
34 34
 
35 35
 // half measure ... (TODO)
36 36
 if (empty($_GET['dirname'])) {
37
-    $module_handler = xoops_getHandler('module') ;
38
-    list($top_module) = $module_handler->getObjects(new Criteria('isactive', 1)) ;
39
-    $_GET['dirname'] = $top_module->getVar('dirname') ;
37
+    $module_handler = xoops_getHandler('module');
38
+    list($top_module) = $module_handler->getObjects(new Criteria('isactive', 1));
39
+    $_GET['dirname'] = $top_module->getVar('dirname');
40 40
 }
41 41
 
42 42
 // language file
43
-altsys_include_language_file($page) ;
43
+altsys_include_language_file($page);
44 44
 
45 45
 // branch to each pages
46
-$mytrustdirpath = __DIR__ ;
46
+$mytrustdirpath = __DIR__;
47 47
 if (file_exists(XOOPS_TRUST_PATH.'/libs/altsys/'.$page.'.php')) {
48
-    include XOOPS_TRUST_PATH.'/libs/altsys/'.$page.'.php' ;
48
+    include XOOPS_TRUST_PATH.'/libs/altsys/'.$page.'.php';
49 49
 } else {
50
-    die('wrong request') ;
50
+    die('wrong request');
51 51
 }
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/mypreferences.php 1 patch
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -5,33 +5,33 @@  discard block
 block discarded – undo
5 5
 //                     GIJOE <http://www.peak.ne.jp/>                        //
6 6
 // ------------------------------------------------------------------------- //
7 7
 
8
-require_once __DIR__.'/class/AltsysBreadcrumbs.class.php' ;
9
-include_once __DIR__.'/include/gtickets.php' ;
10
-include_once __DIR__.'/include/altsys_functions.php' ;
8
+require_once __DIR__.'/class/AltsysBreadcrumbs.class.php';
9
+include_once __DIR__.'/include/gtickets.php';
10
+include_once __DIR__.'/include/altsys_functions.php';
11 11
 
12 12
 // check access right (needs module_admin of this module)
13
-if (! is_object($xoopsUser) || ! is_object($xoopsModule) || ! $xoopsUser->isAdmin($xoopsModule->mid())) {
14
-    die('Access Denied') ;
13
+if (!is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid())) {
14
+    die('Access Denied');
15 15
 }
16 16
 
17 17
 
18 18
 // initials
19 19
 $db = XoopsDatabaseFactory::getDatabaseConnection();
20
-(method_exists('MyTextSanitizer', 'sGetInstance') and $myts = MyTextSanitizer::sGetInstance()) || $myts = MyTextSanitizer::getInstance() ;
20
+(method_exists('MyTextSanitizer', 'sGetInstance') and $myts = MyTextSanitizer::sGetInstance()) || $myts = MyTextSanitizer::getInstance();
21 21
 
22 22
 // language file
23
-altsys_include_language_file('mypreferences') ;
23
+altsys_include_language_file('mypreferences');
24 24
 
25 25
 
26
-$op = empty($_GET['op']) ? 'showmod' : preg_replace('/[^a-zA-Z0-9_-]/', '', $_GET['op']) ;
26
+$op = empty($_GET['op']) ? 'showmod' : preg_replace('/[^a-zA-Z0-9_-]/', '', $_GET['op']);
27 27
 
28 28
 if ($op == 'showmod') {
29 29
     $config_handler = xoops_getHandler('config');
30
-    $mod = $xoopsModule->mid() ;
30
+    $mod = $xoopsModule->mid();
31 31
     $config = $config_handler->getConfigs(new Criteria('conf_modid', $mod));
32 32
     $count = count($config);
33 33
     if ($count < 1) {
34
-        die('no configs') ;
34
+        die('no configs');
35 35
     }
36 36
     include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
37 37
     $form = new XoopsThemeForm(_MD_A_MYPREFERENCES_FORMTITLE, 'pref_form', 'index.php?mode=admin&lib=altsys&page=mypreferences&op=save');
@@ -39,30 +39,30 @@  discard block
 block discarded – undo
39 39
     $module = $module_handler->get($mod);
40 40
 
41 41
     // language
42
-    $language = empty($xoopsConfig['language']) ? 'english' : $xoopsConfig['language'] ;
42
+    $language = empty($xoopsConfig['language']) ? 'english' : $xoopsConfig['language'];
43 43
 
44 44
     // load modinfo.php if necessary (judged by a specific constant is defined)
45
-    if (! defined('_MYMENU_CONSTANT_IN_MODINFO') || ! defined(_MYMENU_CONSTANT_IN_MODINFO)) {
45
+    if (!defined('_MYMENU_CONSTANT_IN_MODINFO') || !defined(_MYMENU_CONSTANT_IN_MODINFO)) {
46 46
         if (file_exists("$mydirpath/language/$language/modinfo.php")) {
47 47
             // user customized language file
48
-            include_once "$mydirpath/language/$language/modinfo.php" ;
48
+            include_once "$mydirpath/language/$language/modinfo.php";
49 49
         } elseif (file_exists("$mytrustdirpath/language/$language/modinfo.php")) {
50 50
             // default language file
51
-            include_once "$mytrustdirpath/language/$language/modinfo.php" ;
51
+            include_once "$mytrustdirpath/language/$language/modinfo.php";
52 52
         } else {
53 53
             // fallback english
54
-            include_once "$mytrustdirpath/language/english/modinfo.php" ;
54
+            include_once "$mytrustdirpath/language/english/modinfo.php";
55 55
         }
56 56
     }
57 57
 
58 58
     // if has comments feature, need comment lang file
59
-    if ($module->getVar('hascomments') == 1 && ! defined('_CM_TITLE')) {
59
+    if ($module->getVar('hascomments') == 1 && !defined('_CM_TITLE')) {
60 60
         include_once XOOPS_ROOT_PATH.'/language/'.$xoopsConfig['language'].'/comment.php';
61 61
     }
62 62
 
63 63
     // RMV-NOTIFY
64 64
     // if has notification feature, need notification lang file
65
-    if ($module->getVar('hasnotification') == 1 && ! defined('_NOT_NOTIFICATIONOPTIONS')) {
65
+    if ($module->getVar('hasnotification') == 1 && !defined('_NOT_NOTIFICATIONOPTIONS')) {
66 66
         include_once XOOPS_ROOT_PATH.'/language/'.$xoopsConfig['language'].'/notification.php';
67 67
     }
68 68
 
@@ -72,9 +72,9 @@  discard block
 block discarded – undo
72 72
         //  $form->addElement(new XoopsFormHidden('redirect', XOOPS_URL.'/modules/'.$module->getVar('dirname').'/'.$module->getInfo('adminindex')));
73 73
     // }
74 74
     for ($i = 0; $i < $count; $i++) {
75
-        $title_icon = ($config[$i]->getVar('conf_valuetype') === 'encrypt')? '<img src="'.XOOPS_MODULE_URL.'/legacy/admin/theme/icons/textfield_key.png" alt="Encrypted">' : ''; // support XCL 2.2.3 'encrypt' of 'conf_valuetype'
75
+        $title_icon = ($config[$i]->getVar('conf_valuetype') === 'encrypt') ? '<img src="'.XOOPS_MODULE_URL.'/legacy/admin/theme/icons/textfield_key.png" alt="Encrypted">' : ''; // support XCL 2.2.3 'encrypt' of 'conf_valuetype'
76 76
         $title4tray = (!defined($config[$i]->getVar('conf_desc')) || constant($config[$i]->getVar('conf_desc')) == '') ? (constant($config[$i]->getVar('conf_title')).$title_icon) : (constant($config[$i]->getVar('conf_title')).$title_icon.'<br /><br /><span style="font-weight:normal;">'.constant($config[$i]->getVar('conf_desc')).'</span>'); // GIJ
77
-        $title = '' ; // GIJ
77
+        $title = ''; // GIJ
78 78
         switch ($config[$i]->getVar('conf_formtype')) {
79 79
         case 'textarea':
80 80
             (method_exists('MyTextSanitizer', 'sGetInstance') and $myts = MyTextSanitizer::sGetInstance()) || $myts = MyTextSanitizer::getInstance();
@@ -155,25 +155,25 @@  discard block
 block discarded – undo
155 155
             break;
156 156
         }
157 157
         $hidden = new XoopsFormHidden('conf_ids[]', $config[$i]->getVar('conf_id'));
158
-        $ele_tray = new XoopsFormElementTray($title4tray, '') ;
158
+        $ele_tray = new XoopsFormElementTray($title4tray, '');
159 159
         $ele_tray->addElement($ele);
160 160
         $ele_tray->addElement($hidden);
161
-        $form->addElement($ele_tray) ;
161
+        $form->addElement($ele_tray);
162 162
         unset($ele_tray, $ele, $hidden);
163 163
     }
164 164
     // $button_tray->addElement(new XoopsFormHidden('op', 'save'));
165
-    $xoopsGTicket->addTicketXoopsFormElement($button_tray, __LINE__, 1800, 'mypreferences') ;
165
+    $xoopsGTicket->addTicketXoopsFormElement($button_tray, __LINE__, 1800, 'mypreferences');
166 166
     $button_tray->addElement(new XoopsFormButton('', 'button', _GO, 'submit'));
167
-    $form->addElement($button_tray) ;
167
+    $form->addElement($button_tray);
168 168
     xoops_cp_header();
169 169
 
170 170
     // GIJ patch start
171
-    altsys_include_mymenu() ;
172
-    $breadcrumbsObj = AltsysBreadcrumbs::getInstance() ;
171
+    altsys_include_mymenu();
172
+    $breadcrumbsObj = AltsysBreadcrumbs::getInstance();
173 173
     if ($breadcrumbsObj->hasPaths()) {
174
-        $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&amp;lib=altsys&amp;page=mypreferences', _PREFERENCES) ;
174
+        $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&amp;lib=altsys&amp;page=mypreferences', _PREFERENCES);
175 175
     }
176
-    echo "<h3 style='text-align:"._GLOBAL_LEFT.";'>".$module->getVar('name').' &nbsp; '._PREFERENCES."</h3>\n" ;
176
+    echo "<h3 style='text-align:"._GLOBAL_LEFT.";'>".$module->getVar('name').' &nbsp; '._PREFERENCES."</h3>\n";
177 177
     // GIJ patch end
178 178
 
179 179
     $form->display();
@@ -185,10 +185,10 @@  discard block
 block discarded – undo
185 185
     //if ( !admin_refcheck("/modules/$admin_mydirname/admin/") ) {
186 186
     //  exit('Invalid referer');
187 187
     //}
188
-    if (! $xoopsGTicket->check(true, 'mypreferences')) {
188
+    if (!$xoopsGTicket->check(true, 'mypreferences')) {
189 189
         redirect_header(XOOPS_URL.'/', 3, $xoopsGTicket->getErrors());
190 190
     }
191
-    require_once XOOPS_ROOT_PATH.'/class/template.php' ;
191
+    require_once XOOPS_ROOT_PATH.'/class/template.php';
192 192
     $xoopsTpl = new XoopsTpl();
193 193
 //HACK by domifara for new XOOPS and XCL etc.
194 194
 //old xoops
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
     if ($count > 0) {
210 210
         for ($i = 0; $i < $count; $i++) {
211 211
             $config = $config_handler->getConfig($conf_ids[$i]);
212
-            $new_value =& $_POST[$config->getVar('conf_name')];
212
+            $new_value = & $_POST[$config->getVar('conf_name')];
213 213
             if (is_array($new_value) || $new_value != $config->getVar('conf_value')) {
214 214
                 // if language has been changed
215 215
                 if (!$lang_updated && $config->getVar('conf_catid') == XOOPS_CONF && $config->getVar('conf_name') == 'language') {
@@ -238,13 +238,13 @@  discard block
 block discarded – undo
238 238
                         // generate compiled files for the new theme
239 239
                         // block files only for now..
240 240
                         $tplfile_handler = xoops_getHandler('tplfile');
241
-                        $dtemplates =& $tplfile_handler->find('default', 'block');
241
+                        $dtemplates = & $tplfile_handler->find('default', 'block');
242 242
                         $dcount = count($dtemplates);
243 243
 
244 244
                         // need to do this to pass to xoops_template_touch function
245 245
                         $GLOBALS['xoopsConfig']['template_set'] = $newtplset;
246 246
 
247
-                        altsys_clear_templates_c() ;
247
+                        altsys_clear_templates_c();
248 248
 
249 249
 /*                      for ($i = 0; $i < $dcount; $i++) {
250 250
                             $found =& $tplfile_handler->find($newtplset, 'block', $dtemplates[$i]->getVar('tpl_refid'), null);
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
 
260 260
                         // generate image cache files from image binary data, save them under cache/
261 261
                         $image_handler = xoops_getHandler('imagesetimg');
262
-                        $imagefiles =& $image_handler->getObjects(new Criteria('tplset_name', $newtplset), true);
262
+                        $imagefiles = & $image_handler->getObjects(new Criteria('tplset_name', $newtplset), true);
263 263
                         foreach (array_keys($imagefiles) as $i) {
264 264
                             if (!$fp = fopen(XOOPS_CACHE_PATH.'/'.$newtplset.'_'.$imagefiles[$i]->getVar('imgsetimg_file'), 'wb')) {
265 265
                             } else {
@@ -272,9 +272,9 @@  discard block
 block discarded – undo
272 272
                 }
273 273
 
274 274
                 // add read permission for the start module to all groups
275
-                if (!$startmod_updated    && $new_value != '--' && $config->getVar('conf_catid') == XOOPS_CONF && $config->getVar('conf_name') == 'startpage') {
275
+                if (!$startmod_updated && $new_value != '--' && $config->getVar('conf_catid') == XOOPS_CONF && $config->getVar('conf_name') == 'startpage') {
276 276
                     $member_handler = xoops_getHandler('member');
277
-                    $groups =& $member_handler->getGroupList();
277
+                    $groups = & $member_handler->getGroupList();
278 278
                     $moduleperm_handler = xoops_getHandler('groupperm');
279 279
                     $module_handler = xoops_getHandler('module');
280 280
                     $module = $module_handler->getByDirname($new_value);
@@ -293,5 +293,5 @@  discard block
 block discarded – undo
293 293
         }
294 294
     }
295 295
 
296
-    redirect_header('index.php?mode=admin&lib=altsys&page=mypreferences', 2, _MD_A_MYPREFERENCES_UPDATED) ;
296
+    redirect_header('index.php?mode=admin&lib=altsys&page=mypreferences', 2, _MD_A_MYPREFERENCES_UPDATED);
297 297
 }
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/class/SetupAltsysLangMgr.class.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -1,15 +1,15 @@  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
-if (! defined('XOOPS_TRUST_PATH') || XOOPS_TRUST_PATH == '') {
8
-    header('Location: '.XOOPS_URL.'/modules/altsys/setup_xoops_trust_path.php') ;
9
-    exit ;
7
+if (!defined('XOOPS_TRUST_PATH') || XOOPS_TRUST_PATH == '') {
8
+    header('Location: '.XOOPS_URL.'/modules/altsys/setup_xoops_trust_path.php');
9
+    exit;
10 10
 }
11 11
 
12
-define('ALTSYS_MYLANGUAGE_ROOT_PATH', XOOPS_ROOT_PATH . '/my_language');
12
+define('ALTSYS_MYLANGUAGE_ROOT_PATH', XOOPS_ROOT_PATH.'/my_language');
13 13
 
14 14
 
15 15
 class SetupAltsysLangMgr extends XCube_ActionFilter
@@ -26,23 +26,23 @@  discard block
 block discarded – undo
26 26
 }
27 27
 
28 28
 
29
-require_once XOOPS_ROOT_PATH . '/core/XCube_LanguageManager.class.php';
30
-require_once XOOPS_ROOT_PATH . '/modules/legacy/kernel/Legacy_LanguageManager.class.php';
29
+require_once XOOPS_ROOT_PATH.'/core/XCube_LanguageManager.class.php';
30
+require_once XOOPS_ROOT_PATH.'/modules/legacy/kernel/Legacy_LanguageManager.class.php';
31 31
 
32 32
 class AltsysLangMgr_LanguageManager extends Legacy_LanguageManager
33 33
 {
34
-    public $langman = null ;
35
-    public $theme_lang_checked = false ;
34
+    public $langman = null;
35
+    public $theme_lang_checked = false;
36 36
 
37 37
     public function prepare()
38 38
     {
39
-        $langmanpath = XOOPS_TRUST_PATH.'/libs/altsys/class/D3LanguageManager.class.php' ;
40
-        if (! file_exists($langmanpath)) {
41
-            die('install the latest altsys') ;
39
+        $langmanpath = XOOPS_TRUST_PATH.'/libs/altsys/class/D3LanguageManager.class.php';
40
+        if (!file_exists($langmanpath)) {
41
+            die('install the latest altsys');
42 42
         }
43 43
         require_once $langmanpath;
44
-        $this->langman = D3LanguageManager::getInstance() ;
45
-        $this->langman->language = $this->mLanguageName ;
44
+        $this->langman = D3LanguageManager::getInstance();
45
+        $this->langman->language = $this->mLanguageName;
46 46
 
47 47
         parent::prepare();
48 48
     }
@@ -50,40 +50,40 @@  discard block
 block discarded – undo
50 50
     public function _loadLanguage($dirname, $fileBodyName)
51 51
     {
52 52
         // read/check once (selected_theme)/language/(lang).php
53
-        if (! $this->theme_lang_checked) {
54
-            $root = XCube_Root::getSingleton() ;
55
-            if (! empty($root->mContext->mXoopsConfig['theme_set'])) {
56
-                $langdir = XOOPS_THEME_PATH.'/'.$root->mContext->mXoopsConfig['theme_set'].'/language' ;
53
+        if (!$this->theme_lang_checked) {
54
+            $root = XCube_Root::getSingleton();
55
+            if (!empty($root->mContext->mXoopsConfig['theme_set'])) {
56
+                $langdir = XOOPS_THEME_PATH.'/'.$root->mContext->mXoopsConfig['theme_set'].'/language';
57 57
                 if (file_exists($langdir)) {
58
-                    $langfile = $langdir.'/'.$this->mLanguageName.'.php' ;
59
-                    $engfile = $langdir.'/english.php' ;
58
+                    $langfile = $langdir.'/'.$this->mLanguageName.'.php';
59
+                    $engfile = $langdir.'/english.php';
60 60
                     if (file_exists($langfile)) {
61
-                        require_once $langfile ;
61
+                        require_once $langfile;
62 62
                     } elseif (file_exists($engfile)) {
63
-                        require_once $engfile ;
63
+                        require_once $engfile;
64 64
                     }
65 65
                 }
66
-                $this->theme_lang_checked = true ;
66
+                $this->theme_lang_checked = true;
67 67
             }
68 68
         }
69 69
 
70 70
         // read normal
71
-        $this->langman->read($fileBodyName.'.php', $dirname) ;
71
+        $this->langman->read($fileBodyName.'.php', $dirname);
72 72
     }
73 73
 
74 74
     public function loadPageTypeMessageCatalog($type)
75 75
     {
76 76
         // I dare not to use langman...
77 77
         if (strpos($type, '.') === false && $this->langman->my_language) {
78
-            $mylang_file = $this->langman->my_language.'/'.$this->mLanguageName.'/'.$type.'.php' ;
78
+            $mylang_file = $this->langman->my_language.'/'.$this->mLanguageName.'/'.$type.'.php';
79 79
             if (file_exists($mylang_file)) {
80
-                require_once $mylang_file ;
80
+                require_once $mylang_file;
81 81
             }
82 82
         }
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
         parent::loadPageTypeMessageCatalog($type);
86
-        error_reporting($original_error_level) ;
86
+        error_reporting($original_error_level);
87 87
     }
88 88
 
89 89
     public function loadGlobalMessageCatalog()
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
         /* if (!$this->_loadFile(XOOPS_ROOT_PATH . "/modules/legacy/language/" . $this->mLanguageName . "/global.php")) {
92 92
             $this->_loadFile(XOOPS_ROOT_PATH . "/modules/legacy/language/english/global.php");
93 93
         } */
94
-        $this->_loadLanguage('legacy', 'global') ;
94
+        $this->_loadLanguage('legacy', 'global');
95 95
 
96 96
         //
97 97
         // Now, if XOOPS_USE_MULTIBYTES isn't defined, set zero to it.
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/class/MyBlocksAdminForXCL21.class.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 // $Id: MyBlocksAdminForXCL21.class.php ,ver 0.0.7.1 2011/01/27 16:10:00 domifara Exp $
3 3
 
4
-require_once __DIR__.'/MyBlocksAdmin.class.php' ;
4
+require_once __DIR__.'/MyBlocksAdmin.class.php';
5 5
 
6 6
 class MyBlocksAdminForXCL21 extends MyBlocksAdmin
7 7
 {
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
     static $instance;
17 17
     if (!isset($instance)) {
18 18
         $instance = new MyBlocksAdminForXCL21();
19
-        $instance->construct() ;
19
+        $instance->construct();
20 20
     }
21 21
     return $instance;
22 22
 }
@@ -27,8 +27,8 @@  discard block
 block discarded – undo
27 27
 public function renderCell4BlockOptions($block_data)
28 28
 {
29 29
     if ($this->target_dirname && substr($this->target_dirname, 0, 1) != '_') {
30
-        $langman = D3LanguageManager::getInstance() ;
31
-        $langman->read('admin.php', $this->target_dirname) ;
30
+        $langman = D3LanguageManager::getInstance();
31
+        $langman->read('admin.php', $this->target_dirname);
32 32
     }
33 33
 
34 34
     $bid = (int)$block_data['bid'];
@@ -36,15 +36,15 @@  discard block
 block discarded – undo
36 36
 //HACK by domifara
37 37
 //	$block = new XoopsBlock( $bid ) ;
38 38
     $handler = xoops_getHandler('block');
39
-    $block = $handler->create(false) ;
40
-    $block->load($bid) ;
39
+    $block = $handler->create(false);
40
+    $block->load($bid);
41 41
 
42
-    $legacy_block = Legacy_Utils::createBlockProcedure($block) ;
43
-    return $legacy_block->getOptionForm() ;
42
+    $legacy_block = Legacy_Utils::createBlockProcedure($block);
43
+    return $legacy_block->getOptionForm();
44 44
 }
45 45
 
46 46
     public function checkFck()
47 47
     {
48
-        return (! altsysUtils::isInstalledXclHtmleditor() && file_exists(XOOPS_ROOT_PATH.'/common/fckeditor/fckeditor.js'));
48
+        return (!altsysUtils::isInstalledXclHtmleditor() && file_exists(XOOPS_ROOT_PATH.'/common/fckeditor/fckeditor.js'));
49 49
     }
50 50
 }
Please login to merge, or discard this patch.