@@ -31,6 +31,9 @@ discard block |
||
31 | 31 | public $renderPagerFnc; |
32 | 32 | public $renderPagerFncArgs; |
33 | 33 | |
34 | + /** |
|
35 | + * @param boolean|string $id |
|
36 | + */ |
|
34 | 37 | public function __construct($id, $ds, $pageSize = 10, $pageNumber = -1) { |
35 | 38 | global $_PAGE; // use view state object |
36 | 39 | |
@@ -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 |
@@ -12,18 +12,18 @@ discard block |
||
12 | 12 | |
13 | 13 | class DataSetPager { |
14 | 14 | |
15 | - public $ds; // datasource |
|
15 | + public $ds; // datasource |
|
16 | 16 | public $pageSize; |
17 | 17 | public $pageNumber; |
18 | 18 | public $rows; |
19 | 19 | public $pager; |
20 | 20 | public $id; |
21 | 21 | |
22 | - // normal page |
|
22 | + // normal page |
|
23 | 23 | public $pageStyle; |
24 | 24 | public $pageClass; |
25 | 25 | |
26 | - // selected page |
|
26 | + // selected page |
|
27 | 27 | public $selPageStyle; |
28 | 28 | public $selPageClass; |
29 | 29 | public $renderRowFnc; |
@@ -32,166 +32,166 @@ discard block |
||
32 | 32 | public $renderPagerFncArgs; |
33 | 33 | |
34 | 34 | public function __construct($id, $ds, $pageSize = 10, $pageNumber = -1) { |
35 | - global $_PAGE; // use view state object |
|
36 | - |
|
37 | - global $__DataSetPagerCnt; |
|
38 | - |
|
39 | - // set id |
|
40 | - $__DataSetPagerCnt++; |
|
41 | - $this->id = !empty($id) ? $id : "dsp" . $__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 | - } |
|
35 | + global $_PAGE; // use view state object |
|
36 | + |
|
37 | + global $__DataSetPagerCnt; |
|
38 | + |
|
39 | + // set id |
|
40 | + $__DataSetPagerCnt++; |
|
41 | + $this->id = !empty($id) ? $id : "dsp" . $__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->db->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->db->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->db->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->db->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->db->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->db->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 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | $__DataSetPagerCnt = 0; |
12 | 12 | |
13 | -class DataSetPager { |
|
13 | +class DataSetPager{ |
|
14 | 14 | |
15 | 15 | public $ds; // datasource |
16 | 16 | public $pageSize; |
@@ -31,26 +31,26 @@ discard block |
||
31 | 31 | public $renderPagerFnc; |
32 | 32 | public $renderPagerFncArgs; |
33 | 33 | |
34 | - public function __construct($id, $ds, $pageSize = 10, $pageNumber = -1) { |
|
34 | + public function __construct($id, $ds, $pageSize = 10, $pageNumber = -1){ |
|
35 | 35 | global $_PAGE; // use view state object |
36 | 36 | |
37 | 37 | global $__DataSetPagerCnt; |
38 | 38 | |
39 | 39 | // set id |
40 | 40 | $__DataSetPagerCnt++; |
41 | - $this->id = !empty($id) ? $id : "dsp" . $__DataSetPagerCnt; |
|
41 | + $this->id = !empty($id) ? $id : "dsp".$__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->db->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->db->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->db->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->db->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 { |
@@ -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 | public $ds; // datasource |
16 | 17 | public $pageSize; |
@@ -31,7 +32,8 @@ discard block |
||
31 | 32 | public $renderPagerFnc; |
32 | 33 | public $renderPagerFncArgs; |
33 | 34 | |
34 | - public function __construct($id, $ds, $pageSize = 10, $pageNumber = -1) { |
|
35 | + public function __construct($id, $ds, $pageSize = 10, $pageNumber = -1) |
|
36 | + { |
|
35 | 37 | global $_PAGE; // use view state object |
36 | 38 | |
37 | 39 | global $__DataSetPagerCnt; |
@@ -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->db->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) { |
@@ -8,8 +8,8 @@ |
||
8 | 8 | ******************************************************* |
9 | 9 | */ |
10 | 10 | |
11 | -use PHPMailer\PHPMailer\PHPMailer; |
|
12 | 11 | use PHPMailer\PHPMailer\Exception as PHPMailerException; |
12 | +use PHPMailer\PHPMailer\PHPMailer; |
|
13 | 13 | |
14 | 14 | require MODX_MANAGER_PATH . 'includes/controls/phpmailer/Exception.php'; |
15 | 15 | require MODX_MANAGER_PATH . 'includes/controls/phpmailer/PHPMailer.php'; |
@@ -11,9 +11,9 @@ discard block |
||
11 | 11 | use PHPMailer\PHPMailer\PHPMailer; |
12 | 12 | use PHPMailer\PHPMailer\Exception as PHPMailerException; |
13 | 13 | |
14 | -require MODX_MANAGER_PATH . 'includes/controls/phpmailer/Exception.php'; |
|
15 | -require MODX_MANAGER_PATH . 'includes/controls/phpmailer/PHPMailer.php'; |
|
16 | -require MODX_MANAGER_PATH . 'includes/controls/phpmailer/SMTP.php'; |
|
14 | +require MODX_MANAGER_PATH.'includes/controls/phpmailer/Exception.php'; |
|
15 | +require MODX_MANAGER_PATH.'includes/controls/phpmailer/PHPMailer.php'; |
|
16 | +require MODX_MANAGER_PATH.'includes/controls/phpmailer/SMTP.php'; |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * Class MODxMailer |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | public function init(DocumentParser $modx) |
47 | 47 | { |
48 | 48 | $this->modx = $modx; |
49 | - $this->PluginDir = MODX_MANAGER_PATH . 'includes/controls/phpmailer/'; |
|
49 | + $this->PluginDir = MODX_MANAGER_PATH.'includes/controls/phpmailer/'; |
|
50 | 50 | |
51 | 51 | switch ($modx->config['email_method']) { |
52 | 52 | case 'smtp': |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | mb_language($this->mb_language); |
113 | 113 | mb_internal_encoding($modx->config['modx_charset']); |
114 | 114 | } |
115 | - $exconf = MODX_MANAGER_PATH . 'includes/controls/phpmailer/config.inc.php'; |
|
115 | + $exconf = MODX_MANAGER_PATH.'includes/controls/phpmailer/config.inc.php'; |
|
116 | 116 | if (is_file($exconf)) { |
117 | 117 | include($exconf); |
118 | 118 | } |
@@ -180,12 +180,12 @@ discard block |
||
180 | 180 | } |
181 | 181 | |
182 | 182 | if ($this->modx->debug) { |
183 | - $debug_info = 'CharSet = ' . $this->CharSet . "\n"; |
|
184 | - $debug_info .= 'Encoding = ' . $this->Encoding . "\n"; |
|
185 | - $debug_info .= 'mb_language = ' . $this->mb_language . "\n"; |
|
186 | - $debug_info .= 'encode_header_method = ' . $this->encode_header_method . "\n"; |
|
183 | + $debug_info = 'CharSet = '.$this->CharSet."\n"; |
|
184 | + $debug_info .= 'Encoding = '.$this->Encoding."\n"; |
|
185 | + $debug_info .= 'mb_language = '.$this->mb_language."\n"; |
|
186 | + $debug_info .= 'encode_header_method = '.$this->encode_header_method."\n"; |
|
187 | 187 | $debug_info .= "send_mode = {$mode}\n"; |
188 | - $debug_info .= 'Subject = ' . $this->Subject . "\n"; |
|
188 | + $debug_info .= 'Subject = '.$this->Subject."\n"; |
|
189 | 189 | $log = "<pre>{$debug_info}\n{$header}\n{$org_body}</pre>"; |
190 | 190 | $this->modx->logEvent(1, 1, $log, 'MODxMailer debug information'); |
191 | 191 | |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | ini_set('sendmail_from', $old_from); |
252 | 252 | } |
253 | 253 | if (!$rt) { |
254 | - $msg = $this->Lang('instantiate') . "<br />\n"; |
|
254 | + $msg = $this->Lang('instantiate')."<br />\n"; |
|
255 | 255 | $msg .= "{$this->Subject}<br />\n"; |
256 | 256 | $msg .= "{$this->FromName}<{$this->From}><br />\n"; |
257 | 257 | $msg .= mb_convert_encoding($body, $this->modx->config['modx_charset'], $this->CharSet); |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | $classDump = call_user_func('get_object_vars', $this); |
274 | 274 | unset($classDump['modx']); |
275 | 275 | $this->modx->config['send_errormail'] = '0'; |
276 | - $this->modx->logEvent(0, 3, $msg . '<pre>' . print_r($classDump, true) . '</pre>', 'phpmailer'); |
|
276 | + $this->modx->logEvent(0, 3, $msg.'<pre>'.print_r($classDump, true).'</pre>', 'phpmailer'); |
|
277 | 277 | |
278 | 278 | return parent::SetError($msg); |
279 | 279 | } |
@@ -1,5 +1,5 @@ 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 | if (!$modx->hasPermission('logs')) { |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | $logs_user = record_sort(array_unique_multi($logs, 'internalKey'), 'username'); |
66 | 66 | foreach ($logs_user as $row) { |
67 | 67 | $selectedtext = $row['internalKey'] == $_REQUEST['searchuser'] ? ' selected="selected"' : ''; |
68 | - echo "\t\t" . '<option value="' . $row['internalKey'] . '"' . $selectedtext . '>' . $row['username'] . "</option>\n"; |
|
68 | + echo "\t\t".'<option value="'.$row['internalKey'].'"'.$selectedtext.'>'.$row['username']."</option>\n"; |
|
69 | 69 | } |
70 | 70 | ?> |
71 | 71 | </select> |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | continue; |
87 | 87 | } |
88 | 88 | $selectedtext = $row['action'] == $_REQUEST['action'] ? ' selected="selected"' : ''; |
89 | - echo "\t\t" . '<option value="' . $row['action'] . '"' . $selectedtext . '>' . $row['action'] . ' - ' . $action . "</option>\n"; |
|
89 | + echo "\t\t".'<option value="'.$row['action'].'"'.$selectedtext.'>'.$row['action'].' - '.$action."</option>\n"; |
|
90 | 90 | } |
91 | 91 | ?> |
92 | 92 | </select> |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | $logs_items = record_sort(array_unique_multi($logs, 'itemid'), 'itemid'); |
103 | 103 | foreach ($logs_items as $row) { |
104 | 104 | $selectedtext = $row['itemid'] == $_REQUEST['itemid'] ? ' selected="selected"' : ''; |
105 | - echo "\t\t" . '<option value="' . $row['itemid'] . '"' . $selectedtext . '>' . $row['itemid'] . "</option>\n"; |
|
105 | + echo "\t\t".'<option value="'.$row['itemid'].'"'.$selectedtext.'>'.$row['itemid']."</option>\n"; |
|
106 | 106 | } |
107 | 107 | ?> |
108 | 108 | </select> |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | $logs_names = record_sort(array_unique_multi($logs, 'itemname'), 'itemname'); |
119 | 119 | foreach ($logs_names as $row) { |
120 | 120 | $selectedtext = $row['itemname'] == $_REQUEST['itemname'] ? ' selected="selected"' : ''; |
121 | - echo "\t\t" . '<option value="' . $row['itemname'] . '"' . $selectedtext . '>' . $row['itemname'] . "</option>\n"; |
|
121 | + echo "\t\t".'<option value="'.$row['itemname'].'"'.$selectedtext.'>'.$row['itemname']."</option>\n"; |
|
122 | 122 | } |
123 | 123 | ?> |
124 | 124 | </select> |
@@ -176,26 +176,26 @@ discard block |
||
176 | 176 | // get the selections the user made. |
177 | 177 | $sqladd = array(); |
178 | 178 | if ($_REQUEST['searchuser'] != 0) { |
179 | - $sqladd[] = "internalKey='" . (int)$_REQUEST['searchuser'] . "'"; |
|
179 | + $sqladd[] = "internalKey='".(int) $_REQUEST['searchuser']."'"; |
|
180 | 180 | } |
181 | 181 | if ($_REQUEST['action'] != 0) { |
182 | - $sqladd[] = "action=" . (int)$_REQUEST['action']; |
|
182 | + $sqladd[] = "action=".(int) $_REQUEST['action']; |
|
183 | 183 | } |
184 | 184 | if ($_REQUEST['itemid'] != 0 || $_REQUEST['itemid'] == "-") { |
185 | - $sqladd[] = "itemid='" . $_REQUEST['itemid'] . "'"; |
|
185 | + $sqladd[] = "itemid='".$_REQUEST['itemid']."'"; |
|
186 | 186 | } |
187 | 187 | if ($_REQUEST['itemname'] != '0') { |
188 | - $sqladd[] = "itemname='" . $modx->db->escape($_REQUEST['itemname']) . "'"; |
|
188 | + $sqladd[] = "itemname='".$modx->db->escape($_REQUEST['itemname'])."'"; |
|
189 | 189 | } |
190 | 190 | if ($_REQUEST['message'] != "") { |
191 | - $sqladd[] = "message LIKE '%" . $modx->db->escape($_REQUEST['message']) . "%'"; |
|
191 | + $sqladd[] = "message LIKE '%".$modx->db->escape($_REQUEST['message'])."%'"; |
|
192 | 192 | } |
193 | 193 | // date stuff |
194 | 194 | if ($_REQUEST['datefrom'] != "") { |
195 | - $sqladd[] = "timestamp>" . $modx->toTimeStamp($_REQUEST['datefrom']); |
|
195 | + $sqladd[] = "timestamp>".$modx->toTimeStamp($_REQUEST['datefrom']); |
|
196 | 196 | } |
197 | 197 | if ($_REQUEST['dateto'] != "") { |
198 | - $sqladd[] = "timestamp<" . $modx->toTimeStamp($_REQUEST['dateto']); |
|
198 | + $sqladd[] = "timestamp<".$modx->toTimeStamp($_REQUEST['dateto']); |
|
199 | 199 | } |
200 | 200 | |
201 | 201 | // If current position is not set, set it to zero |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | // Number of result to display on the page, will be in the LIMIT of the sql query also |
209 | 209 | $int_num_result = is_numeric($_REQUEST['nrresults']) ? $_REQUEST['nrresults'] : $number_of_logs; |
210 | 210 | |
211 | - $extargv = "&a=13&searchuser=" . $_REQUEST['searchuser'] . "&action=" . $_REQUEST['action'] . "&itemid=" . $_REQUEST['itemid'] . "&itemname=" . $_REQUEST['itemname'] . "&message=" . $_REQUEST['message'] . "&dateto=" . $_REQUEST['dateto'] . "&datefrom=" . $_REQUEST['datefrom'] . "&nrresults=" . $int_num_result . "&log_submit=" . $_REQUEST['log_submit']; // extra argv here (could be anything depending on your page) |
|
211 | + $extargv = "&a=13&searchuser=".$_REQUEST['searchuser']."&action=".$_REQUEST['action']."&itemid=".$_REQUEST['itemid']."&itemname=".$_REQUEST['itemname']."&message=".$_REQUEST['message']."&dateto=".$_REQUEST['dateto']."&datefrom=".$_REQUEST['datefrom']."&nrresults=".$int_num_result."&log_submit=".$_REQUEST['log_submit']; // extra argv here (could be anything depending on your page) |
|
212 | 212 | |
213 | 213 | // build the sql |
214 | 214 | $limit = $num_rows = $modx->db->getValue($modx->db->select('COUNT(*)', $modx->getFullTableName('manager_log'), (!empty($sqladd) ? implode(' AND ', $sqladd) : ''))); |
@@ -216,9 +216,9 @@ discard block |
||
216 | 216 | $rs = $modx->db->select('*', $modx->getFullTableName('manager_log'), (!empty($sqladd) ? implode(' AND ', $sqladd) : ''), 'timestamp DESC, id DESC', "{$int_cur_position}, {$int_num_result}"); |
217 | 217 | |
218 | 218 | if ($limit < 1) { |
219 | - echo '<p>' . $_lang["mgrlog_emptysrch"] . '</p>'; |
|
219 | + echo '<p>'.$_lang["mgrlog_emptysrch"].'</p>'; |
|
220 | 220 | } else { |
221 | - echo '<p>' . $_lang["mgrlog_sortinst"] . '</p>'; |
|
221 | + echo '<p>'.$_lang["mgrlog_sortinst"].'</p>'; |
|
222 | 222 | |
223 | 223 | include_once "paginate.inc.php"; |
224 | 224 | // New instance of the Paging class, you can modify the color and the width of the html table |
@@ -230,11 +230,11 @@ discard block |
||
230 | 230 | $current_row = $int_cur_position / $int_num_result; |
231 | 231 | |
232 | 232 | // Display the result as you like... |
233 | - print "<p>" . $_lang["paging_showing"] . " " . $array_paging['lower']; |
|
234 | - print " " . $_lang["paging_to"] . " " . $array_paging['upper']; |
|
235 | - print " (" . $array_paging['total'] . " " . $_lang["paging_total"] . ")<br />"; |
|
236 | - $paging = $array_paging['first_link'] . $_lang["paging_first"] . (isset($array_paging['first_link']) ? "</a> " : " "); |
|
237 | - $paging .= $array_paging['previous_link'] . $_lang["paging_prev"] . (isset($array_paging['previous_link']) ? "</a> " : " "); |
|
233 | + print "<p>".$_lang["paging_showing"]." ".$array_paging['lower']; |
|
234 | + print " ".$_lang["paging_to"]." ".$array_paging['upper']; |
|
235 | + print " (".$array_paging['total']." ".$_lang["paging_total"].")<br />"; |
|
236 | + $paging = $array_paging['first_link'].$_lang["paging_first"].(isset($array_paging['first_link']) ? "</a> " : " "); |
|
237 | + $paging .= $array_paging['previous_link'].$_lang["paging_prev"].(isset($array_paging['previous_link']) ? "</a> " : " "); |
|
238 | 238 | $pagesfound = sizeof($array_row_paging); |
239 | 239 | if ($pagesfound > 6) { |
240 | 240 | $paging .= $array_row_paging[$current_row - 2]; // ." "; |
@@ -244,11 +244,11 @@ discard block |
||
244 | 244 | $paging .= $array_row_paging[$current_row + 2]; // ." "; |
245 | 245 | } else { |
246 | 246 | for ($i = 0; $i < $pagesfound; $i++) { |
247 | - $paging .= $array_row_paging[$i] . " "; |
|
247 | + $paging .= $array_row_paging[$i]." "; |
|
248 | 248 | } |
249 | 249 | } |
250 | - $paging .= $array_paging['next_link'] . $_lang["paging_next"] . (isset($array_paging['next_link']) ? "</a> " : " ") . " "; |
|
251 | - $paging .= $array_paging['last_link'] . $_lang["paging_last"] . (isset($array_paging['last_link']) ? "</a> " : " ") . " "; |
|
250 | + $paging .= $array_paging['next_link'].$_lang["paging_next"].(isset($array_paging['next_link']) ? "</a> " : " ")." "; |
|
251 | + $paging .= $array_paging['last_link'].$_lang["paging_last"].(isset($array_paging['last_link']) ? "</a> " : " ")." "; |
|
252 | 252 | // The above exemple print somethings like: |
253 | 253 | // Results 1 to 20 of 597 <<< 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 >>> |
254 | 254 | // Of course you can now play with array_row_paging in order to print |
@@ -282,16 +282,16 @@ discard block |
||
282 | 282 | if (!preg_match("/^[0-9]+$/", $logentry['itemid'])) { |
283 | 283 | $item = '<div style="text-align:center;">-</div>'; |
284 | 284 | } elseif ($logentry['action'] == 3 || $logentry['action'] == 27 || $logentry['action'] == 5) { |
285 | - $item = '<a href="index.php?a=3&id=' . $logentry['itemid'] . '">' . $logentry['itemname'] . '</a>'; |
|
285 | + $item = '<a href="index.php?a=3&id='.$logentry['itemid'].'">'.$logentry['itemname'].'</a>'; |
|
286 | 286 | } else { |
287 | 287 | $item = $logentry['itemname']; |
288 | 288 | } |
289 | 289 | //index.php?a=13&searchuser=' . $logentry['internalKey'] . '&action=' . $logentry['action'] . '&itemname=' . $logentry['itemname'] . '&log_submit=true' |
290 | - $user_drill = 'index.php?a=13&searchuser=' . $logentry['internalKey'] . '&itemname=0&log_submit=true'; |
|
290 | + $user_drill = 'index.php?a=13&searchuser='.$logentry['internalKey'].'&itemname=0&log_submit=true'; |
|
291 | 291 | ?> |
292 | 292 | <tr> |
293 | - <td><?= '<a href="' . $user_drill . '">' . $logentry['username'] . '</a>' ?></td> |
|
294 | - <td class="text-nowrap"><?= '[' . $logentry['action'] . '] ' . $logentry['message'] ?></td> |
|
293 | + <td><?= '<a href="'.$user_drill.'">'.$logentry['username'].'</a>' ?></td> |
|
294 | + <td class="text-nowrap"><?= '['.$logentry['action'].'] '.$logentry['message'] ?></td> |
|
295 | 295 | <td class="text-xs-right"><?= $logentry['itemid'] ?></td> |
296 | 296 | <td><?= $item ?></td> |
297 | 297 | <td class="text-nowrap"><?= $modx->toDateFormat($logentry['timestamp'] + $server_offset_time) ?></td> |
@@ -1,8 +1,8 @@ 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 | -if (!$modx->hasPermission('logs')) { |
|
5 | +if (!$modx->hasPermission('logs')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
@@ -11,17 +11,17 @@ discard block |
||
11 | 11 | * @param string $checkKey |
12 | 12 | * @return array |
13 | 13 | */ |
14 | -function array_unique_multi($array, $checkKey) |
|
15 | -{ |
|
14 | +function array_unique_multi($array, $checkKey) |
|
15 | +{ |
|
16 | 16 | // Use the builtin if we're not a multi-dimensional array |
17 | - if (!is_array(current($array)) || empty($checkKey)) { |
|
17 | + if (!is_array(current($array)) || empty($checkKey)) { |
|
18 | 18 | return array_unique($array); |
19 | 19 | } |
20 | 20 | |
21 | 21 | $ret = array(); |
22 | 22 | $checkValues = array(); // contains the unique key Values |
23 | - foreach ($array as $key => $current) { |
|
24 | - if (in_array($current[$checkKey], $checkValues)) { |
|
23 | + foreach ($array as $key => $current) { |
|
24 | + if (in_array($current[$checkKey], $checkValues)) { |
|
25 | 25 | continue; |
26 | 26 | } // duplicate |
27 | 27 | |
@@ -36,17 +36,17 @@ discard block |
||
36 | 36 | * @param string $key |
37 | 37 | * @return array |
38 | 38 | */ |
39 | -function record_sort($array, $key) |
|
40 | -{ |
|
39 | +function record_sort($array, $key) |
|
40 | +{ |
|
41 | 41 | $hash = array(); |
42 | - foreach ($array as $k => $v) { |
|
42 | + foreach ($array as $k => $v) { |
|
43 | 43 | $hash[$k] = $v[$key]; |
44 | 44 | } |
45 | 45 | |
46 | 46 | natsort($hash); |
47 | 47 | |
48 | 48 | $records = array(); |
49 | - foreach ($hash as $k => $row) { |
|
49 | + foreach ($hash as $k => $row) { |
|
50 | 50 | $records[$k] = $array[$k]; |
51 | 51 | } |
52 | 52 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | <?php |
74 | 74 | // get all users currently in the log |
75 | 75 | $logs_user = record_sort(array_unique_multi($logs, 'internalKey'), 'username'); |
76 | - foreach ($logs_user as $row) { |
|
76 | + foreach ($logs_user as $row) { |
|
77 | 77 | $selectedtext = $row['internalKey'] == $_REQUEST['searchuser'] ? ' selected="selected"' : ''; |
78 | 78 | echo "\t\t" . '<option value="' . $row['internalKey'] . '"' . $selectedtext . '>' . $row['username'] . "</option>\n"; |
79 | 79 | } |
@@ -90,9 +90,9 @@ discard block |
||
90 | 90 | // get all available actions in the log |
91 | 91 | include_once "actionlist.inc.php"; |
92 | 92 | $logs_actions = record_sort(array_unique_multi($logs, 'action'), 'action'); |
93 | - foreach ($logs_actions as $row) { |
|
93 | + foreach ($logs_actions as $row) { |
|
94 | 94 | $action = getAction($row['action']); |
95 | - if ($action == 'Idle') { |
|
95 | + if ($action == 'Idle') { |
|
96 | 96 | continue; |
97 | 97 | } |
98 | 98 | $selectedtext = $row['action'] == $_REQUEST['action'] ? ' selected="selected"' : ''; |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | <?php |
111 | 111 | // get all itemid currently in logging |
112 | 112 | $logs_items = record_sort(array_unique_multi($logs, 'itemid'), 'itemid'); |
113 | - foreach ($logs_items as $row) { |
|
113 | + foreach ($logs_items as $row) { |
|
114 | 114 | $selectedtext = $row['itemid'] == $_REQUEST['itemid'] ? ' selected="selected"' : ''; |
115 | 115 | echo "\t\t" . '<option value="' . $row['itemid'] . '"' . $selectedtext . '>' . $row['itemid'] . "</option>\n"; |
116 | 116 | } |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | <?php |
127 | 127 | // get all itemname currently in logging |
128 | 128 | $logs_names = record_sort(array_unique_multi($logs, 'itemname'), 'itemname'); |
129 | - foreach ($logs_names as $row) { |
|
129 | + foreach ($logs_names as $row) { |
|
130 | 130 | $selectedtext = $row['itemname'] == $_REQUEST['itemname'] ? ' selected="selected"' : ''; |
131 | 131 | echo "\t\t" . '<option value="' . $row['itemname'] . '"' . $selectedtext . '>' . $row['itemname'] . "</option>\n"; |
132 | 132 | } |
@@ -182,36 +182,36 @@ discard block |
||
182 | 182 | <div class="container container-body"> |
183 | 183 | |
184 | 184 | <?php |
185 | -if (isset($_REQUEST['log_submit'])) { |
|
185 | +if (isset($_REQUEST['log_submit'])) { |
|
186 | 186 | // get the selections the user made. |
187 | 187 | $sqladd = array(); |
188 | - if ($_REQUEST['searchuser'] != 0) { |
|
188 | + if ($_REQUEST['searchuser'] != 0) { |
|
189 | 189 | $sqladd[] = "internalKey='" . (int)$_REQUEST['searchuser'] . "'"; |
190 | 190 | } |
191 | - if ($_REQUEST['action'] != 0) { |
|
191 | + if ($_REQUEST['action'] != 0) { |
|
192 | 192 | $sqladd[] = "action=" . (int)$_REQUEST['action']; |
193 | 193 | } |
194 | - if ($_REQUEST['itemid'] != 0 || $_REQUEST['itemid'] == "-") { |
|
194 | + if ($_REQUEST['itemid'] != 0 || $_REQUEST['itemid'] == "-") { |
|
195 | 195 | $sqladd[] = "itemid='" . $_REQUEST['itemid'] . "'"; |
196 | 196 | } |
197 | - if ($_REQUEST['itemname'] != '0') { |
|
197 | + if ($_REQUEST['itemname'] != '0') { |
|
198 | 198 | $sqladd[] = "itemname='" . $modx->db->escape($_REQUEST['itemname']) . "'"; |
199 | 199 | } |
200 | - if ($_REQUEST['message'] != "") { |
|
200 | + if ($_REQUEST['message'] != "") { |
|
201 | 201 | $sqladd[] = "message LIKE '%" . $modx->db->escape($_REQUEST['message']) . "%'"; |
202 | 202 | } |
203 | 203 | // date stuff |
204 | - if ($_REQUEST['datefrom'] != "") { |
|
204 | + if ($_REQUEST['datefrom'] != "") { |
|
205 | 205 | $sqladd[] = "timestamp>" . $modx->toTimeStamp($_REQUEST['datefrom']); |
206 | 206 | } |
207 | - if ($_REQUEST['dateto'] != "") { |
|
207 | + if ($_REQUEST['dateto'] != "") { |
|
208 | 208 | $sqladd[] = "timestamp<" . $modx->toTimeStamp($_REQUEST['dateto']); |
209 | 209 | } |
210 | 210 | |
211 | 211 | // If current position is not set, set it to zero |
212 | - if (!isset($_REQUEST['int_cur_position']) || $_REQUEST['int_cur_position'] == 0) { |
|
212 | + if (!isset($_REQUEST['int_cur_position']) || $_REQUEST['int_cur_position'] == 0) { |
|
213 | 213 | $int_cur_position = 0; |
214 | - } else { |
|
214 | + } else { |
|
215 | 215 | $int_cur_position = $_REQUEST['int_cur_position']; |
216 | 216 | } |
217 | 217 | |
@@ -225,9 +225,9 @@ discard block |
||
225 | 225 | |
226 | 226 | $rs = $modx->db->select('*', $modx->getFullTableName('manager_log'), (!empty($sqladd) ? implode(' AND ', $sqladd) : ''), 'timestamp DESC, id DESC', "{$int_cur_position}, {$int_num_result}"); |
227 | 227 | |
228 | -if ($limit < 1) { |
|
228 | +if ($limit < 1) { |
|
229 | 229 | echo '<p>' . $_lang["mgrlog_emptysrch"] . '</p>'; |
230 | -} else { |
|
230 | +} else { |
|
231 | 231 | echo '<p>' . $_lang["mgrlog_sortinst"] . '</p>'; |
232 | 232 | |
233 | 233 | include_once "paginate.inc.php"; |
@@ -246,14 +246,14 @@ discard block |
||
246 | 246 | $paging = $array_paging['first_link'] . $_lang["paging_first"] . (isset($array_paging['first_link']) ? "</a> " : " "); |
247 | 247 | $paging .= $array_paging['previous_link'] . $_lang["paging_prev"] . (isset($array_paging['previous_link']) ? "</a> " : " "); |
248 | 248 | $pagesfound = sizeof($array_row_paging); |
249 | - if ($pagesfound > 6) { |
|
249 | + if ($pagesfound > 6) { |
|
250 | 250 | $paging .= $array_row_paging[$current_row - 2]; // ." "; |
251 | 251 | $paging .= $array_row_paging[$current_row - 1]; // ." "; |
252 | 252 | $paging .= $array_row_paging[$current_row]; // ." "; |
253 | 253 | $paging .= $array_row_paging[$current_row + 1]; // ." "; |
254 | 254 | $paging .= $array_row_paging[$current_row + 2]; // ." "; |
255 | - } else { |
|
256 | - for ($i = 0; $i < $pagesfound; $i++) { |
|
255 | + } else { |
|
256 | + for ($i = 0; $i < $pagesfound; $i++) { |
|
257 | 257 | $paging .= $array_row_paging[$i] . " "; |
258 | 258 | } |
259 | 259 | } |
@@ -288,12 +288,12 @@ discard block |
||
288 | 288 | // grab the entire log file... |
289 | 289 | $logentries = array(); |
290 | 290 | $i = 0; |
291 | - while ($logentry = $modx->db->getRow($rs)) { |
|
292 | - if (!preg_match("/^[0-9]+$/", $logentry['itemid'])) { |
|
291 | + while ($logentry = $modx->db->getRow($rs)) { |
|
292 | + if (!preg_match("/^[0-9]+$/", $logentry['itemid'])) { |
|
293 | 293 | $item = '<div style="text-align:center;">-</div>'; |
294 | - } elseif ($logentry['action'] == 3 || $logentry['action'] == 27 || $logentry['action'] == 5) { |
|
294 | + } elseif ($logentry['action'] == 3 || $logentry['action'] == 27 || $logentry['action'] == 5) { |
|
295 | 295 | $item = '<a href="index.php?a=3&id=' . $logentry['itemid'] . '">' . $logentry['itemname'] . '</a>'; |
296 | - } else { |
|
296 | + } else { |
|
297 | 297 | $item = $logentry['itemname']; |
298 | 298 | } |
299 | 299 | //index.php?a=13&searchuser=' . $logentry['internalKey'] . '&action=' . $logentry['action'] . '&itemname=' . $logentry['itemname'] . '&log_submit=true' |
@@ -328,6 +328,6 @@ discard block |
||
328 | 328 | // @see index.php @ 915 |
329 | 329 | global $action; |
330 | 330 | $action = 1; |
331 | -} else { |
|
331 | +} else { |
|
332 | 332 | echo $_lang["mgrlog_noquery"]; |
333 | 333 | } |
@@ -4,18 +4,18 @@ |
||
4 | 4 | } |
5 | 5 | |
6 | 6 | switch ($modx->manager->action) { |
7 | - case 78: |
|
8 | - if (!$modx->hasPermission('edit_chunk')) { |
|
9 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
10 | - } |
|
11 | - break; |
|
12 | - case 77: |
|
13 | - if (!$modx->hasPermission('new_chunk')) { |
|
7 | + case 78: |
|
8 | + if (!$modx->hasPermission('edit_chunk')) { |
|
9 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
10 | + } |
|
11 | + break; |
|
12 | + case 77: |
|
13 | + if (!$modx->hasPermission('new_chunk')) { |
|
14 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
15 | + } |
|
16 | + break; |
|
17 | + default: |
|
14 | 18 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
15 | - } |
|
16 | - break; |
|
17 | - default: |
|
18 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
@@ -1,5 +1,5 @@ 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 | |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
19 | 19 | } |
20 | 20 | |
21 | -$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
|
21 | +$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
22 | 22 | |
23 | 23 | // Get table names (alphabetical) |
24 | 24 | $tbl_site_htmlsnippets = $modx->getFullTableName('site_htmlsnippets'); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $content['name'] = $_REQUEST['itemname']; |
48 | 48 | } else { |
49 | 49 | $_SESSION['itemname'] = $_lang["new_htmlsnippet"]; |
50 | - $content['category'] = (int)$_REQUEST['catid']; |
|
50 | + $content['category'] = (int) $_REQUEST['catid']; |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | if ($modx->manager->hasFormValues()) { |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | // Add lock-element JS-Script |
66 | 66 | $lockElementId = $id; |
67 | 67 | $lockElementType = 3; |
68 | -require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php'); |
|
68 | +require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php'); |
|
69 | 69 | |
70 | 70 | // Print RTE Javascript function |
71 | 71 | ?> |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | <input type="hidden" name="mode" value="<?= $modx->manager->action ?>" /> |
137 | 137 | |
138 | 138 | <h1> |
139 | - <i class="fa fa-th-large"></i><?= ($content['name'] ? $content['name'] . '<small>(' . $content['id'] . ')</small>' : $_lang['new_htmlsnippet']) ?><i class="fa fa-question-circle help"></i> |
|
139 | + <i class="fa fa-th-large"></i><?= ($content['name'] ? $content['name'].'<small>('.$content['id'].')</small>' : $_lang['new_htmlsnippet']) ?><i class="fa fa-question-circle help"></i> |
|
140 | 140 | </h1> |
141 | 141 | |
142 | 142 | <?= $_style['actionbuttons']['dynamic']['element'] ?> |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | <div class="form-control-name clearfix"> |
161 | 161 | <input name="name" type="text" maxlength="100" value="<?= $modx->htmlspecialchars($content['name']) ?>" class="form-control form-control-lg" onchange="documentDirty=true;" /> |
162 | 162 | <?php if ($modx->hasPermission('save_role')): ?> |
163 | - <label class="custom-control" title="<?= $_lang['lock_htmlsnippet'] . "\n" . $_lang['lock_htmlsnippet_msg'] ?>" tooltip> |
|
163 | + <label class="custom-control" title="<?= $_lang['lock_htmlsnippet']."\n".$_lang['lock_htmlsnippet_msg'] ?>" tooltip> |
|
164 | 164 | <input name="locked" type="checkbox" value="on"<?= ($content['locked'] == 1 || $content['locked'] == 'on' ? ' checked="checked"' : '') ?> /> |
165 | 165 | <i class="fa fa-lock"></i> |
166 | 166 | </label> |
@@ -184,9 +184,9 @@ discard block |
||
184 | 184 | <select name="categoryid" class="form-control" onchange="documentDirty=true;"> |
185 | 185 | <option> </option> |
186 | 186 | <?php |
187 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
187 | + include_once(MODX_MANAGER_PATH.'includes/categories.inc.php'); |
|
188 | 188 | foreach (getCategories() as $n => $v) { |
189 | - echo "\t\t\t\t" . '<option value="' . $v['id'] . '"' . ($content['category'] == $v['id'] || (empty($content['category']) && $_POST['categoryid'] == $v['id']) ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($v['category']) . "</option>\n"; |
|
189 | + echo "\t\t\t\t".'<option value="'.$v['id'].'"'.($content['category'] == $v['id'] || (empty($content['category']) && $_POST['categoryid'] == $v['id']) ? ' selected="selected"' : '').'>'.$modx->htmlspecialchars($v['category'])."</option>\n"; |
|
190 | 190 | } |
191 | 191 | ?> |
192 | 192 | </select> |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | </div> |
201 | 201 | <?php if ($_SESSION['mgrRole'] == 1): ?> |
202 | 202 | <div class="form-row"> |
203 | - <label><input name="disabled" type="checkbox" value="on"<?= ($content['disabled'] == 1 ? ' checked="checked"' : '') ?> /> <?= ($content['disabled'] == 1 ? "<span class='text-danger'>" . $_lang['disabled'] . "</span>" : $_lang['disabled']) ?></label> |
|
203 | + <label><input name="disabled" type="checkbox" value="on"<?= ($content['disabled'] == 1 ? ' checked="checked"' : '') ?> /> <?= ($content['disabled'] == 1 ? "<span class='text-danger'>".$_lang['disabled']."</span>" : $_lang['disabled']) ?></label> |
|
204 | 204 | </div> |
205 | 205 | <?php endif; ?> |
206 | 206 | </div> |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | $evtOut = $modx->invokeEvent('OnRichTextEditorRegister'); |
217 | 217 | if (is_array($evtOut)) { |
218 | 218 | foreach ($evtOut as $i => $editor) { |
219 | - echo "\t" . '<option value="' . $editor . '"' . ($which_editor == $editor ? ' selected="selected"' : '') . '>' . $editor . "</option>\n"; |
|
219 | + echo "\t".'<option value="'.$editor.'"'.($which_editor == $editor ? ' selected="selected"' : '').'>'.$editor."</option>\n"; |
|
220 | 220 | } |
221 | 221 | } |
222 | 222 | ?> |
@@ -1,5 +1,5 @@ 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 | if (!$modx->hasPermission('save_document')) { |
@@ -7,13 +7,13 @@ discard block |
||
7 | 7 | } |
8 | 8 | |
9 | 9 | if (isset($_REQUEST['id'])) { |
10 | - $id = (int)$_REQUEST['id']; |
|
10 | + $id = (int) $_REQUEST['id']; |
|
11 | 11 | } else { |
12 | 12 | $modx->webAlertAndQuit($_lang["error_no_id"]); |
13 | 13 | } |
14 | 14 | |
15 | 15 | // check permissions on the document |
16 | -include_once MODX_MANAGER_PATH . "processors/user_documents_permissions.class.php"; |
|
16 | +include_once MODX_MANAGER_PATH."processors/user_documents_permissions.class.php"; |
|
17 | 17 | $udperms = new udperms(); |
18 | 18 | $udperms->user = $modx->getLoginUserID(); |
19 | 19 | $udperms->document = $id; |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | }, |
40 | 40 | cancel: function() { |
41 | 41 | documentDirty = false; |
42 | - <?= ($id == 0 ? 'document.location.href="index.php?a=2";' : 'document.location.href="index.php?a=3&id=' . $id . '";') ?> |
|
42 | + <?= ($id == 0 ? 'document.location.href="index.php?a=2";' : 'document.location.href="index.php?a=3&id='.$id.'";') ?> |
|
43 | 43 | } |
44 | 44 | }; |
45 | 45 | |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | </script> |
81 | 81 | |
82 | 82 | <h1> |
83 | - <i class="fa fa-arrows"></i><?= ($pagetitle ? $pagetitle . '<small>(' . $id . ')</small>' : $_lang['move_resource_title']) ?> |
|
83 | + <i class="fa fa-arrows"></i><?= ($pagetitle ? $pagetitle.'<small>('.$id.')</small>' : $_lang['move_resource_title']) ?> |
|
84 | 84 | </h1> |
85 | 85 | |
86 | 86 | <?= $_style['actionbuttons']['dynamic']['save'] ?> |
@@ -4,18 +4,18 @@ |
||
4 | 4 | } |
5 | 5 | |
6 | 6 | switch((int) $modx->manager->action) { |
7 | - case 35: |
|
8 | - if(!$modx->hasPermission('edit_role')) { |
|
9 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
10 | - } |
|
11 | - break; |
|
12 | - case 38: |
|
13 | - if(!$modx->hasPermission('new_role')) { |
|
14 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
15 | - } |
|
16 | - break; |
|
17 | - default: |
|
18 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | + case 35: |
|
8 | + if(!$modx->hasPermission('edit_role')) { |
|
9 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
10 | + } |
|
11 | + break; |
|
12 | + case 38: |
|
13 | + if(!$modx->hasPermission('new_role')) { |
|
14 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
15 | + } |
|
16 | + break; |
|
17 | + default: |
|
18 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | $role = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
@@ -1,21 +1,21 @@ 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 | |
6 | 6 | switch((int) $modx->manager->action) { |
7 | - case 35: |
|
8 | - if(!$modx->hasPermission('edit_role')) { |
|
9 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
10 | - } |
|
11 | - break; |
|
12 | - case 38: |
|
13 | - if(!$modx->hasPermission('new_role')) { |
|
14 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
15 | - } |
|
16 | - break; |
|
17 | - default: |
|
18 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | + case 35: |
|
8 | + if(!$modx->hasPermission('edit_role')) { |
|
9 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
10 | + } |
|
11 | + break; |
|
12 | + case 38: |
|
13 | + if(!$modx->hasPermission('new_role')) { |
|
14 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
15 | + } |
|
16 | + break; |
|
17 | + default: |
|
18 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | $role = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | |
25 | 25 | // check to see the snippet editor isn't locked |
26 | 26 | if($lockedEl = $modx->elementIsLocked(8, $role)) { |
27 | - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['role'])); |
|
27 | + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['role'])); |
|
28 | 28 | } |
29 | 29 | // end check for lock |
30 | 30 | |
@@ -32,15 +32,15 @@ discard block |
||
32 | 32 | $modx->lockElement(8, $role); |
33 | 33 | |
34 | 34 | if($modx->manager->action == '35') { |
35 | - $rs = $modx->db->select('*', $tbl_user_roles, "id='{$role}'"); |
|
36 | - $roledata = $modx->db->getRow($rs); |
|
37 | - if(!$roledata) { |
|
38 | - $modx->webAlertAndQuit("No role returned!"); |
|
39 | - } |
|
40 | - $_SESSION['itemname'] = $roledata['name']; |
|
35 | + $rs = $modx->db->select('*', $tbl_user_roles, "id='{$role}'"); |
|
36 | + $roledata = $modx->db->getRow($rs); |
|
37 | + if(!$roledata) { |
|
38 | + $modx->webAlertAndQuit("No role returned!"); |
|
39 | + } |
|
40 | + $_SESSION['itemname'] = $roledata['name']; |
|
41 | 41 | } else { |
42 | - $roledata = 0; |
|
43 | - $_SESSION['itemname'] = $_lang["new_role"]; |
|
42 | + $roledata = 0; |
|
43 | + $_SESSION['itemname'] = $_lang["new_role"]; |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | // Add lock-element JS-Script |
@@ -107,63 +107,63 @@ discard block |
||
107 | 107 | <div class="form-group"> |
108 | 108 | <h3><?= $_lang['page_data_general'] ?></h3> |
109 | 109 | <?php |
110 | - echo render_form('frames', $_lang['role_frames'], 'disabled'); |
|
111 | - echo render_form('home', $_lang['role_home'], 'disabled'); |
|
112 | - echo render_form('messages', $_lang['role_messages']); |
|
113 | - echo render_form('logout', $_lang['role_logout'], 'disabled'); |
|
114 | - echo render_form('help', $_lang['role_help']); |
|
115 | - echo render_form('action_ok', $_lang['role_actionok'], 'disabled'); |
|
116 | - echo render_form('error_dialog', $_lang['role_errors'], 'disabled'); |
|
117 | - echo render_form('about', $_lang['role_about'], 'disabled'); |
|
118 | - echo render_form('credits', $_lang['role_credits'], 'disabled'); |
|
119 | - echo render_form('change_password', $_lang['role_change_password']); |
|
120 | - echo render_form('save_password', $_lang['role_save_password']); |
|
121 | - ?> |
|
110 | + echo render_form('frames', $_lang['role_frames'], 'disabled'); |
|
111 | + echo render_form('home', $_lang['role_home'], 'disabled'); |
|
112 | + echo render_form('messages', $_lang['role_messages']); |
|
113 | + echo render_form('logout', $_lang['role_logout'], 'disabled'); |
|
114 | + echo render_form('help', $_lang['role_help']); |
|
115 | + echo render_form('action_ok', $_lang['role_actionok'], 'disabled'); |
|
116 | + echo render_form('error_dialog', $_lang['role_errors'], 'disabled'); |
|
117 | + echo render_form('about', $_lang['role_about'], 'disabled'); |
|
118 | + echo render_form('credits', $_lang['role_credits'], 'disabled'); |
|
119 | + echo render_form('change_password', $_lang['role_change_password']); |
|
120 | + echo render_form('save_password', $_lang['role_save_password']); |
|
121 | + ?> |
|
122 | 122 | </div> |
123 | 123 | </div> |
124 | 124 | <div class="col-sm-6 col-lg-3"> |
125 | 125 | <div class="form-group"> |
126 | 126 | <h3><?= $_lang['role_content_management'] ?></h3> |
127 | 127 | <?php |
128 | - echo render_form('view_document', $_lang['role_view_docdata'], 'disabled'); |
|
129 | - echo render_form('new_document', $_lang['role_create_doc']); |
|
130 | - echo render_form('edit_document', $_lang['role_edit_doc']); |
|
131 | - echo render_form('change_resourcetype', $_lang['role_change_resourcetype']); |
|
132 | - echo render_form('save_document', $_lang['role_save_doc']); |
|
133 | - echo render_form('publish_document', $_lang['role_publish_doc']); |
|
134 | - echo render_form('delete_document', $_lang['role_delete_doc']); |
|
135 | - echo render_form('empty_trash', $_lang['role_empty_trash']); |
|
136 | - echo render_form('empty_cache', $_lang['role_cache_refresh']); |
|
137 | - echo render_form('view_unpublished', $_lang['role_view_unpublished']); |
|
138 | - ?> |
|
128 | + echo render_form('view_document', $_lang['role_view_docdata'], 'disabled'); |
|
129 | + echo render_form('new_document', $_lang['role_create_doc']); |
|
130 | + echo render_form('edit_document', $_lang['role_edit_doc']); |
|
131 | + echo render_form('change_resourcetype', $_lang['role_change_resourcetype']); |
|
132 | + echo render_form('save_document', $_lang['role_save_doc']); |
|
133 | + echo render_form('publish_document', $_lang['role_publish_doc']); |
|
134 | + echo render_form('delete_document', $_lang['role_delete_doc']); |
|
135 | + echo render_form('empty_trash', $_lang['role_empty_trash']); |
|
136 | + echo render_form('empty_cache', $_lang['role_cache_refresh']); |
|
137 | + echo render_form('view_unpublished', $_lang['role_view_unpublished']); |
|
138 | + ?> |
|
139 | 139 | </div> |
140 | 140 | </div> |
141 | 141 | <div class="col-sm-6 col-lg-3 form-group"> |
142 | 142 | <div class="form-group"> |
143 | 143 | <h3><?= $_lang['role_file_management'] ?></h3> |
144 | 144 | <?php |
145 | - echo render_form('file_manager', $_lang['role_file_manager']); |
|
146 | - echo render_form('assets_files', $_lang['role_assets_files']); |
|
147 | - echo render_form('assets_images', $_lang['role_assets_images']); |
|
148 | - ?> |
|
145 | + echo render_form('file_manager', $_lang['role_file_manager']); |
|
146 | + echo render_form('assets_files', $_lang['role_assets_files']); |
|
147 | + echo render_form('assets_images', $_lang['role_assets_images']); |
|
148 | + ?> |
|
149 | 149 | </div> |
150 | 150 | <div class="form-group"> |
151 | 151 | <h3><?= $_lang['category_management'] ?></h3> |
152 | 152 | <?php |
153 | - echo render_form('category_manager', $_lang['role_category_manager']); |
|
154 | - ?> |
|
153 | + echo render_form('category_manager', $_lang['role_category_manager']); |
|
154 | + ?> |
|
155 | 155 | </div> |
156 | 156 | </div> |
157 | 157 | <div class="col-sm-6 col-lg-3"> |
158 | 158 | <div class="form-group"> |
159 | 159 | <h3><?= $_lang['role_module_management'] ?></h3> |
160 | 160 | <?php |
161 | - echo render_form('new_module', $_lang['role_new_module']); |
|
162 | - echo render_form('edit_module', $_lang['role_edit_module']); |
|
163 | - echo render_form('save_module', $_lang['role_save_module']); |
|
164 | - echo render_form('delete_module', $_lang['role_delete_module']); |
|
165 | - echo render_form('exec_module', $_lang['role_run_module']); |
|
166 | - ?> |
|
161 | + echo render_form('new_module', $_lang['role_new_module']); |
|
162 | + echo render_form('edit_module', $_lang['role_edit_module']); |
|
163 | + echo render_form('save_module', $_lang['role_save_module']); |
|
164 | + echo render_form('delete_module', $_lang['role_delete_module']); |
|
165 | + echo render_form('exec_module', $_lang['role_run_module']); |
|
166 | + ?> |
|
167 | 167 | </div> |
168 | 168 | </div> |
169 | 169 | </div> |
@@ -173,44 +173,44 @@ discard block |
||
173 | 173 | <div class="form-group"> |
174 | 174 | <h3><?= $_lang['role_template_management'] ?></h3> |
175 | 175 | <?php |
176 | - echo render_form('new_template', $_lang['role_create_template']); |
|
177 | - echo render_form('edit_template', $_lang['role_edit_template']); |
|
178 | - echo render_form('save_template', $_lang['role_save_template']); |
|
179 | - echo render_form('delete_template', $_lang['role_delete_template']); |
|
180 | - ?> |
|
176 | + echo render_form('new_template', $_lang['role_create_template']); |
|
177 | + echo render_form('edit_template', $_lang['role_edit_template']); |
|
178 | + echo render_form('save_template', $_lang['role_save_template']); |
|
179 | + echo render_form('delete_template', $_lang['role_delete_template']); |
|
180 | + ?> |
|
181 | 181 | </div> |
182 | 182 | </div> |
183 | 183 | <div class="col-sm-6 col-lg-3"> |
184 | 184 | <div class="form-group"> |
185 | 185 | <h3><?= $_lang['role_snippet_management'] ?></h3> |
186 | 186 | <?php |
187 | - echo render_form('new_snippet', $_lang['role_create_snippet']); |
|
188 | - echo render_form('edit_snippet', $_lang['role_edit_snippet']); |
|
189 | - echo render_form('save_snippet', $_lang['role_save_snippet']); |
|
190 | - echo render_form('delete_snippet', $_lang['role_delete_snippet']); |
|
191 | - ?> |
|
187 | + echo render_form('new_snippet', $_lang['role_create_snippet']); |
|
188 | + echo render_form('edit_snippet', $_lang['role_edit_snippet']); |
|
189 | + echo render_form('save_snippet', $_lang['role_save_snippet']); |
|
190 | + echo render_form('delete_snippet', $_lang['role_delete_snippet']); |
|
191 | + ?> |
|
192 | 192 | </div> |
193 | 193 | </div> |
194 | 194 | <div class="col-sm-6 col-lg-3"> |
195 | 195 | <div class="form-group"> |
196 | 196 | <h3><?= $_lang['role_chunk_management'] ?></h3> |
197 | 197 | <?php |
198 | - echo render_form('new_chunk', $_lang['role_create_chunk']); |
|
199 | - echo render_form('edit_chunk', $_lang['role_edit_chunk']); |
|
200 | - echo render_form('save_chunk', $_lang['role_save_chunk']); |
|
201 | - echo render_form('delete_chunk', $_lang['role_delete_chunk']); |
|
202 | - ?> |
|
198 | + echo render_form('new_chunk', $_lang['role_create_chunk']); |
|
199 | + echo render_form('edit_chunk', $_lang['role_edit_chunk']); |
|
200 | + echo render_form('save_chunk', $_lang['role_save_chunk']); |
|
201 | + echo render_form('delete_chunk', $_lang['role_delete_chunk']); |
|
202 | + ?> |
|
203 | 203 | </div> |
204 | 204 | </div> |
205 | 205 | <div class="col-sm-6 col-lg-3"> |
206 | 206 | <div class="form-group"> |
207 | 207 | <h3><?= $_lang['role_plugin_management'] ?></h3> |
208 | 208 | <?php |
209 | - echo render_form('new_plugin', $_lang['role_create_plugin']); |
|
210 | - echo render_form('edit_plugin', $_lang['role_edit_plugin']); |
|
211 | - echo render_form('save_plugin', $_lang['role_save_plugin']); |
|
212 | - echo render_form('delete_plugin', $_lang['role_delete_plugin']); |
|
213 | - ?> |
|
209 | + echo render_form('new_plugin', $_lang['role_create_plugin']); |
|
210 | + echo render_form('edit_plugin', $_lang['role_edit_plugin']); |
|
211 | + echo render_form('save_plugin', $_lang['role_save_plugin']); |
|
212 | + echo render_form('delete_plugin', $_lang['role_delete_plugin']); |
|
213 | + ?> |
|
214 | 214 | </div> |
215 | 215 | </div> |
216 | 216 | </div> |
@@ -220,42 +220,42 @@ discard block |
||
220 | 220 | <div class="form-group"> |
221 | 221 | <h3><?= $_lang['role_user_management'] ?></h3> |
222 | 222 | <?php |
223 | - echo render_form('new_user', $_lang['role_new_user']); |
|
224 | - echo render_form('edit_user', $_lang['role_edit_user']); |
|
225 | - echo render_form('save_user', $_lang['role_save_user']); |
|
226 | - echo render_form('delete_user', $_lang['role_delete_user']); |
|
227 | - ?> |
|
223 | + echo render_form('new_user', $_lang['role_new_user']); |
|
224 | + echo render_form('edit_user', $_lang['role_edit_user']); |
|
225 | + echo render_form('save_user', $_lang['role_save_user']); |
|
226 | + echo render_form('delete_user', $_lang['role_delete_user']); |
|
227 | + ?> |
|
228 | 228 | </div> |
229 | 229 | </div> |
230 | 230 | <div class="col-sm-6 col-lg-3"> |
231 | 231 | <div class="form-group"> |
232 | 232 | <h3><?= $_lang['role_web_user_management'] ?></h3> |
233 | 233 | <?php |
234 | - echo render_form('new_web_user', $_lang['role_new_web_user']); |
|
235 | - echo render_form('edit_web_user', $_lang['role_edit_web_user']); |
|
236 | - echo render_form('save_web_user', $_lang['role_save_web_user']); |
|
237 | - echo render_form('delete_web_user', $_lang['role_delete_web_user']); |
|
238 | - ?> |
|
234 | + echo render_form('new_web_user', $_lang['role_new_web_user']); |
|
235 | + echo render_form('edit_web_user', $_lang['role_edit_web_user']); |
|
236 | + echo render_form('save_web_user', $_lang['role_save_web_user']); |
|
237 | + echo render_form('delete_web_user', $_lang['role_delete_web_user']); |
|
238 | + ?> |
|
239 | 239 | </div> |
240 | 240 | </div> |
241 | 241 | <div class="col-sm-6 col-lg-3"> |
242 | 242 | <div class="form-group"> |
243 | 243 | <h3><?= $_lang['role_udperms'] ?></h3> |
244 | 244 | <?php |
245 | - echo render_form('access_permissions', $_lang['role_access_persmissions']); |
|
246 | - echo render_form('web_access_permissions', $_lang['role_web_access_persmissions']); |
|
247 | - ?> |
|
245 | + echo render_form('access_permissions', $_lang['role_access_persmissions']); |
|
246 | + echo render_form('web_access_permissions', $_lang['role_web_access_persmissions']); |
|
247 | + ?> |
|
248 | 248 | </div> |
249 | 249 | </div> |
250 | 250 | <div class="col-sm-6 col-lg-3"> |
251 | 251 | <div class="form-group"> |
252 | 252 | <h3><?= $_lang['role_role_management'] ?></h3> |
253 | 253 | <?php |
254 | - echo render_form('new_role', $_lang['role_new_role']); |
|
255 | - echo render_form('edit_role', $_lang['role_edit_role']); |
|
256 | - echo render_form('save_role', $_lang['role_save_role']); |
|
257 | - echo render_form('delete_role', $_lang['role_delete_role']); |
|
258 | - ?> |
|
254 | + echo render_form('new_role', $_lang['role_new_role']); |
|
255 | + echo render_form('edit_role', $_lang['role_edit_role']); |
|
256 | + echo render_form('save_role', $_lang['role_save_role']); |
|
257 | + echo render_form('delete_role', $_lang['role_delete_role']); |
|
258 | + ?> |
|
259 | 259 | </div> |
260 | 260 | </div> |
261 | 261 | </div> |
@@ -265,23 +265,23 @@ discard block |
||
265 | 265 | <div class="form-group"> |
266 | 266 | <h3><?= $_lang['role_eventlog_management'] ?></h3> |
267 | 267 | <?php |
268 | - echo render_form('view_eventlog', $_lang['role_view_eventlog']); |
|
269 | - echo render_form('delete_eventlog', $_lang['role_delete_eventlog']); |
|
270 | - ?> |
|
268 | + echo render_form('view_eventlog', $_lang['role_view_eventlog']); |
|
269 | + echo render_form('delete_eventlog', $_lang['role_delete_eventlog']); |
|
270 | + ?> |
|
271 | 271 | </div> |
272 | 272 | </div> |
273 | 273 | <div class="col-sm-6 col-lg-3"> |
274 | 274 | <div class="form-group"> |
275 | 275 | <h3><?= $_lang['role_config_management'] ?></h3> |
276 | 276 | <?php |
277 | - echo render_form('logs', $_lang['role_view_logs']); |
|
278 | - echo render_form('settings', $_lang['role_edit_settings']); |
|
279 | - echo render_form('bk_manager', $_lang['role_bk_manager']); |
|
280 | - echo render_form('import_static', $_lang['role_import_static']); |
|
281 | - echo render_form('export_static', $_lang['role_export_static']); |
|
282 | - echo render_form('remove_locks', $_lang['role_remove_locks']); |
|
283 | - echo render_form('display_locks', $_lang['role_display_locks']); |
|
284 | - ?> |
|
277 | + echo render_form('logs', $_lang['role_view_logs']); |
|
278 | + echo render_form('settings', $_lang['role_edit_settings']); |
|
279 | + echo render_form('bk_manager', $_lang['role_bk_manager']); |
|
280 | + echo render_form('import_static', $_lang['role_import_static']); |
|
281 | + echo render_form('export_static', $_lang['role_export_static']); |
|
282 | + echo render_form('remove_locks', $_lang['role_remove_locks']); |
|
283 | + echo render_form('display_locks', $_lang['role_display_locks']); |
|
284 | + ?> |
|
285 | 285 | </div> |
286 | 286 | </div> |
287 | 287 | </div> |
@@ -300,32 +300,32 @@ discard block |
||
300 | 300 | * @return string |
301 | 301 | */ |
302 | 302 | function render_form($name, $label, $status = '') { |
303 | - $modx = evolutionCMS(); global $roledata; |
|
303 | + $modx = evolutionCMS(); global $roledata; |
|
304 | 304 | |
305 | - $tpl = '<label class="d-block" for="[+name+]check"> |
|
305 | + $tpl = '<label class="d-block" for="[+name+]check"> |
|
306 | 306 | <input name="[+name+]check" id="[+name+]check" class="click" type="checkbox" onchange="changestate(document.userform.[+name+])" [+checked+] [+status+]> |
307 | 307 | <input type="hidden" class="[+set+]" name="[+name+]" value="[+value+]"> |
308 | 308 | [+label+] |
309 | 309 | </label>'; |
310 | 310 | |
311 | - $checked = ($roledata[$name] == 1) ? 'checked' : ''; |
|
312 | - $value = ($roledata[$name] == 1) ? 1 : 0; |
|
313 | - if($status == 'disabled') { |
|
314 | - $checked = 'checked'; |
|
315 | - $value = 1; |
|
316 | - $set = 'fix'; |
|
317 | - } else { |
|
318 | - $set = 'set'; |
|
319 | - } |
|
311 | + $checked = ($roledata[$name] == 1) ? 'checked' : ''; |
|
312 | + $value = ($roledata[$name] == 1) ? 1 : 0; |
|
313 | + if($status == 'disabled') { |
|
314 | + $checked = 'checked'; |
|
315 | + $value = 1; |
|
316 | + $set = 'fix'; |
|
317 | + } else { |
|
318 | + $set = 'set'; |
|
319 | + } |
|
320 | 320 | |
321 | - $ph = array( |
|
322 | - 'name' => $name, |
|
323 | - 'checked' => $checked, |
|
324 | - 'status' => $status, |
|
325 | - 'value' => $value, |
|
326 | - 'label' => $label, |
|
327 | - 'set' => $set |
|
328 | - ); |
|
321 | + $ph = array( |
|
322 | + 'name' => $name, |
|
323 | + 'checked' => $checked, |
|
324 | + 'status' => $status, |
|
325 | + 'value' => $value, |
|
326 | + 'label' => $label, |
|
327 | + 'set' => $set |
|
328 | + ); |
|
329 | 329 | |
330 | - return $modx->parseText($tpl, $ph); |
|
330 | + return $modx->parseText($tpl, $ph); |
|
331 | 331 | } |
@@ -1,16 +1,16 @@ 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 | |
6 | -switch((int) $modx->manager->action) { |
|
6 | +switch ((int) $modx->manager->action) { |
|
7 | 7 | case 35: |
8 | - if(!$modx->hasPermission('edit_role')) { |
|
8 | + if (!$modx->hasPermission('edit_role')) { |
|
9 | 9 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
10 | 10 | } |
11 | 11 | break; |
12 | 12 | case 38: |
13 | - if(!$modx->hasPermission('new_role')) { |
|
13 | + if (!$modx->hasPermission('new_role')) { |
|
14 | 14 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
15 | 15 | } |
16 | 16 | break; |
@@ -18,12 +18,12 @@ discard block |
||
18 | 18 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
19 | 19 | } |
20 | 20 | |
21 | -$role = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
|
21 | +$role = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
22 | 22 | |
23 | 23 | $tbl_user_roles = $modx->getFullTableName('user_roles'); |
24 | 24 | |
25 | 25 | // check to see the snippet editor isn't locked |
26 | -if($lockedEl = $modx->elementIsLocked(8, $role)) { |
|
26 | +if ($lockedEl = $modx->elementIsLocked(8, $role)) { |
|
27 | 27 | $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['role'])); |
28 | 28 | } |
29 | 29 | // end check for lock |
@@ -31,10 +31,10 @@ discard block |
||
31 | 31 | // Lock snippet for other users to edit |
32 | 32 | $modx->lockElement(8, $role); |
33 | 33 | |
34 | -if($modx->manager->action == '35') { |
|
34 | +if ($modx->manager->action == '35') { |
|
35 | 35 | $rs = $modx->db->select('*', $tbl_user_roles, "id='{$role}'"); |
36 | 36 | $roledata = $modx->db->getRow($rs); |
37 | - if(!$roledata) { |
|
37 | + if (!$roledata) { |
|
38 | 38 | $modx->webAlertAndQuit("No role returned!"); |
39 | 39 | } |
40 | 40 | $_SESSION['itemname'] = $roledata['name']; |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | // Add lock-element JS-Script |
47 | 47 | $lockElementId = $role; |
48 | 48 | $lockElementType = 8; |
49 | -require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php'); |
|
49 | +require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php'); |
|
50 | 50 | ?> |
51 | 51 | <script type="text/javascript"> |
52 | 52 | function changestate(element) { |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | <input type="hidden" name="id" value="<?= $_GET['id'] ?>"> |
83 | 83 | |
84 | 84 | <h1> |
85 | - <i class="fa fa-legal"></i><?= ($roledata['name'] ? $roledata['name'] . '<small>(' . $roledata['id'] . ')</small>' : $_lang['role_title']) ?> |
|
85 | + <i class="fa fa-legal"></i><?= ($roledata['name'] ? $roledata['name'].'<small>('.$roledata['id'].')</small>' : $_lang['role_title']) ?> |
|
86 | 86 | </h1> |
87 | 87 | |
88 | 88 | <?= $_style['actionbuttons']['dynamic']['savedelete'] ?> |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | * @param string $status |
300 | 300 | * @return string |
301 | 301 | */ |
302 | -function render_form($name, $label, $status = '') { |
|
302 | +function render_form($name, $label, $status = ''){ |
|
303 | 303 | $modx = evolutionCMS(); global $roledata; |
304 | 304 | |
305 | 305 | $tpl = '<label class="d-block" for="[+name+]check"> |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | |
311 | 311 | $checked = ($roledata[$name] == 1) ? 'checked' : ''; |
312 | 312 | $value = ($roledata[$name] == 1) ? 1 : 0; |
313 | - if($status == 'disabled') { |
|
313 | + if ($status == 'disabled') { |
|
314 | 314 | $checked = 'checked'; |
315 | 315 | $value = 1; |
316 | 316 | $set = 'fix'; |
@@ -299,7 +299,8 @@ |
||
299 | 299 | * @param string $status |
300 | 300 | * @return string |
301 | 301 | */ |
302 | -function render_form($name, $label, $status = '') { |
|
302 | +function render_form($name, $label, $status = '') |
|
303 | +{ |
|
303 | 304 | $modx = evolutionCMS(); global $roledata; |
304 | 305 | |
305 | 306 | $tpl = '<label class="d-block" for="[+name+]check"> |
@@ -1,12 +1,12 @@ 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 | if (!$modx->hasPermission('save_template')) { |
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
9 | -$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
|
9 | +$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
10 | 10 | $reset = isset($_POST['reset']) && $_POST['reset'] == 'true' ? 1 : 0; |
11 | 11 | |
12 | 12 | $tbl_site_templates = $modx->getFullTableName('site_templates'); |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | $templatename = ''; |
20 | 20 | |
21 | 21 | if (isset($_POST['listSubmitted'])) { |
22 | - $updateMsg .= '<div class="text-success" id="updated">' . $_lang['sort_updated'] . '</div>'; |
|
22 | + $updateMsg .= '<div class="text-success" id="updated">'.$_lang['sort_updated'].'</div>'; |
|
23 | 23 | foreach ($_POST as $listName => $listValue) { |
24 | 24 | if ($listName == 'listSubmitted' || $listName == 'reset') { |
25 | 25 | continue; |
@@ -47,11 +47,11 @@ discard block |
||
47 | 47 | while ($row = $modx->db->getRow($rs)) { |
48 | 48 | $templatename = $row['templatename']; |
49 | 49 | $caption = $row['caption'] != '' ? $row['caption'] : $row['name']; |
50 | - $sortableList .= '<li id="item_' . $row['id'] . '"><i class="fa fa-list-alt"></i> ' . $caption . ' <small class="protectedNode" style="float:right">[*' . $row['name'] . '*]</small></li>'; |
|
50 | + $sortableList .= '<li id="item_'.$row['id'].'"><i class="fa fa-list-alt"></i> '.$caption.' <small class="protectedNode" style="float:right">[*'.$row['name'].'*]</small></li>'; |
|
51 | 51 | } |
52 | 52 | $sortableList .= '</ul></div>'; |
53 | 53 | } else { |
54 | - $updateMsg = '<p class="text-danger">' . $_lang['tmplvars_novars'] . '</p>'; |
|
54 | + $updateMsg = '<p class="text-danger">'.$_lang['tmplvars_novars'].'</p>'; |
|
55 | 55 | } |
56 | 56 | ?> |
57 | 57 | |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | </script> |
129 | 129 | |
130 | 130 | <h1> |
131 | - <i class="fa fa-sort-numeric-asc"></i><?= ($templatename ? $templatename . '<small>(' . $id . ')</small>' : $_lang['template_tv_edit_title']) ?> |
|
131 | + <i class="fa fa-sort-numeric-asc"></i><?= ($templatename ? $templatename.'<small>('.$id.')</small>' : $_lang['template_tv_edit_title']) ?> |
|
132 | 132 | </h1> |
133 | 133 | |
134 | 134 | <?= $_style['actionbuttons']['dynamic']['save'] ?> |
@@ -1,21 +1,21 @@ 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 | |
6 | 6 | switch($modx->manager->action) { |
7 | - case 16: |
|
8 | - if(!$modx->hasPermission('edit_template')) { |
|
9 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
10 | - } |
|
11 | - break; |
|
12 | - case 19: |
|
13 | - if(!$modx->hasPermission('new_template')) { |
|
14 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
15 | - } |
|
16 | - break; |
|
17 | - default: |
|
18 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | + case 16: |
|
8 | + if(!$modx->hasPermission('edit_template')) { |
|
9 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
10 | + } |
|
11 | + break; |
|
12 | + case 19: |
|
13 | + if(!$modx->hasPermission('new_template')) { |
|
14 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
15 | + } |
|
16 | + break; |
|
17 | + default: |
|
18 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | |
25 | 25 | // check to see the snippet editor isn't locked |
26 | 26 | if($lockedEl = $modx->elementIsLocked(1, $id)) { |
27 | - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['template'])); |
|
27 | + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['template'])); |
|
28 | 28 | } |
29 | 29 | // end check for lock |
30 | 30 | |
@@ -33,23 +33,23 @@ discard block |
||
33 | 33 | |
34 | 34 | $content = array(); |
35 | 35 | if(!empty($id)) { |
36 | - $rs = $modx->db->select('*', $tbl_site_templates, "id='{$id}'"); |
|
37 | - $content = $modx->db->getRow($rs); |
|
38 | - if(!$content) { |
|
39 | - $modx->webAlertAndQuit("No database record has been found for this template."); |
|
40 | - } |
|
41 | - |
|
42 | - $_SESSION['itemname'] = $content['templatename']; |
|
43 | - if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { |
|
44 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
45 | - } |
|
36 | + $rs = $modx->db->select('*', $tbl_site_templates, "id='{$id}'"); |
|
37 | + $content = $modx->db->getRow($rs); |
|
38 | + if(!$content) { |
|
39 | + $modx->webAlertAndQuit("No database record has been found for this template."); |
|
40 | + } |
|
41 | + |
|
42 | + $_SESSION['itemname'] = $content['templatename']; |
|
43 | + if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { |
|
44 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
45 | + } |
|
46 | 46 | } else { |
47 | - $_SESSION['itemname'] = $_lang["new_template"]; |
|
48 | - $content['category'] = (int)$_REQUEST['catid']; |
|
47 | + $_SESSION['itemname'] = $_lang["new_template"]; |
|
48 | + $content['category'] = (int)$_REQUEST['catid']; |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | if($modx->manager->hasFormValues()) { |
52 | - $modx->manager->loadFormValues(); |
|
52 | + $modx->manager->loadFormValues(); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | $content = array_merge($content, $_POST); |
@@ -98,12 +98,12 @@ discard block |
||
98 | 98 | |
99 | 99 | <form name="mutate" method="post" action="index.php"> |
100 | 100 | <?php |
101 | - // invoke OnTempFormPrerender event |
|
102 | - $evtOut = $modx->invokeEvent("OnTempFormPrerender", array("id" => $id)); |
|
103 | - if(is_array($evtOut)) { |
|
104 | - echo implode("", $evtOut); |
|
105 | - } |
|
106 | - ?> |
|
101 | + // invoke OnTempFormPrerender event |
|
102 | + $evtOut = $modx->invokeEvent("OnTempFormPrerender", array("id" => $id)); |
|
103 | + if(is_array($evtOut)) { |
|
104 | + echo implode("", $evtOut); |
|
105 | + } |
|
106 | + ?> |
|
107 | 107 | <input type="hidden" name="a" value="20"> |
108 | 108 | <input type="hidden" name="id" value="<?= $_REQUEST['id'] ?>"> |
109 | 109 | <input type="hidden" name="mode" value="<?= $modx->manager->action ?>"> |
@@ -133,8 +133,8 @@ discard block |
||
133 | 133 | <label class="col-md-3 col-lg-2"> |
134 | 134 | <?= $_lang['template_name'] ?> |
135 | 135 | <?php if($id == $modx->config['default_template']) { |
136 | - echo '<small class="form-text text-danger">' . mb_strtolower(rtrim($_lang['defaulttemplate_title'], ':'), $modx_manager_charset) . '</small>'; |
|
137 | - } ?> |
|
136 | + echo '<small class="form-text text-danger">' . mb_strtolower(rtrim($_lang['defaulttemplate_title'], ':'), $modx_manager_charset) . '</small>'; |
|
137 | + } ?> |
|
138 | 138 | </label> |
139 | 139 | <div class="col-md-9 col-lg-10"> |
140 | 140 | <div class="form-control-name clearfix"> |
@@ -162,11 +162,11 @@ discard block |
||
162 | 162 | <select name="categoryid" class="form-control" onchange="documentDirty=true;"> |
163 | 163 | <option> </option> |
164 | 164 | <?php |
165 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
166 | - foreach(getCategories() as $n => $v) { |
|
167 | - echo "<option value='" . $v['id'] . "'" . ($content["category"] == $v["id"] ? " selected='selected'" : "") . ">" . $modx->htmlspecialchars($v["category"]) . "</option>"; |
|
168 | - } |
|
169 | - ?> |
|
165 | + include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
166 | + foreach(getCategories() as $n => $v) { |
|
167 | + echo "<option value='" . $v['id'] . "'" . ($content["category"] == $v["id"] ? " selected='selected'" : "") . ">" . $modx->htmlspecialchars($v["category"]) . "</option>"; |
|
168 | + } |
|
169 | + ?> |
|
170 | 170 | </select> |
171 | 171 | </div> |
172 | 172 | </div> |
@@ -197,38 +197,38 @@ discard block |
||
197 | 197 | <input type="submit" name="save" style="display:none"> |
198 | 198 | |
199 | 199 | <?php |
200 | - $selectedTvs = array(); |
|
201 | - if(!isset($_POST['assignedTv'])) { |
|
202 | - $rs = $modx->db->select(sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category", $_lang['no_category']), sprintf("%s tv |
|
200 | + $selectedTvs = array(); |
|
201 | + if(!isset($_POST['assignedTv'])) { |
|
202 | + $rs = $modx->db->select(sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category", $_lang['no_category']), sprintf("%s tv |
|
203 | 203 | LEFT JOIN %s tr ON tv.id=tr.tmplvarid |
204 | 204 | LEFT JOIN %s cat ON tv.category=cat.id", $modx->getFullTableName('site_tmplvars'), $modx->getFullTableName('site_tmplvar_templates'), $modx->getFullTableName('categories')), "templateid='{$id}'", "tr.rank DESC, tv.rank DESC, tvcaption DESC, tvid DESC" // workaround for correct sort of none-existing ranks |
205 | - ); |
|
206 | - while($row = $modx->db->getRow($rs)) { |
|
207 | - $selectedTvs[$row['tvid']] = $row; |
|
208 | - } |
|
209 | - $selectedTvs = array_reverse($selectedTvs, true); // reverse ORDERBY DESC |
|
210 | - } |
|
211 | - |
|
212 | - $unselectedTvs = array(); |
|
213 | - $rs = $modx->db->select(sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category, cat.id as catid", $_lang['no_category']), sprintf("%s tv |
|
205 | + ); |
|
206 | + while($row = $modx->db->getRow($rs)) { |
|
207 | + $selectedTvs[$row['tvid']] = $row; |
|
208 | + } |
|
209 | + $selectedTvs = array_reverse($selectedTvs, true); // reverse ORDERBY DESC |
|
210 | + } |
|
211 | + |
|
212 | + $unselectedTvs = array(); |
|
213 | + $rs = $modx->db->select(sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category, cat.id as catid", $_lang['no_category']), sprintf("%s tv |
|
214 | 214 | LEFT JOIN %s tr ON tv.id=tr.tmplvarid |
215 | 215 | LEFT JOIN %s cat ON tv.category=cat.id", $modx->getFullTableName('site_tmplvars'), $modx->getFullTableName('site_tmplvar_templates'), $modx->getFullTableName('categories')), "", "category, tvcaption"); |
216 | - while($row = $modx->db->getRow($rs)) { |
|
217 | - $unselectedTvs[$row['tvid']] = $row; |
|
218 | - } |
|
219 | - |
|
220 | - // Catch checkboxes if form not validated |
|
221 | - if(isset($_POST['assignedTv'])) { |
|
222 | - $selectedTvs = array(); |
|
223 | - foreach($_POST['assignedTv'] as $tvid) { |
|
224 | - if(isset($unselectedTvs[$tvid])) { |
|
225 | - $selectedTvs[$tvid] = $unselectedTvs[$tvid]; |
|
226 | - } |
|
227 | - }; |
|
228 | - } |
|
229 | - |
|
230 | - $total = count($selectedTvs); |
|
231 | - ?> |
|
216 | + while($row = $modx->db->getRow($rs)) { |
|
217 | + $unselectedTvs[$row['tvid']] = $row; |
|
218 | + } |
|
219 | + |
|
220 | + // Catch checkboxes if form not validated |
|
221 | + if(isset($_POST['assignedTv'])) { |
|
222 | + $selectedTvs = array(); |
|
223 | + foreach($_POST['assignedTv'] as $tvid) { |
|
224 | + if(isset($unselectedTvs[$tvid])) { |
|
225 | + $selectedTvs[$tvid] = $unselectedTvs[$tvid]; |
|
226 | + } |
|
227 | + }; |
|
228 | + } |
|
229 | + |
|
230 | + $total = count($selectedTvs); |
|
231 | + ?> |
|
232 | 232 | </div> |
233 | 233 | |
234 | 234 | <div class="tab-page" id="tabAssignedTVs"> |
@@ -238,65 +238,65 @@ discard block |
||
238 | 238 | |
239 | 239 | <div class="container container-body"> |
240 | 240 | <?php |
241 | - if($total > 0) { |
|
242 | - echo '<p>' . $_lang['template_tv_msg'] . '</p>'; |
|
243 | - } |
|
244 | - if($modx->hasPermission('save_template') && $total > 1 && $id) { |
|
245 | - echo sprintf('<div class="form-group"><a class="btn btn-primary" href="index.php?a=117&id=%s">%s</a></div>', $id, $_lang['template_tv_edit']); |
|
246 | - } |
|
247 | - |
|
248 | - // Selected TVs |
|
249 | - $tvList = ''; |
|
250 | - if($total > 0) { |
|
251 | - $tvList .= '<ul>'; |
|
252 | - foreach($selectedTvs as $row) { |
|
253 | - $desc = !empty($row['tvdescription']) ? ' <small>(' . $row['tvdescription'] . ')</small>' : ''; |
|
254 | - $locked = $row['tvlocked'] ? ' <em>(' . $_lang['locked'] . ')</em>' : ""; |
|
255 | - $tvList .= sprintf('<li><label><input name="assignedTv[]" value="%s" type="checkbox" checked="checked" onchange="documentDirty=true;jQuery(\'#tvsDirty\').val(\'1\');"> %s <small>(%s)</small> - %s%s</label>%s <a href="index.php?id=%s&a=301&or=%s&oid=%s">%s</a></li>', $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->manager->action, $id, $_lang['edit']); |
|
256 | - } |
|
257 | - $tvList .= '</ul>'; |
|
258 | - |
|
259 | - } else { |
|
260 | - echo $_lang['template_no_tv']; |
|
261 | - } |
|
262 | - echo $tvList; |
|
263 | - |
|
264 | - // Unselected TVs |
|
265 | - $tvList = '<hr/><p>' . $_lang['template_notassigned_tv'] . '</p><ul>'; |
|
266 | - $preCat = ''; |
|
267 | - $insideUl = 0; |
|
268 | - while($row = array_shift($unselectedTvs)) { |
|
269 | - if(isset($selectedTvs[$row['tvid']])) { |
|
270 | - continue; |
|
271 | - } // Skip selected |
|
272 | - $row['category'] = stripslashes($row['category']); //pixelchutes |
|
273 | - if($preCat !== $row['category']) { |
|
274 | - $tvList .= $insideUl ? '</ul>' : ''; |
|
275 | - $tvList .= '<li><strong>' . $row['category'] . ($row['catid'] != '' ? ' <small>(' . $row['catid'] . ')</small>' : '') . '</strong><ul>'; |
|
276 | - $insideUl = 1; |
|
277 | - } |
|
278 | - |
|
279 | - $desc = !empty($row['tvdescription']) ? ' <small>(' . $row['tvdescription'] . ')</small>' : ''; |
|
280 | - $locked = $row['tvlocked'] ? ' <em>(' . $_lang['locked'] . ')</em>' : ""; |
|
281 | - $tvList .= sprintf('<li><label><input name="assignedTv[]" value="%s" type="checkbox" onchange="documentDirty=true;jQuery(\'#tvsDirty\').val(\'1\');"> %s <small>(%s)</small> - %s%s</label>%s <a href="index.php?id=%s&a=301&or=%s&oid=%s">%s</a></li>', $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->manager->action, $id, $_lang['edit']); |
|
282 | - $tvList .= '</li>'; |
|
283 | - |
|
284 | - $preCat = $row['category']; |
|
285 | - } |
|
286 | - $tvList .= $insideUl ? '</ul>' : ''; |
|
287 | - $tvList .= '</ul>'; |
|
288 | - echo $tvList; |
|
289 | - |
|
290 | - ?> |
|
241 | + if($total > 0) { |
|
242 | + echo '<p>' . $_lang['template_tv_msg'] . '</p>'; |
|
243 | + } |
|
244 | + if($modx->hasPermission('save_template') && $total > 1 && $id) { |
|
245 | + echo sprintf('<div class="form-group"><a class="btn btn-primary" href="index.php?a=117&id=%s">%s</a></div>', $id, $_lang['template_tv_edit']); |
|
246 | + } |
|
247 | + |
|
248 | + // Selected TVs |
|
249 | + $tvList = ''; |
|
250 | + if($total > 0) { |
|
251 | + $tvList .= '<ul>'; |
|
252 | + foreach($selectedTvs as $row) { |
|
253 | + $desc = !empty($row['tvdescription']) ? ' <small>(' . $row['tvdescription'] . ')</small>' : ''; |
|
254 | + $locked = $row['tvlocked'] ? ' <em>(' . $_lang['locked'] . ')</em>' : ""; |
|
255 | + $tvList .= sprintf('<li><label><input name="assignedTv[]" value="%s" type="checkbox" checked="checked" onchange="documentDirty=true;jQuery(\'#tvsDirty\').val(\'1\');"> %s <small>(%s)</small> - %s%s</label>%s <a href="index.php?id=%s&a=301&or=%s&oid=%s">%s</a></li>', $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->manager->action, $id, $_lang['edit']); |
|
256 | + } |
|
257 | + $tvList .= '</ul>'; |
|
258 | + |
|
259 | + } else { |
|
260 | + echo $_lang['template_no_tv']; |
|
261 | + } |
|
262 | + echo $tvList; |
|
263 | + |
|
264 | + // Unselected TVs |
|
265 | + $tvList = '<hr/><p>' . $_lang['template_notassigned_tv'] . '</p><ul>'; |
|
266 | + $preCat = ''; |
|
267 | + $insideUl = 0; |
|
268 | + while($row = array_shift($unselectedTvs)) { |
|
269 | + if(isset($selectedTvs[$row['tvid']])) { |
|
270 | + continue; |
|
271 | + } // Skip selected |
|
272 | + $row['category'] = stripslashes($row['category']); //pixelchutes |
|
273 | + if($preCat !== $row['category']) { |
|
274 | + $tvList .= $insideUl ? '</ul>' : ''; |
|
275 | + $tvList .= '<li><strong>' . $row['category'] . ($row['catid'] != '' ? ' <small>(' . $row['catid'] . ')</small>' : '') . '</strong><ul>'; |
|
276 | + $insideUl = 1; |
|
277 | + } |
|
278 | + |
|
279 | + $desc = !empty($row['tvdescription']) ? ' <small>(' . $row['tvdescription'] . ')</small>' : ''; |
|
280 | + $locked = $row['tvlocked'] ? ' <em>(' . $_lang['locked'] . ')</em>' : ""; |
|
281 | + $tvList .= sprintf('<li><label><input name="assignedTv[]" value="%s" type="checkbox" onchange="documentDirty=true;jQuery(\'#tvsDirty\').val(\'1\');"> %s <small>(%s)</small> - %s%s</label>%s <a href="index.php?id=%s&a=301&or=%s&oid=%s">%s</a></li>', $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->manager->action, $id, $_lang['edit']); |
|
282 | + $tvList .= '</li>'; |
|
283 | + |
|
284 | + $preCat = $row['category']; |
|
285 | + } |
|
286 | + $tvList .= $insideUl ? '</ul>' : ''; |
|
287 | + $tvList .= '</ul>'; |
|
288 | + echo $tvList; |
|
289 | + |
|
290 | + ?> |
|
291 | 291 | </div> |
292 | 292 | </div> |
293 | 293 | |
294 | 294 | <?php |
295 | - // invoke OnTempFormRender event |
|
296 | - $evtOut = $modx->invokeEvent("OnTempFormRender", array("id" => $id)); |
|
297 | - if(is_array($evtOut)) { |
|
298 | - echo implode("", $evtOut); |
|
299 | - } |
|
300 | - ?> |
|
295 | + // invoke OnTempFormRender event |
|
296 | + $evtOut = $modx->invokeEvent("OnTempFormRender", array("id" => $id)); |
|
297 | + if(is_array($evtOut)) { |
|
298 | + echo implode("", $evtOut); |
|
299 | + } |
|
300 | + ?> |
|
301 | 301 | </div> |
302 | 302 | </form> |
@@ -4,18 +4,18 @@ |
||
4 | 4 | } |
5 | 5 | |
6 | 6 | switch($modx->manager->action) { |
7 | - case 16: |
|
8 | - if(!$modx->hasPermission('edit_template')) { |
|
9 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
10 | - } |
|
11 | - break; |
|
12 | - case 19: |
|
13 | - if(!$modx->hasPermission('new_template')) { |
|
14 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
15 | - } |
|
16 | - break; |
|
17 | - default: |
|
18 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | + case 16: |
|
8 | + if(!$modx->hasPermission('edit_template')) { |
|
9 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
10 | + } |
|
11 | + break; |
|
12 | + case 19: |
|
13 | + if(!$modx->hasPermission('new_template')) { |
|
14 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
15 | + } |
|
16 | + break; |
|
17 | + default: |
|
18 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
@@ -1,16 +1,16 @@ 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 | |
6 | -switch($modx->manager->action) { |
|
6 | +switch ($modx->manager->action) { |
|
7 | 7 | case 16: |
8 | - if(!$modx->hasPermission('edit_template')) { |
|
8 | + if (!$modx->hasPermission('edit_template')) { |
|
9 | 9 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
10 | 10 | } |
11 | 11 | break; |
12 | 12 | case 19: |
13 | - if(!$modx->hasPermission('new_template')) { |
|
13 | + if (!$modx->hasPermission('new_template')) { |
|
14 | 14 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
15 | 15 | } |
16 | 16 | break; |
@@ -18,12 +18,12 @@ discard block |
||
18 | 18 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
19 | 19 | } |
20 | 20 | |
21 | -$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
|
21 | +$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
22 | 22 | |
23 | 23 | $tbl_site_templates = $modx->getFullTableName('site_templates'); |
24 | 24 | |
25 | 25 | // check to see the snippet editor isn't locked |
26 | -if($lockedEl = $modx->elementIsLocked(1, $id)) { |
|
26 | +if ($lockedEl = $modx->elementIsLocked(1, $id)) { |
|
27 | 27 | $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['template'])); |
28 | 28 | } |
29 | 29 | // end check for lock |
@@ -32,23 +32,23 @@ discard block |
||
32 | 32 | $modx->lockElement(1, $id); |
33 | 33 | |
34 | 34 | $content = array(); |
35 | -if(!empty($id)) { |
|
35 | +if (!empty($id)) { |
|
36 | 36 | $rs = $modx->db->select('*', $tbl_site_templates, "id='{$id}'"); |
37 | 37 | $content = $modx->db->getRow($rs); |
38 | - if(!$content) { |
|
38 | + if (!$content) { |
|
39 | 39 | $modx->webAlertAndQuit("No database record has been found for this template."); |
40 | 40 | } |
41 | 41 | |
42 | 42 | $_SESSION['itemname'] = $content['templatename']; |
43 | - if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { |
|
43 | + if ($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { |
|
44 | 44 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
45 | 45 | } |
46 | 46 | } else { |
47 | 47 | $_SESSION['itemname'] = $_lang["new_template"]; |
48 | - $content['category'] = (int)$_REQUEST['catid']; |
|
48 | + $content['category'] = (int) $_REQUEST['catid']; |
|
49 | 49 | } |
50 | 50 | |
51 | -if($modx->manager->hasFormValues()) { |
|
51 | +if ($modx->manager->hasFormValues()) { |
|
52 | 52 | $modx->manager->loadFormValues(); |
53 | 53 | } |
54 | 54 | |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | // Add lock-element JS-Script |
59 | 59 | $lockElementId = $id; |
60 | 60 | $lockElementType = 1; |
61 | -require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php'); |
|
61 | +require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php'); |
|
62 | 62 | ?> |
63 | 63 | <script type="text/javascript"> |
64 | 64 | |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | <?php |
101 | 101 | // invoke OnTempFormPrerender event |
102 | 102 | $evtOut = $modx->invokeEvent("OnTempFormPrerender", array("id" => $id)); |
103 | - if(is_array($evtOut)) { |
|
103 | + if (is_array($evtOut)) { |
|
104 | 104 | echo implode("", $evtOut); |
105 | 105 | } |
106 | 106 | ?> |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | <input type="hidden" name="mode" value="<?= $modx->manager->action ?>"> |
110 | 110 | |
111 | 111 | <h1> |
112 | - <i class="fa fa-newspaper-o"></i><?= ($content['templatename'] ? $content['templatename'] . '<small>(' . $content['id'] . ')</small>' : $_lang['new_template']) ?><i class="fa fa-question-circle help"></i> |
|
112 | + <i class="fa fa-newspaper-o"></i><?= ($content['templatename'] ? $content['templatename'].'<small>('.$content['id'].')</small>' : $_lang['new_template']) ?><i class="fa fa-question-circle help"></i> |
|
113 | 113 | </h1> |
114 | 114 | |
115 | 115 | <?= $_style['actionbuttons']['dynamic']['element'] ?> |
@@ -132,15 +132,15 @@ discard block |
||
132 | 132 | <div class="row form-row"> |
133 | 133 | <label class="col-md-3 col-lg-2"> |
134 | 134 | <?= $_lang['template_name'] ?> |
135 | - <?php if($id == $modx->config['default_template']) { |
|
136 | - echo '<small class="form-text text-danger">' . mb_strtolower(rtrim($_lang['defaulttemplate_title'], ':'), $modx_manager_charset) . '</small>'; |
|
135 | + <?php if ($id == $modx->config['default_template']) { |
|
136 | + echo '<small class="form-text text-danger">'.mb_strtolower(rtrim($_lang['defaulttemplate_title'], ':'), $modx_manager_charset).'</small>'; |
|
137 | 137 | } ?> |
138 | 138 | </label> |
139 | 139 | <div class="col-md-9 col-lg-10"> |
140 | 140 | <div class="form-control-name clearfix"> |
141 | 141 | <input name="templatename" type="text" maxlength="100" value="<?= $modx->htmlspecialchars($content['templatename']) ?>" class="form-control form-control-lg" onchange="documentDirty=true;"> |
142 | - <?php if($modx->hasPermission('save_role')): ?> |
|
143 | - <label class="custom-control" title="<?= $_lang['lock_template'] . "\n" . $_lang['lock_template_msg'] ?>" tooltip> |
|
142 | + <?php if ($modx->hasPermission('save_role')): ?> |
|
143 | + <label class="custom-control" title="<?= $_lang['lock_template']."\n".$_lang['lock_template_msg'] ?>" tooltip> |
|
144 | 144 | <input name="locked" type="checkbox"<?= ($content['locked'] == 1 ? ' checked="checked"' : '') ?> /> |
145 | 145 | <i class="fa fa-lock"></i> |
146 | 146 | </label> |
@@ -162,9 +162,9 @@ discard block |
||
162 | 162 | <select name="categoryid" class="form-control" onchange="documentDirty=true;"> |
163 | 163 | <option> </option> |
164 | 164 | <?php |
165 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
166 | - foreach(getCategories() as $n => $v) { |
|
167 | - echo "<option value='" . $v['id'] . "'" . ($content["category"] == $v["id"] ? " selected='selected'" : "") . ">" . $modx->htmlspecialchars($v["category"]) . "</option>"; |
|
165 | + include_once(MODX_MANAGER_PATH.'includes/categories.inc.php'); |
|
166 | + foreach (getCategories() as $n => $v) { |
|
167 | + echo "<option value='".$v['id']."'".($content["category"] == $v["id"] ? " selected='selected'" : "").">".$modx->htmlspecialchars($v["category"])."</option>"; |
|
168 | 168 | } |
169 | 169 | ?> |
170 | 170 | </select> |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | </div> |
178 | 178 | </div> |
179 | 179 | </div> |
180 | - <?php if($modx->hasPermission('save_role')): ?> |
|
180 | + <?php if ($modx->hasPermission('save_role')): ?> |
|
181 | 181 | <div class="form-group"> |
182 | 182 | <label> |
183 | 183 | <input name="selectable" type="checkbox"<?= ($selectable == 1 ? ' checked="checked"' : '') ?> /> <?= $_lang['template_selectable'] ?></label> |
@@ -198,30 +198,30 @@ discard block |
||
198 | 198 | |
199 | 199 | <?php |
200 | 200 | $selectedTvs = array(); |
201 | - if(!isset($_POST['assignedTv'])) { |
|
201 | + if (!isset($_POST['assignedTv'])) { |
|
202 | 202 | $rs = $modx->db->select(sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category", $_lang['no_category']), sprintf("%s tv |
203 | 203 | LEFT JOIN %s tr ON tv.id=tr.tmplvarid |
204 | 204 | LEFT JOIN %s cat ON tv.category=cat.id", $modx->getFullTableName('site_tmplvars'), $modx->getFullTableName('site_tmplvar_templates'), $modx->getFullTableName('categories')), "templateid='{$id}'", "tr.rank DESC, tv.rank DESC, tvcaption DESC, tvid DESC" // workaround for correct sort of none-existing ranks |
205 | 205 | ); |
206 | - while($row = $modx->db->getRow($rs)) { |
|
206 | + while ($row = $modx->db->getRow($rs)) { |
|
207 | 207 | $selectedTvs[$row['tvid']] = $row; |
208 | 208 | } |
209 | - $selectedTvs = array_reverse($selectedTvs, true); // reverse ORDERBY DESC |
|
209 | + $selectedTvs = array_reverse($selectedTvs, true); // reverse ORDERBY DESC |
|
210 | 210 | } |
211 | 211 | |
212 | 212 | $unselectedTvs = array(); |
213 | 213 | $rs = $modx->db->select(sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category, cat.id as catid", $_lang['no_category']), sprintf("%s tv |
214 | 214 | LEFT JOIN %s tr ON tv.id=tr.tmplvarid |
215 | 215 | LEFT JOIN %s cat ON tv.category=cat.id", $modx->getFullTableName('site_tmplvars'), $modx->getFullTableName('site_tmplvar_templates'), $modx->getFullTableName('categories')), "", "category, tvcaption"); |
216 | - while($row = $modx->db->getRow($rs)) { |
|
216 | + while ($row = $modx->db->getRow($rs)) { |
|
217 | 217 | $unselectedTvs[$row['tvid']] = $row; |
218 | 218 | } |
219 | 219 | |
220 | 220 | // Catch checkboxes if form not validated |
221 | - if(isset($_POST['assignedTv'])) { |
|
221 | + if (isset($_POST['assignedTv'])) { |
|
222 | 222 | $selectedTvs = array(); |
223 | - foreach($_POST['assignedTv'] as $tvid) { |
|
224 | - if(isset($unselectedTvs[$tvid])) { |
|
223 | + foreach ($_POST['assignedTv'] as $tvid) { |
|
224 | + if (isset($unselectedTvs[$tvid])) { |
|
225 | 225 | $selectedTvs[$tvid] = $unselectedTvs[$tvid]; |
226 | 226 | } |
227 | 227 | }; |
@@ -238,20 +238,20 @@ discard block |
||
238 | 238 | |
239 | 239 | <div class="container container-body"> |
240 | 240 | <?php |
241 | - if($total > 0) { |
|
242 | - echo '<p>' . $_lang['template_tv_msg'] . '</p>'; |
|
241 | + if ($total > 0) { |
|
242 | + echo '<p>'.$_lang['template_tv_msg'].'</p>'; |
|
243 | 243 | } |
244 | - if($modx->hasPermission('save_template') && $total > 1 && $id) { |
|
244 | + if ($modx->hasPermission('save_template') && $total > 1 && $id) { |
|
245 | 245 | echo sprintf('<div class="form-group"><a class="btn btn-primary" href="index.php?a=117&id=%s">%s</a></div>', $id, $_lang['template_tv_edit']); |
246 | 246 | } |
247 | 247 | |
248 | 248 | // Selected TVs |
249 | 249 | $tvList = ''; |
250 | - if($total > 0) { |
|
250 | + if ($total > 0) { |
|
251 | 251 | $tvList .= '<ul>'; |
252 | - foreach($selectedTvs as $row) { |
|
253 | - $desc = !empty($row['tvdescription']) ? ' <small>(' . $row['tvdescription'] . ')</small>' : ''; |
|
254 | - $locked = $row['tvlocked'] ? ' <em>(' . $_lang['locked'] . ')</em>' : ""; |
|
252 | + foreach ($selectedTvs as $row) { |
|
253 | + $desc = !empty($row['tvdescription']) ? ' <small>('.$row['tvdescription'].')</small>' : ''; |
|
254 | + $locked = $row['tvlocked'] ? ' <em>('.$_lang['locked'].')</em>' : ""; |
|
255 | 255 | $tvList .= sprintf('<li><label><input name="assignedTv[]" value="%s" type="checkbox" checked="checked" onchange="documentDirty=true;jQuery(\'#tvsDirty\').val(\'1\');"> %s <small>(%s)</small> - %s%s</label>%s <a href="index.php?id=%s&a=301&or=%s&oid=%s">%s</a></li>', $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->manager->action, $id, $_lang['edit']); |
256 | 256 | } |
257 | 257 | $tvList .= '</ul>'; |
@@ -262,22 +262,22 @@ discard block |
||
262 | 262 | echo $tvList; |
263 | 263 | |
264 | 264 | // Unselected TVs |
265 | - $tvList = '<hr/><p>' . $_lang['template_notassigned_tv'] . '</p><ul>'; |
|
265 | + $tvList = '<hr/><p>'.$_lang['template_notassigned_tv'].'</p><ul>'; |
|
266 | 266 | $preCat = ''; |
267 | 267 | $insideUl = 0; |
268 | - while($row = array_shift($unselectedTvs)) { |
|
269 | - if(isset($selectedTvs[$row['tvid']])) { |
|
268 | + while ($row = array_shift($unselectedTvs)) { |
|
269 | + if (isset($selectedTvs[$row['tvid']])) { |
|
270 | 270 | continue; |
271 | 271 | } // Skip selected |
272 | 272 | $row['category'] = stripslashes($row['category']); //pixelchutes |
273 | - if($preCat !== $row['category']) { |
|
273 | + if ($preCat !== $row['category']) { |
|
274 | 274 | $tvList .= $insideUl ? '</ul>' : ''; |
275 | - $tvList .= '<li><strong>' . $row['category'] . ($row['catid'] != '' ? ' <small>(' . $row['catid'] . ')</small>' : '') . '</strong><ul>'; |
|
275 | + $tvList .= '<li><strong>'.$row['category'].($row['catid'] != '' ? ' <small>('.$row['catid'].')</small>' : '').'</strong><ul>'; |
|
276 | 276 | $insideUl = 1; |
277 | 277 | } |
278 | 278 | |
279 | - $desc = !empty($row['tvdescription']) ? ' <small>(' . $row['tvdescription'] . ')</small>' : ''; |
|
280 | - $locked = $row['tvlocked'] ? ' <em>(' . $_lang['locked'] . ')</em>' : ""; |
|
279 | + $desc = !empty($row['tvdescription']) ? ' <small>('.$row['tvdescription'].')</small>' : ''; |
|
280 | + $locked = $row['tvlocked'] ? ' <em>('.$_lang['locked'].')</em>' : ""; |
|
281 | 281 | $tvList .= sprintf('<li><label><input name="assignedTv[]" value="%s" type="checkbox" onchange="documentDirty=true;jQuery(\'#tvsDirty\').val(\'1\');"> %s <small>(%s)</small> - %s%s</label>%s <a href="index.php?id=%s&a=301&or=%s&oid=%s">%s</a></li>', $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->manager->action, $id, $_lang['edit']); |
282 | 282 | $tvList .= '</li>'; |
283 | 283 | |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | <?php |
295 | 295 | // invoke OnTempFormRender event |
296 | 296 | $evtOut = $modx->invokeEvent("OnTempFormRender", array("id" => $id)); |
297 | - if(is_array($evtOut)) { |
|
297 | + if (is_array($evtOut)) { |
|
298 | 298 | echo implode("", $evtOut); |
299 | 299 | } |
300 | 300 | ?> |
@@ -1,19 +1,19 @@ 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 | if (!$modx->hasPermission('edit_document') || !$modx->hasPermission('save_document')) { |
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
9 | -$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : null; |
|
9 | +$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : null; |
|
10 | 10 | $reset = isset($_POST['reset']) && $_POST['reset'] == 'true' ? 1 : 0; |
11 | 11 | $items = isset($_POST['list']) ? $_POST['list'] : ''; |
12 | 12 | $ressourcelist = ''; |
13 | 13 | $updateMsg = ''; |
14 | 14 | |
15 | 15 | // check permissions on the document |
16 | -include_once MODX_MANAGER_PATH . "processors/user_documents_permissions.class.php"; |
|
16 | +include_once MODX_MANAGER_PATH."processors/user_documents_permissions.class.php"; |
|
17 | 17 | $udperms = new udperms(); |
18 | 18 | $udperms->user = $modx->getLoginUserID(); |
19 | 19 | $udperms->document = $id; |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | } |
25 | 25 | |
26 | 26 | if (isset($_POST['listSubmitted'])) { |
27 | - $updateMsg .= '<div class="text-success" id="updated">' . $_lang['sort_updated'] . '</div>'; |
|
27 | + $updateMsg .= '<div class="text-success" id="updated">'.$_lang['sort_updated'].'</div>'; |
|
28 | 28 | if (strlen($items) > 0) { |
29 | 29 | $items = explode(';', $items); |
30 | 30 | foreach ($items as $key => $value) { |
@@ -44,15 +44,15 @@ discard block |
||
44 | 44 | $tblsc = $modx->getFullTableName('site_content'); |
45 | 45 | $tbldg = $modx->getFullTableName('document_groups'); |
46 | 46 | |
47 | - $rs = $modx->db->select('pagetitle', $tblsc, 'id=' . $id . ''); |
|
47 | + $rs = $modx->db->select('pagetitle', $tblsc, 'id='.$id.''); |
|
48 | 48 | $pagetitle = $modx->db->getValue($rs); |
49 | 49 | |
50 | 50 | $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',', $_SESSION['mgrDocgroups']) : ''; |
51 | 51 | $docgrp_cond = $docgrp ? "OR dg.document_group IN ({$docgrp})" : ''; |
52 | - $mgrRole = (isset ($_SESSION['mgrRole']) && (string)$_SESSION['mgrRole'] === '1') ? '1' : '0'; |
|
53 | - $access = " AND (1={$mgrRole} OR sc.privatemgr=0" . (!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))"); |
|
52 | + $mgrRole = (isset ($_SESSION['mgrRole']) && (string) $_SESSION['mgrRole'] === '1') ? '1' : '0'; |
|
53 | + $access = " AND (1={$mgrRole} OR sc.privatemgr=0".(!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))"); |
|
54 | 54 | |
55 | - $rs = $modx->db->select('sc.id, sc.pagetitle, sc.parent, sc.menuindex, sc.published, sc.hidemenu, sc.deleted, sc.isfolder', $tblsc . 'AS sc LEFT JOIN ' . $tbldg . ' dg ON dg.document=sc.id', 'sc.parent=' . $id . $access . ' GROUP BY sc.id', 'menuindex ASC'); |
|
55 | + $rs = $modx->db->select('sc.id, sc.pagetitle, sc.parent, sc.menuindex, sc.published, sc.hidemenu, sc.deleted, sc.isfolder', $tblsc.'AS sc LEFT JOIN '.$tbldg.' dg ON dg.document=sc.id', 'sc.parent='.$id.$access.' GROUP BY sc.id', 'menuindex ASC'); |
|
56 | 56 | |
57 | 57 | if ($modx->db->getRecordCount($rs)) { |
58 | 58 | $ressourcelist .= '<div class="clearfix"><ul id="sortlist" class="sortableList">'; |
@@ -61,12 +61,12 @@ discard block |
||
61 | 61 | $classes .= ($row['hidemenu']) ? ' notInMenuNode ' : ' inMenuNode'; |
62 | 62 | $classes .= ($row['published']) ? ' publishedNode ' : ' unpublishedNode '; |
63 | 63 | $classes = ($row['deleted']) ? ' deletedNode ' : $classes; |
64 | - $icon = $row['isfolder'] ? '<i class="' . $_style['files_folder'] . '"></i> ' : ' <i class="' . $_style['files_page_html'] . '"></i> '; |
|
65 | - $ressourcelist .= '<li id="item_' . $row['id'] . '" class="' . $classes . '">' . $icon . $row['pagetitle'] . ' <small>(' . $row['id'] . ')</small></li>'; |
|
64 | + $icon = $row['isfolder'] ? '<i class="'.$_style['files_folder'].'"></i> ' : ' <i class="'.$_style['files_page_html'].'"></i> '; |
|
65 | + $ressourcelist .= '<li id="item_'.$row['id'].'" class="'.$classes.'">'.$icon.$row['pagetitle'].' <small>('.$row['id'].')</small></li>'; |
|
66 | 66 | } |
67 | 67 | $ressourcelist .= '</ul></div>'; |
68 | 68 | } else { |
69 | - $updateMsg = '<p class="text-danger">' . $_lang['sort_nochildren'] . '</p>'; |
|
69 | + $updateMsg = '<p class="text-danger">'.$_lang['sort_nochildren'].'</p>'; |
|
70 | 70 | } |
71 | 71 | } |
72 | 72 | |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | </script> |
150 | 150 | |
151 | 151 | <h1> |
152 | - <i class="fa fa-sort-numeric-asc"></i><?= ($pagetitle ? $pagetitle . '<small>(' . $id . ')</small>' : $_lang['sort_menuindex']) ?> |
|
152 | + <i class="fa fa-sort-numeric-asc"></i><?= ($pagetitle ? $pagetitle.'<small>('.$id.')</small>' : $_lang['sort_menuindex']) ?> |
|
153 | 153 | </h1> |
154 | 154 | |
155 | 155 | <?= $_style['actionbuttons']['dynamic']['save'] ?> |