@@ -2059,7 +2059,8 @@ discard block |
||
2059 | 2059 | */ |
2060 | 2060 | public function addrFormat($addr) |
2061 | 2061 | { |
2062 | - if (empty($addr[1])) { // No name provided |
|
2062 | + if (empty($addr[1])) { |
|
2063 | +// No name provided |
|
2063 | 2064 | return $this->secureHeader($addr[0]); |
2064 | 2065 | } |
2065 | 2066 | |
@@ -3425,7 +3426,7 @@ discard block |
||
3425 | 3426 | { |
3426 | 3427 | $this->RecipientsQueue = array_filter( |
3427 | 3428 | $this->RecipientsQueue, |
3428 | - function ($params) use ($kind) { |
|
3429 | + function ($params) use ($kind){ |
|
3429 | 3430 | return $params[0] != $kind; |
3430 | 3431 | } |
3431 | 3432 | ); |
@@ -10,7 +10,8 @@ discard block |
||
10 | 10 | |
11 | 11 | $__DataSetPagerCnt = 0; |
12 | 12 | |
13 | -class DataSetPager { |
|
13 | +class DataSetPager |
|
14 | +{ |
|
14 | 15 | |
15 | 16 | var $ds; // datasource |
16 | 17 | var $pageSize; |
@@ -27,7 +28,8 @@ discard block |
||
27 | 28 | var $selPageStyle; |
28 | 29 | var $selPageClass; |
29 | 30 | |
30 | - function __construct($id, $ds, $pageSize = 10, $pageNumber = -1) { |
|
31 | + function __construct($id, $ds, $pageSize = 10, $pageNumber = -1) |
|
32 | + { |
|
31 | 33 | global $_PAGE; // use view state object |
32 | 34 | |
33 | 35 | global $__DataSetPagerCnt; |
@@ -57,35 +59,42 @@ discard block |
||
57 | 59 | $this->pager = ''; |
58 | 60 | } |
59 | 61 | |
60 | - function getRenderedPager() { |
|
62 | + function getRenderedPager() |
|
63 | + { |
|
61 | 64 | return $this->pager; |
62 | 65 | } |
63 | 66 | |
64 | - function getRenderedRows() { |
|
67 | + function getRenderedRows() |
|
68 | + { |
|
65 | 69 | return $this->rows; |
66 | 70 | } |
67 | 71 | |
68 | - function setDataSource($ds) { |
|
72 | + function setDataSource($ds) |
|
73 | + { |
|
69 | 74 | $this->ds = $ds; |
70 | 75 | } |
71 | 76 | |
72 | - function setPageSize($ps) { |
|
77 | + function setPageSize($ps) |
|
78 | + { |
|
73 | 79 | $this->pageSize = $ps; |
74 | 80 | } |
75 | 81 | |
76 | - function setRenderRowFnc($fncName, $args = "") { |
|
82 | + function setRenderRowFnc($fncName, $args = "") |
|
83 | + { |
|
77 | 84 | $this->renderRowFnc = &$fncName; |
78 | 85 | $this->renderRowFncArgs = $args; // extra agruments |
79 | 86 | |
80 | 87 | |
81 | 88 | } |
82 | 89 | |
83 | - function setRenderPagerFnc($fncName, $args = "") { |
|
90 | + function setRenderPagerFnc($fncName, $args = "") |
|
91 | + { |
|
84 | 92 | $this->renderPagerFnc = $fncName; |
85 | 93 | $this->renderPagerFncArgs = $args; // extra agruments |
86 | 94 | } |
87 | 95 | |
88 | - function render() { |
|
96 | + function render() |
|
97 | + { |
|
89 | 98 | global $modx, $_PAGE; |
90 | 99 | |
91 | 100 | $isDataset = $modx->db->isResult($this->ds); |
@@ -137,8 +146,10 @@ discard block |
||
137 | 146 | $url = $_SERVER['PHP_SELF'] . '?'; |
138 | 147 | } |
139 | 148 | $i = 0; |
140 | - foreach($_GET as $n => $v) if($n != 'dpgn' . $this->id) { |
|
149 | + foreach($_GET as $n => $v) { |
|
150 | + if($n != 'dpgn' . $this->id) { |
|
141 | 151 | $i++; |
152 | + } |
|
142 | 153 | $url .= (($i > 1) ? "&" : "") . "$n=$v"; |
143 | 154 | } |
144 | 155 | if($i >= 1) { |
@@ -1,6 +1,7 @@ discard block |
||
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 |
||
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 | } |
@@ -5,9 +5,9 @@ |
||
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 |
@@ -5,9 +5,9 @@ |
||
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 |
@@ -1,8 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | $userid = intval($value); |
3 | 3 | if (!isset($modx->filter->cache['ui'][$userid])) { |
4 | - if ($userid < 0) $user = $modx->getWebUserInfo(abs($userid)); |
|
5 | - else $user = $modx->getUserInfo($userid); |
|
4 | + if ($userid < 0) { |
|
5 | + $user = $modx->getWebUserInfo(abs($userid)); |
|
6 | + } else { |
|
7 | + $user = $modx->getUserInfo($userid); |
|
8 | + } |
|
6 | 9 | $modx->filter->cache['ui'][$userid] = $user; |
7 | 10 | } else { |
8 | 11 | $user = $modx->filter->cache['ui'][$userid]; |
@@ -1,16 +1,17 @@ |
||
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 |
@@ -9,14 +9,15 @@ |
||
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 | } |
@@ -1,9 +1,11 @@ discard block |
||
1 | 1 | <?php |
2 | -if(strpos($opt,',')) list($limit,$delim) = explode(',', $opt); |
|
3 | -elseif(preg_match('/^[1-9][0-9]*$/',$opt)) {$limit=$opt;$delim='';} |
|
4 | -else {$limit=124;$delim='';} |
|
2 | +if(strpos($opt,',')) { |
|
3 | + list($limit,$delim) = explode(',', $opt); |
|
4 | +} elseif(preg_match('/^[1-9][0-9]*$/',$opt)) {$limit=$opt;$delim='';} else {$limit=124;$delim='';} |
|
5 | 5 | |
6 | -if($delim==='') $delim = $modx->config['manager_language']==='japanese-utf8' ? '。' : '.'; |
|
6 | +if($delim==='') { |
|
7 | + $delim = $modx->config['manager_language']==='japanese-utf8' ? '。' : '.'; |
|
8 | +} |
|
7 | 9 | $limit = intval($limit); |
8 | 10 | |
9 | 11 | $content = $modx->filter->parseDocumentSource($value); |
@@ -11,8 +13,9 @@ discard block |
||
11 | 13 | $content = strip_tags($content); |
12 | 14 | |
13 | 15 | $content = str_replace(array("\r\n","\r","\n","\t",' '),' ',$content); |
14 | -if(preg_match('/\s+/',$content)) |
|
16 | +if(preg_match('/\s+/',$content)) { |
|
15 | 17 | $content = preg_replace('/\s+/',' ',$content); |
18 | +} |
|
16 | 19 | $content = trim($content); |
17 | 20 | |
18 | 21 | $pos = $modx->filter->strpos($content, $delim); |
@@ -21,23 +24,35 @@ discard block |
||
21 | 24 | $_ = explode($delim, $content); |
22 | 25 | $text = ''; |
23 | 26 | foreach($_ as $v) { |
24 | - if($limit <= $modx->filter->strlen($text.$v.$delim)) break; |
|
27 | + if($limit <= $modx->filter->strlen($text.$v.$delim)) { |
|
28 | + break; |
|
29 | + } |
|
25 | 30 | $text .= $v.$delim; |
26 | 31 | } |
27 | - if($text) $content = $text; |
|
28 | -} |
|
32 | + if($text) { |
|
33 | + $content = $text; |
|
34 | + } |
|
35 | + } |
|
29 | 36 | |
30 | 37 | if($limit<$modx->filter->strlen($content) && strpos($content,' ')!==false) { |
31 | 38 | $_ = explode(' ', $content); |
32 | 39 | $text = ''; |
33 | 40 | foreach($_ as $v) { |
34 | - if($limit <= $modx->filter->strlen($text.$v.' ')) break; |
|
41 | + if($limit <= $modx->filter->strlen($text.$v.' ')) { |
|
42 | + break; |
|
43 | + } |
|
35 | 44 | $text .= $v . ' '; |
36 | 45 | } |
37 | - if($text!=='') $content = $text; |
|
38 | -} |
|
46 | + if($text!=='') { |
|
47 | + $content = $text; |
|
48 | + } |
|
49 | + } |
|
39 | 50 | |
40 | -if($limit < $modx->filter->strlen($content)) $content = $modx->filter->substr($content, 0, $limit); |
|
41 | -if($modx->filter->substr($content,-1)==$delim) $content = rtrim($content,$delim) . $delim; |
|
51 | +if($limit < $modx->filter->strlen($content)) { |
|
52 | + $content = $modx->filter->substr($content, 0, $limit); |
|
53 | +} |
|
54 | +if($modx->filter->substr($content,-1)==$delim) { |
|
55 | + $content = rtrim($content,$delim) . $delim; |
|
56 | +} |
|
42 | 57 | |
43 | 58 | return $content; |