@@ -10,7 +10,7 @@ |
||
| 10 | 10 | * @param int $flags |
| 11 | 11 | * @param string $encode |
| 12 | 12 | * @param int $safecount |
| 13 | - * @return string|array |
|
| 13 | + * @return null|string |
|
| 14 | 14 | */ |
| 15 | 15 | public function htmlspecialchars($str = '', $flags = ENT_COMPAT, $encode = '', $safecount = 0) |
| 16 | 16 | { |
@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <?php namespace EvolutionCMS; |
| 2 | 2 | |
| 3 | -use PHPMailer\PHPMailer\PHPMailer; |
|
| 4 | 3 | use PHPMailer\PHPMailer\Exception as PHPMailerException; |
| 4 | +use PHPMailer\PHPMailer\PHPMailer; |
|
| 5 | 5 | |
| 6 | 6 | class Mail extends PHPMailer |
| 7 | 7 | { |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | { |
| 30 | 30 | $modx = evolutionCMS(); |
| 31 | 31 | $this->modx = $modx; |
| 32 | - $this->PluginDir = MODX_MANAGER_PATH . 'includes/controls/phpmailer/'; |
|
| 32 | + $this->PluginDir = MODX_MANAGER_PATH.'includes/controls/phpmailer/'; |
|
| 33 | 33 | |
| 34 | 34 | switch ($modx->config['email_method']) { |
| 35 | 35 | case 'smtp': |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | mb_language($this->mb_language); |
| 96 | 96 | mb_internal_encoding($modx->config['modx_charset']); |
| 97 | 97 | } |
| 98 | - $exconf = MODX_MANAGER_PATH . 'includes/controls/phpmailer/config.inc.php'; |
|
| 98 | + $exconf = MODX_MANAGER_PATH.'includes/controls/phpmailer/config.inc.php'; |
|
| 99 | 99 | if (is_file($exconf)) { |
| 100 | 100 | include($exconf); |
| 101 | 101 | } |
@@ -163,12 +163,12 @@ discard block |
||
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | if ($this->modx->debug) { |
| 166 | - $debug_info = 'CharSet = ' . $this->CharSet . "\n"; |
|
| 167 | - $debug_info .= 'Encoding = ' . $this->Encoding . "\n"; |
|
| 168 | - $debug_info .= 'mb_language = ' . $this->mb_language . "\n"; |
|
| 169 | - $debug_info .= 'encode_header_method = ' . $this->encode_header_method . "\n"; |
|
| 166 | + $debug_info = 'CharSet = '.$this->CharSet."\n"; |
|
| 167 | + $debug_info .= 'Encoding = '.$this->Encoding."\n"; |
|
| 168 | + $debug_info .= 'mb_language = '.$this->mb_language."\n"; |
|
| 169 | + $debug_info .= 'encode_header_method = '.$this->encode_header_method."\n"; |
|
| 170 | 170 | $debug_info .= "send_mode = {$mode}\n"; |
| 171 | - $debug_info .= 'Subject = ' . $this->Subject . "\n"; |
|
| 171 | + $debug_info .= 'Subject = '.$this->Subject."\n"; |
|
| 172 | 172 | $log = "<pre>{$debug_info}\n{$header}\n{$org_body}</pre>"; |
| 173 | 173 | $this->modx->logEvent(1, 1, $log, 'MODxMailer debug information'); |
| 174 | 174 | |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | ini_set('sendmail_from', $old_from); |
| 235 | 235 | } |
| 236 | 236 | if (!$rt) { |
| 237 | - $msg = $this->Lang('instantiate') . "<br />\n"; |
|
| 237 | + $msg = $this->Lang('instantiate')."<br />\n"; |
|
| 238 | 238 | $msg .= "{$this->Subject}<br />\n"; |
| 239 | 239 | $msg .= "{$this->FromName}<{$this->From}><br />\n"; |
| 240 | 240 | $msg .= mb_convert_encoding($body, $this->modx->config['modx_charset'], $this->CharSet); |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | $classDump = call_user_func('get_object_vars', $this); |
| 257 | 257 | unset($classDump['modx']); |
| 258 | 258 | $this->modx->config['send_errormail'] = '0'; |
| 259 | - $this->modx->logEvent(0, 3, $msg . '<pre>' . print_r($classDump, true) . '</pre>', 'phpmailer'); |
|
| 259 | + $this->modx->logEvent(0, 3, $msg.'<pre>'.print_r($classDump, true).'</pre>', 'phpmailer'); |
|
| 260 | 260 | |
| 261 | 261 | return parent::SetError($msg); |
| 262 | 262 | } |
@@ -33,6 +33,9 @@ discard block |
||
| 33 | 33 | public $renderPagerFncArgs; |
| 34 | 34 | public static $dataSetPagerCnt; |
| 35 | 35 | |
| 36 | + /** |
|
| 37 | + * @param boolean|string $id |
|
| 38 | + */ |
|
| 36 | 39 | public function __construct($id, $ds, $pageSize = 10, $pageNumber = -1) { |
| 37 | 40 | global $_PAGE; // use view state object |
| 38 | 41 | |
@@ -77,6 +80,9 @@ discard block |
||
| 77 | 80 | $this->pageSize = $ps; |
| 78 | 81 | } |
| 79 | 82 | |
| 83 | + /** |
|
| 84 | + * @param DataGrid $fncName |
|
| 85 | + */ |
|
| 80 | 86 | public function setRenderRowFnc($fncName, $args = "") { |
| 81 | 87 | $this->renderRowFnc = &$fncName; |
| 82 | 88 | $this->renderRowFncArgs = $args; // extra agruments |
@@ -13,18 +13,18 @@ discard block |
||
| 13 | 13 | |
| 14 | 14 | class DataSetPager implements DataSetPagerInterface{ |
| 15 | 15 | |
| 16 | - public $ds; // datasource |
|
| 16 | + public $ds; // datasource |
|
| 17 | 17 | public $pageSize; |
| 18 | 18 | public $pageNumber; |
| 19 | 19 | public $rows; |
| 20 | 20 | public $pager; |
| 21 | 21 | public $id; |
| 22 | 22 | |
| 23 | - // normal page |
|
| 23 | + // normal page |
|
| 24 | 24 | public $pageStyle; |
| 25 | 25 | public $pageClass; |
| 26 | 26 | |
| 27 | - // selected page |
|
| 27 | + // selected page |
|
| 28 | 28 | public $selPageStyle; |
| 29 | 29 | public $selPageClass; |
| 30 | 30 | public $renderRowFnc; |
@@ -34,164 +34,164 @@ discard block |
||
| 34 | 34 | public static $dataSetPagerCnt; |
| 35 | 35 | |
| 36 | 36 | public function __construct($id, $ds, $pageSize = 10, $pageNumber = -1) { |
| 37 | - global $_PAGE; // use view state object |
|
| 38 | - |
|
| 39 | - // set id |
|
| 40 | - self::$dataSetPagerCnt++; |
|
| 41 | - $this->id = !empty($id) ? $id : "dsp" . self::$dataSetPagerCnt; |
|
| 42 | - |
|
| 43 | - // get pagenumber |
|
| 44 | - // by setting pager to -1 cause pager to load it's last page number |
|
| 45 | - if($pageNumber == -1) { |
|
| 46 | - $pageNumber = 1; |
|
| 47 | - if(isset($_GET["dpgn" . $this->id])) { |
|
| 48 | - $pageNumber = $_GET["dpgn" . $this->id]; |
|
| 49 | - } elseif(isset($_PAGE['vs'][$id . '_dpgn'])) { |
|
| 50 | - $pageNumber = $_PAGE['vs'][$id . '_dpgn']; |
|
| 51 | - } |
|
| 52 | - } |
|
| 53 | - if(!is_numeric($pageNumber)) { |
|
| 54 | - $pageNumber = 1; |
|
| 55 | - } |
|
| 56 | - |
|
| 57 | - $this->ds = $ds; // datasource |
|
| 58 | - $this->pageSize = $pageSize; |
|
| 59 | - $this->pageNumber = $pageNumber; |
|
| 60 | - $this->rows = ''; |
|
| 61 | - $this->pager = ''; |
|
| 62 | - } |
|
| 37 | + global $_PAGE; // use view state object |
|
| 38 | + |
|
| 39 | + // set id |
|
| 40 | + self::$dataSetPagerCnt++; |
|
| 41 | + $this->id = !empty($id) ? $id : "dsp" . self::$dataSetPagerCnt; |
|
| 42 | + |
|
| 43 | + // get pagenumber |
|
| 44 | + // by setting pager to -1 cause pager to load it's last page number |
|
| 45 | + if($pageNumber == -1) { |
|
| 46 | + $pageNumber = 1; |
|
| 47 | + if(isset($_GET["dpgn" . $this->id])) { |
|
| 48 | + $pageNumber = $_GET["dpgn" . $this->id]; |
|
| 49 | + } elseif(isset($_PAGE['vs'][$id . '_dpgn'])) { |
|
| 50 | + $pageNumber = $_PAGE['vs'][$id . '_dpgn']; |
|
| 51 | + } |
|
| 52 | + } |
|
| 53 | + if(!is_numeric($pageNumber)) { |
|
| 54 | + $pageNumber = 1; |
|
| 55 | + } |
|
| 56 | + |
|
| 57 | + $this->ds = $ds; // datasource |
|
| 58 | + $this->pageSize = $pageSize; |
|
| 59 | + $this->pageNumber = $pageNumber; |
|
| 60 | + $this->rows = ''; |
|
| 61 | + $this->pager = ''; |
|
| 62 | + } |
|
| 63 | 63 | |
| 64 | 64 | public function getRenderedPager() { |
| 65 | - return $this->pager; |
|
| 66 | - } |
|
| 65 | + return $this->pager; |
|
| 66 | + } |
|
| 67 | 67 | |
| 68 | 68 | public function getRenderedRows() { |
| 69 | - return $this->rows; |
|
| 70 | - } |
|
| 69 | + return $this->rows; |
|
| 70 | + } |
|
| 71 | 71 | |
| 72 | 72 | public function setDataSource($ds) { |
| 73 | - $this->ds = $ds; |
|
| 74 | - } |
|
| 73 | + $this->ds = $ds; |
|
| 74 | + } |
|
| 75 | 75 | |
| 76 | 76 | public function setPageSize($ps) { |
| 77 | - $this->pageSize = $ps; |
|
| 78 | - } |
|
| 77 | + $this->pageSize = $ps; |
|
| 78 | + } |
|
| 79 | 79 | |
| 80 | 80 | public function setRenderRowFnc($fncName, $args = "") { |
| 81 | - $this->renderRowFnc = &$fncName; |
|
| 82 | - $this->renderRowFncArgs = $args; // extra agruments |
|
| 81 | + $this->renderRowFnc = &$fncName; |
|
| 82 | + $this->renderRowFncArgs = $args; // extra agruments |
|
| 83 | 83 | |
| 84 | 84 | |
| 85 | - } |
|
| 85 | + } |
|
| 86 | 86 | |
| 87 | 87 | public function setRenderPagerFnc($fncName, $args = "") { |
| 88 | - $this->renderPagerFnc = $fncName; |
|
| 89 | - $this->renderPagerFncArgs = $args; // extra agruments |
|
| 90 | - } |
|
| 88 | + $this->renderPagerFnc = $fncName; |
|
| 89 | + $this->renderPagerFncArgs = $args; // extra agruments |
|
| 90 | + } |
|
| 91 | 91 | |
| 92 | 92 | public function render() { |
| 93 | - $modx = evolutionCMS(); global $_PAGE; |
|
| 94 | - |
|
| 95 | - $isDataset = $modx->getDatabase()->isResult($this->ds); |
|
| 96 | - |
|
| 97 | - if(!$this->selPageStyle) { |
|
| 98 | - $this->selPageStyle = "font-weight:bold"; |
|
| 99 | - } |
|
| 100 | - |
|
| 101 | - // get total number of rows |
|
| 102 | - $tnr = ($isDataset) ? $modx->getDatabase()->getRecordCount($this->ds) : count($this->ds); |
|
| 103 | - |
|
| 104 | - // render: no records found |
|
| 105 | - if($tnr <= 0) { |
|
| 106 | - $fnc = $this->renderRowFnc; |
|
| 107 | - $args = $this->renderRowFncArgs; |
|
| 108 | - if(isset($fnc)) { |
|
| 109 | - if($args != "") { |
|
| 110 | - $this->rows .= $fnc(0, null, $args); |
|
| 111 | - } // if agrs was specified then we will pass three params |
|
| 112 | - else { |
|
| 113 | - $this->rows .= $fnc(0, null); |
|
| 114 | - } // otherwise two will be passed |
|
| 115 | - } |
|
| 116 | - return; |
|
| 117 | - } |
|
| 118 | - |
|
| 119 | - // get total pages |
|
| 120 | - $tp = ceil($tnr / $this->pageSize); |
|
| 121 | - if($this->pageNumber > $tp) { |
|
| 122 | - $this->pageNumber = 1; |
|
| 123 | - } |
|
| 124 | - |
|
| 125 | - // get page number |
|
| 126 | - $p = $this->pageNumber; |
|
| 127 | - |
|
| 128 | - // save page number to view state if available |
|
| 129 | - if(isset($_PAGE['vs'])) { |
|
| 130 | - $_PAGE['vs'][$this->id . '_dpgn'] = $p; |
|
| 131 | - } |
|
| 132 | - |
|
| 133 | - // render pager : renderPagerFnc($cuurentPage,$pagerNumber,$arguments=""); |
|
| 134 | - if($tp > 1) { |
|
| 135 | - $url = ''; |
|
| 136 | - $fnc = $this->renderPagerFnc; |
|
| 137 | - $args = $this->renderPagerFncArgs; |
|
| 138 | - if(!isset($fnc)) { |
|
| 139 | - if($modx->isFrontend()) { |
|
| 140 | - $url = $modx->makeUrl($modx->documentIdentifier, '', '', 'full') . '?'; |
|
| 141 | - } else { |
|
| 142 | - $url = $_SERVER['PHP_SELF'] . '?'; |
|
| 143 | - } |
|
| 144 | - $i = 0; |
|
| 145 | - foreach($_GET as $n => $v) if($n != 'dpgn' . $this->id) { |
|
| 146 | - $i++; |
|
| 147 | - $url .= (($i > 1) ? "&" : "") . "$n=$v"; |
|
| 148 | - } |
|
| 149 | - if($i >= 1) { |
|
| 150 | - $url .= "&"; |
|
| 151 | - } |
|
| 152 | - } |
|
| 153 | - for($i = 1; $i <= $tp; $i++) { |
|
| 154 | - if(isset($fnc)) { |
|
| 155 | - if($args != "") { |
|
| 156 | - $this->pager .= $fnc($p, $i, $args); |
|
| 157 | - } else { |
|
| 158 | - $this->pager .= $fnc($p, $i); |
|
| 159 | - } |
|
| 160 | - } else { |
|
| 161 | - $this->pager .= ($p == $i) ? " <span class='" . $this->selPageClass . "' style='" . $this->selPageStyle . "'>$i</span> " : " <a href='" . $url . "dpgn" . $this->id . "=$i' class='" . $this->pageClass . "' style='" . $this->pageStyle . "'>$i</a> "; |
|
| 162 | - } |
|
| 163 | - } |
|
| 164 | - } |
|
| 165 | - |
|
| 166 | - // render row : renderRowFnc($rowNumber,$row,$arguments="") |
|
| 167 | - $fnc = $this->renderRowFnc; |
|
| 168 | - $args = $this->renderRowFncArgs; |
|
| 169 | - |
|
| 170 | - if(isset($fnc)) { |
|
| 171 | - $i = 1; |
|
| 172 | - $fncObject = is_object($fnc); |
|
| 173 | - $minitems = (($p - 1) * $this->pageSize) + 1; |
|
| 174 | - $maxitems = (($p - 1) * $this->pageSize) + $this->pageSize; |
|
| 175 | - while($i <= $maxitems && ($row = ($isDataset) ? $modx->getDatabase()->getRow($this->ds) : $this->ds[$i - 1])) { |
|
| 176 | - if($i >= $minitems && $i <= $maxitems) { |
|
| 177 | - if($fncObject) { |
|
| 178 | - if($args != "") { |
|
| 179 | - $this->rows .= $fnc->RenderRowFnc($i, $row, $args); |
|
| 180 | - } else { |
|
| 181 | - $this->rows .= $fnc->RenderRowFnc($i, $row); |
|
| 182 | - } |
|
| 183 | - } else { |
|
| 184 | - if($args != "") { |
|
| 185 | - $this->rows .= $fnc($i, $row, $args); |
|
| 186 | - } // if agrs was specified then we wil pass three params |
|
| 187 | - else { |
|
| 188 | - $this->rows .= $fnc($i, $row); |
|
| 189 | - } // otherwise two will be passed |
|
| 190 | - } |
|
| 191 | - |
|
| 192 | - } |
|
| 193 | - $i++; |
|
| 194 | - } |
|
| 195 | - } |
|
| 196 | - } |
|
| 93 | + $modx = evolutionCMS(); global $_PAGE; |
|
| 94 | + |
|
| 95 | + $isDataset = $modx->getDatabase()->isResult($this->ds); |
|
| 96 | + |
|
| 97 | + if(!$this->selPageStyle) { |
|
| 98 | + $this->selPageStyle = "font-weight:bold"; |
|
| 99 | + } |
|
| 100 | + |
|
| 101 | + // get total number of rows |
|
| 102 | + $tnr = ($isDataset) ? $modx->getDatabase()->getRecordCount($this->ds) : count($this->ds); |
|
| 103 | + |
|
| 104 | + // render: no records found |
|
| 105 | + if($tnr <= 0) { |
|
| 106 | + $fnc = $this->renderRowFnc; |
|
| 107 | + $args = $this->renderRowFncArgs; |
|
| 108 | + if(isset($fnc)) { |
|
| 109 | + if($args != "") { |
|
| 110 | + $this->rows .= $fnc(0, null, $args); |
|
| 111 | + } // if agrs was specified then we will pass three params |
|
| 112 | + else { |
|
| 113 | + $this->rows .= $fnc(0, null); |
|
| 114 | + } // otherwise two will be passed |
|
| 115 | + } |
|
| 116 | + return; |
|
| 117 | + } |
|
| 118 | + |
|
| 119 | + // get total pages |
|
| 120 | + $tp = ceil($tnr / $this->pageSize); |
|
| 121 | + if($this->pageNumber > $tp) { |
|
| 122 | + $this->pageNumber = 1; |
|
| 123 | + } |
|
| 124 | + |
|
| 125 | + // get page number |
|
| 126 | + $p = $this->pageNumber; |
|
| 127 | + |
|
| 128 | + // save page number to view state if available |
|
| 129 | + if(isset($_PAGE['vs'])) { |
|
| 130 | + $_PAGE['vs'][$this->id . '_dpgn'] = $p; |
|
| 131 | + } |
|
| 132 | + |
|
| 133 | + // render pager : renderPagerFnc($cuurentPage,$pagerNumber,$arguments=""); |
|
| 134 | + if($tp > 1) { |
|
| 135 | + $url = ''; |
|
| 136 | + $fnc = $this->renderPagerFnc; |
|
| 137 | + $args = $this->renderPagerFncArgs; |
|
| 138 | + if(!isset($fnc)) { |
|
| 139 | + if($modx->isFrontend()) { |
|
| 140 | + $url = $modx->makeUrl($modx->documentIdentifier, '', '', 'full') . '?'; |
|
| 141 | + } else { |
|
| 142 | + $url = $_SERVER['PHP_SELF'] . '?'; |
|
| 143 | + } |
|
| 144 | + $i = 0; |
|
| 145 | + foreach($_GET as $n => $v) if($n != 'dpgn' . $this->id) { |
|
| 146 | + $i++; |
|
| 147 | + $url .= (($i > 1) ? "&" : "") . "$n=$v"; |
|
| 148 | + } |
|
| 149 | + if($i >= 1) { |
|
| 150 | + $url .= "&"; |
|
| 151 | + } |
|
| 152 | + } |
|
| 153 | + for($i = 1; $i <= $tp; $i++) { |
|
| 154 | + if(isset($fnc)) { |
|
| 155 | + if($args != "") { |
|
| 156 | + $this->pager .= $fnc($p, $i, $args); |
|
| 157 | + } else { |
|
| 158 | + $this->pager .= $fnc($p, $i); |
|
| 159 | + } |
|
| 160 | + } else { |
|
| 161 | + $this->pager .= ($p == $i) ? " <span class='" . $this->selPageClass . "' style='" . $this->selPageStyle . "'>$i</span> " : " <a href='" . $url . "dpgn" . $this->id . "=$i' class='" . $this->pageClass . "' style='" . $this->pageStyle . "'>$i</a> "; |
|
| 162 | + } |
|
| 163 | + } |
|
| 164 | + } |
|
| 165 | + |
|
| 166 | + // render row : renderRowFnc($rowNumber,$row,$arguments="") |
|
| 167 | + $fnc = $this->renderRowFnc; |
|
| 168 | + $args = $this->renderRowFncArgs; |
|
| 169 | + |
|
| 170 | + if(isset($fnc)) { |
|
| 171 | + $i = 1; |
|
| 172 | + $fncObject = is_object($fnc); |
|
| 173 | + $minitems = (($p - 1) * $this->pageSize) + 1; |
|
| 174 | + $maxitems = (($p - 1) * $this->pageSize) + $this->pageSize; |
|
| 175 | + while($i <= $maxitems && ($row = ($isDataset) ? $modx->getDatabase()->getRow($this->ds) : $this->ds[$i - 1])) { |
|
| 176 | + if($i >= $minitems && $i <= $maxitems) { |
|
| 177 | + if($fncObject) { |
|
| 178 | + if($args != "") { |
|
| 179 | + $this->rows .= $fnc->RenderRowFnc($i, $row, $args); |
|
| 180 | + } else { |
|
| 181 | + $this->rows .= $fnc->RenderRowFnc($i, $row); |
|
| 182 | + } |
|
| 183 | + } else { |
|
| 184 | + if($args != "") { |
|
| 185 | + $this->rows .= $fnc($i, $row, $args); |
|
| 186 | + } // if agrs was specified then we wil pass three params |
|
| 187 | + else { |
|
| 188 | + $this->rows .= $fnc($i, $row); |
|
| 189 | + } // otherwise two will be passed |
|
| 190 | + } |
|
| 191 | + |
|
| 192 | + } |
|
| 193 | + $i++; |
|
| 194 | + } |
|
| 195 | + } |
|
| 196 | + } |
|
| 197 | 197 | } |
@@ -33,24 +33,24 @@ discard block |
||
| 33 | 33 | public $renderPagerFncArgs; |
| 34 | 34 | public static $dataSetPagerCnt; |
| 35 | 35 | |
| 36 | - public function __construct($id, $ds, $pageSize = 10, $pageNumber = -1) { |
|
| 36 | + public function __construct($id, $ds, $pageSize = 10, $pageNumber = -1){ |
|
| 37 | 37 | global $_PAGE; // use view state object |
| 38 | 38 | |
| 39 | 39 | // set id |
| 40 | 40 | self::$dataSetPagerCnt++; |
| 41 | - $this->id = !empty($id) ? $id : "dsp" . self::$dataSetPagerCnt; |
|
| 41 | + $this->id = !empty($id) ? $id : "dsp".self::$dataSetPagerCnt; |
|
| 42 | 42 | |
| 43 | 43 | // get pagenumber |
| 44 | 44 | // by setting pager to -1 cause pager to load it's last page number |
| 45 | - if($pageNumber == -1) { |
|
| 45 | + if ($pageNumber == -1) { |
|
| 46 | 46 | $pageNumber = 1; |
| 47 | - if(isset($_GET["dpgn" . $this->id])) { |
|
| 48 | - $pageNumber = $_GET["dpgn" . $this->id]; |
|
| 49 | - } elseif(isset($_PAGE['vs'][$id . '_dpgn'])) { |
|
| 50 | - $pageNumber = $_PAGE['vs'][$id . '_dpgn']; |
|
| 47 | + if (isset($_GET["dpgn".$this->id])) { |
|
| 48 | + $pageNumber = $_GET["dpgn".$this->id]; |
|
| 49 | + } elseif (isset($_PAGE['vs'][$id.'_dpgn'])) { |
|
| 50 | + $pageNumber = $_PAGE['vs'][$id.'_dpgn']; |
|
| 51 | 51 | } |
| 52 | 52 | } |
| 53 | - if(!is_numeric($pageNumber)) { |
|
| 53 | + if (!is_numeric($pageNumber)) { |
|
| 54 | 54 | $pageNumber = 1; |
| 55 | 55 | } |
| 56 | 56 | |
@@ -61,40 +61,40 @@ discard block |
||
| 61 | 61 | $this->pager = ''; |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | - public function getRenderedPager() { |
|
| 64 | + public function getRenderedPager(){ |
|
| 65 | 65 | return $this->pager; |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | - public function getRenderedRows() { |
|
| 68 | + public function getRenderedRows(){ |
|
| 69 | 69 | return $this->rows; |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | - public function setDataSource($ds) { |
|
| 72 | + public function setDataSource($ds){ |
|
| 73 | 73 | $this->ds = $ds; |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | - public function setPageSize($ps) { |
|
| 76 | + public function setPageSize($ps){ |
|
| 77 | 77 | $this->pageSize = $ps; |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | - public function setRenderRowFnc($fncName, $args = "") { |
|
| 80 | + public function setRenderRowFnc($fncName, $args = ""){ |
|
| 81 | 81 | $this->renderRowFnc = &$fncName; |
| 82 | - $this->renderRowFncArgs = $args; // extra agruments |
|
| 82 | + $this->renderRowFncArgs = $args; // extra agruments |
|
| 83 | 83 | |
| 84 | 84 | |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | - public function setRenderPagerFnc($fncName, $args = "") { |
|
| 87 | + public function setRenderPagerFnc($fncName, $args = ""){ |
|
| 88 | 88 | $this->renderPagerFnc = $fncName; |
| 89 | - $this->renderPagerFncArgs = $args; // extra agruments |
|
| 89 | + $this->renderPagerFncArgs = $args; // extra agruments |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | - public function render() { |
|
| 92 | + public function render(){ |
|
| 93 | 93 | $modx = evolutionCMS(); global $_PAGE; |
| 94 | 94 | |
| 95 | 95 | $isDataset = $modx->getDatabase()->isResult($this->ds); |
| 96 | 96 | |
| 97 | - if(!$this->selPageStyle) { |
|
| 97 | + if (!$this->selPageStyle) { |
|
| 98 | 98 | $this->selPageStyle = "font-weight:bold"; |
| 99 | 99 | } |
| 100 | 100 | |
@@ -102,11 +102,11 @@ discard block |
||
| 102 | 102 | $tnr = ($isDataset) ? $modx->getDatabase()->getRecordCount($this->ds) : count($this->ds); |
| 103 | 103 | |
| 104 | 104 | // render: no records found |
| 105 | - if($tnr <= 0) { |
|
| 105 | + if ($tnr <= 0) { |
|
| 106 | 106 | $fnc = $this->renderRowFnc; |
| 107 | 107 | $args = $this->renderRowFncArgs; |
| 108 | - if(isset($fnc)) { |
|
| 109 | - if($args != "") { |
|
| 108 | + if (isset($fnc)) { |
|
| 109 | + if ($args != "") { |
|
| 110 | 110 | $this->rows .= $fnc(0, null, $args); |
| 111 | 111 | } // if agrs was specified then we will pass three params |
| 112 | 112 | else { |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | |
| 119 | 119 | // get total pages |
| 120 | 120 | $tp = ceil($tnr / $this->pageSize); |
| 121 | - if($this->pageNumber > $tp) { |
|
| 121 | + if ($this->pageNumber > $tp) { |
|
| 122 | 122 | $this->pageNumber = 1; |
| 123 | 123 | } |
| 124 | 124 | |
@@ -126,39 +126,39 @@ discard block |
||
| 126 | 126 | $p = $this->pageNumber; |
| 127 | 127 | |
| 128 | 128 | // save page number to view state if available |
| 129 | - if(isset($_PAGE['vs'])) { |
|
| 130 | - $_PAGE['vs'][$this->id . '_dpgn'] = $p; |
|
| 129 | + if (isset($_PAGE['vs'])) { |
|
| 130 | + $_PAGE['vs'][$this->id.'_dpgn'] = $p; |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | // render pager : renderPagerFnc($cuurentPage,$pagerNumber,$arguments=""); |
| 134 | - if($tp > 1) { |
|
| 134 | + if ($tp > 1) { |
|
| 135 | 135 | $url = ''; |
| 136 | 136 | $fnc = $this->renderPagerFnc; |
| 137 | 137 | $args = $this->renderPagerFncArgs; |
| 138 | - if(!isset($fnc)) { |
|
| 139 | - if($modx->isFrontend()) { |
|
| 140 | - $url = $modx->makeUrl($modx->documentIdentifier, '', '', 'full') . '?'; |
|
| 138 | + if (!isset($fnc)) { |
|
| 139 | + if ($modx->isFrontend()) { |
|
| 140 | + $url = $modx->makeUrl($modx->documentIdentifier, '', '', 'full').'?'; |
|
| 141 | 141 | } else { |
| 142 | - $url = $_SERVER['PHP_SELF'] . '?'; |
|
| 142 | + $url = $_SERVER['PHP_SELF'].'?'; |
|
| 143 | 143 | } |
| 144 | 144 | $i = 0; |
| 145 | - foreach($_GET as $n => $v) if($n != 'dpgn' . $this->id) { |
|
| 145 | + foreach ($_GET as $n => $v) if ($n != 'dpgn'.$this->id) { |
|
| 146 | 146 | $i++; |
| 147 | - $url .= (($i > 1) ? "&" : "") . "$n=$v"; |
|
| 147 | + $url .= (($i > 1) ? "&" : "")."$n=$v"; |
|
| 148 | 148 | } |
| 149 | - if($i >= 1) { |
|
| 149 | + if ($i >= 1) { |
|
| 150 | 150 | $url .= "&"; |
| 151 | 151 | } |
| 152 | 152 | } |
| 153 | - for($i = 1; $i <= $tp; $i++) { |
|
| 154 | - if(isset($fnc)) { |
|
| 155 | - if($args != "") { |
|
| 153 | + for ($i = 1; $i <= $tp; $i++) { |
|
| 154 | + if (isset($fnc)) { |
|
| 155 | + if ($args != "") { |
|
| 156 | 156 | $this->pager .= $fnc($p, $i, $args); |
| 157 | 157 | } else { |
| 158 | 158 | $this->pager .= $fnc($p, $i); |
| 159 | 159 | } |
| 160 | 160 | } else { |
| 161 | - $this->pager .= ($p == $i) ? " <span class='" . $this->selPageClass . "' style='" . $this->selPageStyle . "'>$i</span> " : " <a href='" . $url . "dpgn" . $this->id . "=$i' class='" . $this->pageClass . "' style='" . $this->pageStyle . "'>$i</a> "; |
|
| 161 | + $this->pager .= ($p == $i) ? " <span class='".$this->selPageClass."' style='".$this->selPageStyle."'>$i</span> " : " <a href='".$url."dpgn".$this->id."=$i' class='".$this->pageClass."' style='".$this->pageStyle."'>$i</a> "; |
|
| 162 | 162 | } |
| 163 | 163 | } |
| 164 | 164 | } |
@@ -167,21 +167,21 @@ discard block |
||
| 167 | 167 | $fnc = $this->renderRowFnc; |
| 168 | 168 | $args = $this->renderRowFncArgs; |
| 169 | 169 | |
| 170 | - if(isset($fnc)) { |
|
| 170 | + if (isset($fnc)) { |
|
| 171 | 171 | $i = 1; |
| 172 | 172 | $fncObject = is_object($fnc); |
| 173 | 173 | $minitems = (($p - 1) * $this->pageSize) + 1; |
| 174 | 174 | $maxitems = (($p - 1) * $this->pageSize) + $this->pageSize; |
| 175 | - while($i <= $maxitems && ($row = ($isDataset) ? $modx->getDatabase()->getRow($this->ds) : $this->ds[$i - 1])) { |
|
| 176 | - if($i >= $minitems && $i <= $maxitems) { |
|
| 177 | - if($fncObject) { |
|
| 178 | - if($args != "") { |
|
| 175 | + while ($i <= $maxitems && ($row = ($isDataset) ? $modx->getDatabase()->getRow($this->ds) : $this->ds[$i - 1])) { |
|
| 176 | + if ($i >= $minitems && $i <= $maxitems) { |
|
| 177 | + if ($fncObject) { |
|
| 178 | + if ($args != "") { |
|
| 179 | 179 | $this->rows .= $fnc->RenderRowFnc($i, $row, $args); |
| 180 | 180 | } else { |
| 181 | 181 | $this->rows .= $fnc->RenderRowFnc($i, $row); |
| 182 | 182 | } |
| 183 | 183 | } else { |
| 184 | - if($args != "") { |
|
| 184 | + if ($args != "") { |
|
| 185 | 185 | $this->rows .= $fnc($i, $row, $args); |
| 186 | 186 | } // if agrs was specified then we wil pass three params |
| 187 | 187 | else { |
@@ -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) { |
@@ -3,13 +3,13 @@ discard block |
||
| 3 | 3 | * EVO Installer |
| 4 | 4 | */ |
| 5 | 5 | error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED); |
| 6 | -$base_path = dirname(__DIR__) . '/'; |
|
| 6 | +$base_path = dirname(__DIR__).'/'; |
|
| 7 | 7 | |
| 8 | -if (is_file($base_path . 'assets/cache/siteManager.php')) { |
|
| 9 | - include_once $base_path . 'assets/cache/siteManager.php'; |
|
| 8 | +if (is_file($base_path.'assets/cache/siteManager.php')) { |
|
| 9 | + include_once $base_path.'assets/cache/siteManager.php'; |
|
| 10 | 10 | } |
| 11 | -if (! defined('MGR_DIR')) { |
|
| 12 | - if (is_dir($base_path . 'manager')) { |
|
| 11 | +if (!defined('MGR_DIR')) { |
|
| 12 | + if (is_dir($base_path.'manager')) { |
|
| 13 | 13 | define('MGR_DIR', 'manager'); |
| 14 | 14 | } else { |
| 15 | 15 | die('MGR_DIR is not defined'); |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | require_once 'src/functions.php'; |
| 20 | 20 | |
| 21 | 21 | if (empty($_GET['self'])) { |
| 22 | - require_once '../' . MGR_DIR . '/includes/version.inc.php'; |
|
| 22 | + require_once '../'.MGR_DIR.'/includes/version.inc.php'; |
|
| 23 | 23 | |
| 24 | 24 | // start session |
| 25 | 25 | session_start(); |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | install_sessionCheck(); |
| 28 | 28 | |
| 29 | 29 | $moduleName = 'EVO'; |
| 30 | - $moduleVersion = $modx_branch . ' ' . $modx_version; |
|
| 30 | + $moduleVersion = $modx_branch.' '.$modx_version; |
|
| 31 | 31 | $moduleRelease = $modx_release_date; |
| 32 | 32 | $moduleSQLBaseFile = 'stubs/sql/setup.sql'; |
| 33 | 33 | $moduleSQLDataFile = 'stubs/sql/setup.data.sql'; |
@@ -68,8 +68,8 @@ discard block |
||
| 68 | 68 | $action = isset($_GET['action']) ? trim(strip_tags($_GET['action'])) : 'language'; |
| 69 | 69 | str_replace('.', '', $action); |
| 70 | 70 | |
| 71 | - $controller = 'src/controllers/' . $action . '.php'; |
|
| 72 | - if (! file_exists($controller)) { |
|
| 71 | + $controller = 'src/controllers/'.$action.'.php'; |
|
| 72 | + if (!file_exists($controller)) { |
|
| 73 | 73 | die("Invalid install action attempted. [action={$action}]"); |
| 74 | 74 | } |
| 75 | 75 | require $controller; |
@@ -81,8 +81,8 @@ discard block |
||
| 81 | 81 | } else { |
| 82 | 82 | $action = isset($_GET['action']) && is_scalar($_GET['action']) ? trim($_GET['action']) : 'language'; |
| 83 | 83 | str_replace('.', '', $action); |
| 84 | - $controller = 'src/controllers/' . $action . '.php'; |
|
| 85 | - if (! file_exists($controller)) { |
|
| 84 | + $controller = 'src/controllers/'.$action.'.php'; |
|
| 85 | + if (!file_exists($controller)) { |
|
| 86 | 86 | die("Invalid install action attempted. [action={$action}]"); |
| 87 | 87 | } |
| 88 | 88 | require $controller; |
@@ -20,14 +20,14 @@ |
||
| 20 | 20 | ($docid > 0 ? "id='$docid'" : "privatemgr = 1")); |
| 21 | 21 | $rs = $modx->getDatabase()->select( |
| 22 | 22 | 'DISTINCT sc.id', |
| 23 | - $modx->getFullTableName("site_content") . " sc |
|
| 24 | - LEFT JOIN " . $modx->getFullTableName("document_groups") . " dg ON dg.document = sc.id |
|
| 25 | - LEFT JOIN " . $modx->getFullTableName("membergroup_access") . " mga ON mga.documentgroup = dg.document_group", |
|
| 26 | - ($docid > 0 ? " sc.id='{$docid}' AND " : "") . "mga.id>0" |
|
| 23 | + $modx->getFullTableName("site_content")." sc |
|
| 24 | + LEFT JOIN " . $modx->getFullTableName("document_groups")." dg ON dg.document = sc.id |
|
| 25 | + LEFT JOIN " . $modx->getFullTableName("membergroup_access")." mga ON mga.documentgroup = dg.document_group", |
|
| 26 | + ($docid > 0 ? " sc.id='{$docid}' AND " : "")."mga.id>0" |
|
| 27 | 27 | ); |
| 28 | 28 | $ids = $modx->getDatabase()->getColumn("id", $rs); |
| 29 | 29 | if (count($ids) > 0) { |
| 30 | 30 | $modx->getDatabase()->update('privatemgr = 1', $modx->getFullTableName("site_content"), |
| 31 | - "id IN (" . implode(", ", $ids) . ")"); |
|
| 31 | + "id IN (".implode(", ", $ids).")"); |
|
| 32 | 32 | } |
| 33 | 33 | } |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | if (!empty($user_id)) { |
| 15 | 15 | // Raymond: grab the user settings from the database. |
| 16 | 16 | $rs = $modx->getDatabase()->select('setting_name, setting_value', $modx->getFullTableName('user_settings'), |
| 17 | - "user=" . $modx->getLoginUserID()); |
|
| 17 | + "user=".$modx->getLoginUserID()); |
|
| 18 | 18 | |
| 19 | 19 | $which_browser_default = $which_browser; |
| 20 | 20 | while ($row = $modx->getDatabase()->getRow($rs)) { |
@@ -20,14 +20,14 @@ |
||
| 20 | 20 | ($docid > 0 ? "id='$docid'" : "privateweb = 1")); |
| 21 | 21 | $rs = $modx->getDatabase()->select( |
| 22 | 22 | 'DISTINCT sc.id', |
| 23 | - $modx->getFullTableName("site_content") . " sc |
|
| 24 | - LEFT JOIN " . $modx->getFullTableName("document_groups") . " dg ON dg.document = sc.id |
|
| 25 | - LEFT JOIN " . $modx->getFullTableName("webgroup_access") . " wga ON wga.documentgroup = dg.document_group", |
|
| 26 | - ($docid > 0 ? " sc.id='{$docid}' AND " : "") . "wga.id>0" |
|
| 23 | + $modx->getFullTableName("site_content")." sc |
|
| 24 | + LEFT JOIN " . $modx->getFullTableName("document_groups")." dg ON dg.document = sc.id |
|
| 25 | + LEFT JOIN " . $modx->getFullTableName("webgroup_access")." wga ON wga.documentgroup = dg.document_group", |
|
| 26 | + ($docid > 0 ? " sc.id='{$docid}' AND " : "")."wga.id>0" |
|
| 27 | 27 | ); |
| 28 | 28 | $ids = $modx->getDatabase()->getColumn("id", $rs); |
| 29 | 29 | if (count($ids) > 0) { |
| 30 | 30 | $modx->getDatabase()->update('privateweb = 1', $modx->getFullTableName("site_content"), |
| 31 | - "id IN (" . implode(", ", $ids) . ")"); |
|
| 31 | + "id IN (".implode(", ", $ids).")"); |
|
| 32 | 32 | } |
| 33 | 33 | } |
@@ -1,11 +1,11 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
| 3 | - die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
| 3 | + die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
| 4 | 4 | } |
| 5 | 5 | global $SystemAlertMsgQueque; |
| 6 | 6 | // display system alert window if messages are available |
| 7 | 7 | if(count($SystemAlertMsgQueque) > 0) { |
| 8 | - include "sysalert.display.inc.php"; |
|
| 8 | + include "sysalert.display.inc.php"; |
|
| 9 | 9 | } |
| 10 | 10 | ?> |
| 11 | 11 | <script type='text/javascript'> |
@@ -19,17 +19,17 @@ discard block |
||
| 19 | 19 | </script> |
| 20 | 20 | <?php |
| 21 | 21 | if(in_array($modx->getManagerApi()->action, array( |
| 22 | - 85, |
|
| 23 | - 27, |
|
| 24 | - 4, |
|
| 25 | - 72, |
|
| 26 | - 13, |
|
| 27 | - 11, |
|
| 28 | - 12, |
|
| 29 | - 87, |
|
| 30 | - 88 |
|
| 22 | + 85, |
|
| 23 | + 27, |
|
| 24 | + 4, |
|
| 25 | + 72, |
|
| 26 | + 13, |
|
| 27 | + 11, |
|
| 28 | + 12, |
|
| 29 | + 87, |
|
| 30 | + 88 |
|
| 31 | 31 | ))) { |
| 32 | - echo $modx->getManagerApi()->loadDatePicker($modx->config['mgr_date_picker_path']); |
|
| 32 | + echo $modx->getManagerApi()->loadDatePicker($modx->config['mgr_date_picker_path']); |
|
| 33 | 33 | } |
| 34 | 34 | ?> |
| 35 | 35 | </body> |
@@ -1,10 +1,10 @@ discard block |
||
| 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 />Please use the EVO Content Manager instead of accessing this file directly."); |
| 4 | 4 | } |
| 5 | 5 | global $SystemAlertMsgQueque; |
| 6 | 6 | // display system alert window if messages are available |
| 7 | -if(count($SystemAlertMsgQueque) > 0) { |
|
| 7 | +if (count($SystemAlertMsgQueque) > 0) { |
|
| 8 | 8 | include "sysalert.display.inc.php"; |
| 9 | 9 | } |
| 10 | 10 | ?> |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | }); |
| 19 | 19 | </script> |
| 20 | 20 | <?php |
| 21 | -if(in_array($modx->getManagerApi()->action, array( |
|
| 21 | +if (in_array($modx->getManagerApi()->action, array( |
|
| 22 | 22 | 85, |
| 23 | 23 | 27, |
| 24 | 24 | 4, |
@@ -1,30 +1,30 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | - /** |
|
| 4 | - * System Alert Message Queue Display file |
|
| 5 | - * Written By Raymond Irving, April, 2005 |
|
| 6 | - * |
|
| 7 | - * Used to display system alert messages inside the browser |
|
| 8 | - * |
|
| 9 | - */ |
|
| 3 | + /** |
|
| 4 | + * System Alert Message Queue Display file |
|
| 5 | + * Written By Raymond Irving, April, 2005 |
|
| 6 | + * |
|
| 7 | + * Used to display system alert messages inside the browser |
|
| 8 | + * |
|
| 9 | + */ |
|
| 10 | 10 | |
| 11 | - require_once(dirname(__FILE__).'/protect.inc.php'); |
|
| 11 | + require_once(dirname(__FILE__).'/protect.inc.php'); |
|
| 12 | 12 | |
| 13 | - $sysMsgs = ""; |
|
| 14 | - $limit = count($SystemAlertMsgQueque); |
|
| 15 | - for($i=0;$i<$limit;$i++) { |
|
| 16 | - $sysMsgs .= $SystemAlertMsgQueque[$i]."<hr sys/>"; |
|
| 17 | - } |
|
| 18 | - // reset message queque |
|
| 19 | - unset($_SESSION['SystemAlertMsgQueque']); |
|
| 20 | - $_SESSION['SystemAlertMsgQueque'] = array(); |
|
| 21 | - $SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque']; |
|
| 13 | + $sysMsgs = ""; |
|
| 14 | + $limit = count($SystemAlertMsgQueque); |
|
| 15 | + for($i=0;$i<$limit;$i++) { |
|
| 16 | + $sysMsgs .= $SystemAlertMsgQueque[$i]."<hr sys/>"; |
|
| 17 | + } |
|
| 18 | + // reset message queque |
|
| 19 | + unset($_SESSION['SystemAlertMsgQueque']); |
|
| 20 | + $_SESSION['SystemAlertMsgQueque'] = array(); |
|
| 21 | + $SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque']; |
|
| 22 | 22 | |
| 23 | - if($sysMsgs!="") { |
|
| 23 | + if($sysMsgs!="") { |
|
| 24 | 24 | ?> |
| 25 | 25 | |
| 26 | 26 | <?php // fetch the styles |
| 27 | - echo '<link rel="stylesheet" type="text/css" href="'.MODX_MANAGER_URL.'media/style/'.$manager_theme.'/style.css'.'" />'; |
|
| 27 | + echo '<link rel="stylesheet" type="text/css" href="'.MODX_MANAGER_URL.'media/style/'.$manager_theme.'/style.css'.'" />'; |
|
| 28 | 28 | ?> |
| 29 | 29 | <script type="text/javascript"> |
| 30 | 30 | // <![CDATA[ |
@@ -42,5 +42,5 @@ discard block |
||
| 42 | 42 | // ]]> |
| 43 | 43 | </script> |
| 44 | 44 | <?php |
| 45 | - } |
|
| 45 | + } |
|
| 46 | 46 | ?> |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | |
| 13 | 13 | $sysMsgs = ""; |
| 14 | 14 | $limit = count($SystemAlertMsgQueque); |
| 15 | - for($i=0;$i<$limit;$i++) { |
|
| 15 | + for ($i = 0; $i < $limit; $i++) { |
|
| 16 | 16 | $sysMsgs .= $SystemAlertMsgQueque[$i]."<hr sys/>"; |
| 17 | 17 | } |
| 18 | 18 | // reset message queque |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | $_SESSION['SystemAlertMsgQueque'] = array(); |
| 21 | 21 | $SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque']; |
| 22 | 22 | |
| 23 | - if($sysMsgs!="") { |
|
| 23 | + if ($sysMsgs != "") { |
|
| 24 | 24 | ?> |
| 25 | 25 | |
| 26 | 26 | <?php // fetch the styles |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | var sysAlert = new Element('div').setProperties({ |
| 33 | 33 | 'class': 'sysAlert' |
| 34 | 34 | }); |
| 35 | - sysAlert.innerHTML = '<?php echo $modx->getDatabase()->escape($sysMsgs);?>'; |
|
| 35 | + sysAlert.innerHTML = '<?php echo $modx->getDatabase()->escape($sysMsgs); ?>'; |
|
| 36 | 36 | var boxHtml = new MooPrompt('<?php echo $_lang['sys_alert']; ?>', sysAlert, { |
| 37 | 37 | buttons: 1, |
| 38 | 38 | button1: 'Ok', |