Completed
Push — master ( 3a6ebc...3a5a05 )
by Michael
04:13
created
xoops_trust_path/libs/altsys/include/Text_Diff_Renderer.php 4 patches
Doc Comments   +9 added lines patch added patch discarded remove patch
@@ -125,6 +125,12 @@  discard block
 block discarded – undo
125 125
         return $output . $this->_endDiff();
126 126
     }
127 127
 
128
+    /**
129
+     * @param integer $xbeg
130
+     * @param integer $xlen
131
+     * @param integer $ybeg
132
+     * @param integer $ylen
133
+     */
128 134
     public function _block($xbeg, $xlen, $ybeg, $ylen, &$edits)
129 135
     {
130 136
         $output = $this->_startBlock($this->_blockHeader($xbeg, $xlen, $ybeg, $ylen));
@@ -174,6 +180,9 @@  discard block
 block discarded – undo
174 180
         return $xbeg . ($xlen ? ($ylen ? 'c' : 'd') : 'a') . $ybeg;
175 181
     }
176 182
 
183
+    /**
184
+     * @param string $header
185
+     */
177 186
     public function _startBlock($header)
178 187
     {
179 188
         return $header . "\n";
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -89,8 +89,8 @@  discard block
 block discarded – undo
89 89
                             $block[] = new Text_Diff_Op_copy($context);
90 90
                         }
91 91
                         $output .= $this->_block($x0, $ntrail + $xi - $x0,
92
-                                                 $y0, $ntrail + $yi - $y0,
93
-                                                 $block);
92
+                                                    $y0, $ntrail + $yi - $y0,
93
+                                                    $block);
94 94
                         $block = false;
95 95
                     }
96 96
                 }
@@ -118,8 +118,8 @@  discard block
 block discarded – undo
118 118
 
119 119
         if (is_array($block)) {
120 120
             $output .= $this->_block($x0, $xi - $x0,
121
-                                     $y0, $yi - $y0,
122
-                                     $block);
121
+                                        $y0, $yi - $y0,
122
+                                        $block);
123 123
         }
124 124
 
125 125
         return $output . $this->_endDiff();
Please login to merge, or discard this patch.
Switch Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -131,21 +131,21 @@
 block discarded – undo
131 131
 
132 132
         foreach ($edits as $edit) {
133 133
             switch (strtolower(get_class($edit))) {
134
-            case 'text_diff_op_copy':
135
-                $output .= $this->_context($edit->orig);
136
-                break;
134
+                case 'text_diff_op_copy':
135
+                    $output .= $this->_context($edit->orig);
136
+                    break;
137 137
 
138
-            case 'text_diff_op_add':
139
-                $output .= $this->_added($edit->final);
140
-                break;
138
+                case 'text_diff_op_add':
139
+                    $output .= $this->_added($edit->final);
140
+                    break;
141 141
 
142
-            case 'text_diff_op_delete':
143
-                $output .= $this->_deleted($edit->orig);
144
-                break;
142
+                case 'text_diff_op_delete':
143
+                    $output .= $this->_deleted($edit->orig);
144
+                    break;
145 145
 
146
-            case 'text_diff_op_change':
147
-                $output .= $this->_changed($edit->orig, $edit->final);
148
-                break;
146
+                case 'text_diff_op_change':
147
+                    $output .= $this->_changed($edit->orig, $edit->final);
148
+                    break;
149 149
             }
150 150
         }
151 151
 
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
     public function __construct($params = array())
37 37
     {
38 38
         foreach ($params as $param => $value) {
39
-            $v = '_' . $param;
39
+            $v = '_'.$param;
40 40
             if (isset($this->$v)) {
41 41
                 $this->$v = $value;
42 42
             }
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
                                      $block);
123 123
         }
124 124
 
125
-        return $output . $this->_endDiff();
125
+        return $output.$this->_endDiff();
126 126
     }
127 127
 
128 128
     public function _block($xbeg, $xlen, $ybeg, $ylen, &$edits)
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
             }
150 150
         }
151 151
 
152
-        return $output . $this->_endBlock();
152
+        return $output.$this->_endBlock();
153 153
     }
154 154
 
155 155
     public function _startDiff()
@@ -165,18 +165,18 @@  discard block
 block discarded – undo
165 165
     public function _blockHeader($xbeg, $xlen, $ybeg, $ylen)
166 166
     {
167 167
         if ($xlen > 1) {
168
-            $xbeg .= ',' . ($xbeg + $xlen - 1);
168
+            $xbeg .= ','.($xbeg + $xlen - 1);
169 169
         }
170 170
         if ($ylen > 1) {
171
-            $ybeg .= ',' . ($ybeg + $ylen - 1);
171
+            $ybeg .= ','.($ybeg + $ylen - 1);
172 172
         }
173 173
 
174
-        return $xbeg . ($xlen ? ($ylen ? 'c' : 'd') : 'a') . $ybeg;
174
+        return $xbeg.($xlen ? ($ylen ? 'c' : 'd') : 'a').$ybeg;
175 175
     }
176 176
 
177 177
     public function _startBlock($header)
178 178
     {
179
-        return $header . "\n";
179
+        return $header."\n";
180 180
     }
181 181
 
182 182
     public function _endBlock()
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 
187 187
     public function _lines($lines, $prefix = ' ')
188 188
     {
189
-        return $prefix . implode("\n$prefix", $lines) . "\n";
189
+        return $prefix.implode("\n$prefix", $lines)."\n";
190 190
     }
191 191
 
192 192
     public function _context($lines)
@@ -206,6 +206,6 @@  discard block
 block discarded – undo
206 206
 
207 207
     public function _changed($orig, $final)
208 208
     {
209
-        return $this->_deleted($orig) . "---\n" . $this->_added($final);
209
+        return $this->_deleted($orig)."---\n".$this->_added($final);
210 210
     }
211 211
 }
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/include/Text_Diff_Renderer_inline.php 3 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -63,6 +63,9 @@  discard block
 block discarded – undo
63 63
         return $header;
64 64
     }
65 65
 
66
+    /**
67
+     * @param string[] $lines
68
+     */
66 69
     public function _lines($lines, $prefix = ' ', $encode = true)
67 70
     {
68 71
         if ($encode) {
@@ -128,6 +131,9 @@  discard block
 block discarded – undo
128 131
         return str_replace($nl, "\n", $renderer->render($diff)) . "\n";
129 132
     }
130 133
 
134
+    /**
135
+     * @param string $string
136
+     */
131 137
     public function _splitOnWords($string, $newlineEscape = "\n")
132 138
     {
133 139
         $words = array();
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -118,11 +118,11 @@
 block discarded – undo
118 118
          * preserve whitespace as well. Therefore we split on words,
119 119
          * but include all blocks of whitespace in the wordlist. */
120 120
         $diff = new Text_Diff($this->_splitOnWords($text1, $nl),
121
-                               $this->_splitOnWords($text2, $nl));
121
+                                $this->_splitOnWords($text2, $nl));
122 122
 
123 123
         /* Get the diff in inline format. */
124 124
         $renderer = new Text_Diff_Renderer_inline(array_merge($this->getParams(),
125
-                                                               array('split_level' => 'words')));
125
+                                                                array('split_level' => 'words')));
126 126
 
127 127
         /* Run the diff and get the output. */
128 128
         return str_replace($nl, "\n", $renderer->render($diff)) . "\n";
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -72,14 +72,14 @@  discard block
 block discarded – undo
72 72
         if ($this->_split_level == 'words') {
73 73
             return implode('', $lines);
74 74
         } else {
75
-            return implode("\n", $lines) . "\n";
75
+            return implode("\n", $lines)."\n";
76 76
         }
77 77
     }
78 78
 
79 79
     public function _added($lines)
80 80
     {
81 81
         array_walk($lines, array(&$this, '_encode'));
82
-        $lines[0] = $this->_ins_prefix . $lines[0];
82
+        $lines[0] = $this->_ins_prefix.$lines[0];
83 83
         $lines[count($lines) - 1] .= $this->_ins_suffix;
84 84
         return $this->_lines($lines, ' ', false);
85 85
     }
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
     public function _deleted($lines, $words = false)
88 88
     {
89 89
         array_walk($lines, array(&$this, '_encode'));
90
-        $lines[0] = $this->_del_prefix . $lines[0];
90
+        $lines[0] = $this->_del_prefix.$lines[0];
91 91
         $lines[count($lines) - 1] .= $this->_del_suffix;
92 92
         return $this->_lines($lines, ' ', false);
93 93
     }
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
                 $orig[0] = substr($orig[0], 1);
106 106
                 $final[0] = substr($final[0], 1);
107 107
             }
108
-            return $prefix . $this->_deleted($orig) . $this->_added($final);
108
+            return $prefix.$this->_deleted($orig).$this->_added($final);
109 109
         }
110 110
 
111 111
         $text1 = implode("\n", $orig);
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
                                                                array('split_level' => 'words')));
126 126
 
127 127
         /* Run the diff and get the output. */
128
-        return str_replace($nl, "\n", $renderer->render($diff)) . "\n";
128
+        return str_replace($nl, "\n", $renderer->render($diff))."\n";
129 129
     }
130 130
 
131 131
     public function _splitOnWords($string, $newlineEscape = "\n")
Please login to merge, or discard this patch.
html/modules/altsys/setup_xoops_trust_path.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -1,45 +1,45 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-$xoopsOption['nocommon'] = 1 ;
4
-define('_LEGACY_PREVENT_LOAD_CORE_', 1) ;
3
+$xoopsOption['nocommon'] = 1;
4
+define('_LEGACY_PREVENT_LOAD_CORE_', 1);
5 5
 
6
-include '../../mainfile.php' ;
6
+include '../../mainfile.php';
7 7
 
8 8
 if (defined('XOOPS_TRUST_PATH') && XOOPS_TRUST_PATH != '' && file_exists(XOOPS_TRUST_PATH.'/libs/altsys')) {
9
-    die('No problem with your XOOPS_TRUST_PATH') ;
9
+    die('No problem with your XOOPS_TRUST_PATH');
10 10
 }
11 11
 
12 12
 
13 13
 // show the hint if password mathes
14
-$hint = '' ;
14
+$hint = '';
15 15
 if (@$_POST['dbpassword'] == XOOPS_DB_PASS) {
16 16
     // find XOOPS_TRUST_PATH
17
-    $xoops_trust_path = '' ;
18
-    $base_dirs = array( XOOPS_ROOT_PATH , dirname(XOOPS_ROOT_PATH) , dirname(dirname(XOOPS_ROOT_PATH)) ) ;
17
+    $xoops_trust_path = '';
18
+    $base_dirs = array(XOOPS_ROOT_PATH, dirname(XOOPS_ROOT_PATH), dirname(dirname(XOOPS_ROOT_PATH)));
19 19
     foreach ($base_dirs as $base_dir) {
20
-        $dh = @opendir($base_dir) ;
21
-        if (! empty($dh)) {
20
+        $dh = @opendir($base_dir);
21
+        if (!empty($dh)) {
22 22
             while (($file = readdir($dh)) !== false) {
23 23
                 if (substr($file, 0, 1) == '.') {
24
-                    continue ;
24
+                    continue;
25 25
                 }
26
-                $fullpath = $base_dir . '/' . $file ;
27
-                if (! is_dir($fullpath)) {
28
-                    continue ;
26
+                $fullpath = $base_dir.'/'.$file;
27
+                if (!is_dir($fullpath)) {
28
+                    continue;
29 29
                 }
30 30
                 if (is_dir($fullpath.'/libs/altsys')) {
31
-                    $xoops_trust_path = $fullpath ;
32
-                    break 2 ;
31
+                    $xoops_trust_path = $fullpath;
32
+                    break 2;
33 33
                 }
34 34
             }
35 35
         }
36 36
     }
37 37
     // fall back
38 38
     if (empty($xoops_trust_path)) {
39
-        $xoops_trust_path = dirname(XOOPS_ROOT_PATH).'/xoops_trust_path' ;
39
+        $xoops_trust_path = dirname(XOOPS_ROOT_PATH).'/xoops_trust_path';
40 40
     }
41 41
     // create the hint
42
-    if (! defined('XOOPS_TRUST_PATH')) {
42
+    if (!defined('XOOPS_TRUST_PATH')) {
43 43
         $hint = "Insert the red line.<br />define('XOOPS_ROOT_PATH', '".htmlspecialchars(XOOPS_ROOT_PATH, ENT_QUOTES)."');<br /><ins style='color:red;'>define('XOOPS_TRUST_PATH', '".htmlspecialchars($xoops_trust_path, ENT_QUOTES)."');</ins>";
44 44
     } else {
45 45
         $hint = "<del>define('XOOPS_TRUST_PATH', '');</del><br /><ins style='color:red;'>define('XOOPS_TRUST_PATH', '".htmlspecialchars($xoops_trust_path, ENT_QUOTES)."');</ins>";
Please login to merge, or discard this patch.
html/modules/altsys/index.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-$xoopsOption['nocommon'] = 1 ;
4
-define('_LEGACY_PREVENT_LOAD_CORE_', true) ;
5
-require '../../mainfile.php' ;
3
+$xoopsOption['nocommon'] = 1;
4
+define('_LEGACY_PREVENT_LOAD_CORE_', true);
5
+require '../../mainfile.php';
6 6
 
7
-header('Location: '.XOOPS_URL.'/user.php') ;
7
+header('Location: '.XOOPS_URL.'/user.php');
Please login to merge, or discard this patch.
html/modules/altsys/mytrustdirname.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,2 +1,2 @@
 block discarded – undo
1 1
 <?php
2
-    $mytrustdirname = 'altsys' ;
2
+    $mytrustdirname = 'altsys';
Please login to merge, or discard this patch.
html/preload/SetupAltsysLangMgr.class.php 1 patch
Spacing   +33 added lines, -33 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
-        require_once($langmanpath) ;
44
-        $this->langman =& D3LanguageManager::getInstance() ;
45
-        $this->langman->language = $this->mLanguageName ;
43
+        require_once($langmanpath);
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,8 +91,8 @@  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') ;
95
-        $this->_loadLanguage('legacy', 'setting') ;
94
+        $this->_loadLanguage('legacy', 'global');
95
+        $this->_loadLanguage('legacy', 'setting');
96 96
 
97 97
         //
98 98
         // 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/include/admin_in_theme_header.inc.php 3 patches
Switch Indentation   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -201,41 +201,41 @@
 block discarded – undo
201 201
             }
202 202
         }
203 203
         switch ($block_arr[$i]->getVar('side')) {
204
-        case XOOPS_SIDEBLOCK_LEFT:
205
-            if (!isset($show_lblock)) {
206
-                $xoopsTpl->assign('xoops_showlblock', 1);
207
-                $show_lblock = 1;
208
-            }
209
-            $xoopsTpl->append('xoops_lblocks', array('title' => $block_arr[$i]->getVar('title'), 'content' => $bcontent, 'weight' => $block_arr[$i]->getVar('weight')));
210
-            break;
211
-        case XOOPS_CENTERBLOCK_LEFT:
212
-            if (!isset($show_cblock)) {
213
-                $xoopsTpl->assign('xoops_showcblock', 1);
214
-                $show_cblock = 1;
215
-            }
216
-            $xoopsTpl->append('xoops_clblocks', array('title' => $block_arr[$i]->getVar('title'), 'content' => $bcontent, 'weight' => $block_arr[$i]->getVar('weight')));
217
-            break;
218
-        case XOOPS_CENTERBLOCK_RIGHT:
219
-            if (!isset($show_cblock)) {
220
-                $xoopsTpl->assign('xoops_showcblock', 1);
221
-                $show_cblock = 1;
222
-            }
223
-            $xoopsTpl->append('xoops_crblocks', array('title' => $block_arr[$i]->getVar('title'), 'content' => $bcontent, 'weight' => $block_arr[$i]->getVar('weight')));
224
-            break;
225
-        case XOOPS_CENTERBLOCK_CENTER:
226
-            if (!isset($show_cblock)) {
227
-                $xoopsTpl->assign('xoops_showcblock', 1);
228
-                $show_cblock = 1;
229
-            }
230
-            $xoopsTpl->append('xoops_ccblocks', array('title' => $block_arr[$i]->getVar('title'), 'content' => $bcontent, 'weight' => $block_arr[$i]->getVar('weight')));
231
-            break;
232
-        case XOOPS_SIDEBLOCK_RIGHT:
233
-            if (!isset($show_rblock)) {
234
-                $xoopsTpl->assign('xoops_showrblock', 1);
235
-                $show_rblock = 1;
236
-            }
237
-            $xoopsTpl->append('xoops_rblocks', array('title' => $block_arr[$i]->getVar('title'), 'content' => $bcontent, 'weight' => $block_arr[$i]->getVar('weight')));
238
-            break;
204
+            case XOOPS_SIDEBLOCK_LEFT:
205
+                if (!isset($show_lblock)) {
206
+                    $xoopsTpl->assign('xoops_showlblock', 1);
207
+                    $show_lblock = 1;
208
+                }
209
+                $xoopsTpl->append('xoops_lblocks', array('title' => $block_arr[$i]->getVar('title'), 'content' => $bcontent, 'weight' => $block_arr[$i]->getVar('weight')));
210
+                break;
211
+            case XOOPS_CENTERBLOCK_LEFT:
212
+                if (!isset($show_cblock)) {
213
+                    $xoopsTpl->assign('xoops_showcblock', 1);
214
+                    $show_cblock = 1;
215
+                }
216
+                $xoopsTpl->append('xoops_clblocks', array('title' => $block_arr[$i]->getVar('title'), 'content' => $bcontent, 'weight' => $block_arr[$i]->getVar('weight')));
217
+                break;
218
+            case XOOPS_CENTERBLOCK_RIGHT:
219
+                if (!isset($show_cblock)) {
220
+                    $xoopsTpl->assign('xoops_showcblock', 1);
221
+                    $show_cblock = 1;
222
+                }
223
+                $xoopsTpl->append('xoops_crblocks', array('title' => $block_arr[$i]->getVar('title'), 'content' => $bcontent, 'weight' => $block_arr[$i]->getVar('weight')));
224
+                break;
225
+            case XOOPS_CENTERBLOCK_CENTER:
226
+                if (!isset($show_cblock)) {
227
+                    $xoopsTpl->assign('xoops_showcblock', 1);
228
+                    $show_cblock = 1;
229
+                }
230
+                $xoopsTpl->append('xoops_ccblocks', array('title' => $block_arr[$i]->getVar('title'), 'content' => $bcontent, 'weight' => $block_arr[$i]->getVar('weight')));
231
+                break;
232
+            case XOOPS_SIDEBLOCK_RIGHT:
233
+                if (!isset($show_rblock)) {
234
+                    $xoopsTpl->assign('xoops_showrblock', 1);
235
+                    $show_rblock = 1;
236
+                }
237
+                $xoopsTpl->append('xoops_rblocks', array('title' => $block_arr[$i]->getVar('title'), 'content' => $bcontent, 'weight' => $block_arr[$i]->getVar('weight')));
238
+                break;
239 239
         }
240 240
         unset($bcontent);
241 241
     }
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -142,7 +142,7 @@
 block discarded – undo
142 142
     $block_arr = array() ;
143 143
     if (!empty($blockids)) {
144 144
         $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
145
-               . ' AND b.bid IN (' . implode(',', $blockids) . ') ORDER BY b.weight,b.bid' ;
145
+                . ' AND b.bid IN (' . implode(',', $blockids) . ') ORDER BY b.weight,b.bid' ;
146 146
         $result = $db->query($sql);
147 147
         while ($myrow = $db->fetchArray($result)) {
148 148
 
Please login to merge, or discard this patch.
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
30 30
 //  ------------------------------------------------------------------------ //
31 31
 
32
-require_once dirname(__DIR__).'/class/AltsysBreadcrumbs.class.php' ;
32
+require_once dirname(__DIR__).'/class/AltsysBreadcrumbs.class.php';
33 33
 include_once XOOPS_ROOT_PATH.'/class/xoopsblock.php';
34 34
 
35 35
     $xoopsOption['theme_use_smarty'] = 1;
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 //HACK by domifara
59 59
     if (defined('XOOPS_CUBE_LEGACY')) {
60 60
         $handler = xoops_gethandler('block');
61
-        $xoopsblock =& $handler->create(false) ;
61
+        $xoopsblock = & $handler->create(false);
62 62
     } else {
63 63
         $xoopsblock = new XoopsBlock();
64 64
     }
@@ -68,46 +68,46 @@  discard block
 block discarded – undo
68 68
     if (is_object($xoopsUser)) {
69 69
         $xoopsTpl->assign(array('xoops_isuser' => true, 'xoops_userid' => $xoopsUser->getVar('uid'), 'xoops_uname' => $xoopsUser->getVar('uname'), 'xoops_isadmin' => $xoopsUserIsAdmin));
70 70
         if (is_object(@$xoopsModule)) {
71
-            if ($xoopsModule->getVar('mid') == 1 && @$_GET['fct'] == 'preferences' && @$_GET['op'] == 'showmod' && ! empty($_GET['mod'])) {
72
-                $module_handler = xoops_gethandler('module') ;
73
-                $target_module = $module_handler->get((int)$_GET['mod']) ;
71
+            if ($xoopsModule->getVar('mid') == 1 && @$_GET['fct'] == 'preferences' && @$_GET['op'] == 'showmod' && !empty($_GET['mod'])) {
72
+                $module_handler = xoops_gethandler('module');
73
+                $target_module = $module_handler->get((int)$_GET['mod']);
74 74
             } else {
75
-                $target_module =& $xoopsModule ;
75
+                $target_module = & $xoopsModule;
76 76
             }
77 77
 
78 78
             // set page title
79 79
             $xoopsTpl->assign(array('xoops_pagetitle' => $target_module->getVar('name'), 'xoops_modulename' => $target_module->getVar('name'), 'xoops_dirname' => $target_module->getVar('dirname')));
80 80
 
81 81
             // xoops_breadcrumbs
82
-            $breadcrumbsObj =& AltsysBreadcrumbs::getInstance() ;
82
+            $breadcrumbsObj = & AltsysBreadcrumbs::getInstance();
83 83
             if ($breadcrumbsObj->hasPaths()) {
84
-                $xoops_breadcrumbs = $breadcrumbsObj->getXoopsBreadcrumbs() ;
84
+                $xoops_breadcrumbs = $breadcrumbsObj->getXoopsBreadcrumbs();
85 85
             } else {
86
-                $mod_url = XOOPS_URL.'/modules/'.$target_module->getVar('dirname') ;
87
-                $mod_path = XOOPS_ROOT_PATH.'/modules/'.$target_module->getVar('dirname') ;
88
-                $modinfo = $target_module->getInfo() ;
89
-                $xoops_breadcrumbs = array() ;
90
-                if (! empty($modinfo['hasMain'])) {
86
+                $mod_url = XOOPS_URL.'/modules/'.$target_module->getVar('dirname');
87
+                $mod_path = XOOPS_ROOT_PATH.'/modules/'.$target_module->getVar('dirname');
88
+                $modinfo = $target_module->getInfo();
89
+                $xoops_breadcrumbs = array();
90
+                if (!empty($modinfo['hasMain'])) {
91 91
                     $xoops_breadcrumbs[] = array(
92
-                        'url' => $mod_url.'/' ,
92
+                        'url' => $mod_url.'/',
93 93
                         'name' => sprintf(_MD_A_AINTHEME_FMT_PUBLICTOP, $target_module->getVar('name'))
94
-                    ) ;
94
+                    );
95 95
                 }
96
-                if (! empty($modinfo['adminindex'])) {
96
+                if (!empty($modinfo['adminindex'])) {
97 97
                     $xoops_breadcrumbs[] = array(
98
-                        'url' => $mod_url.'/'.$modinfo['adminindex'] ,
98
+                        'url' => $mod_url.'/'.$modinfo['adminindex'],
99 99
                         'name' => sprintf(_MD_A_AINTHEME_FMT_ADMINTOP, $target_module->getVar('name'))
100
-                    ) ;
100
+                    );
101 101
                 }
102
-                if (! empty($GLOBALS['altsysAdminPageTitle'])) {
103
-                    $xoops_breadcrumbs[] = array( 'name' => htmlspecialchars($GLOBALS['altsysAdminPageTitle'], ENT_QUOTES) ) ;
104
-                } elseif (! empty($modinfo['adminmenu'])) {
105
-                    @include $mod_path.'/'.$modinfo['adminmenu'] ;
102
+                if (!empty($GLOBALS['altsysAdminPageTitle'])) {
103
+                    $xoops_breadcrumbs[] = array('name' => htmlspecialchars($GLOBALS['altsysAdminPageTitle'], ENT_QUOTES));
104
+                } elseif (!empty($modinfo['adminmenu'])) {
105
+                    @include $mod_path.'/'.$modinfo['adminmenu'];
106 106
                     if (is_array(@$adminmenu)) {
107 107
                         foreach ($adminmenu as $eachmenu) {
108 108
                             if (strstr($_SERVER['REQUEST_URI'], $eachmenu['link'])) {
109
-                                $xoops_breadcrumbs[] = array( 'name' => $eachmenu['title'] ) ;
110
-                                break ;
109
+                                $xoops_breadcrumbs[] = array('name' => $eachmenu['title']);
110
+                                break;
111 111
                             }
112 112
                         }
113 113
                     }
@@ -116,21 +116,21 @@  discard block
 block discarded – undo
116 116
 
117 117
             //$block_arr =& $xoopsblock->getAllByGroupModule($xoopsUser->getGroups(), $target_module->getVar('mid'), false, XOOPS_BLOCK_VISIBLE);
118 118
         } else {
119
-            $xoopsTpl->assign(array( 'xoops_pagetitle' => _CPHOME )) ;
119
+            $xoopsTpl->assign(array('xoops_pagetitle' => _CPHOME));
120 120
             $xoops_breadcrumbs = array(
121 121
                 array(
122
-                    'url' => XOOPS_URL.'/admin.php' ,
122
+                    'url' => XOOPS_URL.'/admin.php',
123 123
                     'name' => _CPHOME
124 124
                 )
125
-            ) ;
125
+            );
126 126
         }
127 127
     } else {
128
-        exit ;
128
+        exit;
129 129
     }
130 130
 
131 131
     // get block_arr
132
-    $db = XoopsDatabaseFactory::getDatabaseConnection() ;
133
-    $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()) . ')';
132
+    $db = XoopsDatabaseFactory::getDatabaseConnection();
133
+    $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()).')';
134 134
     $result = $db->query($sql);
135 135
 
136 136
     $blockids = array();
@@ -138,30 +138,30 @@  discard block
 block discarded – undo
138 138
         $blockids[] = (int)$blockid;
139 139
     }
140 140
 
141
-    global $block_arr , $i ; // for piCal :-)
142
-    $block_arr = array() ;
141
+    global $block_arr, $i; // for piCal :-)
142
+    $block_arr = array();
143 143
     if (!empty($blockids)) {
144
-        $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
145
-               . ' AND b.bid IN (' . implode(',', $blockids) . ') ORDER BY b.weight,b.bid' ;
144
+        $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
145
+               . ' AND b.bid IN ('.implode(',', $blockids).') ORDER BY b.weight,b.bid';
146 146
         $result = $db->query($sql);
147 147
         while ($myrow = $db->fetchArray($result)) {
148 148
 
149 149
 //HACK by domifara
150 150
             if (defined('XOOPS_CUBE_LEGACY')) {
151
-                $block =& $handler->create(false) ;
151
+                $block = & $handler->create(false);
152 152
                 $block->assignVars($myrow);
153 153
             } else {
154
-                $block = new XoopsBlock($myrow) ;
154
+                $block = new XoopsBlock($myrow);
155 155
             }
156 156
 
157
-            $block_arr[ $myrow['bid'] ] = $block ;
157
+            $block_arr[$myrow['bid']] = $block;
158 158
         }
159 159
     }
160 160
 
161
-    $adminmenublock_exists = false ;
161
+    $adminmenublock_exists = false;
162 162
     foreach (array_keys($block_arr) as $i) {
163 163
         if ($block_arr[$i]->getVar('show_func') == 'b_altsys_admin_menu_show') {
164
-            $adminmenublock_exists = true ;
164
+            $adminmenublock_exists = true;
165 165
         }
166 166
         $bcachetime = $block_arr[$i]->getVar('bcachetime');
167 167
         if (empty($bcachetime)) {
@@ -242,15 +242,15 @@  discard block
 block discarded – undo
242 242
     }
243 243
 
244 244
     // FALLBACK inserting admin_menu_block in admin side
245
-    if (! $adminmenublock_exists) {
246
-        require_once XOOPS_ROOT_PATH.'/modules/altsys/blocks/blocks.php' ;
247
-        $admin_menu_block = array( b_altsys_admin_menu_show(array( 'altsys' )) ) ;
248
-        $admin_menu_block[0]['title'] = 'Admin Menu' ;
249
-        $lblocks =& $xoopsTpl->get_template_vars('xoops_lblocks') ;
250
-        if (! is_array($lblocks)) {
251
-            $lblocks = array() ;
245
+    if (!$adminmenublock_exists) {
246
+        require_once XOOPS_ROOT_PATH.'/modules/altsys/blocks/blocks.php';
247
+        $admin_menu_block = array(b_altsys_admin_menu_show(array('altsys')));
248
+        $admin_menu_block[0]['title'] = 'Admin Menu';
249
+        $lblocks = & $xoopsTpl->get_template_vars('xoops_lblocks');
250
+        if (!is_array($lblocks)) {
251
+            $lblocks = array();
252 252
         }
253
-        $xoopsTpl->assign('xoops_lblocks', array_merge($admin_menu_block, $lblocks)) ;
253
+        $xoopsTpl->assign('xoops_lblocks', array_merge($admin_menu_block, $lblocks));
254 254
     }
255 255
 
256 256
     //unset($block_arr);
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/include/compilehook.inc.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -5,20 +5,20 @@
 block discarded – undo
5 5
 // save assigned variables for the template
6 6
 function tplsadmin_save_tplsvars($file, $smarty)
7 7
 {
8
-    $tplsvars_file = 'tplsvars_' ;
9
-    $tplsvars_file .= substr(md5(substr(XOOPS_DB_PASS, 0, 4)), 0, 4) . '_' ;
8
+    $tplsvars_file = 'tplsvars_';
9
+    $tplsvars_file .= substr(md5(substr(XOOPS_DB_PASS, 0, 4)), 0, 4).'_';
10 10
     if (strncmp($file, 'db:', 3) === 0) {
11
-        $tplsvars_file .= substr($file, 3) ;
11
+        $tplsvars_file .= substr($file, 3);
12 12
     } elseif (strncmp($file, 'file:', 5) === 0) {
13
-        $tplsvars_file .= strtr(substr($file, 5), '/', '%') ;
13
+        $tplsvars_file .= strtr(substr($file, 5), '/', '%');
14 14
     } else {
15
-        $tplsvars_file .= strtr($file, '/', '%') ;
15
+        $tplsvars_file .= strtr($file, '/', '%');
16 16
     }
17 17
 
18 18
     if ($fw = @fopen(XOOPS_COMPILE_PATH.'/'.$tplsvars_file, 'x')) {
19
-        fwrite($fw, serialize($smarty->_tpl_vars)) ;
20
-        fclose($fw) ;
21
-        return true ;
19
+        fwrite($fw, serialize($smarty->_tpl_vars));
20
+        fclose($fw);
21
+        return true;
22 22
     }
23
-    return false ;
23
+    return false;
24 24
 }
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/include/lang_functions.php 1 patch
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -2,91 +2,91 @@
 block discarded – undo
2 2
 
3 3
 function altsys_mylangadmin_get_constant_names($langfile_unique_path, $mydirname)
4 4
 {
5
-    $constpref = '' ;
6
-    $langfile_names = array() ;
7
-    $reqonce_ret = 0 ;
8
-    $already_read = false ;
9
-    $langfile_fingerprint = '_MYLANGADMIN_'.md5($langfile_unique_path) ;
5
+    $constpref = '';
6
+    $langfile_names = array();
7
+    $reqonce_ret = 0;
8
+    $already_read = false;
9
+    $langfile_fingerprint = '_MYLANGADMIN_'.md5($langfile_unique_path);
10 10
 
11 11
     // for debug
12 12
     //require_once XOOPS_TRUST_PATH.'/modules/pico/language/japanese/modinfo.php' ;
13 13
 
14 14
     // get constant_names by "require"
15
-    if (! defined($langfile_fingerprint)) {
16
-        $system_constants = array_keys(get_defined_constants()) ;
17
-        $reqonce_ret = require_once($langfile_unique_path) ;
18
-        $langfile_names = array_diff(array_keys(get_defined_constants()), $system_constants) ;
15
+    if (!defined($langfile_fingerprint)) {
16
+        $system_constants = array_keys(get_defined_constants());
17
+        $reqonce_ret = require_once($langfile_unique_path);
18
+        $langfile_names = array_diff(array_keys(get_defined_constants()), $system_constants);
19 19
     }
20 20
 
21 21
     // We have to parse the file if it has been already included ...
22 22
     if (empty($langfile_names) && ($reqonce_ret === true || defined($langfile_fingerprint))) {
23
-        $already_read = true ;
24
-        $langfile_names = altsys_mylangadmin_get_constant_names_by_pcre($langfile_unique_path) ;
23
+        $already_read = true;
24
+        $langfile_names = altsys_mylangadmin_get_constant_names_by_pcre($langfile_unique_path);
25 25
     }
26 26
 
27 27
     // modinfo.php of D3 module
28 28
     if (empty($langfile_names) && file_exists(XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/mytrustdirname.php') /* && substr( $langfile_unique_path , -11 ) == 'modinfo.php' */) {
29 29
         // get $constpref
30
-        $constpref = '' ;
31
-        require $langfile_unique_path ;
32
-        $langfile_names = array() ;
30
+        $constpref = '';
31
+        require $langfile_unique_path;
32
+        $langfile_names = array();
33 33
         if ($constpref) {
34 34
             foreach (array_keys(get_defined_constants()) as $name) {
35 35
                 if (strncmp($name, $constpref, strlen($constpref)) == 0) {
36
-                    $langfile_names[] = $name ;
36
+                    $langfile_names[] = $name;
37 37
                 }
38 38
             }
39 39
         }
40 40
     }
41 41
 
42 42
 
43
-    return array( $langfile_names , $constpref , $already_read ) ;
43
+    return array($langfile_names, $constpref, $already_read);
44 44
 }
45 45
 
46 46
 
47 47
 function altsys_mylangadmin_get_constant_names_by_pcre($langfile_path)
48 48
 {
49
-    if (! file_exists($langfile_path)) {
50
-        return array() ;
49
+    if (!file_exists($langfile_path)) {
50
+        return array();
51 51
     }
52
-    $file_contents = file_get_contents($langfile_path) ;
53
-    preg_match_all('/\n\s*define\(\s*(["\'])([0-9a-zA-Z_]+)\\1/iU', $file_contents, $matches) ;
54
-    $langfile_names = array() ;
52
+    $file_contents = file_get_contents($langfile_path);
53
+    preg_match_all('/\n\s*define\(\s*(["\'])([0-9a-zA-Z_]+)\\1/iU', $file_contents, $matches);
54
+    $langfile_names = array();
55 55
     foreach ($matches[2] as $name) {
56 56
         // if( defined( $name ) )
57
-        $langfile_names[] = $name ;
57
+        $langfile_names[] = $name;
58 58
     }
59 59
 
60
-    return $langfile_names ;
60
+    return $langfile_names;
61 61
 }
62 62
 
63 63
 
64 64
 function altsys_mylangadmin_get_constants_by_pcre($langfile_path)
65 65
 {
66
-    if (! file_exists($langfile_path)) {
67
-        return array() ;
66
+    if (!file_exists($langfile_path)) {
67
+        return array();
68 68
     }
69 69
 
70
-    $file_contents = file_get_contents($langfile_path) ;
71
-    preg_match_all('/\n\s*define\(\s*(["\'])([0-9a-zA-Z_]+)\\1\s*\,\s*(["\'])([^\\3]+)\\3/iU', $file_contents, $matches) ;
72
-    $constants = array() ;
70
+    $file_contents = file_get_contents($langfile_path);
71
+    preg_match_all('/\n\s*define\(\s*(["\'])([0-9a-zA-Z_]+)\\1\s*\,\s*(["\'])([^\\3]+)\\3/iU', $file_contents, $matches);
72
+    $constants = array();
73 73
     foreach ($matches[2] as $i => $name) {
74
-        $constants[ $name ] = $matches[4][$i] ;
74
+        $constants[$name] = $matches[4][$i];
75 75
     }
76 76
 
77
-    return $constants ;
77
+    return $constants;
78 78
 }
79 79
 
80 80
 
81 81
 function altsys_mylangadmin_errordie($target_mname, $message4disp)
82 82
 {
83
-    xoops_cp_header() ;
84
-    altsys_include_mymenu() ;
85
-    $breadcrumbsObj =& AltsysBreadcrumbs::getInstance() ;
86
-    $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&amp;lib=altsys&amp;page=mylangadmin', _MI_ALTSYS_MENU_MYLANGADMIN) ;
87
-    $breadcrumbsObj->appendPath('', $target_mname) ;
88
-    echo '<h3>' . _MYLANGADMIN_H3_MODULE . ' : ' . $target_mname . '</h3>' ;
89
-    echo '<p>'.$message4disp.'</p>' ;
90
-    xoops_cp_footer() ;
91
-    exit ;
83
+    xoops_cp_header();
84
+    altsys_include_mymenu();
85
+    $breadcrumbsObj = & AltsysBreadcrumbs::getInstance();
86
+    $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&amp;lib=altsys&amp;page=mylangadmin', _MI_ALTSYS_MENU_MYLANGADMIN);
87
+    $breadcrumbsObj->appendPath('', $target_mname);
88
+    echo '<h3>'._MYLANGADMIN_H3_MODULE.' : '.$target_mname.'</h3>';
89
+    echo '<p>'.$message4disp.'</p>';
90
+    xoops_cp_footer();
91
+    exit;
92 92
 }
Please login to merge, or discard this patch.