@@ -2,4 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | use Exception; |
| 4 | 4 | |
| 5 | -class ContainerException extends Exception{} |
|
| 5 | +class ContainerException extends Exception |
|
| 6 | +{ |
|
| 7 | +} |
|
@@ -373,7 +373,8 @@ discard block |
||
| 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'; |
@@ -490,7 +491,7 @@ discard block |
||
| 490 | 491 | { |
| 491 | 492 | $out = false; |
| 492 | 493 | if ($ds instanceof mysqli_result) { |
| 493 | - switch($mode){ |
|
| 494 | + switch($mode) { |
|
| 494 | 495 | case 'assoc': |
| 495 | 496 | $out = $ds->fetch_assoc(); |
| 496 | 497 | break; |
@@ -1,3 +1,5 @@ |
||
| 1 | 1 | <?php namespace EvolutionCMS\Interfaces; |
| 2 | 2 | |
| 3 | -interface ManagerApiInterface{} |
|
| 3 | +interface ManagerApiInterface |
|
| 4 | +{ |
|
| 5 | +} |
|
@@ -1,3 +1,5 @@ |
||
| 1 | 1 | <?php namespace EvolutionCMS\Interfaces; |
| 2 | 2 | |
| 3 | -interface ServiceProviderInterface{} |
|
| 3 | +interface ServiceProviderInterface |
|
| 4 | +{ |
|
| 5 | +} |
|
@@ -1,3 +1,5 @@ |
||
| 1 | 1 | <?php namespace EvolutionCMS\Interfaces; |
| 2 | 2 | |
| 3 | -interface PasswordHashInterface{} |
|
| 3 | +interface PasswordHashInterface |
|
| 4 | +{ |
|
| 5 | +} |
|
@@ -11,7 +11,8 @@ discard block |
||
| 11 | 11 | # ----------------------------------------- |
| 12 | 12 | # |
| 13 | 13 | |
| 14 | -class DataGrid implements DataGridInterface{ |
|
| 14 | +class DataGrid implements DataGridInterface |
|
| 15 | +{ |
|
| 15 | 16 | |
| 16 | 17 | public $ds; // datasource |
| 17 | 18 | public $id; |
@@ -75,7 +76,8 @@ discard block |
||
| 75 | 76 | |
| 76 | 77 | public static $dataGridCnt; |
| 77 | 78 | |
| 78 | - public function __construct($id, $ds, $pageSize = 20, $pageNumber = -1) { |
|
| 79 | + public function __construct($id, $ds, $pageSize = 20, $pageNumber = -1) |
|
| 80 | + { |
|
| 79 | 81 | // set id |
| 80 | 82 | self::$dataGridCnt++; |
| 81 | 83 | $this->id = $this->id ? empty($id) : "dg" . self::$dataGridCnt; |
@@ -89,11 +91,13 @@ discard block |
||
| 89 | 91 | $this->pagerLocation = 'top-right'; |
| 90 | 92 | } |
| 91 | 93 | |
| 92 | - public function setDataSource($ds) { |
|
| 94 | + public function setDataSource($ds) |
|
| 95 | + { |
|
| 93 | 96 | $this->ds = $ds; |
| 94 | 97 | } |
| 95 | 98 | |
| 96 | - public function render() { |
|
| 99 | + public function render() |
|
| 100 | + { |
|
| 97 | 101 | $modx = evolutionCMS(); |
| 98 | 102 | $columnHeaderStyle = ($this->columnHeaderStyle) ? "style='" . $this->columnHeaderStyle . "'" : ''; |
| 99 | 103 | $columnHeaderClass = ($this->columnHeaderClass) ? "class='" . $this->columnHeaderClass . "'" : ""; |
@@ -128,7 +132,9 @@ discard block |
||
| 128 | 132 | |
| 129 | 133 | if($this->_isDataset && !$this->columns) { |
| 130 | 134 | $cols = $modx->getDatabase()->numFields($this->ds); |
| 131 | - for($i = 0; $i < $cols; $i++) $this->columns .= ($i ? "," : "") . $modx->getDatabase()->fieldName($this->ds, $i); |
|
| 135 | + for($i = 0; $i < $cols; $i++) { |
|
| 136 | + $this->columns .= ($i ? "," : "") . $modx->getDatabase()->fieldName($this->ds, $i); |
|
| 137 | + } |
|
| 132 | 138 | } |
| 133 | 139 | |
| 134 | 140 | // start grid |
@@ -207,7 +213,8 @@ discard block |
||
| 207 | 213 | |
| 208 | 214 | // format column values |
| 209 | 215 | |
| 210 | - public function RenderRowFnc($n, $row) { |
|
| 216 | + public function RenderRowFnc($n, $row) |
|
| 217 | + { |
|
| 211 | 218 | if($this->_alt == 0) { |
| 212 | 219 | $Style = $this->_itemStyle; |
| 213 | 220 | $Class = $this->_itemClass; |
@@ -237,7 +244,8 @@ discard block |
||
| 237 | 244 | return $o; |
| 238 | 245 | } |
| 239 | 246 | |
| 240 | - public function formatColumnValue($row, $value, $type, &$align) { |
|
| 247 | + public function formatColumnValue($row, $value, $type, &$align) |
|
| 248 | + { |
|
| 241 | 249 | if(strpos($type, ":") !== false) { |
| 242 | 250 | list($type, $type_format) = explode(":", $type, 2); |
| 243 | 251 | } |
@@ -2,7 +2,8 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | use EvolutionCMS\Interfaces\ContextMenuInterface; |
| 4 | 4 | |
| 5 | -class ContextMenu implements ContextMenuInterface{ |
|
| 5 | +class ContextMenu implements ContextMenuInterface |
|
| 6 | +{ |
|
| 6 | 7 | public $id; |
| 7 | 8 | /** |
| 8 | 9 | * @var string |
@@ -19,7 +20,8 @@ discard block |
||
| 19 | 20 | |
| 20 | 21 | public static $cnt; |
| 21 | 22 | |
| 22 | - public function __construct($id = '', $width = 120, $visible = false) { |
|
| 23 | + public function __construct($id = '', $width = 120, $visible = false) |
|
| 24 | + { |
|
| 23 | 25 | self::$cnt++; |
| 24 | 26 | $this->html = ""; |
| 25 | 27 | $this->visible = $visible ? $visible : false; |
@@ -27,7 +29,8 @@ discard block |
||
| 27 | 29 | $this->id = $id ? $id : "cntxMnu" . self::$cnt; // set id |
| 28 | 30 | } |
| 29 | 31 | |
| 30 | - public function addItem($text, $action = "", $img = "", $disabled = 0) { |
|
| 32 | + public function addItem($text, $action = "", $img = "", $disabled = 0) |
|
| 33 | + { |
|
| 31 | 34 | global $base_url, $_style; |
| 32 | 35 | if($disabled) { |
| 33 | 36 | return; |
@@ -52,13 +55,15 @@ discard block |
||
| 52 | 55 | $this->html .= $img . ' ' . $text . '</div>'; |
| 53 | 56 | } |
| 54 | 57 | |
| 55 | - public function addSeparator() { |
|
| 58 | + public function addSeparator() |
|
| 59 | + { |
|
| 56 | 60 | $this->html .= " |
| 57 | 61 | <div class='cntxMnuSeparator'></div> |
| 58 | 62 | "; |
| 59 | 63 | } |
| 60 | 64 | |
| 61 | - public function render() { |
|
| 65 | + public function render() |
|
| 66 | + { |
|
| 62 | 67 | $ContextMenuScript = <<<BLOCK |
| 63 | 68 | <script> |
| 64 | 69 | function getCntxMenu(id) { |
@@ -76,7 +81,8 @@ discard block |
||
| 76 | 81 | return $html; |
| 77 | 82 | } |
| 78 | 83 | |
| 79 | - public function getClientScriptObject() { |
|
| 84 | + public function getClientScriptObject() |
|
| 85 | + { |
|
| 80 | 86 | return "getCntxMenu('" . $this->id . "')"; |
| 81 | 87 | } |
| 82 | 88 | } |
@@ -11,7 +11,8 @@ discard block |
||
| 11 | 11 | # ----------------------------------------- |
| 12 | 12 | # |
| 13 | 13 | |
| 14 | -class DataSetPager implements DataSetPagerInterface{ |
|
| 14 | +class DataSetPager implements DataSetPagerInterface |
|
| 15 | +{ |
|
| 15 | 16 | |
| 16 | 17 | public $ds; // datasource |
| 17 | 18 | public $pageSize; |
@@ -33,7 +34,8 @@ discard block |
||
| 33 | 34 | public $renderPagerFncArgs; |
| 34 | 35 | public static $dataSetPagerCnt; |
| 35 | 36 | |
| 36 | - public function __construct($id, $ds, $pageSize = 10, $pageNumber = -1) { |
|
| 37 | + public function __construct($id, $ds, $pageSize = 10, $pageNumber = -1) |
|
| 38 | + { |
|
| 37 | 39 | global $_PAGE; // use view state object |
| 38 | 40 | |
| 39 | 41 | // set id |
@@ -61,35 +63,42 @@ discard block |
||
| 61 | 63 | $this->pager = ''; |
| 62 | 64 | } |
| 63 | 65 | |
| 64 | - public function getRenderedPager() { |
|
| 66 | + public function getRenderedPager() |
|
| 67 | + { |
|
| 65 | 68 | return $this->pager; |
| 66 | 69 | } |
| 67 | 70 | |
| 68 | - public function getRenderedRows() { |
|
| 71 | + public function getRenderedRows() |
|
| 72 | + { |
|
| 69 | 73 | return $this->rows; |
| 70 | 74 | } |
| 71 | 75 | |
| 72 | - public function setDataSource($ds) { |
|
| 76 | + public function setDataSource($ds) |
|
| 77 | + { |
|
| 73 | 78 | $this->ds = $ds; |
| 74 | 79 | } |
| 75 | 80 | |
| 76 | - public function setPageSize($ps) { |
|
| 81 | + public function setPageSize($ps) |
|
| 82 | + { |
|
| 77 | 83 | $this->pageSize = $ps; |
| 78 | 84 | } |
| 79 | 85 | |
| 80 | - public function setRenderRowFnc($fncName, $args = "") { |
|
| 86 | + public function setRenderRowFnc($fncName, $args = "") |
|
| 87 | + { |
|
| 81 | 88 | $this->renderRowFnc = &$fncName; |
| 82 | 89 | $this->renderRowFncArgs = $args; // extra agruments |
| 83 | 90 | |
| 84 | 91 | |
| 85 | 92 | } |
| 86 | 93 | |
| 87 | - public function setRenderPagerFnc($fncName, $args = "") { |
|
| 94 | + public function setRenderPagerFnc($fncName, $args = "") |
|
| 95 | + { |
|
| 88 | 96 | $this->renderPagerFnc = $fncName; |
| 89 | 97 | $this->renderPagerFncArgs = $args; // extra agruments |
| 90 | 98 | } |
| 91 | 99 | |
| 92 | - public function render() { |
|
| 100 | + public function render() |
|
| 101 | + { |
|
| 93 | 102 | $modx = evolutionCMS(); global $_PAGE; |
| 94 | 103 | |
| 95 | 104 | $isDataset = $modx->getDatabase()->isResult($this->ds); |
@@ -142,8 +151,10 @@ discard block |
||
| 142 | 151 | $url = $_SERVER['PHP_SELF'] . '?'; |
| 143 | 152 | } |
| 144 | 153 | $i = 0; |
| 145 | - foreach($_GET as $n => $v) if($n != 'dpgn' . $this->id) { |
|
| 154 | + foreach($_GET as $n => $v) { |
|
| 155 | + if($n != 'dpgn' . $this->id) { |
|
| 146 | 156 | $i++; |
| 157 | + } |
|
| 147 | 158 | $url .= (($i > 1) ? "&" : "") . "$n=$v"; |
| 148 | 159 | } |
| 149 | 160 | if($i >= 1) { |
@@ -1,8 +1,11 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | $userid = (int)$value; |
| 3 | 3 | if (!isset($modx->getModifiers()->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->getModifiers()->cache['ui'][$userid] = $user; |
| 7 | 10 | } else { |
| 8 | 11 | $user = $modx->getModifiers()->cache['ui'][$userid]; |