Completed
Pull Request — master (#247)
by
unknown
04:05
created
assets/snippets/DocLister/core/controller/site_content.php 1 patch
Braces   +99 added lines, -99 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('MODX_BASE_PATH')) {
2
+if (!defined('MODX_BASE_PATH')) {
3 3
     die('HACK???');
4 4
 }
5 5
 
@@ -11,8 +11,8 @@  discard block
 block discarded – undo
11 11
  * @license GNU General Public License (GPL), http://www.gnu.org/copyleft/gpl.html
12 12
  * @author Agel_Nash <[email protected]>, kabachello <[email protected]>
13 13
  */
14
-class site_contentDocLister extends DocLister
15
-{
14
+class site_contentDocLister extends DocLister
15
+{
16 16
     /**
17 17
      * Экземпляр экстендера TV
18 18
      *
@@ -32,8 +32,8 @@  discard block
 block discarded – undo
32 32
      * @param array $cfg
33 33
      * @param null $startTime
34 34
      */
35
-    public function __construct($modx, $cfg = array(), $startTime = null)
36
-    {
35
+    public function __construct($modx, $cfg = array(), $startTime = null)
36
+    {
37 37
         parent::__construct($modx, $cfg, $startTime);
38 38
         $this->extTV = $this->getExtender('tv', true, true);
39 39
     }
@@ -41,35 +41,35 @@  discard block
 block discarded – undo
41 41
     /**
42 42
      * @absctract
43 43
      */
44
-    public function getDocs($tvlist = '')
45
-    {
46
-        if ($tvlist == '') {
44
+    public function getDocs($tvlist = '')
45
+    {
46
+        if ($tvlist == '') {
47 47
             $tvlist = $this->getCFGDef('tvList', '');
48 48
         }
49 49
         
50 50
         $this->extTV->getAllTV_Name();
51 51
 
52
-        if ($this->extPaginate = $this->getExtender('paginate')) {
52
+        if ($this->extPaginate = $this->getExtender('paginate')) {
53 53
             $this->extPaginate->init($this);
54
-        } else {
54
+        } else {
55 55
             $this->config->setConfig(array('start' => 0));
56 56
         }
57 57
         $type = $this->getCFGDef('idType', 'parents');
58 58
         $this->_docs = ($type == 'parents') ? $this->getChildrenList() : $this->getDocList();
59
-        if ($tvlist != '' && count($this->_docs) > 0) {
59
+        if ($tvlist != '' && count($this->_docs) > 0) {
60 60
             $tv = $this->extTV->getTVList(array_keys($this->_docs), $tvlist);
61
-            if (!is_array($tv)) {
61
+            if (!is_array($tv)) {
62 62
                 $tv = array();
63 63
             }
64
-            foreach ($tv as $docID => $TVitem) {
65
-                if (isset($this->_docs[$docID]) && is_array($this->_docs[$docID])) {
64
+            foreach ($tv as $docID => $TVitem) {
65
+                if (isset($this->_docs[$docID]) && is_array($this->_docs[$docID])) {
66 66
                     $this->_docs[$docID] = array_merge($this->_docs[$docID], $TVitem);
67
-                } else {
67
+                } else {
68 68
                     unset($this->_docs[$docID]);
69 69
                 }
70 70
             }
71 71
         }
72
-        if (1 == $this->getCFGDef('tree', '0')) {
72
+        if (1 == $this->getCFGDef('tree', '0')) {
73 73
             $this->treeBuild('id', 'parent');
74 74
         }
75 75
 
@@ -80,24 +80,24 @@  discard block
 block discarded – undo
80 80
      * @param string $tpl
81 81
      * @return string
82 82
      */
83
-    public function _render($tpl = '')
84
-    {
83
+    public function _render($tpl = '')
84
+    {
85 85
         $out = '';
86
-        if ($tpl == '') {
86
+        if ($tpl == '') {
87 87
             $tpl = $this->getCFGDef('tpl', '@CODE:<a href="[+url+]">[+pagetitle+]</a><br />');
88 88
         }
89
-        if ($tpl != '') {
89
+        if ($tpl != '') {
90 90
             $date = $this->getCFGDef('dateSource', 'pub_date');
91 91
 
92 92
             $this->toPlaceholders(count($this->_docs), 1, "display"); // [+display+] - сколько показано на странице.
93 93
 
94 94
             $i = 1;
95 95
             $sysPlh = $this->renameKeyArr($this->_plh, $this->getCFGDef("sysKey", "dl"));
96
-            if (count($this->_docs) > 0) {
96
+            if (count($this->_docs) > 0) {
97 97
                 /**
98 98
                  * @var $extUser user_DL_Extender
99 99
                  */
100
-                if ($extUser = $this->getExtender('user')) {
100
+                if ($extUser = $this->getExtender('user')) {
101 101
                     $extUser->init($this, array('fields' => $this->getCFGDef("userFields", "")));
102 102
                 }
103 103
 
@@ -116,20 +116,20 @@  discard block
 block discarded – undo
116 116
                  */
117 117
                 $extJotCount = $this->getCFGdef('jotcount', 0) ? $this->getExtender('jotcount', true) : null;
118 118
 
119
-                if ($extJotCount) {
119
+                if ($extJotCount) {
120 120
                     $comments = $extJotCount->countComments(array_keys($this->_docs));
121 121
                 }
122 122
 
123 123
                 $this->skippedDocs = 0;
124
-                foreach ($this->_docs as $item) {
124
+                foreach ($this->_docs as $item) {
125 125
                     $this->renderTPL = $tpl;
126
-                    if ($extUser) {
126
+                    if ($extUser) {
127 127
                         $item = $extUser->setUserData($item); //[+user.id.createdby+], [+user.fullname.publishedby+], [+dl.user.publishedby+]....
128 128
                     }
129 129
 
130 130
                     $item['summary'] = $extSummary ? $this->getSummary($item, $extSummary, 'introtext', 'content') : '';
131 131
 
132
-                    if ($extJotCount) {
132
+                    if ($extJotCount) {
133 133
                         $item['jotcount'] = APIHelpers::getkey($comments, $item['id'], 0);
134 134
                     }
135 135
 
@@ -139,53 +139,53 @@  discard block
 block discarded – undo
139 139
 
140 140
                     $item['title'] = ($item['menutitle'] == '' ? $item['pagetitle'] : $item['menutitle']);
141 141
 
142
-                    if ($this->getCFGDef('makeUrl', 1)) {
143
-                        if ($item['type'] == 'reference') {
142
+                    if ($this->getCFGDef('makeUrl', 1)) {
143
+                        if ($item['type'] == 'reference') {
144 144
                             $item['url'] = is_numeric($item['content']) ? $this->modx->makeUrl($item['content'], '', '',
145 145
                                 $this->getCFGDef('urlScheme', '')) : $item['content'];
146
-                        } else {
146
+                        } else {
147 147
                             $item['url'] = $this->modx->makeUrl($item['id'], '', '', $this->getCFGDef('urlScheme', ''));
148 148
                         }
149 149
                     }
150 150
 
151 151
                     $item['date'] = (isset($item[$date]) && $date != 'createdon' && $item[$date] != 0 && $item[$date] == (int)$item[$date]) ? $item[$date] : $item['createdon'];
152 152
                     $item['date'] = $item['date'] + $this->modx->config['server_offset_time'];
153
-                    if ($this->getCFGDef('dateFormat', '%d.%b.%y %H:%M') != '') {
153
+                    if ($this->getCFGDef('dateFormat', '%d.%b.%y %H:%M') != '') {
154 154
                         $item['date'] = strftime($this->getCFGDef('dateFormat', '%d.%b.%y %H:%M'), $item['date']);
155 155
                     }
156 156
 
157 157
                     $findTpl = $this->renderTPL;
158 158
                     $tmp = $this->uniformPrepare($item, $i);
159 159
                     extract($tmp, EXTR_SKIP);
160
-                    if ($this->renderTPL == '') {
160
+                    if ($this->renderTPL == '') {
161 161
                         $this->renderTPL = $findTpl;
162 162
                     }
163 163
 
164
-                    if ($extPrepare) {
164
+                    if ($extPrepare) {
165 165
                         $item = $extPrepare->init($this, array(
166 166
                             'data'      => $item,
167 167
                             'nameParam' => 'prepare'
168 168
                         ));
169
-                        if (is_bool($item) && $item === false) {
169
+                        if (is_bool($item) && $item === false) {
170 170
                             $this->skippedDocs++;
171 171
                             continue;
172 172
                         }
173 173
                     }
174 174
                     $tmp = $this->parseChunk($this->renderTPL, $item);
175 175
 
176
-                    if ($this->getCFGDef('contentPlaceholder', 0) !== 0) {
176
+                    if ($this->getCFGDef('contentPlaceholder', 0) !== 0) {
177 177
                         $this->toPlaceholders($tmp, 1,
178 178
                             "item[" . $i . "]"); // [+item[x]+] – individual placeholder for each iteration documents on this page
179 179
                     }
180 180
                     $out .= $tmp;
181 181
                     $i++;
182 182
                 }
183
-            } else {
183
+            } else {
184 184
                 $noneTPL = $this->getCFGDef("noneTPL", "");
185 185
                 $out = ($noneTPL != '') ? $this->parseChunk($noneTPL, $sysPlh) : '';
186 186
             }
187 187
             $out = $this->renderWrap($out);
188
-        } else {
188
+        } else {
189 189
             $out = 'no template';
190 190
         }
191 191
 
@@ -198,8 +198,8 @@  discard block
 block discarded – undo
198 198
      * @param array $array
199 199
      * @return string
200 200
      */
201
-    public function getJSON($data, $fields, $array = array())
202
-    {
201
+    public function getJSON($data, $fields, $array = array())
202
+    {
203 203
         $out = array();
204 204
         $fields = is_array($fields) ? $fields : explode(",", $fields);
205 205
         $date = $this->getCFGDef('dateSource', 'pub_date');
@@ -219,38 +219,38 @@  discard block
 block discarded – undo
219 219
          */
220 220
         $extE = $this->getExtender('e', true, true);
221 221
 
222
-        foreach ($data as $num => $item) {
222
+        foreach ($data as $num => $item) {
223 223
             $row = $item;
224
-            if ((array('1') == $fields || in_array('summary', $fields)) && $extSummary) {
224
+            if ((array('1') == $fields || in_array('summary', $fields)) && $extSummary) {
225 225
                 $row['summary'] = $this->getSummary($this->_docs[$num], $extSummary, 'introtext', 'content');
226 226
             }
227
-            if (array('1') == $fields || in_array('date', $fields)) {
227
+            if (array('1') == $fields || in_array('date', $fields)) {
228 228
                 $tmp = (isset($this->_docs[$num][$date]) && $date != 'createdon' && $this->_docs[$num][$date] != 0 && $this->_docs[$num][$date] == (int)$this->_docs[$num][$date]) ? $this->_docs[$num][$date] : $this->_docs[$num]['createdon'];
229 229
                 $row['date'] = strftime($this->getCFGDef('dateFormat', '%d.%b.%y %H:%M'),
230 230
                     $tmp + $this->modx->config['server_offset_time']);
231 231
             }
232
-            if (array('1') == $fields || in_array('pagetitle', $fields)) {
232
+            if (array('1') == $fields || in_array('pagetitle', $fields)) {
233 233
                 $row['title'] = ($row['menutitle'] == '') ? $row['pagetitle'] : $row['menutitle'];
234 234
             }
235 235
             if ((bool)$this->getCFGDef('makeUrl', 1) && (array('1') == $fields || in_array(array('content', 'type'),
236 236
                         $fields))
237
-            ) {
238
-                if ($row['type'] == 'reference') {
237
+            ) {
238
+                if ($row['type'] == 'reference') {
239 239
                     $row['url'] = is_numeric($row['content']) ? $this->modx->makeUrl($row['content'], '', '',
240 240
                         $this->getCFGDef('urlScheme', '')) : $row['content'];
241
-                } else {
241
+                } else {
242 242
                     $row['url'] = $this->modx->makeUrl($row['id'], '', '', $this->getCFGDef('urlScheme', ''));
243 243
                 }
244 244
             }
245
-            if ($extE && $tmp = $extE->init($this, array('data' => $row))) {
246
-                if (is_array($tmp)) {
245
+            if ($extE && $tmp = $extE->init($this, array('data' => $row))) {
246
+                if (is_array($tmp)) {
247 247
                     $row = $tmp;
248 248
                 }
249 249
             }
250 250
 
251
-            if ($extPrepare) {
251
+            if ($extPrepare) {
252 252
                 $row = $extPrepare->init($this, array('data' => $row));
253
-                if (is_bool($row) && $row === false) {
253
+                if (is_bool($row) && $row === false) {
254 254
                     continue;
255 255
                 }
256 256
             }
@@ -263,31 +263,31 @@  discard block
 block discarded – undo
263 263
     /**
264 264
      * @abstract
265 265
      */
266
-    public function getChildrenCount()
267
-    {
266
+    public function getChildrenCount()
267
+    {
268 268
         $out = 0;
269 269
         $sanitarInIDs = $this->sanitarIn($this->IDs);
270
-        if ($sanitarInIDs != "''" || $this->getCFGDef('ignoreEmpty', '0')) {
270
+        if ($sanitarInIDs != "''" || $this->getCFGDef('ignoreEmpty', '0')) {
271 271
             $where = $this->getCFGDef('addWhereList', '');
272 272
             $where = sqlHelper::trimLogicalOp($where);
273 273
             $where = ($where ? $where . ' AND ' : '') . $this->_filters['where'];
274
-            if ($where != '' && $this->_filters['where'] != '') {
274
+            if ($where != '' && $this->_filters['where'] != '') {
275 275
                 $where .= " AND ";
276 276
             }
277 277
             $where = sqlHelper::trimLogicalOp($where);
278 278
 
279 279
             $where = "WHERE {$where}";
280 280
             $whereArr = array();
281
-            if (!$this->getCFGDef('showNoPublish', 0)) {
281
+            if (!$this->getCFGDef('showNoPublish', 0)) {
282 282
                 $whereArr[] = "c.deleted=0 AND c.published=1";
283 283
             }
284 284
 
285 285
             $tbl_site_content = $this->getTable('site_content', 'c');
286 286
 
287
-            if ($sanitarInIDs != "''") {
288
-                switch ($this->getCFGDef('idType', 'parents')) {
287
+            if ($sanitarInIDs != "''") {
288
+                switch ($this->getCFGDef('idType', 'parents')) {
289 289
                     case 'parents':
290
-                        switch ($this->getCFGDef('showParent', '0')) {
290
+                        switch ($this->getCFGDef('showParent', '0')) {
291 291
                             case '-1':
292 292
                                 $tmpWhere = "c.parent IN (" . $sanitarInIDs . ")";
293 293
                                 break;
@@ -299,10 +299,10 @@  discard block
 block discarded – undo
299 299
                                 $tmpWhere = "(c.parent IN ({$sanitarInIDs}) OR c.id IN({$sanitarInIDs}))";
300 300
                                 break;
301 301
                         }
302
-                        if (($addDocs = $this->getCFGDef('documents', '')) != '') {
302
+                        if (($addDocs = $this->getCFGDef('documents', '')) != '') {
303 303
                             $addDocs = $this->sanitarIn($this->cleanIDs($addDocs));
304 304
                             $whereArr[] = "((" . $tmpWhere . ") OR c.id IN({$addDocs}))";
305
-                        } else {
305
+                        } else {
306 306
                             $whereArr[] = $tmpWhere;
307 307
                         }
308 308
 
@@ -315,14 +315,14 @@  discard block
 block discarded – undo
315 315
             $from = $tbl_site_content . " " . $this->_filters['join'];
316 316
             $where = sqlHelper::trimLogicalOp($where);
317 317
 
318
-            if (trim($where) != 'WHERE') {
318
+            if (trim($where) != 'WHERE') {
319 319
                 $where .= " AND ";
320 320
             }
321 321
 
322 322
             $where .= implode(" AND ", $whereArr);
323 323
             $where = sqlHelper::trimLogicalOp($where);
324 324
 
325
-            if (trim($where) == 'WHERE') {
325
+            if (trim($where) == 'WHERE') {
326 326
                 $where = '';
327 327
             }
328 328
             $group = $this->getGroupSQL($this->getCFGDef('groupBy', 'c.id'));
@@ -339,11 +339,11 @@  discard block
 block discarded – undo
339 339
     /**
340 340
      * @return array
341 341
      */
342
-    protected function getDocList()
343
-    {
342
+    protected function getDocList()
343
+    {
344 344
         $out = array();
345 345
         $sanitarInIDs = $this->sanitarIn($this->IDs);
346
-        if ($sanitarInIDs != "''" || $this->getCFGDef('ignoreEmpty', '0')) {
346
+        if ($sanitarInIDs != "''" || $this->getCFGDef('ignoreEmpty', '0')) {
347 347
             $where = $this->getCFGDef('addWhereList', '');
348 348
             $where = sqlHelper::trimLogicalOp($where);
349 349
 
@@ -351,21 +351,21 @@  discard block
 block discarded – undo
351 351
             $where = sqlHelper::trimLogicalOp($where);
352 352
 
353 353
             $tbl_site_content = $this->getTable('site_content', 'c');
354
-            if ($sanitarInIDs != "''") {
354
+            if ($sanitarInIDs != "''") {
355 355
                 $where .= ($where ? " AND " : "") . "c.id IN ({$sanitarInIDs}) AND";
356 356
             }
357 357
             $where = sqlHelper::trimLogicalOp($where);
358 358
 
359
-            if ($this->getCFGDef('showNoPublish', 0)) {
360
-                if ($where != '') {
359
+            if ($this->getCFGDef('showNoPublish', 0)) {
360
+                if ($where != '') {
361 361
                     $where = "WHERE {$where}";
362
-                } else {
362
+                } else {
363 363
                     $where = '';
364 364
                 }
365
-            } else {
366
-                if ($where != '') {
365
+            } else {
366
+                if ($where != '') {
367 367
                     $where = "WHERE {$where} AND ";
368
-                } else {
368
+                } else {
369 369
                     $where = "WHERE {$where} ";
370 370
                 }
371 371
                 $where .= "c.deleted=0 AND c.published=1";
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
 
385 385
             $rows = $this->modx->db->makeArray($rs);
386 386
 
387
-            foreach ($rows as $item) {
387
+            foreach ($rows as $item) {
388 388
                 $out[$item['id']] = $item;
389 389
             }
390 390
         }
@@ -396,19 +396,19 @@  discard block
 block discarded – undo
396 396
      * @param string $id
397 397
      * @return array
398 398
      */
399
-    public function getChildrenFolder($id)
400
-    {
399
+    public function getChildrenFolder($id)
400
+    {
401 401
         $where = $this->getCFGDef('addWhereFolder', '');
402 402
         $where = sqlHelper::trimLogicalOp($where);
403
-        if ($where != '') {
403
+        if ($where != '') {
404 404
             $where .= " AND ";
405 405
         }
406 406
 
407 407
         $tbl_site_content = $this->getTable('site_content', 'c');
408 408
         $sanitarInIDs = $this->sanitarIn($id);
409
-        if ($this->getCFGDef('showNoPublish', 0)) {
409
+        if ($this->getCFGDef('showNoPublish', 0)) {
410 410
             $where = "WHERE {$where} c.parent IN ({$sanitarInIDs}) AND c.isfolder=1";
411
-        } else {
411
+        } else {
412 412
             $where = "WHERE {$where} c.parent IN ({$sanitarInIDs}) AND c.deleted=0 AND c.published=1 AND c.isfolder=1";
413 413
         }
414 414
 
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
 
417 417
         $rows = $this->modx->db->makeArray($rs);
418 418
         $out = array();
419
-        foreach ($rows as $item) {
419
+        foreach ($rows as $item) {
420 420
             $out[] = $item['id'];
421 421
         }
422 422
 
@@ -428,10 +428,10 @@  discard block
 block discarded – undo
428 428
      * @param $sort
429 429
      * @return array
430 430
      */
431
-    protected function injectSortByTV($table, $sort)
432
-    {
431
+    protected function injectSortByTV($table, $sort)
432
+    {
433 433
         $out = $this->getExtender('tv', true, true)->injectSortByTV($table, $sort);
434
-        if (!is_array($out) || empty($out)) {
434
+        if (!is_array($out) || empty($out)) {
435 435
             $out = array($table, $sort);
436 436
         }
437 437
 
@@ -441,19 +441,19 @@  discard block
 block discarded – undo
441 441
     /**
442 442
      * @return array
443 443
      */
444
-    protected function getChildrenList()
445
-    {
444
+    protected function getChildrenList()
445
+    {
446 446
         $where = array();
447 447
         $out = array();
448 448
 
449 449
         $tmpWhere = $this->getCFGDef('addWhereList', '');
450 450
         $tmpWhere = sqlHelper::trimLogicalOp($tmpWhere);
451
-        if (!empty($tmpWhere)) {
451
+        if (!empty($tmpWhere)) {
452 452
             $where[] = $tmpWhere;
453 453
         }
454 454
 
455 455
         $tmpWhere = sqlHelper::trimLogicalOp($this->_filters['where']);
456
-        if (!empty($tmpWhere)) {
456
+        if (!empty($tmpWhere)) {
457 457
             $where[] = $tmpWhere;
458 458
         }
459 459
 
@@ -464,8 +464,8 @@  discard block
 block discarded – undo
464 464
         $sanitarInIDs = $this->sanitarIn($this->IDs);
465 465
 
466 466
         $tmpWhere = null;
467
-        if ($sanitarInIDs != "''") {
468
-            switch ($this->getCFGDef('showParent', '0')) {
467
+        if ($sanitarInIDs != "''") {
468
+            switch ($this->getCFGDef('showParent', '0')) {
469 469
                 case '-1':
470 470
                     $tmpWhere = "c.parent IN (" . $sanitarInIDs . ")";
471 471
                     break;
@@ -478,29 +478,29 @@  discard block
 block discarded – undo
478 478
                     break;
479 479
             }
480 480
         }
481
-        if (($addDocs = $this->getCFGDef('documents', '')) != '') {
481
+        if (($addDocs = $this->getCFGDef('documents', '')) != '') {
482 482
             $addDocs = $this->sanitarIn($this->cleanIDs($addDocs));
483
-            if (empty($tmpWhere)) {
483
+            if (empty($tmpWhere)) {
484 484
                 $tmpWhere = "c.id IN({$addDocs})";
485
-            } else {
485
+            } else {
486 486
                 $tmpWhere = "((" . $tmpWhere . ") OR c.id IN({$addDocs}))";
487 487
             }
488 488
         }
489
-        if (!empty($tmpWhere)) {
489
+        if (!empty($tmpWhere)) {
490 490
             $where[] = $tmpWhere;
491 491
         }
492
-        if (!$this->getCFGDef('showNoPublish', 0)) {
492
+        if (!$this->getCFGDef('showNoPublish', 0)) {
493 493
             $where[] = "c.deleted=0 AND c.published=1";
494 494
         }
495
-        if (!empty($where)) {
495
+        if (!empty($where)) {
496 496
             $where = "WHERE " . implode(" AND ", $where);
497
-        } else {
497
+        } else {
498 498
             $where = '';
499 499
         }
500 500
         $fields = $this->getCFGDef('selectFields', 'c.*');
501 501
         $group = $this->getGroupSQL($this->getCFGDef('groupBy', 'c.id'));
502 502
 
503
-        if ($sanitarInIDs != "''" || $this->getCFGDef('ignoreEmpty', '0')) {
503
+        if ($sanitarInIDs != "''" || $this->getCFGDef('ignoreEmpty', '0')) {
504 504
             $sql = $this->dbQuery("SELECT {$fields} FROM " . $from . " " . $where . " " .
505 505
                 $group . " " .
506 506
                 $sort . " " .
@@ -509,7 +509,7 @@  discard block
 block discarded – undo
509 509
 
510 510
             $rows = $this->modx->db->makeArray($sql);
511 511
 
512
-            foreach ($rows as $item) {
512
+            foreach ($rows as $item) {
513 513
                 $out[$item['id']] = $item;
514 514
             }
515 515
         }
@@ -522,10 +522,10 @@  discard block
 block discarded – undo
522 522
      * @param string $type
523 523
      * @return string
524 524
      */
525
-    public function changeSortType($field, $type)
526
-    {
525
+    public function changeSortType($field, $type)
526
+    {
527 527
         $type = trim($type);
528
-        switch (strtoupper($type)) {
528
+        switch (strtoupper($type)) {
529 529
             case 'TVDATETIME':
530 530
                 $field = "STR_TO_DATE(" . $field . ",'%d-%m-%Y %H:%i:%s')";
531 531
                 break;
Please login to merge, or discard this patch.