Completed
Push — develop ( e6bcf2...351294 )
by Dmytro
06:18
created
manager/includes/template.parser.class.inc.php 1 patch
Braces   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -7,55 +7,55 @@  discard block
 block discarded – undo
7 7
  *
8 8
  */
9 9
 
10
-class TemplateParser
11
-{
10
+class TemplateParser
11
+{
12 12
 
13 13
     /**
14 14
      * @param array $config [action, tabs, toArray]
15 15
      * @param array $data
16 16
      * @return string
17 17
      */
18
-    public function output($config = array(), $data = array())
19
-    {
18
+    public function output($config = array(), $data = array())
19
+    {
20 20
         $modx = evolutionCMS();
21 21
 
22 22
         $output = '';
23 23
         $action = !empty($config['action']) ? $config['action'] : (!empty($_REQUEST['a']) ? $_REQUEST['a'] : '');
24 24
         $tab = isset($config['tab']) ? ' AND tab IN(' . $config['tab'] . ')' : '';
25 25
 
26
-        if ($action) {
26
+        if ($action) {
27 27
             $sql = $modx->db->query('SELECT t1.*, IF(t1.alias=\'\',t1.name,t1.alias) AS alias, t2.category AS category_name
28 28
 			FROM ' . $modx->getFullTableName('system_templates') . ' AS t1
29 29
 			INNER JOIN ' . $modx->getFullTableName('categories') . ' AS t2 ON t2.id=t1.category
30 30
 			WHERE t1.action IN(' . $action . ') ' . $tab . '
31 31
 			ORDER BY t1.tab ASC, t1.rank ASC');
32 32
 
33
-            if ($modx->db->getRecordCount($sql)) {
33
+            if ($modx->db->getRecordCount($sql)) {
34 34
                 $tabs = array();
35
-                while ($row = $modx->db->getRow($sql)) {
36
-                    if (!$row['value'] && !empty($data[$row['name']])) {
35
+                while ($row = $modx->db->getRow($sql)) {
36
+                    if (!$row['value'] && !empty($data[$row['name']])) {
37 37
                         $row['value'] = $data[$row['name']];
38 38
                     }
39 39
                     $tabs[$row['tab']]['category_name'] = $row['category_name'];
40 40
                     $tabs[$row['tab']][$row['name']] = TemplateParser::render($row);
41 41
                 }
42 42
 
43
-                if (!empty($config['toArray'])) {
43
+                if (!empty($config['toArray'])) {
44 44
                     $output = $tabs;
45
-                } else {
45
+                } else {
46 46
                     $output .= '<div class="tab-pane" id="pane_' . $action . '">';
47 47
                     $output .= '
48 48
 					<script type="text/javascript">
49 49
 						var pane_' . $action . ' = new WebFXTabPane(document.getElementById("pane_' . $action . '"), ' . ($modx->config['remember_last_tab'] == 1 ? 'true' : 'false') . ');
50 50
 					</script>';
51 51
 
52
-                    foreach ($tabs as $idTab => $tab) {
52
+                    foreach ($tabs as $idTab => $tab) {
53 53
                         $output .= '<div class="tab-page" id="tab_' . $action . '_' . $idTab . '">';
54 54
                         $output .= '
55 55
 						<h2 class="tab">' . (!empty($config['tabs'][$idTab]) ? $config['tabs'][$idTab] : $tab['category_name']) . '</h2>
56 56
 						<script type="text/javascript">pane_' . $action . '.addTabPage(document.getElementById("tab_' . $action . '_' . $idTab . '"));</script>';
57 57
                         unset($tab['category_name']);
58
-                        foreach ($tab as $item) {
58
+                        foreach ($tab as $item) {
59 59
                             $output .= $item;
60 60
                         }
61 61
                         $output .= '</div>';
@@ -72,8 +72,8 @@  discard block
 block discarded – undo
72 72
      * @param array $data
73 73
      * @return string
74 74
      */
75
-    private function render($data)
76
-    {
75
+    private function render($data)
76
+    {
77 77
         $modx = evolutionCMS();
78 78
         global $_lang, $_country_lang;
79 79
 
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
         $output = '';
85 85
         $output .= '<div class="form-group row">';
86 86
 
87
-        switch ($data['type']) {
87
+        switch ($data['type']) {
88 88
 
89 89
             case 'text':
90 90
                 $output .= '<label class="col-sm-3" for="[+name+]">[+lang.name+]</label>
@@ -118,16 +118,16 @@  discard block
 block discarded – undo
118 118
                 $output .= '<label class="col-sm-3" for="[+name+]">[+lang.name+]</label>';
119 119
                 $output .= '<div class="col-sm-7">';
120 120
                 $output .= '<select name="[+name+]" class="form-control" id="[+name+]" onChange="documentDirty=true;">';
121
-                if ($data['name'] == 'country' && isset($_country_lang)) {
121
+                if ($data['name'] == 'country' && isset($_country_lang)) {
122 122
                     $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $data['country'];
123 123
                     $output .= '<option value=""' . (!isset($chosenCountry) ? ' selected' : '') . '>&nbsp;</option>';
124
-                    foreach ($_country_lang as $key => $value) {
124
+                    foreach ($_country_lang as $key => $value) {
125 125
                         $output .= '<option value="' . $key . '"' . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . '>' . $value . '</option>';
126 126
                     }
127
-                } else {
128
-                    if ($data['elements']) {
127
+                } else {
128
+                    if ($data['elements']) {
129 129
                         $elements = explode('||', $data['elements']);
130
-                        foreach ($elements as $key => $value) {
130
+                        foreach ($elements as $key => $value) {
131 131
                             $value = explode('==', $value);
132 132
                             $output .= '<option value="' . $value[1] . '">' . (isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]) . '</option>';
133 133
                         }
@@ -143,9 +143,9 @@  discard block
 block discarded – undo
143 143
                 $output .= '<label class="col-sm-3" for="[+name+]">[+lang.name+]</label>';
144 144
                 $output .= '<div class="col-sm-7">';
145 145
                 $output .= '<input type="checkbox" name="[+name+]" class="form-control" id="[+name+]" value="[+value+]" onChange="documentDirty=true;"[+readonly+] />';
146
-                if ($data['elements']) {
146
+                if ($data['elements']) {
147 147
                     $elements = explode('||', $data['elements']);
148
-                    foreach ($elements as $key => $value) {
148
+                    foreach ($elements as $key => $value) {
149 149
                         $value = explode('==', $value);
150 150
                         $output .= '<br /><input type="checkbox" name="' . $value[0] . '" class="form-control" id="' . $value[0] . '" value="' . $value[1] . '" onChange="documentDirty=true;"[+readonly+] /> ' . (isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]);
151 151
                     }
@@ -159,9 +159,9 @@  discard block
 block discarded – undo
159 159
                 $output .= '<label class="col-sm-3" for="[+name+]">[+lang.name+]</label>';
160 160
                 $output .= '<div class="col-sm-7">';
161 161
                 $output .= '<input type="radio" name="[+name+]" class="form-control" id="[+name+]" value="[+value+]" onChange="documentDirty=true;"[+readonly+] />';
162
-                if ($data['elements']) {
162
+                if ($data['elements']) {
163 163
                     $elements = explode('||', $data['elements']);
164
-                    foreach ($elements as $key => $value) {
164
+                    foreach ($elements as $key => $value) {
165 165
                         $value = explode('==', $value);
166 166
                         $output .= '<br /><input type="radio" name="[+name+]" class="form-control" id="[+name+]_' . $key . '" value="' . $value[1] . '" onChange="documentDirty=true;"[+readonly+] /> ' . (isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]);
167 167
                     }
Please login to merge, or discard this patch.
manager/includes/document.parser.class.inc.php 1 patch
Braces   +32 added lines, -17 removed lines patch added patch discarded remove patch
@@ -721,13 +721,15 @@  discard block
 block discarded – undo
721 721
             $this->virtualDir = '';
722 722
         }
723 723
 
724
-        if (preg_match('@^[1-9][0-9]*$@', $q) && !isset($this->documentListing[$q])) { /* we got an ID returned, check to make sure it's not an alias */
724
+        if (preg_match('@^[1-9][0-9]*$@', $q) && !isset($this->documentListing[$q])) {
725
+/* we got an ID returned, check to make sure it's not an alias */
725 726
             /* FS#476 and FS#308: check that id is valid in terms of virtualDir structure */
726 727
             if ($this->config['use_alias_path'] == 1) {
727 728
                 if (($this->virtualDir != '' && !isset($this->documentListing[$this->virtualDir . '/' . $q]) || ($this->virtualDir == '' && !isset($this->documentListing[$q]))) && (($this->virtualDir != '' && isset($this->documentListing[$this->virtualDir]) && in_array($q, $this->getChildIds($this->documentListing[$this->virtualDir], 1))) || ($this->virtualDir == '' && in_array($q, $this->getChildIds(0, 1))))) {
728 729
                     $this->documentMethod = 'id';
729 730
                     return $q;
730
-                } else { /* not a valid id in terms of virtualDir, treat as alias */
731
+                } else {
732
+/* not a valid id in terms of virtualDir, treat as alias */
731 733
                     $this->documentMethod = 'alias';
732 734
                     return $q;
733 735
                 }
@@ -735,7 +737,8 @@  discard block
 block discarded – undo
735 737
                 $this->documentMethod = 'id';
736 738
                 return $q;
737 739
             }
738
-        } else { /* we didn't get an ID back, so instead we assume it's an alias */
740
+        } else {
741
+/* we didn't get an ID back, so instead we assume it's an alias */
739 742
             if ($this->config['friendly_alias_urls'] != 1) {
740 743
                 $q = $qOrig;
741 744
             }
@@ -1108,7 +1111,8 @@  discard block
 block discarded – undo
1108 1111
         $where = "pub_date <= {$timeNow} AND pub_date!=0 AND published=0";
1109 1112
         $result_pub = $this->db->select('id', '[+prefix+]site_content', $where);
1110 1113
         $this->db->update($field, '[+prefix+]site_content', $where);
1111
-        if ($this->db->getRecordCount($result_pub) >= 1) { //Event unPublished doc
1114
+        if ($this->db->getRecordCount($result_pub) >= 1) {
1115
+//Event unPublished doc
1112 1116
             while ($row_pub = $this->db->getRow($result_pub)) {
1113 1117
                 $this->invokeEvent("OnDocUnPublished", array(
1114 1118
                     "docid" => $row_pub['id']
@@ -1121,7 +1125,8 @@  discard block
 block discarded – undo
1121 1125
         $where = "unpub_date <= {$timeNow} AND unpub_date!=0 AND published=1";
1122 1126
         $result_unpub = $this->db->select('id', '[+prefix+]site_content', $where);
1123 1127
         $this->db->update($field, '[+prefix+]site_content', $where);
1124
-        if ($this->db->getRecordCount($result_unpub) >= 1) { //Event unPublished doc
1128
+        if ($this->db->getRecordCount($result_unpub) >= 1) {
1129
+//Event unPublished doc
1125 1130
             while ($row_unpub = $this->db->getRow($result_unpub)) {
1126 1131
                 $this->invokeEvent("OnDocUnPublished", array(
1127 1132
                     "docid" => $row_unpub['id']
@@ -1272,7 +1277,8 @@  discard block
 block discarded – undo
1272 1277
                         }
1273 1278
                     }
1274 1279
 
1275
-                    if (!in_array($fetch, $tags)) {  // Avoid double Matches
1280
+                    if (!in_array($fetch, $tags)) {
1281
+// Avoid double Matches
1276 1282
                         $tags[] = $fetch; // Fetch
1277 1283
                     };
1278 1284
                     $fetch = ''; // and reset
@@ -2057,7 +2063,8 @@  discard block
 block discarded – undo
2057 2063
      * @return mixed|string
2058 2064
      */
2059 2065
     public function _getSGVar($value)
2060
-    { // Get super globals
2066
+    {
2067
+// Get super globals
2061 2068
         $key = $value;
2062 2069
         $_ = $this->config['enable_filter'];
2063 2070
         $this->config['enable_filter'] = 1;
@@ -2462,7 +2469,8 @@  discard block
 block discarded – undo
2462 2469
         if ($this->config['friendly_urls'] == 1) {
2463 2470
             $aliases = array();
2464 2471
             if (is_array($this->documentListing)) {
2465
-                foreach ($this->documentListing as $path => $docid) { // This is big Loop on large site!
2472
+                foreach ($this->documentListing as $path => $docid) {
2473
+// This is big Loop on large site!
2466 2474
                     $aliases[$docid] = $path;
2467 2475
                     $isfolder[$docid] = $this->aliasListing[$docid]['isfolder'];
2468 2476
                 }
@@ -2495,7 +2503,7 @@  discard block
 block discarded – undo
2495 2503
             $isfriendly = ($this->config['friendly_alias_urls'] == 1 ? 1 : 0);
2496 2504
             $pref = $this->config['friendly_url_prefix'];
2497 2505
             $suff = $this->config['friendly_url_suffix'];
2498
-            $documentSource = preg_replace_callback($in, function ($m) use ($aliases, $isfolder, $isfriendly, $pref, $suff) {
2506
+            $documentSource = preg_replace_callback($in, function ($m) use ($aliases, $isfolder, $isfriendly, $pref, $suff){
2499 2507
                 global $modx;
2500 2508
                 $thealias = $aliases[$m[1]];
2501 2509
                 $thefolder = $isfolder[$m[1]];
@@ -4256,7 +4264,8 @@  discard block
 block discarded – undo
4256 4264
         if (isset($this->snippetCache[$snippetName])) {
4257 4265
             $snippet = $this->snippetCache[$snippetName];
4258 4266
             $properties = !empty($this->snippetCache[$snippetName . "Props"]) ? $this->snippetCache[$snippetName . "Props"] : '';
4259
-        } else { // not in cache so let's check the db
4267
+        } else {
4268
+// not in cache so let's check the db
4260 4269
             $sql = "SELECT ss.`name`, ss.`snippet`, ss.`properties`, sm.properties as `sharedproperties` FROM " . $this->getFullTableName("site_snippets") . " as ss LEFT JOIN " . $this->getFullTableName('site_modules') . " as sm on sm.guid=ss.moduleguid WHERE ss.`name`='" . $this->db->escape($snippetName) . "'  AND ss.disabled=0;";
4261 4270
             $result = $this->db->query($sql);
4262 4271
             if ($this->db->getRecordCount($result) == 1) {
@@ -5234,10 +5243,12 @@  discard block
 block discarded – undo
5234 5243
             return '';
5235 5244
         } // nothing to register
5236 5245
         if (!is_array($options)) {
5237
-            if (is_bool($options)) {  // backward compatibility with old plaintext parameter
5246
+            if (is_bool($options)) {
5247
+// backward compatibility with old plaintext parameter
5238 5248
 
5239 5249
                 $options = array('plaintext' => $options);
5240
-            } elseif (is_string($options)) { // Also allow script name as 2nd param
5250
+            } elseif (is_string($options)) {
5251
+// Also allow script name as 2nd param
5241 5252
 
5242 5253
                 $options = array('name' => $options);
5243 5254
             } else {
@@ -5251,7 +5262,8 @@  discard block
 block discarded – undo
5251 5262
         unset($overwritepos); // probably unnecessary--just making sure
5252 5263
 
5253 5264
         $useThisVer = true;
5254
-        if (isset($this->loadedjscripts[$key])) { // a matching script was found
5265
+        if (isset($this->loadedjscripts[$key])) {
5266
+// a matching script was found
5255 5267
             // if existing script is a startup script, make sure the candidate is also a startup script
5256 5268
             if ($this->loadedjscripts[$key]['startup']) {
5257 5269
                 $startup = true;
@@ -5271,7 +5283,8 @@  discard block
 block discarded – undo
5271 5283
                     // overwrite the old script (the position may be important for dependent scripts)
5272 5284
                     $overwritepos = $this->loadedjscripts[$key]['pos'];
5273 5285
                 }
5274
-            } else { // Use the original version
5286
+            } else {
5287
+// Use the original version
5275 5288
                 if ($startup == true && $this->loadedjscripts[$key]['startup'] == false) {
5276 5289
                     // need to move the exisiting script to the head
5277 5290
                     $version = $this->loadedjscripts[$key][$version];
@@ -5396,7 +5409,8 @@  discard block
 block discarded – undo
5396 5409
         }
5397 5410
 
5398 5411
         $results = null;
5399
-        foreach ($this->pluginEvent[$evtName] as $pluginName) { // start for loop
5412
+        foreach ($this->pluginEvent[$evtName] as $pluginName) {
5413
+// start for loop
5400 5414
             if ($this->dumpPlugins) {
5401 5415
                 $eventtime = $this->getMicroTime();
5402 5416
             }
@@ -5939,7 +5953,8 @@  discard block
 block discarded – undo
5939 5953
      * @return bool
5940 5954
      */
5941 5955
     public function isSafeCode($phpcode = '', $safe_functions = '')
5942
-    { // return true or false
5956
+    {
5957
+// return true or false
5943 5958
         if ($safe_functions == '') {
5944 5959
             return false;
5945 5960
         }
@@ -6351,7 +6366,7 @@  discard block
 block discarded – undo
6351 6366
             $args = array_pad(array(), $_, '$var');
6352 6367
             $args = implode(", ", $args);
6353 6368
             $modx = &$this;
6354
-            $args = preg_replace_callback('/\$var/', function () use ($modx, &$tmp, $val) {
6369
+            $args = preg_replace_callback('/\$var/', function () use ($modx, &$tmp, $val){
6355 6370
                 $arg = $val['args'][$tmp - 1];
6356 6371
                 switch (true) {
6357 6372
                     case is_null($arg): {
Please login to merge, or discard this patch.
manager/includes/extenders/modifiers.class.inc.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -194,7 +194,8 @@  discard block
 block discarded – undo
194 194
             $c = substr($modifiers, 0, 1);
195 195
             $modifiers = substr($modifiers, 1);
196 196
 
197
-            if ($c===':' && preg_match('@^(!?[<>=]{1,2})@', $modifiers, $match)) { // :=, :!=, :<=, :>=, :!<=, :!>=
197
+            if ($c===':' && preg_match('@^(!?[<>=]{1,2})@', $modifiers, $match)) {
198
+// :=, :!=, :<=, :>=, :!<=, :!>=
198 199
                 $c = substr($modifiers, strlen($match[1]), 1);
199 200
                 $debuginfo = "#i=0 #c=[{$c}] #m=[{$modifiers}]";
200 201
                 if ($c==='(') {
@@ -209,7 +210,8 @@  discard block
 block discarded – undo
209 210
 
210 211
                 $result[]=array('cmd'=>trim($match[1]),'opt'=>$opt,'debuginfo'=>$debuginfo);
211 212
                 $cmd = '';
212
-            } elseif (in_array($c, array('+','-','*','/')) && preg_match('@^[0-9]+@', $modifiers, $match)) { // :+3, :-3, :*3 ...
213
+            } elseif (in_array($c, array('+','-','*','/')) && preg_match('@^[0-9]+@', $modifiers, $match)) {
214
+// :+3, :-3, :*3 ...
213 215
                 $modifiers = substr($modifiers, strlen($match[0]));
214 216
                 $result[]=array('cmd'=>'math','opt'=>'%s' . $c . $match[0]);
215 217
                 $cmd = '';
Please login to merge, or discard this patch.
manager/includes/extenders/dbapi.mysqli.class.inc.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -373,7 +373,8 @@
 block discarded – undo
373 373
      * @return bool|mixed|mysqli_result
374 374
      */
375 375
     public function save($fields, $table, $where = '')
376
-    { // This is similar to "replace into table".
376
+    {
377
+// This is similar to "replace into table".
377 378
 
378 379
         if ($where === '') {
379 380
             $mode = 'insert';
Please login to merge, or discard this patch.
manager/includes/extenders/modifiers/mdf_wordwrap.inc.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1 1
 <?php
2
-return preg_replace_callback("~(\b\w+\b)~", function ($m) use ($wrapat) {
2
+return preg_replace_callback("~(\b\w+\b)~", function ($m) use ($wrapat){
3 3
     return wordwrap($m[1], $wrapat, ' ', 1);
4 4
 }, $value);
Please login to merge, or discard this patch.
manager/includes/tmplvars.format.inc.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -363,7 +363,8 @@
 block discarded – undo
363 363
  * @return array|string
364 364
  */
365 365
 function parseInput($src, $delim = "||", $type = "string", $columns = true)
366
-{ // type can be: string, array
366
+{
367
+// type can be: string, array
367 368
     $modx = evolutionCMS();
368 369
     if ($modx->db->isResult($src)) {
369 370
         // must be a recordset
Please login to merge, or discard this patch.
manager/includes/header.inc.php 1 patch
Braces   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />
4 4
     Please use the EVO Content Manager instead of accessing this file directly.");
5 5
 }
@@ -10,26 +10,26 @@  discard block
 block discarded – undo
10 10
 $modx_textdir = isset($modx_textdir) ? $modx_textdir : null;
11 11
 $onManagerMainFrameHeaderHTMLBlock = is_array($evtOut) ? implode("\n", $evtOut) : '';
12 12
 $textdir = $modx_textdir === 'rtl' ? 'rtl' : 'ltr';
13
-if (!isset($modx->config['mgr_jquery_path'])) {
13
+if (!isset($modx->config['mgr_jquery_path'])) {
14 14
     $modx->config['mgr_jquery_path'] = 'media/script/jquery/jquery.min.js';
15 15
 }
16
-if (!isset($modx->config['mgr_date_picker_path'])) {
16
+if (!isset($modx->config['mgr_date_picker_path'])) {
17 17
     $modx->config['mgr_date_picker_path'] = 'media/script/air-datepicker/datepicker.inc.php';
18 18
 }
19 19
 
20 20
 $body_class = '';
21 21
 $theme_modes = array('', 'lightness', 'light', 'dark', 'darkness');
22
-if (!empty($theme_modes[$_COOKIE['MODX_themeMode']])) {
22
+if (!empty($theme_modes[$_COOKIE['MODX_themeMode']])) {
23 23
     $body_class .= ' ' . $theme_modes[$_COOKIE['MODX_themeMode']];
24
-} elseif (!empty($theme_modes[$modx->config['manager_theme_mode']])) {
24
+} elseif (!empty($theme_modes[$modx->config['manager_theme_mode']])) {
25 25
     $body_class .= ' ' . $theme_modes[$modx->config['manager_theme_mode']];
26 26
 }
27 27
 
28 28
 $css = 'media/style/' . $modx->config['manager_theme'] . '/style.css?v=' . $lastInstallTime;
29 29
 
30
-if ($modx->config['manager_theme'] == 'default') {
30
+if ($modx->config['manager_theme'] == 'default') {
31 31
     if (!file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')
32
-        && is_writable(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css')) {
32
+        && is_writable(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css')) {
33 33
         require_once MODX_BASE_PATH . 'assets/lib/Formatter/CSSMinify.php';
34 34
         $minifier = new Formatter\CSSMinify();
35 35
         $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/bootstrap/css/bootstrap.min.css');
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
             $css
50 50
         );
51 51
     }
52
-    if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) {
52
+    if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) {
53 53
         $css = 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css?v=' . $lastInstallTime;
54 54
     }
55 55
 }
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
     <link rel="stylesheet" type="text/css" href="<?= $css ?>"/>
67 67
     <script type="text/javascript" src="media/script/tabpane.js"></script>
68 68
     <?= sprintf('<script type="text/javascript" src="%s"></script>' . "\n", $modx->config['mgr_jquery_path']) ?>
69
-    <?php if ($modx->config['show_picker'] != "0") {
69
+    <?php if ($modx->config['show_picker'] != "0") {
70 70
     ?>
71 71
         <script src="media/style/<?= $modx->config['manager_theme'] ?>/js/color.switcher.js"
72 72
                 type="text/javascript"></script>
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 } ?>
75 75
     <?php
76 76
     $aArr = array('2');
77
-    if (!in_array($_REQUEST['a'], $aArr)) {
77
+    if (!in_array($_REQUEST['a'], $aArr)) {
78 78
         ?>
79 79
         <script src="media/script/mootools/mootools.js" type="text/javascript"></script>
80 80
         <script src="media/script/mootools/moodx.js" type="text/javascript"></script>
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
     <script src="media/script/main.js"></script>
112 112
     <script>
113 113
         <?php
114
-        if (isset($_REQUEST['r']) && preg_match('@^[0-9]+$@', $_REQUEST['r'])) {
114
+        if (isset($_REQUEST['r']) && preg_match('@^[0-9]+$@', $_REQUEST['r'])) {
115 115
             echo 'doRefresh(' . $_REQUEST['r'] . ");\n";
116 116
         }
117 117
         ?>
Please login to merge, or discard this patch.
manager/includes/manager.lockout.inc.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,8 @@
 block discarded – undo
51 51
         } elseif (is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/templates/actions/manager.lockout.tpl')) {
52 52
             $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/templates/actions/manager.lockout.tpl';
53 53
             $login_tpl = file_get_contents($target);
54
-        } elseif (is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/manager.lockout.html')) { // ClipperCMS compatible
54
+        } elseif (is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/manager.lockout.html')) {
55
+// ClipperCMS compatible
55 56
             $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/manager.lockout.html';
56 57
             $lockout_tpl = file_get_contents($target);
57 58
         } else {
Please login to merge, or discard this patch.
manager/includes/preload.functions.inc.php 1 patch
Braces   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -4,14 +4,14 @@  discard block
 block discarded – undo
4 4
 $site_sessionname = genEvoSessionName(); // For legacy extras not using startCMSSession
5 5
 
6 6
 
7
-if (! function_exists('evolutionCMS')) {
7
+if (! function_exists('evolutionCMS')) {
8 8
     /**
9 9
      * @return DocumentParser
10 10
      */
11
-    function evolutionCMS()
12
-    {
13
-        if (! defined('MODX_CLASS')) {
14
-            if (! class_exists('DocumentParser')) {
11
+    function evolutionCMS()
12
+    {
13
+        if (! defined('MODX_CLASS')) {
14
+            if (! class_exists('DocumentParser')) {
15 15
                 throw new RuntimeException('MODX_CLASS not defined and DocumentParser class not exists');
16 16
             }
17 17
             define('MODX_CLASS', 'DocumentParser');
@@ -24,8 +24,8 @@  discard block
 block discarded – undo
24 24
 /**
25 25
  * @return string
26 26
  */
27
-function genEvoSessionName()
28
-{
27
+function genEvoSessionName()
28
+{
29 29
     $_ = crc32(__FILE__);
30 30
     $_ = sprintf('%u', $_);
31 31
 
@@ -35,10 +35,10 @@  discard block
 block discarded – undo
35 35
 /**
36 36
  * @return void
37 37
  */
38
-function startCMSSession()
39
-{
38
+function startCMSSession()
39
+{
40 40
     global $site_sessionname, $https_port, $session_cookie_path, $session_cookie_domain;
41
-    if (MODX_CLI) {
41
+    if (MODX_CLI) {
42 42
         return;
43 43
     }
44 44
 
@@ -51,14 +51,14 @@  discard block
 block discarded – undo
51 51
     session_set_cookie_params($cookieExpiration, $cookiePath, $cookieDomain, $secure, true);
52 52
     session_start();
53 53
     $key = "modx.mgr.session.cookie.lifetime";
54
-    if (isset($_SESSION[$key]) && is_numeric($_SESSION[$key])) {
54
+    if (isset($_SESSION[$key]) && is_numeric($_SESSION[$key])) {
55 55
         $cookieLifetime = (int)$_SESSION[$key];
56
-        if ($cookieLifetime) {
56
+        if ($cookieLifetime) {
57 57
             $cookieExpiration = $_SERVER['REQUEST_TIME'] + $cookieLifetime;
58 58
         }
59 59
         setcookie(session_name(), session_id(), $cookieExpiration, $cookiePath, $cookieDomain, $secure, true);
60 60
     }
61
-    if (!isset($_SESSION['modx.session.created.time'])) {
61
+    if (!isset($_SESSION['modx.session.created.time'])) {
62 62
         $_SESSION['modx.session.created.time'] = $_SERVER['REQUEST_TIME'];
63 63
     }
64 64
 }
@@ -68,9 +68,9 @@  discard block
 block discarded – undo
68 68
  * @param $session_name
69 69
  * @return void
70 70
  */
71
-function removeInvalidCmsSessionFromStorage(&$storage, $session_name)
72
-{
73
-    if (isset($storage[$session_name]) && ($storage[$session_name] === '' || $storage[$session_name] === 'deleted')) {
71
+function removeInvalidCmsSessionFromStorage(&$storage, $session_name)
72
+{
73
+    if (isset($storage[$session_name]) && ($storage[$session_name] === '' || $storage[$session_name] === 'deleted')) {
74 74
         unset($storage[$session_name]);
75 75
     }
76 76
 }
@@ -79,9 +79,9 @@  discard block
 block discarded – undo
79 79
  * @param $session_name
80 80
  * @return void
81 81
  */
82
-function removeInvalidCmsSessionIds($session_name)
83
-{
84
-    if (MODX_CLI) {
82
+function removeInvalidCmsSessionIds($session_name)
83
+{
84
+    if (MODX_CLI) {
85 85
         return;
86 86
     }
87 87
     // session ids is invalid iff it is empty string
Please login to merge, or discard this patch.