Completed
Pull Request — develop (#534)
by Agel_Nash
05:08
created
manager/includes/tmplvars.inc.php 1 patch
Braces   +7 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 // DISPLAY FORM ELEMENTS
3
-function renderFormElement($field_type, $field_id, $default_text = '', $field_elements = '', $field_value = '', $field_style = '', $row = array(), $tvsArray = array()) {
3
+function renderFormElement($field_type, $field_id, $default_text = '', $field_elements = '', $field_value = '', $field_style = '', $row = array(), $tvsArray = array())
4
+{
4 5
 	global $modx;
5 6
 	global $_style;
6 7
 	global $_lang;
@@ -368,13 +369,16 @@  discard block
 block discarded – undo
368 369
 	return $field_html;
369 370
 } // end renderFormElement function
370 371
 
371
-function ParseIntputOptions($v) {
372
+function ParseIntputOptions($v)
373
+{
372 374
 	global $modx;
373 375
 	$a = array();
374 376
 	if(is_array($v)) {
375 377
 		return $v;
376 378
 	} else if($modx->db->isResult($v)) {
377
-		while($cols = $modx->db->getRow($v, 'num')) $a[] = $cols;
379
+		while($cols = $modx->db->getRow($v, 'num')) {
380
+		    $a[] = $cols;
381
+		}
378 382
 	} else {
379 383
 		$a = explode("||", $v);
380 384
 	}
Please login to merge, or discard this patch.
manager/includes/extenders/ex_maketable.inc.php 1 patch
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,9 +5,9 @@
 block discarded – undo
5 5
  * Time: 14:38
6 6
  */
7 7
 
8
-if (!include_once MODX_MANAGER_PATH . 'includes/extenders/maketable.class.php'){
8
+if (!include_once MODX_MANAGER_PATH . 'includes/extenders/maketable.class.php') {
9 9
     return false;
10
-}else{
10
+} else {
11 11
     $this->table= new MakeTable;
12 12
     return true;
13 13
 }
14 14
\ No newline at end of file
Please login to merge, or discard this patch.
manager/includes/extenders/ex_managerapi.inc.php 1 patch
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,9 +5,9 @@
 block discarded – undo
5 5
  * Time: 14:16
6 6
  */
7 7
 
8
-if (!include_once MODX_MANAGER_PATH . 'includes/extenders/manager.api.class.inc.php'){
8
+if (!include_once MODX_MANAGER_PATH . 'includes/extenders/manager.api.class.inc.php') {
9 9
     return false;
10
-}else{
10
+} else {
11 11
     $this->manager= new ManagerAPI;
12 12
     return true;
13 13
 }
14 14
\ No newline at end of file
Please login to merge, or discard this patch.
manager/includes/extenders/modifiers/mdf_getimage.inc.php 1 patch
Braces   +11 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,16 +1,17 @@
 block discarded – undo
1 1
 <?php
2 2
 $pattern = '/<img[\s\n]+.*src=[\s\n]*"([^"]+\.(jpg|jpeg|png|gif))"[^>]+>/i';
3 3
 preg_match_all($pattern , $value , $images);
4
-if($opt==='')
5
-{
6
-    if($images[1][0])  return $images[1][0];
7
-    else               return '';
8
-}
9
-else
10
-{
11
-    foreach($images[0] as $i=>$image)
12
-    {
13
-        if(strpos($image,$opt)!==false) return $images[1][$i];
4
+if($opt==='') {
5
+    if($images[1][0]) {
6
+        return $images[1][0];
7
+    } else {
8
+        return '';
9
+    }
10
+    } else {
11
+    foreach($images[0] as $i=>$image) {
12
+        if(strpos($image,$opt)!==false) {
13
+            return $images[1][$i];
14
+        }
14 15
     }
15 16
 }
16 17
 
Please login to merge, or discard this patch.
manager/includes/extenders/modifiers/mdf_addbreak.inc.php 1 patch
Braces   +8 added lines, -7 removed lines patch added patch discarded remove patch
@@ -9,14 +9,15 @@
 block discarded – undo
9 9
 $blockElms = explode(',', $blockElms);
10 10
 $lines = explode("\n",$text);
11 11
 $c = count($lines);
12
-foreach($lines as $i=>$line)
13
-{
12
+foreach($lines as $i=>$line) {
14 13
     $line = rtrim($line);
15
-    if($i===$c-1) break;
16
-    foreach($blockElms as $block)
17
-    {
18
-        if(preg_match("@</?{$block}" . '[^>]*>$@',$line))
19
-            continue 2;
14
+    if($i===$c-1) {
15
+        break;
16
+    }
17
+    foreach($blockElms as $block) {
18
+        if(preg_match("@</?{$block}" . '[^>]*>$@',$line)) {
19
+                    continue 2;
20
+        }
20 21
     }
21 22
     $lines[$i] = "{$line}<br />";
22 23
 }
Please login to merge, or discard this patch.
manager/includes/extenders/modifiers/mdf_memberof.inc.php 1 patch
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -5,11 +5,14 @@  discard block
 block discarded – undo
5 5
 $groupNames = ($this->strlen($opt) > 0 ) ? explode(',',$opt) : array();
6 6
 
7 7
 // if $groupNames is not an array return false
8
-if(!is_array($groupNames)) return 0;
8
+if(!is_array($groupNames)) {
9
+    return 0;
10
+}
9 11
 
10 12
 // Creates an array with all webgroups the user id is in
11
-if (isset($modx->filter->cache['mo'][$userID])) $grpNames = $modx->filter->cache['mo'][$userID];
12
-else {
13
+if (isset($modx->filter->cache['mo'][$userID])) {
14
+    $grpNames = $modx->filter->cache['mo'][$userID];
15
+} else {
13 16
     $from = sprintf("[+prefix+]webgroup_names wgn INNER JOIN [+prefix+]web_groups wg ON wg.webgroup=wgn.id AND wg.webuser='%s'",$userID);
14 17
     $rs = $modx->db->select('wgn.name',$from);
15 18
     $modx->filter->cache['mo'][$userID] = $grpNames = $modx->db->getColumn('name',$rs);
@@ -17,8 +20,10 @@  discard block
 block discarded – undo
17 20
 
18 21
 // Check if a supplied group matches a webgroup from the array we just created
19 22
 foreach($groupNames as $k=>$v) {
20
-    if(in_array(trim($v),$grpNames)) return 1;
21
-}
23
+    if(in_array(trim($v),$grpNames)) {
24
+        return 1;
25
+    }
26
+    }
22 27
 
23 28
 // If we get here the above logic did not find a match, so return false
24 29
 return 0;
Please login to merge, or discard this patch.
manager/includes/extenders/ex_phpcompat.inc.php 1 patch
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,13 +5,13 @@
 block discarded – undo
5 5
  * Time: 12:25
6 6
  */
7 7
 
8
-if (isset($this->phpcompat) && is_object($this->phpcompat)){
8
+if (isset($this->phpcompat) && is_object($this->phpcompat)) {
9 9
     return true;
10 10
 }
11 11
 
12
-if (!include_once(MODX_MANAGER_PATH . 'includes/extenders/phpcompat.class.inc.php')){
12
+if (!include_once(MODX_MANAGER_PATH . 'includes/extenders/phpcompat.class.inc.php')) {
13 13
     return false;
14
-}else{
14
+} else {
15 15
     $this->phpcompat = new PHPCOMPAT;
16 16
     return true;
17 17
 }
Please login to merge, or discard this patch.
manager/includes/extenders/ex_phpass.inc.php 1 patch
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,13 +5,13 @@
 block discarded – undo
5 5
  * Time: 19:14
6 6
  */
7 7
 
8
-if (isset($this->phpass) && is_object($this->phpass)){
8
+if (isset($this->phpass) && is_object($this->phpass)) {
9 9
     return true;
10 10
 }
11 11
 
12
-if (!include_once(MODX_MANAGER_PATH . 'includes/extenders/phpass.class.inc.php')){
12
+if (!include_once(MODX_MANAGER_PATH . 'includes/extenders/phpass.class.inc.php')) {
13 13
     return false;
14
-}else{
14
+} else {
15 15
     $this->phpass = new PasswordHash;
16 16
     return true;
17 17
 }
18 18
\ No newline at end of file
Please login to merge, or discard this patch.
manager/includes/extenders/ex_export_site.inc.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,8 +5,7 @@
 block discarded – undo
5 5
  * Time: 14:24
6 6
  */
7 7
 
8
-if(include_once(MODX_MANAGER_PATH . 'includes/extenders/export.class.inc.php'))
9
-{
8
+if(include_once(MODX_MANAGER_PATH . 'includes/extenders/export.class.inc.php')) {
10 9
     $this->export = new EXPORT_SITE;
11 10
     return true;
12 11
 } else {
Please login to merge, or discard this patch.