@@ -33,12 +33,12 @@ discard block |
||
33 | 33 | |
34 | 34 | // validateInputArgument |
35 | 35 | if (empty($argv[1])) { |
36 | - echo 'Usage: '.$argv[0].' [/path/to/module_or_theme_or_file]'.PHP_EOL; |
|
36 | + echo 'Usage: ' . $argv[0] . ' [/path/to/module_or_theme_or_file]' . PHP_EOL; |
|
37 | 37 | die(); |
38 | 38 | } |
39 | 39 | |
40 | 40 | $objects = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($argv[1]), RecursiveIteratorIterator::SELF_FIRST); |
41 | - foreach($objects as $name => $object) { |
|
41 | + foreach ($objects as $name => $object) { |
|
42 | 42 | if (strpos($name, '.svn/') === false && strpos($name, '.git/') === false) { |
43 | 43 | |
44 | 44 | $filename = realpath($name); |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | 'gap' |
78 | 78 | ); |
79 | 79 | foreach ($replace as $value) { |
80 | - $content = str_replace('z-'.$value, $value, $content); |
|
80 | + $content = str_replace('z-' . $value, $value, $content); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | $content = $matches[1]; |
114 | 114 | $content = str_replace('<h3>', '', $content); |
115 | 115 | $content = str_replace('</h3>', '', $content); |
116 | - return '<h3>'.$content.'</h3>'; |
|
116 | + return '<h3>' . $content . '</h3>'; |
|
117 | 117 | |
118 | 118 | } |
119 | 119 | |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | */ |
127 | 127 | function formCallback1($matches) |
128 | 128 | { |
129 | - return '<div class="form-group">'.$matches[1].'<label class="col-sm-3 control-label"'.$matches[2].'</label>'.$matches[1].'<div class="col-sm-9">'; |
|
129 | + return '<div class="form-group">' . $matches[1] . '<label class="col-sm-3 control-label"' . $matches[2] . '</label>' . $matches[1] . '<div class="col-sm-9">'; |
|
130 | 130 | |
131 | 131 | } |
132 | 132 | |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | */ |
140 | 140 | function formCallback2($matches) |
141 | 141 | { |
142 | - return '</div>'."\n".$matches[1].'</div>'."\n".$matches[1].'</fieldset>'; |
|
142 | + return '</div>' . "\n" . $matches[1] . '</div>' . "\n" . $matches[1] . '</fieldset>'; |
|
143 | 143 | |
144 | 144 | } |
145 | 145 | |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | */ |
153 | 153 | function formCallback3($matches) |
154 | 154 | { |
155 | - return '</div>'."\n".$matches[3].'<div id="'.$matches[1].'">'."\n".$matches[3].'<div class="form-group">'; |
|
155 | + return '</div>' . "\n" . $matches[3] . '<div id="' . $matches[1] . '">' . "\n" . $matches[3] . '<div class="form-group">'; |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | /** |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | */ |
165 | 165 | function formCallback4($matches) |
166 | 166 | { |
167 | - return '</div>'."\n".$matches[1].'</div>'."\n".$matches[1].'<div class="form-group">'; |
|
167 | + return '</div>' . "\n" . $matches[1] . '</div>' . "\n" . $matches[1] . '<div class="form-group">'; |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | /** |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | $content = str_replace('type="password"', 'type="text" class="form-control"', $content); |
183 | 183 | $content = str_replace('<select', '<select class="form-control"', $content); |
184 | 184 | |
185 | - return '<form class="form'.$content.'</form>'; |
|
185 | + return '<form class="form' . $content . '</form>'; |
|
186 | 186 | } |
187 | 187 | |
188 | 188 | |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | $content = str_replace('<a', ' <a class="btn btn-default"', $content); |
200 | 200 | $content = str_replace('{button', ' {button', $content); |
201 | 201 | |
202 | - return '<div class="form-group">'."\n".' <div class="col-sm-offset-3 col-sm-9">'.$content.' </div>'."\n".' </div>'; |
|
202 | + return '<div class="form-group">' . "\n" . ' <div class="col-sm-offset-3 col-sm-9">' . $content . ' </div>' . "\n" . ' </div>'; |
|
203 | 203 | } |
204 | 204 | } |
205 | 205 |
@@ -935,9 +935,9 @@ discard block |
||
935 | 935 | { |
936 | 936 | // Assemble the markup. |
937 | 937 | $console = $this->markupHeader() |
938 | - . $this->markupMenu() |
|
939 | - . $this->markupBodyContent() |
|
940 | - . $this->markupFooter(); |
|
938 | + . $this->markupMenu() |
|
939 | + . $this->markupBodyContent() |
|
940 | + . $this->markupFooter(); |
|
941 | 941 | // A single print is used in the class. |
942 | 942 | return print $console; |
943 | 943 | } |
@@ -1009,18 +1009,18 @@ discard block |
||
1009 | 1009 | { |
1010 | 1010 | // Array of explanatoty defines, keyed by operations. |
1011 | 1011 | $explanations = array('theme' => __('<strong>INSTRUCTIONS:</strong> Use this utility to recover from theme-related fatal errors or to reset user-specified themes.'), |
1012 | - 'permission' => __('<strong>INSTRUCTIONS:</strong> Use this utility to reset your site permissions to the default state that was set when you originally installed the site. Carefully review the chart below as an example of how your permissions will be setup after running this utility.'), |
|
1013 | - 'block' => __('<strong>INSTRUCTIONS:</strong> Use this utility to disable or delete blocks that you believe are causing issues for your site. Blocks that you disable can still be accessed by the system, but a deleted block is gone for good; double-check your choices before running this utility. If there are no blocks present on your site, this utility will be disabled.'), |
|
1014 | - 'site' => __('<strong>INSTRUCTIONS:</strong> Use this utility to turn on your previously disabled site.'), |
|
1015 | - 'password' => __('<strong>INSTRUCTIONS:</strong> Use this utility to reset your admin (or other) password.'), |
|
1016 | - 'tempdir' => __('<strong>INSTRUCTIONS:</strong> Use this utility to rebuild your temp directory in case you accidentally deleted it or it is corrupted.'), |
|
1017 | - 'outputfilter' => __('<strong>INSTRUCTIONS:</strong> Use this utility to reset the output filter to \'internal\'. Useful if there is something wrong with the output filters in use (eg. HTMLPurifier).'), |
|
1018 | - 'phpids' => __('<strong>INSTRUCTIONS:</strong> Use this utility to disable PHPIDS. Useful if your settings in PHPIDS crashed the entire system.'), |
|
1019 | - 'about' => __('About') |
|
1012 | + 'permission' => __('<strong>INSTRUCTIONS:</strong> Use this utility to reset your site permissions to the default state that was set when you originally installed the site. Carefully review the chart below as an example of how your permissions will be setup after running this utility.'), |
|
1013 | + 'block' => __('<strong>INSTRUCTIONS:</strong> Use this utility to disable or delete blocks that you believe are causing issues for your site. Blocks that you disable can still be accessed by the system, but a deleted block is gone for good; double-check your choices before running this utility. If there are no blocks present on your site, this utility will be disabled.'), |
|
1014 | + 'site' => __('<strong>INSTRUCTIONS:</strong> Use this utility to turn on your previously disabled site.'), |
|
1015 | + 'password' => __('<strong>INSTRUCTIONS:</strong> Use this utility to reset your admin (or other) password.'), |
|
1016 | + 'tempdir' => __('<strong>INSTRUCTIONS:</strong> Use this utility to rebuild your temp directory in case you accidentally deleted it or it is corrupted.'), |
|
1017 | + 'outputfilter' => __('<strong>INSTRUCTIONS:</strong> Use this utility to reset the output filter to \'internal\'. Useful if there is something wrong with the output filters in use (eg. HTMLPurifier).'), |
|
1018 | + 'phpids' => __('<strong>INSTRUCTIONS:</strong> Use this utility to disable PHPIDS. Useful if your settings in PHPIDS crashed the entire system.'), |
|
1019 | + 'about' => __('About') |
|
1020 | 1020 | .__('<strong>VERSION</strong><br />This is <strong>Version '.self::VERSION.'</strong> of the <strong>Zikula Recovery Console</strong><br /><br />') |
1021 | 1021 | .__('<strong>LICENSE</strong><br /><a href="http://www.gnu.org/copyleft/gpl.html" title="General Public License">General Public License</a><br /><br />') |
1022 | 1022 | .__('<strong>CREDITS</strong><br />Maintained and enhanced by the Zikula CoreDev team. Originally developed by <a href="http://www.alarconcepts.com/" title="John Alarcon">John Alarcon</a>. Greatly inspired by the ideas and work of <a href="http://www.snowjournal.com" title="Christopher S. Bradford">Christopher S. Bradford</a> and the additional supportive efforts of <a href="http://users.tpg.com.au/staer/" title="Martin Andersen">Martin Andersen</a>, <a href="http://www.landseer-stuttgart.de/" title="Frank Schummertz">Frank Schummertz</a>, <a href="http://pahlscomputers.com/" title="David Pahl">David Pahl</a> and <a href="http://www.itbegins.co.uk/" title="Simon Birtwistle">Simon Birtwistle</a>. Thanks guys!'), |
1023 | - ); |
|
1023 | + ); |
|
1024 | 1024 | // Initialization. |
1025 | 1025 | $explanation = ''; |
1026 | 1026 | // If no op or utility, assume main explanation is needed; return such. |
@@ -1156,7 +1156,7 @@ discard block |
||
1156 | 1156 | $state = false; |
1157 | 1157 | } |
1158 | 1158 | break; |
1159 | - case 'tempdir': |
|
1159 | + case 'tempdir': |
|
1160 | 1160 | if (isset($this->INPUT['confirm']) && $this->INPUT['confirm'] == 1) { |
1161 | 1161 | $this->setRecoveryOutput(__('You have to reload the utility to see the current status of the temp directory.')); |
1162 | 1162 | $state = false; |
@@ -1227,18 +1227,18 @@ discard block |
||
1227 | 1227 | $selector .= '<optgroup label="'.$label.'">'."\n"; |
1228 | 1228 | // Loop through the themes of this type. |
1229 | 1229 | foreach ($themes as $theme) { |
1230 | - if ($theme['state'] == 1) { |
|
1231 | - // Check if form was submitted. |
|
1232 | - if (!$this->INPUT['submit']) { |
|
1233 | - // Default; for selecting the currently set theme in the list. |
|
1234 | - $selected = ($theme['name'] == $this->siteTheme) ? 'selected="selected"' : null; |
|
1235 | - } else { |
|
1236 | - // When submitted, for selecting the selected theme in the list. |
|
1237 | - $selected = ($theme['name'] == $this->INPUT['theme']) ? 'selected="selected"' : null; |
|
1238 | - } |
|
1239 | - // Add option to selector. |
|
1240 | - $selector .= '<option label="'.$theme['name'].'" value="'.$theme['name'].'" '.$selected.'>'.$theme['name'].'</option>'."\n"; |
|
1241 | - } |
|
1230 | + if ($theme['state'] == 1) { |
|
1231 | + // Check if form was submitted. |
|
1232 | + if (!$this->INPUT['submit']) { |
|
1233 | + // Default; for selecting the currently set theme in the list. |
|
1234 | + $selected = ($theme['name'] == $this->siteTheme) ? 'selected="selected"' : null; |
|
1235 | + } else { |
|
1236 | + // When submitted, for selecting the selected theme in the list. |
|
1237 | + $selected = ($theme['name'] == $this->INPUT['theme']) ? 'selected="selected"' : null; |
|
1238 | + } |
|
1239 | + // Add option to selector. |
|
1240 | + $selector .= '<option label="'.$theme['name'].'" value="'.$theme['name'].'" '.$selected.'>'.$theme['name'].'</option>'."\n"; |
|
1241 | + } |
|
1242 | 1242 | } |
1243 | 1243 | // Ending the optgroup. |
1244 | 1244 | $selector .= '</optgroup>'."\n"; |
@@ -1313,7 +1313,7 @@ discard block |
||
1313 | 1313 | return $form; |
1314 | 1314 | } |
1315 | 1315 | |
1316 | - // Get additional inputs for temporary directory rebuild. |
|
1316 | + // Get additional inputs for temporary directory rebuild. |
|
1317 | 1317 | public function getUtilityInputsTempdir() |
1318 | 1318 | { |
1319 | 1319 | if ($this->tempdirexists == false) { |
@@ -1553,7 +1553,7 @@ discard block |
||
1553 | 1553 | case 'outputfilter': |
1554 | 1554 | $success = $this->processRecoveryOutputFilter(); |
1555 | 1555 | break; |
1556 | - case 'phpids': |
|
1556 | + case 'phpids': |
|
1557 | 1557 | $success = $this->processRecoveryPHPIDS(); |
1558 | 1558 | break; |
1559 | 1559 | default: |
@@ -1715,7 +1715,7 @@ discard block |
||
1715 | 1715 | return false; |
1716 | 1716 | } |
1717 | 1717 | |
1718 | - // check that username is not the anonymous one |
|
1718 | + // check that username is not the anonymous one |
|
1719 | 1719 | $anonymous = ModUtil::getVar('Users', 'anonymous'); |
1720 | 1720 | if ($username == $anonymous || $username == strtolower($anonymous)) { |
1721 | 1721 | $this->setError(__('You cannot change the password for the anonymous user. Please provide the username of a valid user')); |
@@ -1784,7 +1784,7 @@ discard block |
||
1784 | 1784 | } |
1785 | 1785 | } |
1786 | 1786 | } |
1787 | - // create all subdirectories |
|
1787 | + // create all subdirectories |
|
1788 | 1788 | else { |
1789 | 1789 | foreach($this->tempdirsubs as $dir => $status) { |
1790 | 1790 | $result = mkdir($this->tempdir.'/'.$dir, null, true); |
@@ -1835,7 +1835,7 @@ discard block |
||
1835 | 1835 | return true; |
1836 | 1836 | } |
1837 | 1837 | |
1838 | - // Process PHPIDS disable |
|
1838 | + // Process PHPIDS disable |
|
1839 | 1839 | public function processRecoveryPHPIDS() |
1840 | 1840 | { |
1841 | 1841 | if (!System::setVar('useids', false)) { |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | { |
67 | 67 | // Set config file target to object early on, for usage in text defines. |
68 | 68 | $dir = explode('/', $_SERVER['PHP_SELF']); |
69 | - $this->siteConfigFile = $this->getServerProtocol().'://'.$this->getHost().'/'.$dir[1].'/config/config.php'; |
|
69 | + $this->siteConfigFile = $this->getServerProtocol() . '://' . $this->getHost() . '/' . $dir[1] . '/config/config.php'; |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | // load all information needed |
@@ -92,11 +92,11 @@ discard block |
||
92 | 92 | while ($dir = readdir($handle)) { |
93 | 93 | // Skip any files, up-dirs, and certain themes. |
94 | 94 | if (substr($dir, 0, 1) == '.' || |
95 | - substr($dir, 0, 5)=='index' || |
|
96 | - substr($dir, 0, 3)=='rss' || |
|
97 | - substr($dir, 0, 4)=='Atom' || |
|
98 | - substr($dir, 0, 7)=='Printer' || |
|
99 | - substr($dir, 0, 9)=='AutoPrint') { |
|
95 | + substr($dir, 0, 5) == 'index' || |
|
96 | + substr($dir, 0, 3) == 'rss' || |
|
97 | + substr($dir, 0, 4) == 'Atom' || |
|
98 | + substr($dir, 0, 7) == 'Printer' || |
|
99 | + substr($dir, 0, 9) == 'AutoPrint') { |
|
100 | 100 | continue; |
101 | 101 | } |
102 | 102 | // Catch the theme name. |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | // |
125 | 125 | // load all modules. |
126 | 126 | // |
127 | - $mods = DBUtil::selectObjectArray('modules',"WHERE ({$this->dbTables['modules_column']['id']} > 0)",'type'); |
|
127 | + $mods = DBUtil::selectObjectArray('modules', "WHERE ({$this->dbTables['modules_column']['id']} > 0)", 'type'); |
|
128 | 128 | // Loop through modules, sorting. |
129 | 129 | foreach ($mods as $mod) { |
130 | 130 | if ($mod['type'] == 3) { |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | $this->tempdirsubsfailed = count($tempdirsubs); |
152 | 152 | // Open the temp directory. |
153 | 153 | $handle = opendir($this->tempdir); |
154 | - if (!$handle){ |
|
154 | + if (!$handle) { |
|
155 | 155 | $this->tempdirexists = false; |
156 | 156 | } else { |
157 | 157 | $this->tempdirexists = true; |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | return true; |
226 | 226 | } |
227 | 227 | // Clean any input and set to object. |
228 | - public function cleanUserInput($input=false) |
|
228 | + public function cleanUserInput($input = false) |
|
229 | 229 | { |
230 | 230 | // Ensure input exists. |
231 | 231 | if (!$input) { |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | $cleaned = array(); |
242 | 242 | foreach ($input as $key=>$val) { |
243 | 243 | // Special case: dba user/pass can contain more than text chars, do it inline. |
244 | - if ($key=='zuname' || $key=='zpass1' || $key=='zpass2') { |
|
244 | + if ($key == 'zuname' || $key == 'zpass1' || $key == 'zpass2') { |
|
245 | 245 | $cleaned[$key] = preg_replace('[!@#$%^_\w]', '', $val); |
246 | 246 | } else { |
247 | 247 | // If $val is not an array, clean and add it to the $cleaned array. |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | $cleaned[$key] = $this->cleanUserInput($val); |
250 | 250 | } else { |
251 | 251 | // Else loop through $val, clean and add its data to $cleaned array. |
252 | - foreach($val as $key2=>$val2) { |
|
252 | + foreach ($val as $key2=>$val2) { |
|
253 | 253 | $cleaned[$key][$key2] = $this->cleanUserInput($val2); |
254 | 254 | } |
255 | 255 | } |
@@ -314,49 +314,49 @@ discard block |
||
314 | 314 | public function markupHeader() |
315 | 315 | { |
316 | 316 | // Handles everything through the opening <body> tag, inclusive. |
317 | - $head = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"'."\n"; |
|
318 | - $head .= '"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'."\n"; |
|
319 | - $head .= '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US">'."\n\n"; |
|
320 | - $head .= '<head>'."\n\n"; |
|
321 | - $head .= '<meta http-equiv="content-type" content="text/html; charset=utf-8" />'."\n\n"; |
|
322 | - $head .= '<title>'.'Zikula Recovery Console'.'</title>'."\n\n"; |
|
317 | + $head = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"' . "\n"; |
|
318 | + $head .= '"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">' . "\n"; |
|
319 | + $head .= '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US">' . "\n\n"; |
|
320 | + $head .= '<head>' . "\n\n"; |
|
321 | + $head .= '<meta http-equiv="content-type" content="text/html; charset=utf-8" />' . "\n\n"; |
|
322 | + $head .= '<title>' . 'Zikula Recovery Console' . '</title>' . "\n\n"; |
|
323 | 323 | // Countdown timer script. For GUI purposes only; security is not dependent upon Javascript. |
324 | 324 | $head .= $this->markupJavascript(); |
325 | 325 | // All CSS comes via this method. |
326 | 326 | $head .= $this->markupStyles(); |
327 | - $head .= '</head>'."\n\n"; |
|
328 | - $head .= '<body>'."\n\n"; |
|
329 | - $head .= '<div id="container">'."\n\n"; |
|
330 | - $head .= ' <div id="app_title">'.'Zikula Recovery Console'.'</div>'."\n\n"; |
|
327 | + $head .= '</head>' . "\n\n"; |
|
328 | + $head .= '<body>' . "\n\n"; |
|
329 | + $head .= '<div id="container">' . "\n\n"; |
|
330 | + $head .= ' <div id="app_title">' . 'Zikula Recovery Console' . '</div>' . "\n\n"; |
|
331 | 331 | // Return the string. |
332 | 332 | return $head; |
333 | 333 | } |
334 | 334 | // Markup the Recovery Console page script. |
335 | 335 | public function markupJavascript() |
336 | 336 | { |
337 | - $js = '<script type="text/javascript">'."\n"; |
|
338 | - $js .= '<!--'."\n"; |
|
339 | - $js .= ' public function countDown(n) {'."\n"; |
|
337 | + $js = '<script type="text/javascript">' . "\n"; |
|
338 | + $js .= '<!--' . "\n"; |
|
339 | + $js .= ' public function countDown(n) {' . "\n"; |
|
340 | 340 | $js .= ' if(document.getElementById("timer_container")) {'; |
341 | - $js .= ' mins = Math.floor(n/60);'."\n"; |
|
342 | - $js .= ' if(mins < 10) {'."\n"; |
|
343 | - $js .= ' mins = "0" + mins;'."\n"; |
|
344 | - $js .= ' }'."\n"; |
|
345 | - $js .= ' secs = n - mins*60;'."\n"; |
|
346 | - $js .= ' if(secs < 10) {'."\n"; |
|
347 | - $js .= ' secs = "0" + secs;'."\n"; |
|
348 | - $js .= ' }'."\n"; |
|
349 | - $js .= ' if(n > 0) {'."\n"; |
|
350 | - $js .= ' document.getElementById("timer_container").innerHTML = \''.__('LOCKDOWN TIMER').'<div id="timer_digits">\'+mins+\':\' + secs + \'<\/div><div id="timer_reason">'.__('The Zikula Recovery Console will be automatically disabled when the timer expires. If it expires before you finish your work, simply re-upload the file and refresh your browser. The timer will be reset.').'<\/div>\';'."\n"; |
|
351 | - $js .= ' setTimeout(function() { countDown(n - 1) }, 1000)'."\n"; |
|
352 | - $js .= ' } else if (n == 0) {'."\n"; |
|
353 | - $js .= ' document.getElementById("timer_container").innerHTML = \''.__('LOCKDOWN ENGAGED').'<div id="timer_reason" class="red">'.__('The Zikula Recovery Console is now disabled from further use as a security precaution. You must upload a new copy of this file to reset the lockdown timer.').'<\/div>\';'."\n"; |
|
354 | - $js .= ' }'."\n"; |
|
355 | - $js .= ' }'."\n"; |
|
356 | - $js .= ' }'."\n"; |
|
357 | - $js .= ' onload = function() { countDown('.$this->appTimeElapser().') }'."\n"; |
|
358 | - $js .= '-->'."\n"; |
|
359 | - $js .= '</script>'."\n\n"; |
|
341 | + $js .= ' mins = Math.floor(n/60);' . "\n"; |
|
342 | + $js .= ' if(mins < 10) {' . "\n"; |
|
343 | + $js .= ' mins = "0" + mins;' . "\n"; |
|
344 | + $js .= ' }' . "\n"; |
|
345 | + $js .= ' secs = n - mins*60;' . "\n"; |
|
346 | + $js .= ' if(secs < 10) {' . "\n"; |
|
347 | + $js .= ' secs = "0" + secs;' . "\n"; |
|
348 | + $js .= ' }' . "\n"; |
|
349 | + $js .= ' if(n > 0) {' . "\n"; |
|
350 | + $js .= ' document.getElementById("timer_container").innerHTML = \'' . __('LOCKDOWN TIMER') . '<div id="timer_digits">\'+mins+\':\' + secs + \'<\/div><div id="timer_reason">' . __('The Zikula Recovery Console will be automatically disabled when the timer expires. If it expires before you finish your work, simply re-upload the file and refresh your browser. The timer will be reset.') . '<\/div>\';' . "\n"; |
|
351 | + $js .= ' setTimeout(function() { countDown(n - 1) }, 1000)' . "\n"; |
|
352 | + $js .= ' } else if (n == 0) {' . "\n"; |
|
353 | + $js .= ' document.getElementById("timer_container").innerHTML = \'' . __('LOCKDOWN ENGAGED') . '<div id="timer_reason" class="red">' . __('The Zikula Recovery Console is now disabled from further use as a security precaution. You must upload a new copy of this file to reset the lockdown timer.') . '<\/div>\';' . "\n"; |
|
354 | + $js .= ' }' . "\n"; |
|
355 | + $js .= ' }' . "\n"; |
|
356 | + $js .= ' }' . "\n"; |
|
357 | + $js .= ' onload = function() { countDown(' . $this->appTimeElapser() . ') }' . "\n"; |
|
358 | + $js .= '-->' . "\n"; |
|
359 | + $js .= '</script>' . "\n\n"; |
|
360 | 360 | // Return created string. |
361 | 361 | return $js; |
362 | 362 | } |
@@ -644,33 +644,33 @@ discard block |
||
644 | 644 | public function markupMenu() |
645 | 645 | { |
646 | 646 | // Open the left column container. |
647 | - $menu = ' <div id="left_column">'."\n\n"; |
|
647 | + $menu = ' <div id="left_column">' . "\n\n"; |
|
648 | 648 | // Open the navigation block container. |
649 | 649 | $menu .= ' <div id="navblock">'; |
650 | 650 | // Main link. |
651 | - $menu .= '<strong>'.$this->markupMenuLink('','', __('Main'), __('Configuration Overview')).'</strong>'; |
|
651 | + $menu .= '<strong>' . $this->markupMenuLink('', '', __('Main'), __('Configuration Overview')) . '</strong>'; |
|
652 | 652 | // Additional links. |
653 | - $menu .= $this->markupMenuLink('recover', 'theme', __('Theme Recovery')); |
|
654 | - $menu .= $this->markupMenuLink('recover', 'permission', __('Permission Recovery')); |
|
655 | - $menu .= $this->markupMenuLink('recover', 'block', __('Block Recovery')); |
|
656 | - $menu .= $this->markupMenuLink('recover', 'site', __('Disabled Site Recovery')); |
|
657 | - $menu .= $this->markupMenuLink('recover', 'password', __('Password Reset')); |
|
658 | - $menu .= $this->markupMenuLink('recover', 'tempdir', __('Rebuild Temp Directory')); |
|
659 | - $menu .= $this->markupMenuLink('recover', 'outputfilter', __('Reset Output Filter')); |
|
660 | - $menu .= $this->markupMenuLink('recover', 'phpids', __('Disable PHPIDS')); |
|
661 | - $menu .= $this->markupMenuLink('phpinfo', '', __('PHP Information')); |
|
662 | - $menu .= $this->markupMenuLink('about', '', __('About This Application')); |
|
653 | + $menu .= $this->markupMenuLink('recover', 'theme', __('Theme Recovery')); |
|
654 | + $menu .= $this->markupMenuLink('recover', 'permission', __('Permission Recovery')); |
|
655 | + $menu .= $this->markupMenuLink('recover', 'block', __('Block Recovery')); |
|
656 | + $menu .= $this->markupMenuLink('recover', 'site', __('Disabled Site Recovery')); |
|
657 | + $menu .= $this->markupMenuLink('recover', 'password', __('Password Reset')); |
|
658 | + $menu .= $this->markupMenuLink('recover', 'tempdir', __('Rebuild Temp Directory')); |
|
659 | + $menu .= $this->markupMenuLink('recover', 'outputfilter', __('Reset Output Filter')); |
|
660 | + $menu .= $this->markupMenuLink('recover', 'phpids', __('Disable PHPIDS')); |
|
661 | + $menu .= $this->markupMenuLink('phpinfo', '', __('PHP Information')); |
|
662 | + $menu .= $this->markupMenuLink('about', '', __('About This Application')); |
|
663 | 663 | // Closing the navigation block container. |
664 | - $menu .= '</div>'."\n\n"; |
|
664 | + $menu .= '</div>' . "\n\n"; |
|
665 | 665 | // Add the lockdown timer. |
666 | - $menu .= ' <div id="timer_container"></div>'."\n\n"; |
|
666 | + $menu .= ' <div id="timer_container"></div>' . "\n\n"; |
|
667 | 667 | // Close the left column container. |
668 | - $menu .= ' </div>'."\n\n"; |
|
668 | + $menu .= ' </div>' . "\n\n"; |
|
669 | 669 | // Return the created markup. |
670 | 670 | return $menu; |
671 | 671 | } |
672 | 672 | // Markup the Recovery Console main menu links. |
673 | - public function markupMenuLink($op=false, $utility=false, $text='', $title=false) |
|
673 | + public function markupMenuLink($op = false, $utility = false, $text = '', $title = false) |
|
674 | 674 | { |
675 | 675 | // Check if this link is a database-requiring utility. |
676 | 676 | $dba_reqd = (in_array($utility, $this->getAllDatabaseUtilities())) ? true : false; |
@@ -686,25 +686,25 @@ discard block |
||
686 | 686 | // ----- |
687 | 687 | // Return a dimmed link when incompatibility exists. |
688 | 688 | if (!$this->appCompatible()) { |
689 | - return '<a '.$style.'href="'.$action.'"><del title="'. $title.'">'.$text.$asterisk.'</del></a>'; |
|
689 | + return '<a ' . $style . 'href="' . $action . '"><del title="' . $title . '">' . $text . $asterisk . '</del></a>'; |
|
690 | 690 | } |
691 | 691 | // LINK RETURN POINT: Main un-argumented link |
692 | 692 | // ----- |
693 | 693 | // If no operation present (ie, Main) return link here. |
694 | 694 | if (!$op) { |
695 | - return '<a '.$style.'href="'.$action.'" title="'. $title.'">'.$text.'</a>'; |
|
695 | + return '<a ' . $style . 'href="' . $action . '" title="' . $title . '">' . $text . '</a>'; |
|
696 | 696 | } |
697 | 697 | // Attach operation to action string. |
698 | - $action .= '?op='.$op; |
|
698 | + $action .= '?op=' . $op; |
|
699 | 699 | // Re-assign the selected style based on $op. |
700 | 700 | $style = ($op === $this->operation) ? 'class="selected"' : null; |
701 | 701 | // LINK RETURN POINT: Link has $op arg only (ie, about, phpinfo). |
702 | 702 | // ----- |
703 | 703 | if (!$utility) { |
704 | - return '<a '.$style.'href="'.$action.'" title="'. $title.'">'.$text.'</a>'; |
|
704 | + return '<a ' . $style . 'href="' . $action . '" title="' . $title . '">' . $text . '</a>'; |
|
705 | 705 | } |
706 | 706 | // Attach utility to action string. |
707 | - $action .= '&utility='.$utility; |
|
707 | + $action .= '&utility=' . $utility; |
|
708 | 708 | // Reassign the selected style based on $utility. |
709 | 709 | $style = ($utility == $this->utility) ? 'class="selected" ' : null; |
710 | 710 | // LINK RETURN POINT: Link with $op and $utility, requires DB. |
@@ -712,13 +712,13 @@ discard block |
||
712 | 712 | if ($dba_reqd) { |
713 | 713 | // Return a "dimmed" link if the database connection failed. |
714 | 714 | if (!$this->dbEnabled) { |
715 | - return '<a '.$style.'href="'.$action.'"><del title="'. $title.'">'.$text.$asterisk.'</del></a>'; |
|
715 | + return '<a ' . $style . 'href="' . $action . '"><del title="' . $title . '">' . $text . $asterisk . '</del></a>'; |
|
716 | 716 | } |
717 | 717 | // Return a regular link with $op and $utility args if the database connection exists. |
718 | - return '<a '.$style.'href="'.$action.'" title="'. $title.'">'.$text.$asterisk.'</a>'; |
|
718 | + return '<a ' . $style . 'href="' . $action . '" title="' . $title . '">' . $text . $asterisk . '</a>'; |
|
719 | 719 | } |
720 | 720 | // LINK RETURN POINT: Link with $op and $utility, requires no database access. (ie, dba credential encoding utility.) |
721 | - return '<a '.$style.'href="'.$action.'" title="'. $title.'">'.$text.'</a>'; |
|
721 | + return '<a ' . $style . 'href="' . $action . '" title="' . $title . '">' . $text . '</a>'; |
|
722 | 722 | } |
723 | 723 | // Markup the Recovery Console content area. |
724 | 724 | public function markupBodyContent() |
@@ -730,7 +730,7 @@ discard block |
||
730 | 730 | // Check if app is compatible with site. |
731 | 731 | if (!$this->appCompatible()) { |
732 | 732 | // If not, append a message, close container and return; user goes no further. |
733 | - $content .= __('<strong>THIS APPLICATION IS INCOMPATIBLE WITH YOUR SITE<br />This application works only with Zikula 1.x+.<br />When stil using PostNuke .764 consider the <a href="http://community.zikula.org/Downloads-req-viewdownload-cid-7.htm" title="PostNuke Swiss Army Knife">PostNuke Swiss Army Knife</a> (PSAK) utility.').'</div>'."\n\n"; |
|
733 | + $content .= __('<strong>THIS APPLICATION IS INCOMPATIBLE WITH YOUR SITE<br />This application works only with Zikula 1.x+.<br />When stil using PostNuke .764 consider the <a href="http://community.zikula.org/Downloads-req-viewdownload-cid-7.htm" title="PostNuke Swiss Army Knife">PostNuke Swiss Army Knife</a> (PSAK) utility.') . '</div>' . "\n\n"; |
|
734 | 734 | return $content; |
735 | 735 | } |
736 | 736 | } |
@@ -742,39 +742,39 @@ discard block |
||
742 | 742 | $this->op = false; |
743 | 743 | $this->utility = false; |
744 | 744 | // Append a message, close container and return; user goes no further. |
745 | - $content .= __('Invalid Operation').'</div>'."\n\n"; |
|
745 | + $content .= __('Invalid Operation') . '</div>' . "\n\n"; |
|
746 | 746 | return $content; |
747 | 747 | } |
748 | 748 | |
749 | 749 | // Get and contain the title of the utility. |
750 | - $content .= ' <div id="page_title" title="'.$this->getTitle().'">'.$this->getTitle().'</div>'."\n\n"; |
|
750 | + $content .= ' <div id="page_title" title="' . $this->getTitle() . '">' . $this->getTitle() . '</div>' . "\n\n"; |
|
751 | 751 | // Check if this particular utility requires db access. |
752 | 752 | if (in_array($this->utility, $this->getAllDatabaseUtilities())) { |
753 | 753 | // If so, check if database is ready. |
754 | 754 | if (!$this->dbEnabled) { |
755 | 755 | // If not, set descriptive message, close container & return; go no further. |
756 | - $content .= ' <div id="explain_disabled">Database required.</div>'."\n\n"; |
|
757 | - $content .= ' </div>'."\n\n"; |
|
756 | + $content .= ' <div id="explain_disabled">Database required.</div>' . "\n\n"; |
|
757 | + $content .= ' </div>' . "\n\n"; |
|
758 | 758 | return $content; |
759 | 759 | } |
760 | 760 | } |
761 | 761 | // A switch calls the methods that gather the page/utility content. |
762 | - switch($this->operation) { |
|
762 | + switch ($this->operation) { |
|
763 | 763 | case 'about': // About page only requires explanation. |
764 | - $content .= ' <div id="explain">'.$this->getExplanation().'</div>'."\n\n"; |
|
764 | + $content .= ' <div id="explain">' . $this->getExplanation() . '</div>' . "\n\n"; |
|
765 | 765 | break; |
766 | 766 | case 'phpinfo': // PHPinfo is processed; get utility, but not explanation. |
767 | - $content .= ' <div id="utility">'."\n\n".$this->getUtility().' </div>'."\n\n"; |
|
767 | + $content .= ' <div id="utility">' . "\n\n" . $this->getUtility() . ' </div>' . "\n\n"; |
|
768 | 768 | break; |
769 | 769 | case 'recover': |
770 | 770 | // Recoveries require explanation, current setting and utility. |
771 | 771 | if (!in_array($this->utility, $this->getAllUtilities())) { |
772 | 772 | // Set message and escape early since utility is not valid. |
773 | - $content .= ' <div id="explain">'.__('Invalid Utility').'</div>'."\n\n"; |
|
773 | + $content .= ' <div id="explain">' . __('Invalid Utility') . '</div>' . "\n\n"; |
|
774 | 774 | break; |
775 | 775 | } |
776 | 776 | // Add utility explanation. |
777 | - $content .= ' <div id="explain">'.$this->getExplanation().'</div>'."\n\n"; |
|
777 | + $content .= ' <div id="explain">' . $this->getExplanation() . '</div>' . "\n\n"; |
|
778 | 778 | // Check if form was submitted. |
779 | 779 | if ($this->INPUT['submit']) { |
780 | 780 | // Process recovery. |
@@ -783,21 +783,21 @@ discard block |
||
783 | 783 | $content .= $this->markupNotices(); |
784 | 784 | } |
785 | 785 | // Add current setting here (as it may have just changed). |
786 | - $content .= ' <div id="current">'.$this->getCurrentSetting().'</div>'."\n\n"; |
|
786 | + $content .= ' <div id="current">' . $this->getCurrentSetting() . '</div>' . "\n\n"; |
|
787 | 787 | // Add the utility content to the output. |
788 | - $content .= ' <div id="utility">'."\n\n".$this->getUtility().' </div>'."\n\n"; |
|
788 | + $content .= ' <div id="utility">' . "\n\n" . $this->getUtility() . ' </div>' . "\n\n"; |
|
789 | 789 | break; |
790 | 790 | default: |
791 | 791 | // Default cases will show the main overview explanation. |
792 | - $content .= ' <div id="explain">'.$this->getExplanation().'</div>'."\n\n"; |
|
792 | + $content .= ' <div id="explain">' . $this->getExplanation() . '</div>' . "\n\n"; |
|
793 | 793 | // Default cases will show the prepared overview. |
794 | - $content .= ' <div id="utility">'."\n\n".$this->getUtility().' </div>'."\n\n"; |
|
794 | + $content .= ' <div id="utility">' . "\n\n" . $this->getUtility() . ' </div>' . "\n\n"; |
|
795 | 795 | break; |
796 | 796 | } |
797 | 797 | // On all pages, append Zikula site-search feature. |
798 | - $content .= ' <div id="search">'.$this->markupSearchBox().'</div>'; |
|
798 | + $content .= ' <div id="search">' . $this->markupSearchBox() . '</div>'; |
|
799 | 799 | // Closing the body-column container. |
800 | - $content .= ' </div>'."\n\n"; |
|
800 | + $content .= ' </div>' . "\n\n"; |
|
801 | 801 | // Return the content string. |
802 | 802 | return $content; |
803 | 803 | } |
@@ -805,7 +805,7 @@ discard block |
||
805 | 805 | public function markupSearchBox() |
806 | 806 | { |
807 | 807 | // Markup a form to search the PN site. |
808 | - $search = '<div><strong class="blue">'.__('Still need help?').'</strong> '.__('Search the <em>entire</em> Zikula site here!').'</div>'."\n\n"; |
|
808 | + $search = '<div><strong class="blue">' . __('Still need help?') . '</strong> ' . __('Search the <em>entire</em> Zikula site here!') . '</div>' . "\n\n"; |
|
809 | 809 | $search .= '<form method="post" action="http://community.zikula.org/index.php" style="display:inline;"> |
810 | 810 | <div> |
811 | 811 | <img src="images/icons/extrasmall/search.png" style="float:left;margin:2px 5px 0 0;" alt="search" /> |
@@ -830,7 +830,7 @@ discard block |
||
830 | 830 | <input type="hidden" name="total" value="" /> |
831 | 831 | <input type="hidden" name="numlimit" value="250" /> |
832 | 832 | <input type="hidden" name="bool" value="AND" /> |
833 | - <input type="submit" id="search_b" value="'.__('SEARCH').'" title="Search" /> |
|
833 | + <input type="submit" id="search_b" value="'.__('SEARCH') . '" title="Search" /> |
|
834 | 834 | </div> |
835 | 835 | </form>'; |
836 | 836 | // Return search form markup. |
@@ -841,15 +841,15 @@ discard block |
||
841 | 841 | { |
842 | 842 | // Footer container and anchors. |
843 | 843 | $footer = ' <div id="footer">'; |
844 | - $footer .= '<a href="http://code.zikula.org/core" title="'.'Zikula Recovery Console'.' v.'.self::VERSION.'">'.'Zikula Recovery Console'.' v.'.self::VERSION.'</a>'; |
|
844 | + $footer .= '<a href="http://code.zikula.org/core" title="' . 'Zikula Recovery Console' . ' v.' . self::VERSION . '">' . 'Zikula Recovery Console' . ' v.' . self::VERSION . '</a>'; |
|
845 | 845 | $footer .= '<br /><br />'; |
846 | 846 | $footer .= '<img src="images/powered/small/cms_zikula.png" alt="Zikula-logo" /> <img src="images/powered/small/php_powered.png" alt="PHP-Logo" />'; |
847 | 847 | // Closing the footer container. |
848 | - $footer .= '</div>'."\n\n"; |
|
848 | + $footer .= '</div>' . "\n\n"; |
|
849 | 849 | // Closing the main container. |
850 | - $footer .= '</div>'."\n\n"; |
|
850 | + $footer .= '</div>' . "\n\n"; |
|
851 | 851 | // Finish off the page markup. |
852 | - $footer .= '</body>'."\n\n".'</html>'; |
|
852 | + $footer .= '</body>' . "\n\n" . '</html>'; |
|
853 | 853 | // Returning the markup. |
854 | 854 | return $footer; |
855 | 855 | } |
@@ -879,19 +879,19 @@ discard block |
||
879 | 879 | // Check if errors exist. |
880 | 880 | if (!empty($errors)) { |
881 | 881 | // Container. |
882 | - $markup .= ' <div id="error">'."\n\n"; |
|
882 | + $markup .= ' <div id="error">' . "\n\n"; |
|
883 | 883 | // Short text title. |
884 | - $markup .= '<strong>'.__('ERROR').'</strong><br />'."\n"; |
|
884 | + $markup .= '<strong>' . __('ERROR') . '</strong><br />' . "\n"; |
|
885 | 885 | // Start an unordered list. |
886 | - $markup .= '<ul>'."\n"; |
|
886 | + $markup .= '<ul>' . "\n"; |
|
887 | 887 | // Converting errors into list items. |
888 | 888 | foreach ($errors as $msg) { |
889 | - $markup .= '<li>' . $msg . '</li>'."\n"; |
|
889 | + $markup .= '<li>' . $msg . '</li>' . "\n"; |
|
890 | 890 | } |
891 | 891 | // End the unordered list. |
892 | - $markup .= '</ul>'."\n"; |
|
892 | + $markup .= '</ul>' . "\n"; |
|
893 | 893 | // Closing container. |
894 | - $markup .= ' </div>'."\n\n"; |
|
894 | + $markup .= ' </div>' . "\n\n"; |
|
895 | 895 | // Return markup string. |
896 | 896 | return $markup; |
897 | 897 | } |
@@ -900,32 +900,32 @@ discard block |
||
900 | 900 | // -------------------- |
901 | 901 | if (!empty($status)) { |
902 | 902 | // Container. |
903 | - $markup .= ' <div id="status">'."\n\n"; |
|
903 | + $markup .= ' <div id="status">' . "\n\n"; |
|
904 | 904 | // Short text title. |
905 | - $markup .= '<strong>'.__('STATUS').'</strong><br />'."\n"; |
|
905 | + $markup .= '<strong>' . __('STATUS') . '</strong><br />' . "\n"; |
|
906 | 906 | // Start an unordered list. |
907 | - $markup .= '<ul>'."\n"; |
|
907 | + $markup .= '<ul>' . "\n"; |
|
908 | 908 | // Converting errors into list items. |
909 | 909 | foreach ($status as $msg) { |
910 | - $markup .= '<li>' . $msg . '</li>'."\n"; |
|
910 | + $markup .= '<li>' . $msg . '</li>' . "\n"; |
|
911 | 911 | } |
912 | 912 | // End the unordered list. |
913 | - $markup .= '</ul>'."\n"; |
|
913 | + $markup .= '</ul>' . "\n"; |
|
914 | 914 | // -------------------- |
915 | 915 | // DO ANY RECOVERY OUTPUT |
916 | 916 | // -------------------- |
917 | 917 | if (!empty($output)) { |
918 | 918 | // For consistence. |
919 | - $markup .= '<pre>'."\n"; |
|
919 | + $markup .= '<pre>' . "\n"; |
|
920 | 920 | // Converting output to lines. |
921 | 921 | foreach ($output as $line) { |
922 | 922 | $markup .= $line . "\n"; |
923 | 923 | } |
924 | 924 | // End preformatting. |
925 | - $markup .= '</pre>'."\n"; |
|
925 | + $markup .= '</pre>' . "\n"; |
|
926 | 926 | } |
927 | 927 | // Closing container. |
928 | - $markup .= ' </div>'."\n\n"; |
|
928 | + $markup .= ' </div>' . "\n\n"; |
|
929 | 929 | } |
930 | 930 | // Return the markup. |
931 | 931 | return $markup; |
@@ -953,7 +953,7 @@ discard block |
||
953 | 953 | $host = $_SERVER['SERVER_NAME']; |
954 | 954 | // Append port to host if port is other than 80; |
955 | 955 | if ($_SERVER['SERVER_PORT'] != '80') { |
956 | - $host .= ':'.$_SERVER['SERVER_PORT']; |
|
956 | + $host .= ':' . $_SERVER['SERVER_PORT']; |
|
957 | 957 | } |
958 | 958 | } |
959 | 959 | // Return the host. |
@@ -1017,7 +1017,7 @@ discard block |
||
1017 | 1017 | 'outputfilter' => __('<strong>INSTRUCTIONS:</strong> Use this utility to reset the output filter to \'internal\'. Useful if there is something wrong with the output filters in use (eg. HTMLPurifier).'), |
1018 | 1018 | 'phpids' => __('<strong>INSTRUCTIONS:</strong> Use this utility to disable PHPIDS. Useful if your settings in PHPIDS crashed the entire system.'), |
1019 | 1019 | 'about' => __('About') |
1020 | - .__('<strong>VERSION</strong><br />This is <strong>Version '.self::VERSION.'</strong> of the <strong>Zikula Recovery Console</strong><br /><br />') |
|
1020 | + .__('<strong>VERSION</strong><br />This is <strong>Version ' . self::VERSION . '</strong> of the <strong>Zikula Recovery Console</strong><br /><br />') |
|
1021 | 1021 | .__('<strong>LICENSE</strong><br /><a href="http://www.gnu.org/copyleft/gpl.html" title="General Public License">General Public License</a><br /><br />') |
1022 | 1022 | .__('<strong>CREDITS</strong><br />Maintained and enhanced by the Zikula CoreDev team. Originally developed by <a href="http://www.alarconcepts.com/" title="John Alarcon">John Alarcon</a>. Greatly inspired by the ideas and work of <a href="http://www.snowjournal.com" title="Christopher S. Bradford">Christopher S. Bradford</a> and the additional supportive efforts of <a href="http://users.tpg.com.au/staer/" title="Martin Andersen">Martin Andersen</a>, <a href="http://www.landseer-stuttgart.de/" title="Frank Schummertz">Frank Schummertz</a>, <a href="http://pahlscomputers.com/" title="David Pahl">David Pahl</a> and <a href="http://www.itbegins.co.uk/" title="Simon Birtwistle">Simon Birtwistle</a>. Thanks guys!'), |
1023 | 1023 | ); |
@@ -1044,9 +1044,9 @@ discard block |
||
1044 | 1044 | public function getCurrentSetting() |
1045 | 1045 | { |
1046 | 1046 | // A short descriptive title. |
1047 | - $setting = '<strong>'.__('Current Setting:').'</strong> '; |
|
1047 | + $setting = '<strong>' . __('Current Setting:') . '</strong> '; |
|
1048 | 1048 | // Switch to get proper text. |
1049 | - switch($this->utility) { |
|
1049 | + switch ($this->utility) { |
|
1050 | 1050 | case 'theme': |
1051 | 1051 | $setting .= $this->siteTheme; |
1052 | 1052 | break; |
@@ -1114,24 +1114,24 @@ discard block |
||
1114 | 1114 | } |
1115 | 1115 | // Loop through recovery output. |
1116 | 1116 | foreach ($output as $line) { |
1117 | - $form .= ' '.$line; |
|
1117 | + $form .= ' ' . $line; |
|
1118 | 1118 | } |
1119 | 1119 | return $form; |
1120 | 1120 | } |
1121 | 1121 | // ...else a site-fixing form should be built. Every form comes with confirm and submit; |
1122 | 1122 | // any additional inputs are formatted for display in getUtilityInputs* for auto-inclusion. |
1123 | 1123 | // Start the form. |
1124 | - $form = ' <form method="post" action="'.$this->getBaseScript().'?op='.$this->operation.'&utility='.$this->utility.'" enctype="application/x-www-form-urlencoded">'."\n\n"; |
|
1124 | + $form = ' <form method="post" action="' . $this->getBaseScript() . '?op=' . $this->operation . '&utility=' . $this->utility . '" enctype="application/x-www-form-urlencoded">' . "\n\n"; |
|
1125 | 1125 | // If any additional inputs/markup are available for this utility, get them. |
1126 | - if (method_exists($this, $method='getUtilityInputs'.$this->utility)) { |
|
1126 | + if (method_exists($this, $method = 'getUtilityInputs' . $this->utility)) { |
|
1127 | 1127 | $form .= $this->$method(); |
1128 | 1128 | } |
1129 | 1129 | // Confirmation and submit inputs. |
1130 | - $form .= ' <div class="row"><div class="row_left"><label for="confirm">'.__('Click To Confirm').'</label></div><div class="row_right"><input id="confirm" type="checkbox" name="confirm" value="1" /></div></div>'."\n\n"; |
|
1131 | - $form .= ' <div class="row"><div class="row_left"><label for="submit"> </label></div><div class="row_right"><input class="submit" type="submit" name="submit" id="submit" value="'.__('Run Utility').'" /></div></div>'."\n\n"; |
|
1132 | - $form .= ' <div style="clear:both;"></div>'."\n\n"; |
|
1130 | + $form .= ' <div class="row"><div class="row_left"><label for="confirm">' . __('Click To Confirm') . '</label></div><div class="row_right"><input id="confirm" type="checkbox" name="confirm" value="1" /></div></div>' . "\n\n"; |
|
1131 | + $form .= ' <div class="row"><div class="row_left"><label for="submit"> </label></div><div class="row_right"><input class="submit" type="submit" name="submit" id="submit" value="' . __('Run Utility') . '" /></div></div>' . "\n\n"; |
|
1132 | + $form .= ' <div style="clear:both;"></div>' . "\n\n"; |
|
1133 | 1133 | // Close the form and container. |
1134 | - $form .= ' </form>'."\n\n"; |
|
1134 | + $form .= ' </form>' . "\n\n"; |
|
1135 | 1135 | // Return the form. |
1136 | 1136 | return $form; |
1137 | 1137 | } |
@@ -1141,7 +1141,7 @@ discard block |
||
1141 | 1141 | // Default the utility state to 'enabled' = true. |
1142 | 1142 | $state = true; |
1143 | 1143 | // Utilities for non-broken items can be disabled here. |
1144 | - switch($this->utility) { |
|
1144 | + switch ($this->utility) { |
|
1145 | 1145 | case 'block': |
1146 | 1146 | // If site has no blocks, disable this utility. |
1147 | 1147 | if (count($this->blocks) == 0) { |
@@ -1162,11 +1162,11 @@ discard block |
||
1162 | 1162 | $state = false; |
1163 | 1163 | } elseif ($this->tempdirexists && $this->tempdirsubsfailed == 0) { |
1164 | 1164 | $output = "<br /><br />\n"; |
1165 | - $output .= __('Your temporary directory seems to exist. The status of the subdirectories is as follows:')."\n"; |
|
1165 | + $output .= __('Your temporary directory seems to exist. The status of the subdirectories is as follows:') . "\n"; |
|
1166 | 1166 | $output .= "<br /><br />\n"; |
1167 | 1167 | |
1168 | - foreach($this->tempdirsubs as $dir => $status) { |
|
1169 | - $output .= '<img src="images/icons/extrasmall/button_ok.png" alt="'.__('directory status').'" /> '.$dir."\n"; |
|
1168 | + foreach ($this->tempdirsubs as $dir => $status) { |
|
1169 | + $output .= '<img src="images/icons/extrasmall/button_ok.png" alt="' . __('directory status') . '" /> ' . $dir . "\n"; |
|
1170 | 1170 | $output .= "<br />\n"; |
1171 | 1171 | } |
1172 | 1172 | |
@@ -1201,7 +1201,7 @@ discard block |
||
1201 | 1201 | // enable site |
1202 | 1202 | public function getUtilityInputsSite() |
1203 | 1203 | { |
1204 | - return '<p>'.__('Set the following checkbox to re-enable your site.').'</p>'; |
|
1204 | + return '<p>' . __('Set the following checkbox to re-enable your site.') . '</p>'; |
|
1205 | 1205 | } |
1206 | 1206 | |
1207 | 1207 | // Get inputs for theme recovery. |
@@ -1211,7 +1211,7 @@ discard block |
||
1211 | 1211 | ModUtil::apiFunc('Theme', 'admin', 'regenerate'); |
1212 | 1212 | |
1213 | 1213 | // First, create a dynamic selector. |
1214 | - $selector = '<select name="theme" id="theme" size="1">'."\n"; |
|
1214 | + $selector = '<select name="theme" id="theme" size="1">' . "\n"; |
|
1215 | 1215 | // Loop through all themes. |
1216 | 1216 | foreach ($this->themes as $type => $themes) { |
1217 | 1217 | // Skip any numerically-keyed elements. |
@@ -1219,12 +1219,12 @@ discard block |
||
1219 | 1219 | continue; |
1220 | 1220 | } |
1221 | 1221 | // Assign optgroup text. |
1222 | - $label =__('Core Themes'); |
|
1222 | + $label = __('Core Themes'); |
|
1223 | 1223 | // Create an optgroup for the theme type. |
1224 | 1224 | if (count($themes) == 0) { |
1225 | 1225 | continue; |
1226 | 1226 | } |
1227 | - $selector .= '<optgroup label="'.$label.'">'."\n"; |
|
1227 | + $selector .= '<optgroup label="' . $label . '">' . "\n"; |
|
1228 | 1228 | // Loop through the themes of this type. |
1229 | 1229 | foreach ($themes as $theme) { |
1230 | 1230 | if ($theme['state'] == 1) { |
@@ -1237,17 +1237,17 @@ discard block |
||
1237 | 1237 | $selected = ($theme['name'] == $this->INPUT['theme']) ? 'selected="selected"' : null; |
1238 | 1238 | } |
1239 | 1239 | // Add option to selector. |
1240 | - $selector .= '<option label="'.$theme['name'].'" value="'.$theme['name'].'" '.$selected.'>'.$theme['name'].'</option>'."\n"; |
|
1240 | + $selector .= '<option label="' . $theme['name'] . '" value="' . $theme['name'] . '" ' . $selected . '>' . $theme['name'] . '</option>' . "\n"; |
|
1241 | 1241 | } |
1242 | 1242 | } |
1243 | 1243 | // Ending the optgroup. |
1244 | - $selector .= '</optgroup>'."\n"; |
|
1244 | + $selector .= '</optgroup>' . "\n"; |
|
1245 | 1245 | } |
1246 | 1246 | // Ending the selector. |
1247 | - $selector .= '</select>'."\n"; |
|
1247 | + $selector .= '</select>' . "\n"; |
|
1248 | 1248 | // Create the "utility" portion of the form and return it. |
1249 | - $form = ' <div class="row"><div class="row_left"><label for="themes">'.__('Available Themes').'</label></div><div class="row_right">'.$selector.'</div></div>'."\n"; |
|
1250 | - $form .= ' <div class="row"><div class="row_left"><label for="resetusers">'.__('Reset User Themes').'</label></div><div class="row_right"><input id="resetusers" type="checkbox" name="resetusers" value="1"'.(($this->INPUT['resetusers'] && $this->getErrors()) ? ' checked="checked"' : null).' /></div></div>'."\n"; |
|
1249 | + $form = ' <div class="row"><div class="row_left"><label for="themes">' . __('Available Themes') . '</label></div><div class="row_right">' . $selector . '</div></div>' . "\n"; |
|
1250 | + $form .= ' <div class="row"><div class="row_left"><label for="resetusers">' . __('Reset User Themes') . '</label></div><div class="row_right"><input id="resetusers" type="checkbox" name="resetusers" value="1"' . (($this->INPUT['resetusers'] && $this->getErrors()) ? ' checked="checked"' : null) . ' /></div></div>' . "\n"; |
|
1251 | 1251 | return $form; |
1252 | 1252 | } |
1253 | 1253 | |
@@ -1256,13 +1256,13 @@ discard block |
||
1256 | 1256 | { |
1257 | 1257 | // Cheating a little; there are no actual inputs here. |
1258 | 1258 | $form = '<pre style="font-size:7.25pt;">'; |
1259 | - $form .= '<strong style="font-size:9pt;">'.__('Default Permissions').'</strong>'."\n"; |
|
1259 | + $form .= '<strong style="font-size:9pt;">' . __('Default Permissions') . '</strong>' . "\n"; |
|
1260 | 1260 | $form .= '<div class="bar"><strong> GROUP | COMPONENT | INSTANCE | PERMISSION LEVEL</strong></div>'; |
1261 | - $form .= ' Administrators | .* | .* | Admin'."\n"; |
|
1262 | - $form .= ' All Groups | ExtendedMenublock:: | 1:2: | None'."\n"; |
|
1263 | - $form .= ' Users | .* | .* | Comment'."\n"; |
|
1264 | - $form .= ' Unregistered | ExtendedMenublock:: | 1:(1|3): | None'."\n"; |
|
1265 | - $form .= ' Unregistered | .* | .* | Read'."\n"; |
|
1261 | + $form .= ' Administrators | .* | .* | Admin' . "\n"; |
|
1262 | + $form .= ' All Groups | ExtendedMenublock:: | 1:2: | None' . "\n"; |
|
1263 | + $form .= ' Users | .* | .* | Comment' . "\n"; |
|
1264 | + $form .= ' Unregistered | ExtendedMenublock:: | 1:(1|3): | None' . "\n"; |
|
1265 | + $form .= ' Unregistered | .* | .* | Read' . "\n"; |
|
1266 | 1266 | $form .= '</pre>'; |
1267 | 1267 | return $form; |
1268 | 1268 | } |
@@ -1271,44 +1271,44 @@ discard block |
||
1271 | 1271 | public function getUtilityInputsBlock() |
1272 | 1272 | { |
1273 | 1273 | $form = '<table width="100%" border="1" style="border-collapse:collapse;" cellpadding="3" cellspacing="0">'; |
1274 | - $form .= '<tr style="background:#f2f2f2;">'."\n\n"; |
|
1275 | - $form .= '<th>'.__('BID').'</th>'."\n\n"; |
|
1276 | - $form .= '<th>'.__('Key').'</th>'."\n\n"; |
|
1277 | - $form .= '<th width="100%">'.__('Title').'</th>'."\n\n"; |
|
1278 | - $form .= '<th>'.__('State').'</th>'."\n\n"; |
|
1279 | - $form .= '<th>'.__('MID').'</th>'."\n\n"; |
|
1280 | - $form .= '<th>'.__('Make No Changes').'</th>'."\n\n"; |
|
1281 | - $form .= '<th>'.__('Disable Block').'</th>'."\n\n"; |
|
1282 | - $form .= '<th>'.__('Delete Block').'</th>'."\n\n"; |
|
1283 | - $form .= '</tr>'."\n\n"; |
|
1284 | - $row=0; |
|
1274 | + $form .= '<tr style="background:#f2f2f2;">' . "\n\n"; |
|
1275 | + $form .= '<th>' . __('BID') . '</th>' . "\n\n"; |
|
1276 | + $form .= '<th>' . __('Key') . '</th>' . "\n\n"; |
|
1277 | + $form .= '<th width="100%">' . __('Title') . '</th>' . "\n\n"; |
|
1278 | + $form .= '<th>' . __('State') . '</th>' . "\n\n"; |
|
1279 | + $form .= '<th>' . __('MID') . '</th>' . "\n\n"; |
|
1280 | + $form .= '<th>' . __('Make No Changes') . '</th>' . "\n\n"; |
|
1281 | + $form .= '<th>' . __('Disable Block') . '</th>' . "\n\n"; |
|
1282 | + $form .= '<th>' . __('Delete Block') . '</th>' . "\n\n"; |
|
1283 | + $form .= '</tr>' . "\n\n"; |
|
1284 | + $row = 0; |
|
1285 | 1285 | foreach ($this->blocks as $block) { |
1286 | 1286 | $class = ($row++ & 1) ? ' style="background:#fafafa;"' : null; |
1287 | - $form .= '<tr'.$class.'>'."\n\n"; |
|
1288 | - $form .= '<td class="center">'.$block['bid'].'</td>'."\n\n"; |
|
1289 | - $form .= '<td>'.$block['bkey'].'</td>'."\n\n"; |
|
1290 | - $form .= '<td>'.$block['title'].'</td>'."\n\n"; |
|
1291 | - $form .= '<td class="center">'.(($block['active']) ? '<img src="images/icons/extrasmall/greenled.png" alt="'.$block['title'].' :: '.__('active').'" title="'.$block['title'].' :: '.__('active').'" />' : '<img src="images/icons/extrasmall/yellowled.png" alt="'.$block['title'].' :: '.__('inactive').'" title="'.$block['title'].' :: '.__('inactive').'" />').'</td>'."\n\n"; |
|
1292 | - $form .= '<td class="center">'.$block['mid'].'</td>'."\n\n"; |
|
1293 | - $form .= '<td class="center"><input type="radio" name="blocks['.$block['bid'].']" value="0"'.((empty($this->INPUT['blocks'][$block['bid']])) ? ' checked="checked"' : null).' /></td>'."\n\n"; |
|
1287 | + $form .= '<tr' . $class . '>' . "\n\n"; |
|
1288 | + $form .= '<td class="center">' . $block['bid'] . '</td>' . "\n\n"; |
|
1289 | + $form .= '<td>' . $block['bkey'] . '</td>' . "\n\n"; |
|
1290 | + $form .= '<td>' . $block['title'] . '</td>' . "\n\n"; |
|
1291 | + $form .= '<td class="center">' . (($block['active']) ? '<img src="images/icons/extrasmall/greenled.png" alt="' . $block['title'] . ' :: ' . __('active') . '" title="' . $block['title'] . ' :: ' . __('active') . '" />' : '<img src="images/icons/extrasmall/yellowled.png" alt="' . $block['title'] . ' :: ' . __('inactive') . '" title="' . $block['title'] . ' :: ' . __('inactive') . '" />') . '</td>' . "\n\n"; |
|
1292 | + $form .= '<td class="center">' . $block['mid'] . '</td>' . "\n\n"; |
|
1293 | + $form .= '<td class="center"><input type="radio" name="blocks[' . $block['bid'] . ']" value="0"' . ((empty($this->INPUT['blocks'][$block['bid']])) ? ' checked="checked"' : null) . ' /></td>' . "\n\n"; |
|
1294 | 1294 | if ($block['active'] != 0) { |
1295 | - $form .= '<td class="center"><input type="radio" name="blocks['.$block['bid'].']" value="1"'.(($this->INPUT['blocks'][$block['bid']]==1) ? ' checked="checked"' : null).' /></td>'."\n\n"; |
|
1295 | + $form .= '<td class="center"><input type="radio" name="blocks[' . $block['bid'] . ']" value="1"' . (($this->INPUT['blocks'][$block['bid']] == 1) ? ' checked="checked"' : null) . ' /></td>' . "\n\n"; |
|
1296 | 1296 | } else { |
1297 | - $form .= '<td class="center">'.__('N/A').'</td>'; |
|
1297 | + $form .= '<td class="center">' . __('N/A') . '</td>'; |
|
1298 | 1298 | } |
1299 | - $form .= '<td class="center"><input type="radio" name="blocks['.$block['bid'].']" value="2"'.(($this->INPUT['blocks'][$block['bid']]==2) ? ' checked="checked"' : null).' /></td>'."\n\n"; |
|
1300 | - $form .= '</tr>'."\n\n"; |
|
1299 | + $form .= '<td class="center"><input type="radio" name="blocks[' . $block['bid'] . ']" value="2"' . (($this->INPUT['blocks'][$block['bid']] == 2) ? ' checked="checked"' : null) . ' /></td>' . "\n\n"; |
|
1300 | + $form .= '</tr>' . "\n\n"; |
|
1301 | 1301 | } |
1302 | - $form .= '</table><br />'."\n\n"; |
|
1302 | + $form .= '</table><br />' . "\n\n"; |
|
1303 | 1303 | return $form; |
1304 | 1304 | } |
1305 | 1305 | |
1306 | 1306 | // Get additional inputs for password reset. |
1307 | 1307 | public function getUtilityInputsPassword() |
1308 | 1308 | { |
1309 | - $form = ' <div class="row"><div class="row_left"><label for="zuname">'.__('Username').'</label></div><div class="row_right"><input type="text" id="zuname" name="zuname" value="admin" /></div></div>'."\n"; |
|
1310 | - $form .= ' <div class="row"><div class="row_left"><label for="zpass1">'.__('New password').'</label></div><div class="row_right"><input type="password" id="zpass1" name="zpass1" /></div></div>'."\n"; |
|
1311 | - $form .= ' <div class="row"><div class="row_left"><label for="zpass2">'.__('New password again (for verification)').'</label></div><div class="row_right"><input type="password" id="zpass2" name="zpass2" /></div></div>'."\n"; |
|
1309 | + $form = ' <div class="row"><div class="row_left"><label for="zuname">' . __('Username') . '</label></div><div class="row_right"><input type="text" id="zuname" name="zuname" value="admin" /></div></div>' . "\n"; |
|
1310 | + $form .= ' <div class="row"><div class="row_left"><label for="zpass1">' . __('New password') . '</label></div><div class="row_right"><input type="password" id="zpass1" name="zpass1" /></div></div>' . "\n"; |
|
1311 | + $form .= ' <div class="row"><div class="row_left"><label for="zpass2">' . __('New password again (for verification)') . '</label></div><div class="row_right"><input type="password" id="zpass2" name="zpass2" /></div></div>' . "\n"; |
|
1312 | 1312 | |
1313 | 1313 | return $form; |
1314 | 1314 | } |
@@ -1317,18 +1317,18 @@ discard block |
||
1317 | 1317 | public function getUtilityInputsTempdir() |
1318 | 1318 | { |
1319 | 1319 | if ($this->tempdirexists == false) { |
1320 | - $form = __('Your temporary directory does not seem to exist. It will be built from scratch')."\n"; |
|
1320 | + $form = __('Your temporary directory does not seem to exist. It will be built from scratch') . "\n"; |
|
1321 | 1321 | } else { |
1322 | - $form = __('Your temporary directory seems to exist. The status of the subdirectories is as follows:')."\n"; |
|
1322 | + $form = __('Your temporary directory seems to exist. The status of the subdirectories is as follows:') . "\n"; |
|
1323 | 1323 | $form .= "<br /><br />\n"; |
1324 | 1324 | |
1325 | - foreach($this->tempdirsubs as $dir => $status) { |
|
1325 | + foreach ($this->tempdirsubs as $dir => $status) { |
|
1326 | 1326 | if ($status == 1) { |
1327 | 1327 | $icon = 'button_ok.png'; |
1328 | 1328 | } else { |
1329 | 1329 | $icon = 'button_cancel.png'; |
1330 | 1330 | } |
1331 | - $form .= '<img src="images/icons/extrasmall/'.$icon.'" alt="'.__('directory status').'" /> '.$dir."\n"; |
|
1331 | + $form .= '<img src="images/icons/extrasmall/' . $icon . '" alt="' . __('directory status') . '" /> ' . $dir . "\n"; |
|
1332 | 1332 | $form .= "<br />\n"; |
1333 | 1333 | } |
1334 | 1334 | |
@@ -1365,18 +1365,18 @@ discard block |
||
1365 | 1365 | $replace = array('<table border="0" width="100%">', '<tr>'); |
1366 | 1366 | $phpinfo = str_replace($strings, $replace, $phpinfo); |
1367 | 1367 | } else { |
1368 | - $phpinfo = '<h2>PHP '.phpversion().'</h2>'; |
|
1368 | + $phpinfo = '<h2>PHP ' . phpversion() . '</h2>'; |
|
1369 | 1369 | } |
1370 | 1370 | // Create a submenu for filtering PHP information. |
1371 | - $form = '<div id="phpinfo_menu" class="center">'."\n"; |
|
1372 | - $form .= '[ <a href="'.$this->getBaseScript().'?op=phpinfo&view=0" title="'.__('PHP Version').'">'.__('PHP Version').'</a> ]'; |
|
1373 | - $form .= '[ <a href="'.$this->getBaseScript().'?op=phpinfo&view=4" title="'.__('PHP Core').'">'.__('PHP Core').'</a> ]'; |
|
1374 | - $form .= '[ <a href="'.$this->getBaseScript().'?op=phpinfo&view=32" title="'.__('PHP Variables').'">'.__('PHP Variables').'</a> ]'; |
|
1375 | - $form .= '[ <a href="'.$this->getBaseScript().'?op=phpinfo&view=64" title="'.__('PHP License').'">'.__('PHP License').'</a> ]'."\n"; |
|
1371 | + $form = '<div id="phpinfo_menu" class="center">' . "\n"; |
|
1372 | + $form .= '[ <a href="' . $this->getBaseScript() . '?op=phpinfo&view=0" title="' . __('PHP Version') . '">' . __('PHP Version') . '</a> ]'; |
|
1373 | + $form .= '[ <a href="' . $this->getBaseScript() . '?op=phpinfo&view=4" title="' . __('PHP Core') . '">' . __('PHP Core') . '</a> ]'; |
|
1374 | + $form .= '[ <a href="' . $this->getBaseScript() . '?op=phpinfo&view=32" title="' . __('PHP Variables') . '">' . __('PHP Variables') . '</a> ]'; |
|
1375 | + $form .= '[ <a href="' . $this->getBaseScript() . '?op=phpinfo&view=64" title="' . __('PHP License') . '">' . __('PHP License') . '</a> ]' . "\n"; |
|
1376 | 1376 | $form .= '<br />'; |
1377 | - $form .= '[ <a href="'.$this->getBaseScript().'?op=phpinfo&view=16" title="'.__('PHP Environment').'">'.__('PHP Environment').'</a> ]'; |
|
1378 | - $form .= '[ <a href="'.$this->getBaseScript().'?op=phpinfo&view=8" title="'.__('Apache Environment').'">'.__('Apache Environment').'</a> ]'; |
|
1379 | - $form .= '</div>'."\n"; |
|
1377 | + $form .= '[ <a href="' . $this->getBaseScript() . '?op=phpinfo&view=16" title="' . __('PHP Environment') . '">' . __('PHP Environment') . '</a> ]'; |
|
1378 | + $form .= '[ <a href="' . $this->getBaseScript() . '?op=phpinfo&view=8" title="' . __('Apache Environment') . '">' . __('Apache Environment') . '</a> ]'; |
|
1379 | + $form .= '</div>' . "\n"; |
|
1380 | 1380 | // Add previously resulting string to object's markup here. |
1381 | 1381 | $form .= $phpinfo; |
1382 | 1382 | // Return the "form". |
@@ -1386,15 +1386,15 @@ discard block |
||
1386 | 1386 | public function getMarkedUpOverview() |
1387 | 1387 | { |
1388 | 1388 | // Assemble and return the form markup. |
1389 | - $form = ' <div class="row"><div class="row_left">'.__('Core Version').'</div><div class="row_right">'.$this->siteCodebase.' '.$this->siteVersion.'</div></div>'."\n\n"; |
|
1390 | - $form .= ' <div class="row"><div class="row_left">'.__('Config File').'</div><div class="row_right">'.$this->siteConfigFile.'</div></div>'."\n\n"; |
|
1391 | - $form .= ' <div class="row"><div class="row_left">'.__('Site Status').'</div><div class="row_right">'.(($this->siteInactive) ? '<img src="images/icons/extrasmall/redled.png" />'.__('Off/Disabled') :'<img src="images/icons/extrasmall/greenled.png" />'.__('On/Enabled')).'</div></div>'."\n\n"; |
|
1392 | - $form .= ' <div class="row"><div class="row_left">'.__('Database').'</div><div class="row_right">'.(($this->dbEnabled) ? '<img src="images/icons/extrasmall/greenled.png" />'.__('Connected') : '<img src="images/icons/extrasmall/redled.png" />'.__('Not Connected')).'</div></div>'."\n\n"; |
|
1393 | - $form .= ' <div class="row"><div class="row_left">'.__('Site Language').'</div><div class="row_right">'.$this->siteLang.'</div></div>'."\n\n"; |
|
1394 | - $form .= ' <div class="row"><div class="row_left">'.__('Detected Themes').'</div><div class="row_right">'.$this->getMarkedUpOverviewThemeList().'</div></div>'."\n\n"; |
|
1395 | - $form .= ' <div class="row"><div class="row_left">'.__('Detected Modules').'</div><div class="row_right">'.$this->getMarkedUpOverviewModuleList().'</div></div>'."\n\n"; |
|
1396 | - $form .= ' <div class="row"><div class="row_left">'.__('Detected Blocks').'</div><div class="row_right">'.$this->getMarkedUpOverviewBlockList().'</div></div>'."\n\n"; |
|
1397 | - $form .= ' <div style="clear:both;"></div>'."\n\n"; |
|
1389 | + $form = ' <div class="row"><div class="row_left">' . __('Core Version') . '</div><div class="row_right">' . $this->siteCodebase . ' ' . $this->siteVersion . '</div></div>' . "\n\n"; |
|
1390 | + $form .= ' <div class="row"><div class="row_left">' . __('Config File') . '</div><div class="row_right">' . $this->siteConfigFile . '</div></div>' . "\n\n"; |
|
1391 | + $form .= ' <div class="row"><div class="row_left">' . __('Site Status') . '</div><div class="row_right">' . (($this->siteInactive) ? '<img src="images/icons/extrasmall/redled.png" />' . __('Off/Disabled') : '<img src="images/icons/extrasmall/greenled.png" />' . __('On/Enabled')) . '</div></div>' . "\n\n"; |
|
1392 | + $form .= ' <div class="row"><div class="row_left">' . __('Database') . '</div><div class="row_right">' . (($this->dbEnabled) ? '<img src="images/icons/extrasmall/greenled.png" />' . __('Connected') : '<img src="images/icons/extrasmall/redled.png" />' . __('Not Connected')) . '</div></div>' . "\n\n"; |
|
1393 | + $form .= ' <div class="row"><div class="row_left">' . __('Site Language') . '</div><div class="row_right">' . $this->siteLang . '</div></div>' . "\n\n"; |
|
1394 | + $form .= ' <div class="row"><div class="row_left">' . __('Detected Themes') . '</div><div class="row_right">' . $this->getMarkedUpOverviewThemeList() . '</div></div>' . "\n\n"; |
|
1395 | + $form .= ' <div class="row"><div class="row_left">' . __('Detected Modules') . '</div><div class="row_right">' . $this->getMarkedUpOverviewModuleList() . '</div></div>' . "\n\n"; |
|
1396 | + $form .= ' <div class="row"><div class="row_left">' . __('Detected Blocks') . '</div><div class="row_right">' . $this->getMarkedUpOverviewBlockList() . '</div></div>' . "\n\n"; |
|
1397 | + $form .= ' <div style="clear:both;"></div>' . "\n\n"; |
|
1398 | 1398 | return $form; |
1399 | 1399 | } |
1400 | 1400 | // Get marked up theme list for overview page. |
@@ -1408,7 +1408,7 @@ discard block |
||
1408 | 1408 | } |
1409 | 1409 | |
1410 | 1410 | if (!empty($this->themes['corethemes'])) { |
1411 | - $list .= '<strong>'.__('Core Themes').'</strong>'; |
|
1411 | + $list .= '<strong>' . __('Core Themes') . '</strong>'; |
|
1412 | 1412 | $list .= $this->getMarkedUpOverviewThemeListReal($this->themes['corethemes']); |
1413 | 1413 | } |
1414 | 1414 | |
@@ -1421,11 +1421,11 @@ discard block |
||
1421 | 1421 | $list = '<ul>'; |
1422 | 1422 | foreach ($themesarray as $theme) { |
1423 | 1423 | if ($theme['name'] === $this->siteTheme) { |
1424 | - $list .= '<li><img src="images/icons/extrasmall/greenled.png" alt="'.$theme['name'].' :: '.__('active').'" title="'.$theme['name'].' :: '.__('set as default').'" />'; |
|
1425 | - } else if ($theme['state'] == 1){ |
|
1426 | - $list .= '<li><img src="images/icons/extrasmall/yellowled.png" alt="'.$theme['name'].' :: '.__('inactive').'" title="'.$theme['name'].' :: '.__('inactive').'" />'; |
|
1424 | + $list .= '<li><img src="images/icons/extrasmall/greenled.png" alt="' . $theme['name'] . ' :: ' . __('active') . '" title="' . $theme['name'] . ' :: ' . __('set as default') . '" />'; |
|
1425 | + } else if ($theme['state'] == 1) { |
|
1426 | + $list .= '<li><img src="images/icons/extrasmall/yellowled.png" alt="' . $theme['name'] . ' :: ' . __('inactive') . '" title="' . $theme['name'] . ' :: ' . __('inactive') . '" />'; |
|
1427 | 1427 | } else { |
1428 | - $list .= '<li><img src="images/icons/extrasmall/redled.png" alt="'.$theme['name'].' :: '.__('uninitialized').'" title="'.$theme['name'].' :: '.__('uninitialized').'" />'; |
|
1428 | + $list .= '<li><img src="images/icons/extrasmall/redled.png" alt="' . $theme['name'] . ' :: ' . __('uninitialized') . '" title="' . $theme['name'] . ' :: ' . __('uninitialized') . '" />'; |
|
1429 | 1429 | } |
1430 | 1430 | // Append theme name. |
1431 | 1431 | $list .= $theme['name'] . '</li>'; |
@@ -1445,9 +1445,9 @@ discard block |
||
1445 | 1445 | return $list = __('None Detected'); |
1446 | 1446 | } |
1447 | 1447 | |
1448 | - $list .= '<strong>'.__('System Modules').'</strong>'; |
|
1448 | + $list .= '<strong>' . __('System Modules') . '</strong>'; |
|
1449 | 1449 | $list .= $this->getMarkedUpOverviewModuleListReal($this->modules['sys_mods']); |
1450 | - $list .= '<strong>'.__('Value Added Modules').'</strong>'; |
|
1450 | + $list .= '<strong>' . __('Value Added Modules') . '</strong>'; |
|
1451 | 1451 | $list .= $this->getMarkedUpOverviewModuleListReal($this->modules['usr_mods']); |
1452 | 1452 | return $list; |
1453 | 1453 | } |
@@ -1462,28 +1462,28 @@ discard block |
||
1462 | 1462 | foreach ($modsarray as $mod) { |
1463 | 1463 | // Append module-state image. |
1464 | 1464 | $list .= '<li>'; |
1465 | - switch($mod['state']) { |
|
1465 | + switch ($mod['state']) { |
|
1466 | 1466 | case ModUtil::STATE_UNINITIALISED: |
1467 | - $list .= '<img src="images/icons/extrasmall/redled.png" alt="'.$mod['name'].' :: '.__('uninitialized').'" title="'.$mod['name'].' :: '.__('uninitialized').'" />'; |
|
1467 | + $list .= '<img src="images/icons/extrasmall/redled.png" alt="' . $mod['name'] . ' :: ' . __('uninitialized') . '" title="' . $mod['name'] . ' :: ' . __('uninitialized') . '" />'; |
|
1468 | 1468 | break; |
1469 | 1469 | case ModUtil::STATE_INACTIVE: |
1470 | - $list .= '<img src="images/icons/extrasmall/yellowled.png" alt="'.$mod['name'].' :: '.__('inactive').'" title="'.$mod['name'].' :: '.__('inactive').'" />'; |
|
1470 | + $list .= '<img src="images/icons/extrasmall/yellowled.png" alt="' . $mod['name'] . ' :: ' . __('inactive') . '" title="' . $mod['name'] . ' :: ' . __('inactive') . '" />'; |
|
1471 | 1471 | break; |
1472 | 1472 | case ModUtil::STATE_ACTIVE: |
1473 | - $list .= '<img src="images/icons/extrasmall/greenled.png" alt="'.$mod['name'].' :: '.__('active').'" title="'.$mod['name'].' :: '.__('active').'" />'; |
|
1473 | + $list .= '<img src="images/icons/extrasmall/greenled.png" alt="' . $mod['name'] . ' :: ' . __('active') . '" title="' . $mod['name'] . ' :: ' . __('active') . '" />'; |
|
1474 | 1474 | break; |
1475 | 1475 | case ModUtil::STATE_MISSING: |
1476 | - $list .= '<img src="images/icons/extrasmall/14_layer_deletelayer.png" alt="'.$mod['name'].' :: '.__('files missing').'" title="'.$mod['name'].' :: '.__('files missing').'" />'; |
|
1476 | + $list .= '<img src="images/icons/extrasmall/14_layer_deletelayer.png" alt="' . $mod['name'] . ' :: ' . __('files missing') . '" title="' . $mod['name'] . ' :: ' . __('files missing') . '" />'; |
|
1477 | 1477 | break; |
1478 | 1478 | case ModUtil::STATE_UPGRADED: |
1479 | - $list .= '<img src="images/icons/extrasmall/agt_update-product.png" alt="'.$mod['name'].' :: '.__('upgraded').'" title="'.$mod['name'].' :: '.__('upgraded').'" />'; |
|
1479 | + $list .= '<img src="images/icons/extrasmall/agt_update-product.png" alt="' . $mod['name'] . ' :: ' . __('upgraded') . '" title="' . $mod['name'] . ' :: ' . __('upgraded') . '" />'; |
|
1480 | 1480 | break; |
1481 | 1481 | case ModUtil::STATE_INVALID: |
1482 | 1482 | default: |
1483 | - $list .= '<img src="images/icons/extrasmall/14_layer_deletelayer.png" alt="'.$mod['name'].' :: '.__('invalid').'" title="'.$mod['name'].' :: '.__('invalid').'" />'; |
|
1483 | + $list .= '<img src="images/icons/extrasmall/14_layer_deletelayer.png" alt="' . $mod['name'] . ' :: ' . __('invalid') . '" title="' . $mod['name'] . ' :: ' . __('invalid') . '" />'; |
|
1484 | 1484 | } |
1485 | 1485 | // Append module name. |
1486 | - $list .= ' '.$mod['name'].'</li>'; |
|
1486 | + $list .= ' ' . $mod['name'] . '</li>'; |
|
1487 | 1487 | } |
1488 | 1488 | $list .= '</ul>'; |
1489 | 1489 | } |
@@ -1503,12 +1503,12 @@ discard block |
||
1503 | 1503 | foreach ($this->blocks as $block) { |
1504 | 1504 | // Append module-state image. |
1505 | 1505 | if ($block['active'] == 1) { |
1506 | - $list .= '<li><img src="images/icons/extrasmall/greenled.png" alt="'.$block['title'].' :: '.__('active').'" title="'.$block['title'].' :: '.__('active').'" />'; |
|
1506 | + $list .= '<li><img src="images/icons/extrasmall/greenled.png" alt="' . $block['title'] . ' :: ' . __('active') . '" title="' . $block['title'] . ' :: ' . __('active') . '" />'; |
|
1507 | 1507 | } else { |
1508 | - $list .= '<li><img src="images/icons/extrasmall/yellowled.png" alt="'.$block['title'].' :: '.__('inactive').'" title="'.$block['title'].' :: '.__('inactive').'" />'; |
|
1508 | + $list .= '<li><img src="images/icons/extrasmall/yellowled.png" alt="' . $block['title'] . ' :: ' . __('inactive') . '" title="' . $block['title'] . ' :: ' . __('inactive') . '" />'; |
|
1509 | 1509 | } |
1510 | 1510 | // Append block title. |
1511 | - $list .= ' '.$block['title'].'</li>'; |
|
1511 | + $list .= ' ' . $block['title'] . '</li>'; |
|
1512 | 1512 | } |
1513 | 1513 | $list .= '</ul>'; |
1514 | 1514 | // Return markup string. |
@@ -1531,7 +1531,7 @@ discard block |
||
1531 | 1531 | } |
1532 | 1532 | |
1533 | 1533 | // Call a recovery method based on $this->utility. |
1534 | - switch($this->utility) { |
|
1534 | + switch ($this->utility) { |
|
1535 | 1535 | case 'theme': |
1536 | 1536 | $success = $this->processRecoveryTheme(); |
1537 | 1537 | break; |
@@ -1637,7 +1637,7 @@ discard block |
||
1637 | 1637 | } |
1638 | 1638 | |
1639 | 1639 | // Loop through blocks daga. |
1640 | - foreach($this->INPUT['blocks'] as $bid=>$action) { |
|
1640 | + foreach ($this->INPUT['blocks'] as $bid=>$action) { |
|
1641 | 1641 | // Skip to next block if no action specified. |
1642 | 1642 | if (empty($action)) { |
1643 | 1643 | continue; |
@@ -1655,7 +1655,7 @@ discard block |
||
1655 | 1655 | } |
1656 | 1656 | |
1657 | 1657 | // Loop through all blocks. |
1658 | - foreach($this->INPUT['blocks'] as $bid => $action) { |
|
1658 | + foreach ($this->INPUT['blocks'] as $bid => $action) { |
|
1659 | 1659 | // Get information about the block. |
1660 | 1660 | $block = ModUtil::apiFunc('Blocks', 'user', 'get', array('bid'=>$bid)); |
1661 | 1661 | // Check which action should be performed. |
@@ -1663,20 +1663,20 @@ discard block |
||
1663 | 1663 | // Attempt block disable. |
1664 | 1664 | if (!$this->disableBlock($bid)) { |
1665 | 1665 | // Set error. |
1666 | - $this->setError(__('Block Not Disabled').': '.$block['title']); |
|
1666 | + $this->setError(__('Block Not Disabled') . ': ' . $block['title']); |
|
1667 | 1667 | continue; |
1668 | 1668 | } |
1669 | 1669 | // Set status message. |
1670 | - $this->setStatus(__('Block Disabled').': '.$block['title']); |
|
1670 | + $this->setStatus(__('Block Disabled') . ': ' . $block['title']); |
|
1671 | 1671 | } else if ($action == 2) { // 2 = delete block |
1672 | 1672 | // Attempt block deletion. |
1673 | 1673 | if (!$this->deleteBlock($bid)) { |
1674 | 1674 | // Set error. |
1675 | - $this->setError(__('Block Not Deleted').': '.$block['title']); |
|
1675 | + $this->setError(__('Block Not Deleted') . ': ' . $block['title']); |
|
1676 | 1676 | continue; |
1677 | 1677 | } |
1678 | 1678 | // Set status message. |
1679 | - $this->setStatus(__('Block Deleted').': '.$block['title']); |
|
1679 | + $this->setStatus(__('Block Deleted') . ': ' . $block['title']); |
|
1680 | 1680 | } |
1681 | 1681 | } |
1682 | 1682 | // Return false if any errors. |
@@ -1727,7 +1727,7 @@ discard block |
||
1727 | 1727 | $userscolumn = $table['users_column']; |
1728 | 1728 | |
1729 | 1729 | // check that username exists |
1730 | - $uid = DBUtil::selectField('users', 'uid', $userscolumn['uname']."='".$username."'"); |
|
1730 | + $uid = DBUtil::selectField('users', 'uid', $userscolumn['uname'] . "='" . $username . "'"); |
|
1731 | 1731 | if (!$uid) { |
1732 | 1732 | $this->setError(__('The username you supplied is not valid')); |
1733 | 1733 | return false; |
@@ -1775,9 +1775,9 @@ discard block |
||
1775 | 1775 | |
1776 | 1776 | // recreate only the subdirectories that are missing |
1777 | 1777 | if ($this->tempdirexists) { |
1778 | - foreach($this->tempdirsubs as $dir => $status) { |
|
1778 | + foreach ($this->tempdirsubs as $dir => $status) { |
|
1779 | 1779 | if ($status == 0) { |
1780 | - $result = mkdir($this->tempdir.'/'.$dir, null, true); |
|
1780 | + $result = mkdir($this->tempdir . '/' . $dir, null, true); |
|
1781 | 1781 | if ($result == false) { |
1782 | 1782 | array_push($dir_errors, $dir); |
1783 | 1783 | } |
@@ -1786,8 +1786,8 @@ discard block |
||
1786 | 1786 | } |
1787 | 1787 | // create all subdirectories |
1788 | 1788 | else { |
1789 | - foreach($this->tempdirsubs as $dir => $status) { |
|
1790 | - $result = mkdir($this->tempdir.'/'.$dir, null, true); |
|
1789 | + foreach ($this->tempdirsubs as $dir => $status) { |
|
1790 | + $result = mkdir($this->tempdir . '/' . $dir, null, true); |
|
1791 | 1791 | if ($result == false) { |
1792 | 1792 | array_push($dir_errors, $dir); |
1793 | 1793 | } |
@@ -1801,14 +1801,14 @@ discard block |
||
1801 | 1801 | |
1802 | 1802 | // create htaccess only if needed |
1803 | 1803 | if (!$this->tempdirexists) { |
1804 | - $htaccess_file = 'SetEnvIf Request_URI "\.css$" object_is_css=css'."\n"; |
|
1805 | - $htaccess_file .= 'SetEnvIf Request_URI "\.js$" object_is_js=js'."\n"; |
|
1806 | - $htaccess_file .= 'Order deny,allow'."\n"; |
|
1807 | - $htaccess_file .= 'Deny from all'."\n"; |
|
1808 | - $htaccess_file .= 'Allow from env=object_is_css'."\n"; |
|
1809 | - $htaccess_file .= 'Allow from env=object_is_js'."\n"; |
|
1810 | - |
|
1811 | - $result = FileUtil::writeFile($this->tempdir.'/.htaccess', $htaccess_file); |
|
1804 | + $htaccess_file = 'SetEnvIf Request_URI "\.css$" object_is_css=css' . "\n"; |
|
1805 | + $htaccess_file .= 'SetEnvIf Request_URI "\.js$" object_is_js=js' . "\n"; |
|
1806 | + $htaccess_file .= 'Order deny,allow' . "\n"; |
|
1807 | + $htaccess_file .= 'Deny from all' . "\n"; |
|
1808 | + $htaccess_file .= 'Allow from env=object_is_css' . "\n"; |
|
1809 | + $htaccess_file .= 'Allow from env=object_is_js' . "\n"; |
|
1810 | + |
|
1811 | + $result = FileUtil::writeFile($this->tempdir . '/.htaccess', $htaccess_file); |
|
1812 | 1812 | if ($result === false) { |
1813 | 1813 | $this->setError(__f('There was a problem creating .htaccess file. You will have to download it yourself from the <a href="%s">CoZi</a> and place it inside your temp directory', 'https://code.zikula.org/svn/core/branches/zikula-1.3/src/ztemp/.htaccess')); |
1814 | 1814 | return false; |
@@ -1915,7 +1915,7 @@ discard block |
||
1915 | 1915 | $obj = array('bid'=>$bid, 'active'=>0); |
1916 | 1916 | |
1917 | 1917 | // Attempt to disable the block. |
1918 | - if (!DBUtil::updateObject ($obj, 'blocks', '', 'bid')) { |
|
1918 | + if (!DBUtil::updateObject($obj, 'blocks', '', 'bid')) { |
|
1919 | 1919 | $this->setError(__('Block Not Disabled')); |
1920 | 1920 | return false; |
1921 | 1921 | } |
@@ -1945,7 +1945,7 @@ discard block |
||
1945 | 1945 | } |
1946 | 1946 | |
1947 | 1947 | // Delete the block itself. |
1948 | - if (!DBUtil::deleteObjectByID ('blocks', $bid, 'bid')) { |
|
1948 | + if (!DBUtil::deleteObjectByID('blocks', $bid, 'bid')) { |
|
1949 | 1949 | $this->setError(__('Block Not Deleted')); |
1950 | 1950 | return false; |
1951 | 1951 | } |
@@ -1968,11 +1968,11 @@ discard block |
||
1968 | 1968 | |
1969 | 1969 | // Array of permission objects to insert. |
1970 | 1970 | $perms = array(); |
1971 | - $perms[] = array('pid'=>1, 'gid'=>2, 'sequence'=>1, 'realm'=>0, 'component'=>'.*', 'instance'=>'.*', 'level'=>800, 'bond'=>0); |
|
1972 | - $perms[] = array('pid'=>2, 'gid'=>-1, 'sequence'=>2, 'realm'=>0, 'component'=>'ExtendedMenublock::', 'instance'=>'1:2:', 'level'=>0, 'bond'=>0); |
|
1973 | - $perms[] = array('pid'=>3, 'gid'=>1, 'sequence'=>3, 'realm'=>0, 'component'=>'.*', 'instance'=>'.*', 'level'=>300, 'bond'=>0); |
|
1974 | - $perms[] = array('pid'=>4, 'gid'=>0, 'sequence'=>4, 'realm'=>0, 'component'=>'ExtendedMenublock::', 'instance'=>'1:(1|3):', 'level'=>0, 'bond'=>0); |
|
1975 | - $perms[] = array('pid'=>5, 'gid'=>0, 'sequence'=>5, 'realm'=>0, 'component'=>'.*', 'instance'=>'.*', 'level'=>200, 'bond'=>0); |
|
1971 | + $perms[] = array('pid'=>1, 'gid'=>2, 'sequence'=>1, 'realm'=>0, 'component'=>'.*', 'instance'=>'.*', 'level'=>800, 'bond'=>0); |
|
1972 | + $perms[] = array('pid'=>2, 'gid'=>-1, 'sequence'=>2, 'realm'=>0, 'component'=>'ExtendedMenublock::', 'instance'=>'1:2:', 'level'=>0, 'bond'=>0); |
|
1973 | + $perms[] = array('pid'=>3, 'gid'=>1, 'sequence'=>3, 'realm'=>0, 'component'=>'.*', 'instance'=>'.*', 'level'=>300, 'bond'=>0); |
|
1974 | + $perms[] = array('pid'=>4, 'gid'=>0, 'sequence'=>4, 'realm'=>0, 'component'=>'ExtendedMenublock::', 'instance'=>'1:(1|3):', 'level'=>0, 'bond'=>0); |
|
1975 | + $perms[] = array('pid'=>5, 'gid'=>0, 'sequence'=>5, 'realm'=>0, 'component'=>'.*', 'instance'=>'.*', 'level'=>200, 'bond'=>0); |
|
1976 | 1976 | |
1977 | 1977 | // Insert default permissions or fail. |
1978 | 1978 | if (!DBUtil::insertObjectArray($perms, 'group_perms', 'pid')) { |
@@ -2007,7 +2007,7 @@ discard block |
||
2007 | 2007 | { |
2008 | 2008 | // Header, error content, footer. |
2009 | 2009 | $fatal = $this->markupHeader(); |
2010 | - $fatal .= '<div id="fatal">'.(string)$msg.'</div>'; |
|
2010 | + $fatal .= '<div id="fatal">' . (string)$msg . '</div>'; |
|
2011 | 2011 | $fatal .= $this->markupFooter(); |
2012 | 2012 | // Kill application. |
2013 | 2013 | die ($fatal); |
@@ -1072,8 +1072,7 @@ |
||
1072 | 1072 | } else { |
1073 | 1073 | if ($outputfilter == 1) { |
1074 | 1074 | $setting .= 'Your current output filter is set to HTML Purifier + internal mechanism'; |
1075 | - } |
|
1076 | - else { |
|
1075 | + } else { |
|
1077 | 1076 | $setting .= 'Unable to determine your current output filter setting'; |
1078 | 1077 | } |
1079 | 1078 | } |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | |
22 | 22 | $theme = $argv[1]; |
23 | 23 | |
24 | -if (!file_exists('themes/'.$theme)) { |
|
24 | +if (!file_exists('themes/' . $theme)) { |
|
25 | 25 | die("Theme does not exist!\n"); |
26 | 26 | } |
27 | 27 | |
@@ -41,9 +41,9 @@ discard block |
||
41 | 41 | if ($handle = opendir($directory)) { |
42 | 42 | while (false !== ($file = readdir($handle))) { |
43 | 43 | if ($file != "." && $file != "..") { |
44 | - if (is_dir($directory. "/" . $file)) { |
|
45 | - if($recursive) { |
|
46 | - $array_items = array_merge($array_items, directoryToArray($directory. "/" . $file, $recursive)); |
|
44 | + if (is_dir($directory . "/" . $file)) { |
|
45 | + if ($recursive) { |
|
46 | + $array_items = array_merge($array_items, directoryToArray($directory . "/" . $file, $recursive)); |
|
47 | 47 | } |
48 | 48 | $file = $directory . "/" . $file; |
49 | 49 | $array_items[] = preg_replace("/\/\//si", "/", $file); |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | return $array_items; |
60 | 60 | } |
61 | 61 | |
62 | -$files = directoryToArray("./themes/".$theme."/templates/modules", true); |
|
62 | +$files = directoryToArray("./themes/" . $theme . "/templates/modules", true); |
|
63 | 63 | |
64 | 64 | $output = "## YAML Override template\n"; |
65 | 65 | $output .= "## original/file.tpl: override/file.tpl\n"; |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | continue; |
71 | 71 | } |
72 | 72 | $target = substr($file, 2); |
73 | - $origine = str_replace('themes/'.$theme.'/templates/modules/', '', $target); |
|
73 | + $origine = str_replace('themes/' . $theme . '/templates/modules/', '', $target); |
|
74 | 74 | $array = explode('/', $origine); |
75 | 75 | if (!isset($array[0])) { |
76 | 76 | continue; |
@@ -78,12 +78,12 @@ discard block |
||
78 | 78 | $modname = $array[0]; |
79 | 79 | unset($array[0]); |
80 | 80 | $origine = implode('/', $array); |
81 | - if (is_dir('system/'.$modname)) { |
|
82 | - $origine = 'system/'.$modname.'/templates/'.$origine; |
|
81 | + if (is_dir('system/' . $modname)) { |
|
82 | + $origine = 'system/' . $modname . '/templates/' . $origine; |
|
83 | 83 | } else { |
84 | - $origine = 'modules/'.$modname.'/templates/'.$origine; |
|
84 | + $origine = 'modules/' . $modname . '/templates/' . $origine; |
|
85 | 85 | } |
86 | - $output .= $origine.': '.$target."\n"; |
|
86 | + $output .= $origine . ': ' . $target . "\n"; |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | // write file |
@@ -94,6 +94,6 @@ discard block |
||
94 | 94 | fwrite($fh, $output); |
95 | 95 | fclose($fh); |
96 | 96 | |
97 | -echo 'Done. The file '.$override.' was created succesfully! Please move this file now to themes/'.$theme.'/templates/'; |
|
97 | +echo 'Done. The file ' . $override . ' was created succesfully! Please move this file now to themes/' . $theme . '/templates/'; |
|
98 | 98 | |
99 | 99 | ?> |
100 | 100 | \ No newline at end of file |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | public function validateInputArgument($argv) |
45 | 45 | { |
46 | 46 | if (empty($argv[1])) { |
47 | - echo 'Usage: '.$argv[0].' [/path/to/module_or_theme_or_file]'.PHP_EOL; |
|
47 | + echo 'Usage: ' . $argv[0] . ' [/path/to/module_or_theme_or_file]' . PHP_EOL; |
|
48 | 48 | die(); |
49 | 49 | } |
50 | 50 | |
@@ -108,10 +108,10 @@ discard block |
||
108 | 108 | $this->migrateModuleOrTheme($this->_input); |
109 | 109 | } else if ($this->isPHPFile($this->_input)) { |
110 | 110 | $this->migratePhpFile($this->_input); |
111 | - } else if($this->isTemplate($this->_input)) { |
|
111 | + } else if ($this->isTemplate($this->_input)) { |
|
112 | 112 | $this->migrateTemplate($this->_input); |
113 | 113 | } else { |
114 | - echo $this->_input.' is not a directory, a php file or a template file.'.PHP_EOL; |
|
114 | + echo $this->_input . ' is not a directory, a php file or a template file.' . PHP_EOL; |
|
115 | 115 | die(); |
116 | 116 | } |
117 | 117 | } |
@@ -126,11 +126,11 @@ discard block |
||
126 | 126 | public function migrateModuleOrTheme($input) |
127 | 127 | { |
128 | 128 | $objects = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($input), RecursiveIteratorIterator::SELF_FIRST); |
129 | - foreach($objects as $name => $object) { |
|
129 | + foreach ($objects as $name => $object) { |
|
130 | 130 | if (strpos($name, '.svn/') === false && strpos($name, '.git/') === false) { |
131 | 131 | if ($this->isPHPFile($name)) { |
132 | 132 | $this->migratePhpFile($name); |
133 | - } else if($this->isTemplate($name)) { |
|
133 | + } else if ($this->isTemplate($name)) { |
|
134 | 134 | $this->migrateTemplate($name); |
135 | 135 | } |
136 | 136 | } |
@@ -131,7 +131,7 @@ |
||
131 | 131 | |
132 | 132 | foreach ($columnArray as $alias=>$dbColumn) { |
133 | 133 | if (!isset($columnArrayDef[$alias])) { // skip calculated/math fields |
134 | - continue; |
|
134 | + continue; |
|
135 | 135 | } |
136 | 136 | $columnXML = $tableXML->addChild('column'); |
137 | 137 | $columnXML->addAttribute ('name', $alias); |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | if (!$data) { |
42 | 42 | exit ("Error reading file [$fileIn]\n"); |
43 | 43 | } |
44 | -$lines = explode("\n", $data); |
|
44 | +$lines = explode("\n", $data); |
|
45 | 45 | |
46 | 46 | |
47 | 47 | // |
@@ -49,16 +49,16 @@ discard block |
||
49 | 49 | // |
50 | 50 | $modName = null; |
51 | 51 | foreach ($lines as $line) { |
52 | - $line = str_replace ("\t", ' ', $line); |
|
53 | - $line = str_replace (' ', ' ', $line); |
|
54 | - if (strpos ($line, 'function ') !== false && strpos ($line, '()') != false) { |
|
55 | - $fields = explode (' ', $line); |
|
56 | - $nFields = count ($fields); |
|
52 | + $line = str_replace("\t", ' ', $line); |
|
53 | + $line = str_replace(' ', ' ', $line); |
|
54 | + if (strpos($line, 'function ') !== false && strpos($line, '()') != false) { |
|
55 | + $fields = explode(' ', $line); |
|
56 | + $nFields = count($fields); |
|
57 | 57 | if ($nFields < 2) { |
58 | 58 | exit ("Expected at least 2 fields for function declaration but found [$nFields]\n"); |
59 | 59 | } |
60 | 60 | |
61 | - $fields = explode ('_', $fields[1]); |
|
61 | + $fields = explode('_', $fields[1]); |
|
62 | 62 | $modname = $fields[0]; |
63 | 63 | break; |
64 | 64 | } |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | // |
85 | 85 | $xml = new SimpleXMLElement('<tables></tables>'); |
86 | 86 | foreach ($data as $table => $tableWithPrefix) { |
87 | - if (strpos($table, '_column') !== false || strpos($table, 'column_def') !== false || strpos ($table, 'column_idx') !== false) { |
|
87 | + if (strpos($table, '_column') !== false || strpos($table, 'column_def') !== false || strpos($table, 'column_idx') !== false) { |
|
88 | 88 | continue; |
89 | 89 | } |
90 | 90 | |
@@ -122,27 +122,27 @@ discard block |
||
122 | 122 | $columnArray = $data[$columnArrayIdx]; |
123 | 123 | $columnArrayDef = $data[$columnArrayDefIdx]; |
124 | 124 | $tableXML = $xml->addChild('table'); |
125 | - $tableXML->addAttribute ('name', $table); |
|
125 | + $tableXML->addAttribute('name', $table); |
|
126 | 126 | if ($primaryKeyColumn) { |
127 | - $tableXML->addAttribute ('primaryKey', $primaryKeyColumn); |
|
127 | + $tableXML->addAttribute('primaryKey', $primaryKeyColumn); |
|
128 | 128 | } |
129 | - $tableXML->addAttribute ('enableCategorization', $enableCategorization); |
|
130 | - $tableXML->addAttribute ('enableAttribution', $enableAttribution); |
|
129 | + $tableXML->addAttribute('enableCategorization', $enableCategorization); |
|
130 | + $tableXML->addAttribute('enableAttribution', $enableAttribution); |
|
131 | 131 | |
132 | 132 | foreach ($columnArray as $alias=>$dbColumn) { |
133 | 133 | if (!isset($columnArrayDef[$alias])) { // skip calculated/math fields |
134 | 134 | continue; |
135 | 135 | } |
136 | 136 | $columnXML = $tableXML->addChild('column'); |
137 | - $columnXML->addAttribute ('name', $alias); |
|
138 | - $columnXML->addAttribute ('dbname', $dbColumn); |
|
139 | - $type = ConversionUtil::parseType ($columnArrayDef[$alias]); |
|
140 | - $columnXML->addAttribute ('type', $type['type']); |
|
141 | - $columnXML->addAttribute ('length', $type['length']); |
|
142 | - $columnXML->addAttribute ('nullable', $type['nullable']); |
|
143 | - $columnXML->addAttribute ('default', $type['default']); |
|
144 | - $columnXML->addAttribute ('autoincrement', $type['autoincrement']); |
|
145 | - $columnXML->addAttribute ('primary', $type['primary']); |
|
137 | + $columnXML->addAttribute('name', $alias); |
|
138 | + $columnXML->addAttribute('dbname', $dbColumn); |
|
139 | + $type = ConversionUtil::parseType($columnArrayDef[$alias]); |
|
140 | + $columnXML->addAttribute('type', $type['type']); |
|
141 | + $columnXML->addAttribute('length', $type['length']); |
|
142 | + $columnXML->addAttribute('nullable', $type['nullable']); |
|
143 | + $columnXML->addAttribute('default', $type['default']); |
|
144 | + $columnXML->addAttribute('autoincrement', $type['autoincrement']); |
|
145 | + $columnXML->addAttribute('primary', $type['primary']); |
|
146 | 146 | } |
147 | 147 | |
148 | 148 | if (isset($data[$columnArrayIdxIdx])) { |
@@ -153,14 +153,14 @@ discard block |
||
153 | 153 | foreach ($indexDef as $field) { |
154 | 154 | $t[] = $data[$columnArrayIdx][$field]; |
155 | 155 | } |
156 | - $_indexDef = implode (',', $t); |
|
156 | + $_indexDef = implode(',', $t); |
|
157 | 157 | $columnXML = $tableXML->addChild('index'); |
158 | - $columnXML->addAttribute ('name', $indexName); |
|
159 | - $columnXML->addAttribute ('fields', $_indexDef); |
|
158 | + $columnXML->addAttribute('name', $indexName); |
|
159 | + $columnXML->addAttribute('fields', $_indexDef); |
|
160 | 160 | } else { |
161 | 161 | $columnXML = $tableXML->addChild('index'); |
162 | - $columnXML->addAttribute ('name', $indexName); |
|
163 | - $columnXML->addAttribute ('fields', $indexDef); |
|
162 | + $columnXML->addAttribute('name', $indexName); |
|
163 | + $columnXML->addAttribute('fields', $indexDef); |
|
164 | 164 | } |
165 | 165 | } |
166 | 166 | } |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | // save or echo results |
189 | 189 | // |
190 | 190 | if ($fileOut) { |
191 | - file_put_contents ($fileOut, $xmlText); |
|
191 | + file_put_contents($fileOut, $xmlText); |
|
192 | 192 | } else { |
193 | 193 | print $xmlText; |
194 | 194 | } |
@@ -202,12 +202,12 @@ discard block |
||
202 | 202 | /* ********************************************************* */ |
203 | 203 | class ConversionUtil |
204 | 204 | { |
205 | - public static function parseType ($typeString) |
|
205 | + public static function parseType($typeString) |
|
206 | 206 | { |
207 | 207 | $type = array(); |
208 | 208 | $typeString = preg_replace('/\s\s+/', ' ', $typeString); |
209 | - $fields = explode (' ', $typeString); |
|
210 | - $nFields = count ($fields); |
|
209 | + $fields = explode(' ', $typeString); |
|
210 | + $nFields = count($fields); |
|
211 | 211 | |
212 | 212 | $typemap = array(); |
213 | 213 | $typemap['C'] = 'VARCHAR'; |
@@ -229,14 +229,14 @@ discard block |
||
229 | 229 | $typemap['F'] = 'FLOAT'; |
230 | 230 | $typemap['N'] = 'NUMERIC'; |
231 | 231 | |
232 | - for ($c=0; $c<$nFields; $c++) { |
|
232 | + for ($c = 0; $c < $nFields; $c++) { |
|
233 | 233 | if ($c == 0) { |
234 | 234 | if (strpos($fields[$c], '(') !== false) { |
235 | - $pos1 = strpos ($fields[0], '('); |
|
236 | - $pos2 = strpos ($fields[0], ')'); |
|
237 | - $fType = substr ($fields[0], 0, $pos1); |
|
235 | + $pos1 = strpos($fields[0], '('); |
|
236 | + $pos2 = strpos($fields[0], ')'); |
|
237 | + $fType = substr($fields[0], 0, $pos1); |
|
238 | 238 | $fType = $typemap[$fType]; |
239 | - $fLength = substr ($fields[0], $pos1+1, $pos2-$pos1-1); |
|
239 | + $fLength = substr($fields[0], $pos1 + 1, $pos2 - $pos1 - 1); |
|
240 | 240 | $type['type'] = $fType; |
241 | 241 | $type['length'] = $fLength; |
242 | 242 | } else { |
@@ -261,21 +261,21 @@ discard block |
||
261 | 261 | } |
262 | 262 | |
263 | 263 | if ($fields[$c] == 'DEFAULT') { |
264 | - if ($nFields > $c+2) { |
|
265 | - $type['default'] = $fields[$c+1] . ' ' . $fields[$c+2]; |
|
266 | - $c+=2; |
|
264 | + if ($nFields > $c + 2) { |
|
265 | + $type['default'] = $fields[$c + 1] . ' ' . $fields[$c + 2]; |
|
266 | + $c += 2; |
|
267 | 267 | } else { |
268 | - $type['default'] = $fields[$c+1]; |
|
269 | - $c+=1; |
|
268 | + $type['default'] = $fields[$c + 1]; |
|
269 | + $c += 1; |
|
270 | 270 | } |
271 | 271 | } |
272 | 272 | } |
273 | 273 | } |
274 | 274 | |
275 | - if (!isset($type['nullable'])) { $type['nullable'] = 'true'; } |
|
276 | - if (!isset($type['autoincrement'])) { $type['autoincrement'] = 'false'; } |
|
277 | - if (!isset($type['default'])) { $type['default'] = ''; } |
|
278 | - if (!isset($type['primary'])) { $type['primary'] = 'false'; } |
|
275 | + if (!isset($type['nullable'])) { $type['nullable'] = 'true'; } |
|
276 | + if (!isset($type['autoincrement'])) { $type['autoincrement'] = 'false'; } |
|
277 | + if (!isset($type['default'])) { $type['default'] = ''; } |
|
278 | + if (!isset($type['primary'])) { $type['primary'] = 'false'; } |
|
279 | 279 | |
280 | 280 | return $type; |
281 | 281 | } |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | |
285 | 285 | class DBUtil |
286 | 286 | { |
287 | - public static function getLimitedTablename ($table) |
|
287 | + public static function getLimitedTablename($table) |
|
288 | 288 | { |
289 | 289 | return $table; |
290 | 290 | } |
@@ -298,8 +298,9 @@ |
||
298 | 298 | // ensure correct handling of prefix with and without underscore |
299 | 299 | if ($col_prefix) { |
300 | 300 | $plen = strlen($col_prefix); |
301 | - if ($col_prefix[$plen - 1] != '_') |
|
302 | - $col_prefix .= '_'; |
|
301 | + if ($col_prefix[$plen - 1] != '_') { |
|
302 | + $col_prefix .= '_'; |
|
303 | + } |
|
303 | 304 | } |
304 | 305 | |
305 | 306 | // add standard fields |
@@ -42,7 +42,7 @@ |
||
42 | 42 | 'composer-plugin' => 'Composer Plugins' |
43 | 43 | ]; |
44 | 44 | $types = array_keys($typeOrder); |
45 | - usort($packages, function ($a, $b) use ($types) { |
|
45 | + usort($packages, function($a, $b) use ($types) { |
|
46 | 46 | return array_search($a['type'], $types) - array_search($b['type'], $types); |
47 | 47 | }); |
48 | 48 |
@@ -92,10 +92,10 @@ |
||
92 | 92 | |
93 | 93 | public function registerContainerConfiguration(LoaderInterface $loader) |
94 | 94 | { |
95 | - $loader->load($this->rootDir.'/config/config_'.$this->getEnvironment().'.yml'); |
|
96 | - $loader->load($this->rootDir.'/config/parameters.yml'); |
|
97 | - if (is_readable($this->rootDir.'/config/custom_parameters.yml')) { |
|
98 | - $loader->load($this->rootDir.'/config/custom_parameters.yml'); |
|
95 | + $loader->load($this->rootDir . '/config/config_' . $this->getEnvironment() . '.yml'); |
|
96 | + $loader->load($this->rootDir . '/config/parameters.yml'); |
|
97 | + if (is_readable($this->rootDir . '/config/custom_parameters.yml')) { |
|
98 | + $loader->load($this->rootDir . '/config/custom_parameters.yml'); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | if (!is_readable($this->rootDir . '/config/' . DynamicConfigDumper::CONFIG_GENERATED)) { |
@@ -16,7 +16,7 @@ |
||
16 | 16 | /** |
17 | 17 | * @var ClassLoader |
18 | 18 | */ |
19 | -$loader = require __DIR__.'/../vendor/autoload.php'; |
|
19 | +$loader = require __DIR__ . '/../vendor/autoload.php'; |
|
20 | 20 | |
21 | 21 | AnnotationRegistry::registerLoader([$loader, 'loadClass']); |
22 | 22 | AnnotationReader::addGlobalIgnoredName('type'); |
@@ -12,12 +12,12 @@ discard block |
||
12 | 12 | use Symfony\Component\Debug\Debug; |
13 | 13 | use Symfony\Component\Yaml\Yaml; |
14 | 14 | |
15 | -require __DIR__.'/../app/autoload.php'; |
|
16 | -require __DIR__.'/../app/ZikulaKernel.php'; |
|
17 | -require __DIR__.'/../lib/requirementCheck.php'; |
|
15 | +require __DIR__ . '/../app/autoload.php'; |
|
16 | +require __DIR__ . '/../app/ZikulaKernel.php'; |
|
17 | +require __DIR__ . '/../lib/requirementCheck.php'; |
|
18 | 18 | |
19 | -$kernelConfig = Yaml::parse(file_get_contents(__DIR__.'/../app/config/parameters.yml')); |
|
20 | -if (is_readable($file = __DIR__.'/../app/config/custom_parameters.yml')) { |
|
19 | +$kernelConfig = Yaml::parse(file_get_contents(__DIR__ . '/../app/config/parameters.yml')); |
|
20 | +if (is_readable($file = __DIR__ . '/../app/config/custom_parameters.yml')) { |
|
21 | 21 | $kernelConfig = array_merge($kernelConfig, Yaml::parse(file_get_contents($file))); |
22 | 22 | } |
23 | 23 | $kernelConfig = $kernelConfig['parameters']; |
@@ -36,4 +36,4 @@ discard block |
||
36 | 36 | $kernel->boot(); |
37 | 37 | |
38 | 38 | // legacy handling |
39 | -require __DIR__.'/core.php'; |
|
39 | +require __DIR__ . '/core.php'; |