@@ -1,16 +1,16 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if(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 | if(isset($_REQUEST['id'])) { |
7 | - $id = (int) $_REQUEST['id']; |
|
7 | + $id = (int) $_REQUEST['id']; |
|
8 | 8 | } else { |
9 | - $id = 0; |
|
9 | + $id = 0; |
|
10 | 10 | } |
11 | 11 | |
12 | 12 | if(isset($_GET['opened'])) { |
13 | - $_SESSION['openedArray'] = $_GET['opened']; |
|
13 | + $_SESSION['openedArray'] = $_GET['opened']; |
|
14 | 14 | } |
15 | 15 | |
16 | 16 | $url = $modx->config['site_url']; |
@@ -23,17 +23,17 @@ discard block |
||
23 | 23 | |
24 | 24 | // Get access permissions |
25 | 25 | if($_SESSION['mgrDocgroups']) { |
26 | - $docgrp = implode(",", $_SESSION['mgrDocgroups']); |
|
26 | + $docgrp = implode(",", $_SESSION['mgrDocgroups']); |
|
27 | 27 | } |
28 | 28 | $access = "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0" . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)"); |
29 | 29 | |
30 | 30 | // |
31 | 31 | if($_SESSION['tree_show_only_folders']) { |
32 | - $parent = $id ? ($modx->db->getValue("SELECT parent FROM " . $tbl_site_content . " WHERE id=$id LIMIT 1")) : 0; |
|
33 | - $isfolder = $modx->db->getValue("SELECT isfolder FROM " . $tbl_site_content . " WHERE id=$id LIMIT 1"); |
|
34 | - if(!$isfolder && $parent != 0) { |
|
35 | - $id = $_REQUEST['id'] = $parent; |
|
36 | - } |
|
32 | + $parent = $id ? ($modx->db->getValue("SELECT parent FROM " . $tbl_site_content . " WHERE id=$id LIMIT 1")) : 0; |
|
33 | + $isfolder = $modx->db->getValue("SELECT isfolder FROM " . $tbl_site_content . " WHERE id=$id LIMIT 1"); |
|
34 | + if(!$isfolder && $parent != 0) { |
|
35 | + $id = $_REQUEST['id'] = $parent; |
|
36 | + } |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | // Get the document content |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | LEFT JOIN {$tbl_document_groups} AS dg ON dg.document = sc.id", "sc.id ='{$id}' AND ({$access})"); |
42 | 42 | $content = $modx->db->getRow($rs); |
43 | 43 | if(!$content) { |
44 | - $modx->webAlertAndQuit($_lang["access_permission_denied"]); |
|
44 | + $modx->webAlertAndQuit($_lang["access_permission_denied"]); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | /** |
@@ -85,134 +85,134 @@ discard block |
||
85 | 85 | $filter_sort = ''; |
86 | 86 | $filter_dir = ''; |
87 | 87 | if($numRecords > 0) { |
88 | - $filter_sort = '<select size="1" name="sort" class="form-control form-control-sm" onchange="document.location=\'index.php?a=3&id=' . $id . '&dir=' . $dir . '&sort=\'+this.options[this.selectedIndex].value">' . '<option value="createdon"' . (($sort == 'createdon') ? ' selected' : '') . '>' . $_lang['createdon'] . '</option>' . '<option value="pub_date"' . (($sort == 'pub_date') ? ' selected' : '') . '>' . $_lang["page_data_publishdate"] . '</option>' . '<option value="pagetitle"' . (($sort == 'pagetitle') ? ' selected' : '') . '>' . $_lang['pagetitle'] . '</option>' . '<option value="menuindex"' . (($sort == 'menuindex') ? ' selected' : '') . '>' . $_lang['resource_opt_menu_index'] . '</option>' . //******** resource_opt_is_published - // |
|
89 | - '<option value="published"' . (($sort == 'published') ? ' selected' : '') . '>' . $_lang['resource_opt_is_published'] . '</option>' . //********// |
|
90 | - '</select>'; |
|
91 | - $filter_dir = '<select size="1" name="dir" class="form-control form-control-sm" onchange="document.location=\'index.php?a=3&id=' . $id . '&sort=' . $sort . '&dir=\'+this.options[this.selectedIndex].value">' . '<option value="DESC"' . (($dir == 'DESC') ? ' selected' : '') . '>' . $_lang['sort_desc'] . '</option>' . '<option value="ASC"' . (($dir == 'ASC') ? ' selected' : '') . '>' . $_lang['sort_asc'] . '</option>' . '</select>'; |
|
92 | - $resource = $modx->db->makeArray($rs); |
|
93 | - |
|
94 | - // CSS style for table |
|
95 | - // $tableClass = 'grid'; |
|
96 | - // $rowHeaderClass = 'gridHeader'; |
|
97 | - // $rowRegularClass = 'gridItem'; |
|
98 | - // $rowAlternateClass = 'gridAltItem'; |
|
99 | - $tableClass = 'table data nowrap'; |
|
100 | - $columnHeaderClass = array( |
|
101 | - 'text-center', |
|
102 | - 'text-left', |
|
103 | - 'text-center', |
|
104 | - 'text-center', |
|
105 | - 'text-center', |
|
106 | - 'text-center' |
|
107 | - ); |
|
108 | - |
|
109 | - |
|
110 | - $modx->table->setTableClass($tableClass); |
|
111 | - $modx->table->setColumnHeaderClass($columnHeaderClass); |
|
112 | - // $modx->table->setRowHeaderClass($rowHeaderClass); |
|
113 | - // $modx->table->setRowRegularClass($rowRegularClass); |
|
114 | - // $modx->table->setRowAlternateClass($rowAlternateClass); |
|
115 | - |
|
116 | - // Table header |
|
117 | - $listTableHeader = array( |
|
118 | - 'docid' => $_lang['id'], |
|
119 | - 'title' => $_lang['resource_title'], |
|
120 | - 'createdon' => $_lang['createdon'], |
|
121 | - 'pub_date' => $_lang['page_data_publishdate'], |
|
122 | - 'status' => $_lang['page_data_status'], |
|
123 | - 'edit' => $_lang['mgrlog_action'], |
|
124 | - ); |
|
125 | - $tbWidth = array( |
|
126 | - '1%', |
|
127 | - '', |
|
128 | - '1%', |
|
129 | - '1%', |
|
130 | - '1%', |
|
131 | - '1%' |
|
132 | - ); |
|
133 | - $modx->table->setColumnWidths($tbWidth); |
|
134 | - |
|
135 | - $sd = isset($_REQUEST['dir']) ? '&dir=' . $_REQUEST['dir'] : '&dir=DESC'; |
|
136 | - $sb = isset($_REQUEST['sort']) ? '&sort=' . $_REQUEST['sort'] : '&sort=createdon'; |
|
137 | - $pg = isset($_REQUEST['page']) ? '&page=' . (int) $_REQUEST['page'] : ''; |
|
138 | - $add_path = $sd . $sb . $pg; |
|
139 | - |
|
140 | - $icons = array( |
|
141 | - 'text/html' => $_style['tree_page_html'], |
|
142 | - 'text/plain' => $_style['tree_page'], |
|
143 | - 'text/xml' => $_style['tree_page_xml'], |
|
144 | - 'text/css' => $_style['tree_page_css'], |
|
145 | - 'text/javascript' => $_style['tree_page_js'], |
|
146 | - 'application/rss+xml' => $_style['tree_page_rss'], |
|
147 | - 'application/pdf' => $_style['tree_page_pdf'], |
|
148 | - 'application/vnd.ms-word' => $_style['tree_page_word'], |
|
149 | - 'application/vnd.ms-excel' => $_style['tree_page_excel'], |
|
150 | - 'image/gif' => $_style['tree_page_gif'], |
|
151 | - 'image/jpg' => $_style['tree_page_jpg'], |
|
152 | - 'image/png' => $_style['tree_page_png'] |
|
153 | - ); |
|
154 | - |
|
155 | - $listDocs = array(); |
|
156 | - foreach($resource as $k => $children) { |
|
157 | - |
|
158 | - switch($children['id']) { |
|
159 | - case $modx->config['site_start'] : |
|
160 | - $icon = $_style['tree_page_home']; |
|
161 | - break; |
|
162 | - case $modx->config['error_page'] : |
|
163 | - $icon = $_style['tree_page_404']; |
|
164 | - break; |
|
165 | - case $modx->config['site_unavailable_page'] : |
|
166 | - $icon = $_style['tree_page_hourglass']; |
|
167 | - break; |
|
168 | - case $modx->config['unauthorized_page'] : |
|
169 | - $icon = $_style['tree_page_info']; |
|
170 | - break; |
|
171 | - default: |
|
172 | - if($children['isfolder']) { |
|
173 | - $icon = $_style['tree_folder_new']; |
|
174 | - } else { |
|
175 | - if(isset($icons[$children['contentType']])) { |
|
176 | - $icon = $icons[$children['contentType']]; |
|
177 | - } else { |
|
178 | - $icon = $_style['tree_page']; |
|
179 | - } |
|
180 | - } |
|
181 | - } |
|
182 | - |
|
183 | - $private = ($children['privateweb'] || $children['privatemgr'] ? ' private' : ''); |
|
184 | - |
|
185 | - // дописываем в заголовок класс для неопубликованных плюс по всем ссылкам обратный путь |
|
186 | - // для сохранения сортировки |
|
187 | - $class = ($children['deleted'] ? 'text-danger text-decoration-through' : (!$children['published'] ? ' font-italic text-muted' : ' publish')); |
|
188 | - //$class .= ($children['hidemenu'] ? ' text-muted' : ' text-primary'); |
|
189 | - //$class .= ($children['isfolder'] ? ' font-weight-bold' : ''); |
|
190 | - if($modx->hasPermission('edit_document')) { |
|
191 | - $title = '<span class="doc-item' . $private . '">' . $icon . '<a href="index.php?a=27&id=' . $children['id'] . $add_path . '">' . '<span class="' . $class . '">' . $children['pagetitle'] . '</span></a></span>'; |
|
192 | - } else { |
|
193 | - $title = '<span class="doc-item' . $private . '">' . $icon . '<span class="' . $class . '">' . $children['pagetitle'] . '</span></span>'; |
|
194 | - } |
|
195 | - |
|
196 | - $icon_pub_unpub = (!$children['published']) ? '<a href="index.php?a=61&id=' . $children['id'] . $add_path . '" title="' . $_lang["publish_resource"] . '"><i class="' . $_style["icons_publish_document"] . '"></i></a>' : '<a href="index.php?a=62&id=' . $children['id'] . $add_path . '" title="' . $_lang["unpublish_resource"] . '"><i class="' . $_style["icons_unpublish_resource"] . '" ></i></a>'; |
|
197 | - |
|
198 | - $icon_del_undel = (!$children['deleted']) ? '<a onclick="return confirm(\'' . $_lang["confirm_delete_resource"] . '\')" href="index.php?a=6&id=' . $children['id'] . $add_path . '" title="' . $_lang['delete_resource'] . '"><i class="' . $_style["icons_delete_resource"] . '"></i></a>' : '<a onclick="return confirm(\'' . $_lang["confirm_undelete"] . '\')" href="index.php?a=63&id=' . $children['id'] . $add_path . '" title="' . $_lang['undelete_resource'] . '"><i class="' . $_style["icons_undelete_resource"] . '"></i></a>'; |
|
199 | - |
|
200 | - $listDocs[] = array( |
|
201 | - 'docid' => '<div class="text-right">' . $children['id'] . '</div>', |
|
202 | - 'title' => $title, |
|
203 | - 'createdon' => '<div class="text-right">' . ($modx->toDateFormat($children['createdon'] + $server_offset_time, 'dateOnly')) . '</div>', |
|
204 | - 'pub_date' => '<div class="text-right">' . ($children['pub_date'] ? ($modx->toDateFormat($children['pub_date'] + $server_offset_time, 'dateOnly')) : '') . '</div>', |
|
205 | - 'status' => '<div class="text-nowrap">' . ($children['published'] == 0 ? '<span class="unpublishedDoc">' . $_lang['page_data_unpublished'] . '</span>' : '<span class="publishedDoc">' . $_lang['page_data_published'] . '</span>') . '</div>', |
|
206 | - 'edit' => '<div class="actions text-center text-nowrap">' . ($modx->hasPermission('edit_document') ? '<a href="index.php?a=27&id=' . $children['id'] . $add_path . '" title="' . $_lang['edit'] . '"><i class="' . $_style["icons_edit_resource"] . '"></i></a><a href="index.php?a=51&id=' . $children['id'] . $add_path . '" title="' . $_lang['move'] . '"><i |
|
88 | + $filter_sort = '<select size="1" name="sort" class="form-control form-control-sm" onchange="document.location=\'index.php?a=3&id=' . $id . '&dir=' . $dir . '&sort=\'+this.options[this.selectedIndex].value">' . '<option value="createdon"' . (($sort == 'createdon') ? ' selected' : '') . '>' . $_lang['createdon'] . '</option>' . '<option value="pub_date"' . (($sort == 'pub_date') ? ' selected' : '') . '>' . $_lang["page_data_publishdate"] . '</option>' . '<option value="pagetitle"' . (($sort == 'pagetitle') ? ' selected' : '') . '>' . $_lang['pagetitle'] . '</option>' . '<option value="menuindex"' . (($sort == 'menuindex') ? ' selected' : '') . '>' . $_lang['resource_opt_menu_index'] . '</option>' . //******** resource_opt_is_published - // |
|
89 | + '<option value="published"' . (($sort == 'published') ? ' selected' : '') . '>' . $_lang['resource_opt_is_published'] . '</option>' . //********// |
|
90 | + '</select>'; |
|
91 | + $filter_dir = '<select size="1" name="dir" class="form-control form-control-sm" onchange="document.location=\'index.php?a=3&id=' . $id . '&sort=' . $sort . '&dir=\'+this.options[this.selectedIndex].value">' . '<option value="DESC"' . (($dir == 'DESC') ? ' selected' : '') . '>' . $_lang['sort_desc'] . '</option>' . '<option value="ASC"' . (($dir == 'ASC') ? ' selected' : '') . '>' . $_lang['sort_asc'] . '</option>' . '</select>'; |
|
92 | + $resource = $modx->db->makeArray($rs); |
|
93 | + |
|
94 | + // CSS style for table |
|
95 | + // $tableClass = 'grid'; |
|
96 | + // $rowHeaderClass = 'gridHeader'; |
|
97 | + // $rowRegularClass = 'gridItem'; |
|
98 | + // $rowAlternateClass = 'gridAltItem'; |
|
99 | + $tableClass = 'table data nowrap'; |
|
100 | + $columnHeaderClass = array( |
|
101 | + 'text-center', |
|
102 | + 'text-left', |
|
103 | + 'text-center', |
|
104 | + 'text-center', |
|
105 | + 'text-center', |
|
106 | + 'text-center' |
|
107 | + ); |
|
108 | + |
|
109 | + |
|
110 | + $modx->table->setTableClass($tableClass); |
|
111 | + $modx->table->setColumnHeaderClass($columnHeaderClass); |
|
112 | + // $modx->table->setRowHeaderClass($rowHeaderClass); |
|
113 | + // $modx->table->setRowRegularClass($rowRegularClass); |
|
114 | + // $modx->table->setRowAlternateClass($rowAlternateClass); |
|
115 | + |
|
116 | + // Table header |
|
117 | + $listTableHeader = array( |
|
118 | + 'docid' => $_lang['id'], |
|
119 | + 'title' => $_lang['resource_title'], |
|
120 | + 'createdon' => $_lang['createdon'], |
|
121 | + 'pub_date' => $_lang['page_data_publishdate'], |
|
122 | + 'status' => $_lang['page_data_status'], |
|
123 | + 'edit' => $_lang['mgrlog_action'], |
|
124 | + ); |
|
125 | + $tbWidth = array( |
|
126 | + '1%', |
|
127 | + '', |
|
128 | + '1%', |
|
129 | + '1%', |
|
130 | + '1%', |
|
131 | + '1%' |
|
132 | + ); |
|
133 | + $modx->table->setColumnWidths($tbWidth); |
|
134 | + |
|
135 | + $sd = isset($_REQUEST['dir']) ? '&dir=' . $_REQUEST['dir'] : '&dir=DESC'; |
|
136 | + $sb = isset($_REQUEST['sort']) ? '&sort=' . $_REQUEST['sort'] : '&sort=createdon'; |
|
137 | + $pg = isset($_REQUEST['page']) ? '&page=' . (int) $_REQUEST['page'] : ''; |
|
138 | + $add_path = $sd . $sb . $pg; |
|
139 | + |
|
140 | + $icons = array( |
|
141 | + 'text/html' => $_style['tree_page_html'], |
|
142 | + 'text/plain' => $_style['tree_page'], |
|
143 | + 'text/xml' => $_style['tree_page_xml'], |
|
144 | + 'text/css' => $_style['tree_page_css'], |
|
145 | + 'text/javascript' => $_style['tree_page_js'], |
|
146 | + 'application/rss+xml' => $_style['tree_page_rss'], |
|
147 | + 'application/pdf' => $_style['tree_page_pdf'], |
|
148 | + 'application/vnd.ms-word' => $_style['tree_page_word'], |
|
149 | + 'application/vnd.ms-excel' => $_style['tree_page_excel'], |
|
150 | + 'image/gif' => $_style['tree_page_gif'], |
|
151 | + 'image/jpg' => $_style['tree_page_jpg'], |
|
152 | + 'image/png' => $_style['tree_page_png'] |
|
153 | + ); |
|
154 | + |
|
155 | + $listDocs = array(); |
|
156 | + foreach($resource as $k => $children) { |
|
157 | + |
|
158 | + switch($children['id']) { |
|
159 | + case $modx->config['site_start'] : |
|
160 | + $icon = $_style['tree_page_home']; |
|
161 | + break; |
|
162 | + case $modx->config['error_page'] : |
|
163 | + $icon = $_style['tree_page_404']; |
|
164 | + break; |
|
165 | + case $modx->config['site_unavailable_page'] : |
|
166 | + $icon = $_style['tree_page_hourglass']; |
|
167 | + break; |
|
168 | + case $modx->config['unauthorized_page'] : |
|
169 | + $icon = $_style['tree_page_info']; |
|
170 | + break; |
|
171 | + default: |
|
172 | + if($children['isfolder']) { |
|
173 | + $icon = $_style['tree_folder_new']; |
|
174 | + } else { |
|
175 | + if(isset($icons[$children['contentType']])) { |
|
176 | + $icon = $icons[$children['contentType']]; |
|
177 | + } else { |
|
178 | + $icon = $_style['tree_page']; |
|
179 | + } |
|
180 | + } |
|
181 | + } |
|
182 | + |
|
183 | + $private = ($children['privateweb'] || $children['privatemgr'] ? ' private' : ''); |
|
184 | + |
|
185 | + // дописываем в заголовок класс для неопубликованных плюс по всем ссылкам обратный путь |
|
186 | + // для сохранения сортировки |
|
187 | + $class = ($children['deleted'] ? 'text-danger text-decoration-through' : (!$children['published'] ? ' font-italic text-muted' : ' publish')); |
|
188 | + //$class .= ($children['hidemenu'] ? ' text-muted' : ' text-primary'); |
|
189 | + //$class .= ($children['isfolder'] ? ' font-weight-bold' : ''); |
|
190 | + if($modx->hasPermission('edit_document')) { |
|
191 | + $title = '<span class="doc-item' . $private . '">' . $icon . '<a href="index.php?a=27&id=' . $children['id'] . $add_path . '">' . '<span class="' . $class . '">' . $children['pagetitle'] . '</span></a></span>'; |
|
192 | + } else { |
|
193 | + $title = '<span class="doc-item' . $private . '">' . $icon . '<span class="' . $class . '">' . $children['pagetitle'] . '</span></span>'; |
|
194 | + } |
|
195 | + |
|
196 | + $icon_pub_unpub = (!$children['published']) ? '<a href="index.php?a=61&id=' . $children['id'] . $add_path . '" title="' . $_lang["publish_resource"] . '"><i class="' . $_style["icons_publish_document"] . '"></i></a>' : '<a href="index.php?a=62&id=' . $children['id'] . $add_path . '" title="' . $_lang["unpublish_resource"] . '"><i class="' . $_style["icons_unpublish_resource"] . '" ></i></a>'; |
|
197 | + |
|
198 | + $icon_del_undel = (!$children['deleted']) ? '<a onclick="return confirm(\'' . $_lang["confirm_delete_resource"] . '\')" href="index.php?a=6&id=' . $children['id'] . $add_path . '" title="' . $_lang['delete_resource'] . '"><i class="' . $_style["icons_delete_resource"] . '"></i></a>' : '<a onclick="return confirm(\'' . $_lang["confirm_undelete"] . '\')" href="index.php?a=63&id=' . $children['id'] . $add_path . '" title="' . $_lang['undelete_resource'] . '"><i class="' . $_style["icons_undelete_resource"] . '"></i></a>'; |
|
199 | + |
|
200 | + $listDocs[] = array( |
|
201 | + 'docid' => '<div class="text-right">' . $children['id'] . '</div>', |
|
202 | + 'title' => $title, |
|
203 | + 'createdon' => '<div class="text-right">' . ($modx->toDateFormat($children['createdon'] + $server_offset_time, 'dateOnly')) . '</div>', |
|
204 | + 'pub_date' => '<div class="text-right">' . ($children['pub_date'] ? ($modx->toDateFormat($children['pub_date'] + $server_offset_time, 'dateOnly')) : '') . '</div>', |
|
205 | + 'status' => '<div class="text-nowrap">' . ($children['published'] == 0 ? '<span class="unpublishedDoc">' . $_lang['page_data_unpublished'] . '</span>' : '<span class="publishedDoc">' . $_lang['page_data_published'] . '</span>') . '</div>', |
|
206 | + 'edit' => '<div class="actions text-center text-nowrap">' . ($modx->hasPermission('edit_document') ? '<a href="index.php?a=27&id=' . $children['id'] . $add_path . '" title="' . $_lang['edit'] . '"><i class="' . $_style["icons_edit_resource"] . '"></i></a><a href="index.php?a=51&id=' . $children['id'] . $add_path . '" title="' . $_lang['move'] . '"><i |
|
207 | 207 | class="' . $_style["icons_move_document"] . '"></i></a>' . $icon_pub_unpub : '') . ($modx->hasPermission('delete_document') ? $icon_del_undel : '') . '</div>' |
208 | - ); |
|
209 | - } |
|
208 | + ); |
|
209 | + } |
|
210 | 210 | |
211 | - $modx->table->createPagingNavigation($numRecords, 'a=3&id=' . $content['id'] . '&dir=' . $dir . '&sort=' . $sort); |
|
212 | - $children_output = $modx->table->create($listDocs, $listTableHeader, 'index.php?a=3&id=' . $content['id']); |
|
211 | + $modx->table->createPagingNavigation($numRecords, 'a=3&id=' . $content['id'] . '&dir=' . $dir . '&sort=' . $sort); |
|
212 | + $children_output = $modx->table->create($listDocs, $listTableHeader, 'index.php?a=3&id=' . $content['id']); |
|
213 | 213 | } else { |
214 | - // No Child documents |
|
215 | - $children_output = '<div class="container"><p>' . $_lang['resources_in_container_no'] . '</p></div>'; |
|
214 | + // No Child documents |
|
215 | + $children_output = '<div class="container"><p>' . $_lang['resources_in_container_no'] . '</p></div>'; |
|
216 | 216 | } |
217 | 217 | ?> |
218 | 218 | <script type="text/javascript"> |
@@ -413,20 +413,20 @@ discard block |
||
413 | 413 | <h2 class="tab"><?= $_lang['page_data_source'] ?></h2> |
414 | 414 | <script type="text/javascript">docSettings.addTabPage(document.getElementById("tabSource"));</script> |
415 | 415 | <?php |
416 | - $buffer = ""; |
|
417 | - $filename = $modx->config['base_path'] . "assets/cache/docid_" . $id . ".pageCache.php"; |
|
418 | - $handle = @fopen($filename, "r"); |
|
419 | - if(!$handle) { |
|
420 | - $buffer = '<div class="container container-body">' . $_lang['page_data_notcached'] . '</div>'; |
|
421 | - } else { |
|
422 | - while(!feof($handle)) { |
|
423 | - $buffer .= fgets($handle, 4096); |
|
424 | - } |
|
425 | - fclose($handle); |
|
426 | - $buffer = '<div class="navbar navbar-editor">' . $_lang['page_data_cached'] . '</div><div class="section-editor clearfix"><textarea rows="20" wrap="soft">' . $modx->htmlspecialchars($buffer) . "</textarea></div>\n"; |
|
427 | - } |
|
428 | - echo $buffer; |
|
429 | - ?> |
|
416 | + $buffer = ""; |
|
417 | + $filename = $modx->config['base_path'] . "assets/cache/docid_" . $id . ".pageCache.php"; |
|
418 | + $handle = @fopen($filename, "r"); |
|
419 | + if(!$handle) { |
|
420 | + $buffer = '<div class="container container-body">' . $_lang['page_data_notcached'] . '</div>'; |
|
421 | + } else { |
|
422 | + while(!feof($handle)) { |
|
423 | + $buffer .= fgets($handle, 4096); |
|
424 | + } |
|
425 | + fclose($handle); |
|
426 | + $buffer = '<div class="navbar navbar-editor">' . $_lang['page_data_cached'] . '</div><div class="section-editor clearfix"><textarea rows="20" wrap="soft">' . $modx->htmlspecialchars($buffer) . "</textarea></div>\n"; |
|
427 | + } |
|
428 | + echo $buffer; |
|
429 | + ?> |
|
430 | 430 | </div><!-- end tab-page --> |
431 | 431 | <?php } ?> |
432 | 432 | |
@@ -434,7 +434,7 @@ discard block |
||
434 | 434 | |
435 | 435 | <?php |
436 | 436 | if(isset($_GET['tab']) && is_numeric($_GET['tab'])) { |
437 | - echo '<script type="text/javascript"> docSettings.setSelectedIndex( ' . $_GET['tab'] . ' );</script>'; |
|
437 | + echo '<script type="text/javascript"> docSettings.setSelectedIndex( ' . $_GET['tab'] . ' );</script>'; |
|
438 | 438 | } |
439 | 439 | ?> |
440 | 440 |
@@ -1,21 +1,21 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if(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 12: |
|
8 | - if(!$modx->hasPermission('edit_user')) { |
|
9 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
10 | - } |
|
11 | - break; |
|
12 | - case 11: |
|
13 | - if(!$modx->hasPermission('new_user')) { |
|
14 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
15 | - } |
|
16 | - break; |
|
17 | - default: |
|
18 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | + case 12: |
|
8 | + if(!$modx->hasPermission('edit_user')) { |
|
9 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
10 | + } |
|
11 | + break; |
|
12 | + case 11: |
|
13 | + if(!$modx->hasPermission('new_user')) { |
|
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 | $user = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; |
@@ -23,75 +23,75 @@ discard block |
||
23 | 23 | // check to see the snippet editor isn't locked |
24 | 24 | $rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=12 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'"); |
25 | 25 | if($username = $modx->db->getValue($rs)) { |
26 | - $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "user")); |
|
26 | + $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "user")); |
|
27 | 27 | } |
28 | 28 | // end check for lock |
29 | 29 | |
30 | 30 | if($modx->manager->action == '12') { |
31 | - // get user attribute |
|
32 | - $rs = $modx->db->select('*', $modx->getFullTableName('user_attributes'), "internalKey = '{$user}'"); |
|
33 | - $userdata = $modx->db->getRow($rs); |
|
34 | - if(!$userdata) { |
|
35 | - $modx->webAlertAndQuit("No user returned!"); |
|
36 | - } |
|
37 | - |
|
38 | - |
|
39 | - // get user settings |
|
40 | - $rs = $modx->db->select('*', $modx->getFullTableName('user_settings'), "user = '{$user}'"); |
|
41 | - $usersettings = array(); |
|
42 | - while($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; |
|
43 | - // manually extract so that user display settings are not overwritten |
|
44 | - foreach($usersettings as $k => $v) { |
|
45 | - if($k != 'manager_language' && $k != 'manager_theme') { |
|
46 | - ${$k} = $v; |
|
47 | - } |
|
48 | - } |
|
49 | - |
|
50 | - // get user name |
|
51 | - $rs = $modx->db->select('*', $modx->getFullTableName('manager_users'), "id = '{$user}'"); |
|
52 | - $usernamedata = $modx->db->getRow($rs); |
|
53 | - if(!$usernamedata) { |
|
54 | - $modx->webAlertAndQuit("No user returned while getting username!"); |
|
55 | - } |
|
56 | - $_SESSION['itemname'] = $usernamedata['username']; |
|
31 | + // get user attribute |
|
32 | + $rs = $modx->db->select('*', $modx->getFullTableName('user_attributes'), "internalKey = '{$user}'"); |
|
33 | + $userdata = $modx->db->getRow($rs); |
|
34 | + if(!$userdata) { |
|
35 | + $modx->webAlertAndQuit("No user returned!"); |
|
36 | + } |
|
37 | + |
|
38 | + |
|
39 | + // get user settings |
|
40 | + $rs = $modx->db->select('*', $modx->getFullTableName('user_settings'), "user = '{$user}'"); |
|
41 | + $usersettings = array(); |
|
42 | + while($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; |
|
43 | + // manually extract so that user display settings are not overwritten |
|
44 | + foreach($usersettings as $k => $v) { |
|
45 | + if($k != 'manager_language' && $k != 'manager_theme') { |
|
46 | + ${$k} = $v; |
|
47 | + } |
|
48 | + } |
|
49 | + |
|
50 | + // get user name |
|
51 | + $rs = $modx->db->select('*', $modx->getFullTableName('manager_users'), "id = '{$user}'"); |
|
52 | + $usernamedata = $modx->db->getRow($rs); |
|
53 | + if(!$usernamedata) { |
|
54 | + $modx->webAlertAndQuit("No user returned while getting username!"); |
|
55 | + } |
|
56 | + $_SESSION['itemname'] = $usernamedata['username']; |
|
57 | 57 | } else { |
58 | - $userdata = array(); |
|
59 | - $usersettings = array(); |
|
60 | - $usernamedata = array(); |
|
61 | - $_SESSION['itemname'] = $_lang["new_user"]; |
|
58 | + $userdata = array(); |
|
59 | + $usersettings = array(); |
|
60 | + $usernamedata = array(); |
|
61 | + $_SESSION['itemname'] = $_lang["new_user"]; |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | // avoid doubling htmlspecialchars (already encoded in DB) |
65 | 65 | foreach($userdata as $key => $val) { |
66 | - $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); |
|
66 | + $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); |
|
67 | 67 | }; |
68 | 68 | $usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']); |
69 | 69 | |
70 | 70 | // restore saved form |
71 | 71 | $formRestored = false; |
72 | 72 | if($modx->manager->hasFormValues()) { |
73 | - $modx->manager->loadFormValues(); |
|
74 | - // restore post values |
|
75 | - $userdata = array_merge($userdata, $_POST); |
|
76 | - $userdata['dob'] = $modx->toTimeStamp($userdata['dob']); |
|
77 | - $usernamedata['username'] = $userdata['newusername']; |
|
78 | - $usernamedata['oldusername'] = $_POST['oldusername']; |
|
79 | - $usersettings = array_merge($usersettings, $userdata); |
|
80 | - $usersettings['allowed_days'] = is_array($_POST['allowed_days']) ? implode(",", $_POST['allowed_days']) : ""; |
|
81 | - extract($usersettings, EXTR_OVERWRITE); |
|
73 | + $modx->manager->loadFormValues(); |
|
74 | + // restore post values |
|
75 | + $userdata = array_merge($userdata, $_POST); |
|
76 | + $userdata['dob'] = $modx->toTimeStamp($userdata['dob']); |
|
77 | + $usernamedata['username'] = $userdata['newusername']; |
|
78 | + $usernamedata['oldusername'] = $_POST['oldusername']; |
|
79 | + $usersettings = array_merge($usersettings, $userdata); |
|
80 | + $usersettings['allowed_days'] = is_array($_POST['allowed_days']) ? implode(",", $_POST['allowed_days']) : ""; |
|
81 | + extract($usersettings, EXTR_OVERWRITE); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | // include the country list language file |
85 | 85 | $_country_lang = array(); |
86 | 86 | include_once "lang/country/english_country.inc.php"; |
87 | 87 | if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) { |
88 | - include_once "lang/country/" . $manager_language . "_country.inc.php"; |
|
88 | + include_once "lang/country/" . $manager_language . "_country.inc.php"; |
|
89 | 89 | } |
90 | 90 | asort($_country_lang); |
91 | 91 | |
92 | 92 | $displayStyle = ($_SESSION['browser'] === 'modern') ? 'table-row' : 'block'; |
93 | 93 | if($which_browser == 'default') { |
94 | - $which_browser = $modx->configGlobal['which_browser'] ? $modx->configGlobal['which_browser'] : $modx->config['which_browser']; |
|
94 | + $which_browser = $modx->configGlobal['which_browser'] ? $modx->configGlobal['which_browser'] : $modx->config['which_browser']; |
|
95 | 95 | } |
96 | 96 | ?> |
97 | 97 | <script type="text/javascript"> |
@@ -201,14 +201,14 @@ discard block |
||
201 | 201 | <form action="index.php?a=32" method="post" name="userform"> |
202 | 202 | <?php |
203 | 203 | |
204 | - // invoke OnUserFormPrerender event |
|
205 | - $evtOut = $modx->invokeEvent("OnUserFormPrerender", array( |
|
206 | - "id" => $user |
|
207 | - )); |
|
208 | - if(is_array($evtOut)) { |
|
209 | - echo implode("", $evtOut); |
|
210 | - } |
|
211 | - ?> |
|
204 | + // invoke OnUserFormPrerender event |
|
205 | + $evtOut = $modx->invokeEvent("OnUserFormPrerender", array( |
|
206 | + "id" => $user |
|
207 | + )); |
|
208 | + if(is_array($evtOut)) { |
|
209 | + echo implode("", $evtOut); |
|
210 | + } |
|
211 | + ?> |
|
212 | 212 | <input type="hidden" name="mode" value="<?php echo $modx->manager->action; ?>"> |
213 | 213 | <input type="hidden" name="id" value="<?php echo $user ?>"> |
214 | 214 | <input type="hidden" name="blockedmode" value="<?php echo ($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || ($userdata['blockedafter'] < time() && $userdata['blockedafter'] != 0) || $userdata['failedlogins'] > 3) ? "1" : "0" ?>" /> |
@@ -301,21 +301,21 @@ discard block |
||
301 | 301 | <td> </td> |
302 | 302 | <td><?php |
303 | 303 | |
304 | - $rs = $modx->db->select('name, id', '[+prefix+]user_roles', ($modx->hasPermission('save_role')) ? '' : 'id != 1'); |
|
305 | - ?> |
|
304 | + $rs = $modx->db->select('name, id', '[+prefix+]user_roles', ($modx->hasPermission('save_role')) ? '' : 'id != 1'); |
|
305 | + ?> |
|
306 | 306 | <select name="role" class="inputBox" onChange='documentDirty=true;' style="width:300px"> |
307 | 307 | <?php |
308 | - while($row = $modx->db->getRow($rs)) { |
|
309 | - if($modx->manager->action == '11') { |
|
310 | - $selectedtext = $row['id'] == '1' ? ' selected="selected"' : ''; |
|
311 | - } else { |
|
312 | - $selectedtext = $row['id'] == $userdata['role'] ? "selected='selected'" : ''; |
|
313 | - } |
|
314 | - ?> |
|
308 | + while($row = $modx->db->getRow($rs)) { |
|
309 | + if($modx->manager->action == '11') { |
|
310 | + $selectedtext = $row['id'] == '1' ? ' selected="selected"' : ''; |
|
311 | + } else { |
|
312 | + $selectedtext = $row['id'] == $userdata['role'] ? "selected='selected'" : ''; |
|
313 | + } |
|
314 | + ?> |
|
315 | 315 | <option value="<?php echo $row['id']; ?>"<?php echo $selectedtext; ?>><?php echo $row['name']; ?></option> |
316 | 316 | <?php |
317 | - } |
|
318 | - ?> |
|
317 | + } |
|
318 | + ?> |
|
319 | 319 | </select></td> |
320 | 320 | </tr> |
321 | 321 | <tr> |
@@ -360,10 +360,10 @@ discard block |
||
360 | 360 | <?php $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $userdata['country']; ?> |
361 | 361 | <option value="" <?php (!isset($chosenCountry) ? ' selected' : '') ?> > </option> |
362 | 362 | <?php |
363 | - foreach($_country_lang as $key => $country) { |
|
364 | - echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>"; |
|
365 | - } |
|
366 | - ?> |
|
363 | + foreach($_country_lang as $key => $country) { |
|
364 | + echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>"; |
|
365 | + } |
|
366 | + ?> |
|
367 | 367 | </select></td> |
368 | 368 | </tr> |
369 | 369 | <tr> |
@@ -439,21 +439,21 @@ discard block |
||
439 | 439 | <td><select name="manager_language" class="inputBox" onChange="documentDirty=true"> |
440 | 440 | <option value=""></option> |
441 | 441 | <?php |
442 | - $activelang = !empty($usersettings['manager_language']) ? $usersettings['manager_language'] : ''; |
|
443 | - $dir = dir("includes/lang"); |
|
444 | - while($file = $dir->read()) { |
|
445 | - if(strpos($file, ".inc.php") > 0) { |
|
446 | - $endpos = strpos($file, "."); |
|
447 | - $languagename = substr($file, 0, $endpos); |
|
448 | - $selectedtext = $languagename == $activelang ? "selected='selected'" : ""; |
|
449 | - ?> |
|
442 | + $activelang = !empty($usersettings['manager_language']) ? $usersettings['manager_language'] : ''; |
|
443 | + $dir = dir("includes/lang"); |
|
444 | + while($file = $dir->read()) { |
|
445 | + if(strpos($file, ".inc.php") > 0) { |
|
446 | + $endpos = strpos($file, "."); |
|
447 | + $languagename = substr($file, 0, $endpos); |
|
448 | + $selectedtext = $languagename == $activelang ? "selected='selected'" : ""; |
|
449 | + ?> |
|
450 | 450 | <option value="<?php echo $languagename; ?>" <?php echo $selectedtext; ?>><?php echo ucwords(str_replace("_", " ", $languagename)); ?></option> |
451 | 451 | <?php |
452 | 452 | |
453 | - } |
|
454 | - } |
|
455 | - $dir->close(); |
|
456 | - ?> |
|
453 | + } |
|
454 | + } |
|
455 | + $dir->close(); |
|
456 | + ?> |
|
457 | 457 | </select></td> |
458 | 458 | </tr> |
459 | 459 | <tr> |
@@ -528,22 +528,22 @@ discard block |
||
528 | 528 | <td><select name="manager_theme" class="inputBox" onChange="documentDirty=true;document.userform.theme_refresher.value = Date.parse(new Date());"> |
529 | 529 | <option value=""></option> |
530 | 530 | <?php |
531 | - $dir = dir("media/style/"); |
|
532 | - while($file = $dir->read()) { |
|
533 | - if($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') { |
|
534 | - $themename = $file; |
|
535 | - if($themename === 'common') { |
|
536 | - continue; |
|
537 | - } |
|
538 | - $attr = 'value="' . $themename . '" '; |
|
539 | - if(isset($usersettings['manager_theme']) && $themename == $usersettings['manager_theme']) { |
|
540 | - $attr .= 'selected="selected" '; |
|
541 | - } |
|
542 | - echo "\t\t<option " . rtrim($attr) . '>' . ucwords(str_replace("_", " ", $themename)) . "</option>\n"; |
|
543 | - } |
|
544 | - } |
|
545 | - $dir->close(); |
|
546 | - ?> |
|
531 | + $dir = dir("media/style/"); |
|
532 | + while($file = $dir->read()) { |
|
533 | + if($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') { |
|
534 | + $themename = $file; |
|
535 | + if($themename === 'common') { |
|
536 | + continue; |
|
537 | + } |
|
538 | + $attr = 'value="' . $themename . '" '; |
|
539 | + if(isset($usersettings['manager_theme']) && $themename == $usersettings['manager_theme']) { |
|
540 | + $attr .= 'selected="selected" '; |
|
541 | + } |
|
542 | + echo "\t\t<option " . rtrim($attr) . '>' . ucwords(str_replace("_", " ", $themename)) . "</option>\n"; |
|
543 | + } |
|
544 | + } |
|
545 | + $dir->close(); |
|
546 | + ?> |
|
547 | 547 | </select> |
548 | 548 | <input type="hidden" name="theme_refresher" value=""></td> |
549 | 549 | </tr> |
@@ -555,15 +555,15 @@ discard block |
||
555 | 555 | <th><?php echo $_lang["which_browser_title"] ?></th> |
556 | 556 | <td><select name="which_browser" class="inputBox" onChange="documentDirty=true;"> |
557 | 557 | <?php |
558 | - $selected = 'default' == $usersettings['which_browser'] || !$usersettings['which_browser'] ? ' selected="selected"' : ''; |
|
559 | - echo '<option value="default"' . $selected . '>' . $_lang['option_default'] . "</option>\n"; |
|
560 | - foreach(glob("media/browser/*", GLOB_ONLYDIR) as $dir) { |
|
561 | - $dir = str_replace('\\', '/', $dir); |
|
562 | - $browser_name = substr($dir, strrpos($dir, '/') + 1); |
|
563 | - $selected = $browser_name == $usersettings['which_browser'] ? ' selected="selected"' : ''; |
|
564 | - echo '<option value="' . $browser_name . '"' . $selected . '>' . "{$browser_name}</option>\n"; |
|
565 | - } |
|
566 | - ?> |
|
558 | + $selected = 'default' == $usersettings['which_browser'] || !$usersettings['which_browser'] ? ' selected="selected"' : ''; |
|
559 | + echo '<option value="default"' . $selected . '>' . $_lang['option_default'] . "</option>\n"; |
|
560 | + foreach(glob("media/browser/*", GLOB_ONLYDIR) as $dir) { |
|
561 | + $dir = str_replace('\\', '/', $dir); |
|
562 | + $browser_name = substr($dir, strrpos($dir, '/') + 1); |
|
563 | + $selected = $browser_name == $usersettings['which_browser'] ? ' selected="selected"' : ''; |
|
564 | + echo '<option value="' . $browser_name . '"' . $selected . '>' . "{$browser_name}</option>\n"; |
|
565 | + } |
|
566 | + ?> |
|
567 | 567 | </select></td> |
568 | 568 | </tr> |
569 | 569 | <tr> |
@@ -640,17 +640,17 @@ discard block |
||
640 | 640 | <option value=""></option> |
641 | 641 | <?php |
642 | 642 | |
643 | - $edt = isset ($usersettings["which_editor"]) ? $usersettings["which_editor"] : ''; |
|
644 | - // invoke OnRichTextEditorRegister event |
|
645 | - $evtOut = $modx->invokeEvent("OnRichTextEditorRegister"); |
|
646 | - echo "<option value='none'" . ($edt == 'none' ? " selected='selected'" : "") . ">" . $_lang["none"] . "</option>\n"; |
|
647 | - if(is_array($evtOut)) { |
|
648 | - for($i = 0; $i < count($evtOut); $i++) { |
|
649 | - $editor = $evtOut[$i]; |
|
650 | - echo "<option value='$editor'" . ($edt == $editor ? " selected='selected'" : "") . ">$editor</option>\n"; |
|
651 | - } |
|
652 | - } |
|
653 | - ?> |
|
643 | + $edt = isset ($usersettings["which_editor"]) ? $usersettings["which_editor"] : ''; |
|
644 | + // invoke OnRichTextEditorRegister event |
|
645 | + $evtOut = $modx->invokeEvent("OnRichTextEditorRegister"); |
|
646 | + echo "<option value='none'" . ($edt == 'none' ? " selected='selected'" : "") . ">" . $_lang["none"] . "</option>\n"; |
|
647 | + if(is_array($evtOut)) { |
|
648 | + for($i = 0; $i < count($evtOut); $i++) { |
|
649 | + $editor = $evtOut[$i]; |
|
650 | + echo "<option value='$editor'" . ($edt == $editor ? " selected='selected'" : "") . ">$editor</option>\n"; |
|
651 | + } |
|
652 | + } |
|
653 | + ?> |
|
654 | 654 | </select></td> |
655 | 655 | </tr> |
656 | 656 | <tr id='editorRow1' style="display: <?php echo $use_editor == 1 ? $displayStyle : 'none'; ?>"> |
@@ -683,12 +683,12 @@ discard block |
||
683 | 683 | </tr> |
684 | 684 | </table> |
685 | 685 | <?php |
686 | - // invoke OnInterfaceSettingsRender event |
|
687 | - $evtOut = $modx->invokeEvent("OnInterfaceSettingsRender"); |
|
688 | - if(is_array($evtOut)) { |
|
689 | - echo implode("", $evtOut); |
|
690 | - } |
|
691 | - ?> |
|
686 | + // invoke OnInterfaceSettingsRender event |
|
687 | + $evtOut = $modx->invokeEvent("OnInterfaceSettingsRender"); |
|
688 | + if(is_array($evtOut)) { |
|
689 | + echo implode("", $evtOut); |
|
690 | + } |
|
691 | + ?> |
|
692 | 692 | </div> |
693 | 693 | |
694 | 694 | <!-- Photo --> |
@@ -737,39 +737,39 @@ discard block |
||
737 | 737 | </div> |
738 | 738 | <?php if($use_udperms == 1) { |
739 | 739 | |
740 | - $groupsarray = array(); |
|
741 | - |
|
742 | - if($modx->manager->action == '12') { // only do this bit if the user is being edited |
|
743 | - $rs = $modx->db->select('user_group', $modx->getFullTableName('member_groups'), "member='{$user}'"); |
|
744 | - $groupsarray = $modx->db->getColumn('user_group', $rs); |
|
745 | - } |
|
746 | - // retain selected doc groups between post |
|
747 | - if(is_array($_POST['user_groups'])) { |
|
748 | - foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; |
|
749 | - } |
|
750 | - ?> |
|
740 | + $groupsarray = array(); |
|
741 | + |
|
742 | + if($modx->manager->action == '12') { // only do this bit if the user is being edited |
|
743 | + $rs = $modx->db->select('user_group', $modx->getFullTableName('member_groups'), "member='{$user}'"); |
|
744 | + $groupsarray = $modx->db->getColumn('user_group', $rs); |
|
745 | + } |
|
746 | + // retain selected doc groups between post |
|
747 | + if(is_array($_POST['user_groups'])) { |
|
748 | + foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; |
|
749 | + } |
|
750 | + ?> |
|
751 | 751 | <div class="tab-page" id="tabAccess"> |
752 | 752 | <h2 class="tab"><?php echo $_lang["access_permissions"] ?></h2> |
753 | 753 | <script type="text/javascript">tpUser.addTabPage(document.getElementById("tabAccess"));</script> |
754 | 754 | <p><?php echo $_lang['access_permissions_user_message'] ?></p> |
755 | 755 | <?php |
756 | - $rs = $modx->db->select('name, id', $modx->getFullTableName('membergroup_names'), '', 'name'); |
|
757 | - while($row = $modx->db->getRow($rs)) { |
|
758 | - echo "<label><input type='checkbox' name='user_groups[]' value='" . $row['id'] . "'" . (in_array($row['id'], $groupsarray) ? " checked='checked'" : "") . " />" . $row['name'] . "</label><br />"; |
|
759 | - } |
|
760 | - } |
|
761 | - ?> |
|
756 | + $rs = $modx->db->select('name, id', $modx->getFullTableName('membergroup_names'), '', 'name'); |
|
757 | + while($row = $modx->db->getRow($rs)) { |
|
758 | + echo "<label><input type='checkbox' name='user_groups[]' value='" . $row['id'] . "'" . (in_array($row['id'], $groupsarray) ? " checked='checked'" : "") . " />" . $row['name'] . "</label><br />"; |
|
759 | + } |
|
760 | + } |
|
761 | + ?> |
|
762 | 762 | </div> |
763 | 763 | </div> |
764 | 764 | </div> |
765 | 765 | <input type="submit" name="save" style="display:none"> |
766 | 766 | <?php |
767 | - // invoke OnUserFormRender event |
|
768 | - $evtOut = $modx->invokeEvent("OnUserFormRender", array( |
|
769 | - "id" => $user |
|
770 | - )); |
|
771 | - if(is_array($evtOut)) { |
|
772 | - echo implode("", $evtOut); |
|
773 | - } |
|
774 | - ?> |
|
767 | + // invoke OnUserFormRender event |
|
768 | + $evtOut = $modx->invokeEvent("OnUserFormRender", array( |
|
769 | + "id" => $user |
|
770 | + )); |
|
771 | + if(is_array($evtOut)) { |
|
772 | + echo implode("", $evtOut); |
|
773 | + } |
|
774 | + ?> |
|
775 | 775 | </form> |
@@ -1,21 +1,21 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if(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 88: |
|
8 | - if(!$modx->hasPermission('edit_web_user')) { |
|
9 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
10 | - } |
|
11 | - break; |
|
12 | - case 87: |
|
13 | - if(!$modx->hasPermission('new_web_user')) { |
|
14 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
15 | - } |
|
16 | - break; |
|
17 | - default: |
|
18 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | + case 88: |
|
8 | + if(!$modx->hasPermission('edit_web_user')) { |
|
9 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
10 | + } |
|
11 | + break; |
|
12 | + case 87: |
|
13 | + if(!$modx->hasPermission('new_web_user')) { |
|
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 | $user = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; |
@@ -24,64 +24,64 @@ discard block |
||
24 | 24 | // check to see the snippet editor isn't locked |
25 | 25 | $rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=88 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'"); |
26 | 26 | if($username = $modx->db->getValue($rs)) { |
27 | - $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "web user")); |
|
27 | + $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "web user")); |
|
28 | 28 | } |
29 | 29 | // end check for lock |
30 | 30 | |
31 | 31 | if($modx->manager->action == '88') { |
32 | - // get user attributes |
|
33 | - $rs = $modx->db->select('*', $modx->getFullTableName('web_user_attributes'), "internalKey = '{$user}'"); |
|
34 | - $userdata = $modx->db->getRow($rs); |
|
35 | - if(!$userdata) { |
|
36 | - $modx->webAlertAndQuit("No user returned!"); |
|
37 | - } |
|
38 | - |
|
39 | - // get user settings |
|
40 | - $rs = $modx->db->select('*', $modx->getFullTableName('web_user_settings'), "webuser = '{$user}'"); |
|
41 | - $usersettings = array(); |
|
42 | - while($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; |
|
43 | - extract($usersettings, EXTR_OVERWRITE); |
|
44 | - |
|
45 | - // get user name |
|
46 | - $rs = $modx->db->select('*', $modx->getFullTableName('web_users'), "id = '{$user}'"); |
|
47 | - $usernamedata = $modx->db->getRow($rs); |
|
48 | - if(!$usernamedata) { |
|
49 | - $modx->webAlertAndQuit("No user returned while getting username!"); |
|
50 | - } |
|
51 | - $_SESSION['itemname'] = $usernamedata['username']; |
|
32 | + // get user attributes |
|
33 | + $rs = $modx->db->select('*', $modx->getFullTableName('web_user_attributes'), "internalKey = '{$user}'"); |
|
34 | + $userdata = $modx->db->getRow($rs); |
|
35 | + if(!$userdata) { |
|
36 | + $modx->webAlertAndQuit("No user returned!"); |
|
37 | + } |
|
38 | + |
|
39 | + // get user settings |
|
40 | + $rs = $modx->db->select('*', $modx->getFullTableName('web_user_settings'), "webuser = '{$user}'"); |
|
41 | + $usersettings = array(); |
|
42 | + while($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; |
|
43 | + extract($usersettings, EXTR_OVERWRITE); |
|
44 | + |
|
45 | + // get user name |
|
46 | + $rs = $modx->db->select('*', $modx->getFullTableName('web_users'), "id = '{$user}'"); |
|
47 | + $usernamedata = $modx->db->getRow($rs); |
|
48 | + if(!$usernamedata) { |
|
49 | + $modx->webAlertAndQuit("No user returned while getting username!"); |
|
50 | + } |
|
51 | + $_SESSION['itemname'] = $usernamedata['username']; |
|
52 | 52 | } else { |
53 | - $userdata = array(); |
|
54 | - $usersettings = array(); |
|
55 | - $usernamedata = array(); |
|
56 | - $_SESSION['itemname'] = $_lang["new_web_user"]; |
|
53 | + $userdata = array(); |
|
54 | + $usersettings = array(); |
|
55 | + $usernamedata = array(); |
|
56 | + $_SESSION['itemname'] = $_lang["new_web_user"]; |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | // avoid doubling htmlspecialchars (already encoded in DB) |
60 | 60 | foreach($userdata as $key => $val) { |
61 | - $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); |
|
61 | + $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); |
|
62 | 62 | }; |
63 | 63 | $usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']); |
64 | 64 | |
65 | 65 | // restore saved form |
66 | 66 | $formRestored = false; |
67 | 67 | if($modx->manager->hasFormValues()) { |
68 | - $modx->manager->loadFormValues(); |
|
69 | - // restore post values |
|
70 | - $userdata = array_merge($userdata, $_POST); |
|
71 | - $userdata['dob'] = $modx->toTimeStamp($userdata['dob']); |
|
72 | - $usernamedata['username'] = $userdata['newusername']; |
|
73 | - $usernamedata['oldusername'] = $_POST['oldusername']; |
|
74 | - $usersettings = array_merge($usersettings, $userdata); |
|
75 | - $usersettings['allowed_days'] = is_array($_POST['allowed_days']) ? implode(",", $_POST['allowed_days']) : ""; |
|
76 | - extract($usersettings, EXTR_OVERWRITE); |
|
68 | + $modx->manager->loadFormValues(); |
|
69 | + // restore post values |
|
70 | + $userdata = array_merge($userdata, $_POST); |
|
71 | + $userdata['dob'] = $modx->toTimeStamp($userdata['dob']); |
|
72 | + $usernamedata['username'] = $userdata['newusername']; |
|
73 | + $usernamedata['oldusername'] = $_POST['oldusername']; |
|
74 | + $usersettings = array_merge($usersettings, $userdata); |
|
75 | + $usersettings['allowed_days'] = is_array($_POST['allowed_days']) ? implode(",", $_POST['allowed_days']) : ""; |
|
76 | + extract($usersettings, EXTR_OVERWRITE); |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | // include the country list language file |
80 | 80 | $_country_lang = array(); |
81 | 81 | if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) { |
82 | - include_once "lang/country/" . $manager_language . "_country.inc.php"; |
|
82 | + include_once "lang/country/" . $manager_language . "_country.inc.php"; |
|
83 | 83 | } else { |
84 | - include_once "lang/country/english_country.inc.php"; |
|
84 | + include_once "lang/country/english_country.inc.php"; |
|
85 | 85 | } |
86 | 86 | asort($_country_lang); |
87 | 87 | |
@@ -189,12 +189,12 @@ discard block |
||
189 | 189 | |
190 | 190 | <form action="index.php?a=89" method="post" name="userform"> |
191 | 191 | <?php |
192 | - // invoke OnWUsrFormPrerender event |
|
193 | - $evtOut = $modx->invokeEvent("OnWUsrFormPrerender", array("id" => $user)); |
|
194 | - if(is_array($evtOut)) { |
|
195 | - echo implode("", $evtOut); |
|
196 | - } |
|
197 | - ?> |
|
192 | + // invoke OnWUsrFormPrerender event |
|
193 | + $evtOut = $modx->invokeEvent("OnWUsrFormPrerender", array("id" => $user)); |
|
194 | + if(is_array($evtOut)) { |
|
195 | + echo implode("", $evtOut); |
|
196 | + } |
|
197 | + ?> |
|
198 | 198 | <input type="hidden" name="mode" value="<?php echo $modx->manager->action; ?>" /> |
199 | 199 | <input type="hidden" name="id" value="<?php echo $user ?>" /> |
200 | 200 | <input type="hidden" name="blockedmode" value="<?php echo ($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || ($userdata['blockedafter'] < time() && $userdata['blockedafter'] != 0) || $userdata['failedlogins'] > 3) ? "1" : "0" ?>" /> |
@@ -324,10 +324,10 @@ discard block |
||
324 | 324 | <?php $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $userdata['country']; ?> |
325 | 325 | <option value="" <?php (!isset($chosenCountry) ? ' selected' : '') ?> > </option> |
326 | 326 | <?php |
327 | - foreach($_country_lang as $key => $country) { |
|
328 | - echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>"; |
|
329 | - } |
|
330 | - ?> |
|
327 | + foreach($_country_lang as $key => $country) { |
|
328 | + echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>"; |
|
329 | + } |
|
330 | + ?> |
|
331 | 331 | </select></td> |
332 | 332 | </tr> |
333 | 333 | <tr> |
@@ -387,8 +387,8 @@ discard block |
||
387 | 387 | <i onClick="document.userform.blockedafter.value=''; return true;" class="clearDate <?php echo $_style["actions_calendar_delete"] ?>" data-tooltip="<?php echo $_lang['remove_date']; ?>"></i></td> |
388 | 388 | </tr> |
389 | 389 | <?php |
390 | - } |
|
391 | - ?> |
|
390 | + } |
|
391 | + ?> |
|
392 | 392 | </table> |
393 | 393 | </div> |
394 | 394 | |
@@ -496,40 +496,40 @@ discard block |
||
496 | 496 | </table> |
497 | 497 | </div> |
498 | 498 | <?php |
499 | - if($use_udperms == 1) { |
|
500 | - |
|
501 | - $groupsarray = array(); |
|
502 | - |
|
503 | - if($modx->manager->action == '88') { // only do this bit if the user is being edited |
|
504 | - $rs = $modx->db->select('webgroup', $modx->getFullTableName('web_groups'), "webuser='{$user}'"); |
|
505 | - $groupsarray = $modx->db->getColumn('webgroup', $rs); |
|
506 | - } |
|
507 | - // retain selected user groups between post |
|
508 | - if(is_array($_POST['user_groups'])) { |
|
509 | - foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; |
|
510 | - } |
|
511 | - ?> |
|
499 | + if($use_udperms == 1) { |
|
500 | + |
|
501 | + $groupsarray = array(); |
|
502 | + |
|
503 | + if($modx->manager->action == '88') { // only do this bit if the user is being edited |
|
504 | + $rs = $modx->db->select('webgroup', $modx->getFullTableName('web_groups'), "webuser='{$user}'"); |
|
505 | + $groupsarray = $modx->db->getColumn('webgroup', $rs); |
|
506 | + } |
|
507 | + // retain selected user groups between post |
|
508 | + if(is_array($_POST['user_groups'])) { |
|
509 | + foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; |
|
510 | + } |
|
511 | + ?> |
|
512 | 512 | <div class="tab-page" id="tabPermissions"> |
513 | 513 | <h2 class="tab"><?php echo $_lang['web_access_permissions'] ?></h2> |
514 | 514 | <script type="text/javascript">tpUser.addTabPage(document.getElementById("tabPermissions"));</script> |
515 | 515 | <p><?php echo $_lang['access_permissions_user_message'] ?></p> |
516 | 516 | <?php |
517 | - $rs = $modx->db->select('name, id', $modx->getFullTableName('webgroup_names'), '', 'name'); |
|
518 | - while($row = $modx->db->getRow($rs)) { |
|
519 | - echo '<label><input type="checkbox" name="user_groups[]" value="' . $row['id'] . '"' . (in_array($row['id'], $groupsarray) ? ' checked="checked"' : '') . ' />' . $row['name'] . '</label><br />'; |
|
520 | - } |
|
521 | - } |
|
522 | - ?> |
|
517 | + $rs = $modx->db->select('name, id', $modx->getFullTableName('webgroup_names'), '', 'name'); |
|
518 | + while($row = $modx->db->getRow($rs)) { |
|
519 | + echo '<label><input type="checkbox" name="user_groups[]" value="' . $row['id'] . '"' . (in_array($row['id'], $groupsarray) ? ' checked="checked"' : '') . ' />' . $row['name'] . '</label><br />'; |
|
520 | + } |
|
521 | + } |
|
522 | + ?> |
|
523 | 523 | </div> |
524 | 524 | <?php |
525 | - // invoke OnWUsrFormRender event |
|
526 | - $evtOut = $modx->invokeEvent("OnWUsrFormRender", array( |
|
527 | - "id" => $user |
|
528 | - )); |
|
529 | - if(is_array($evtOut)) { |
|
530 | - echo implode("", $evtOut); |
|
531 | - } |
|
532 | - ?> |
|
525 | + // invoke OnWUsrFormRender event |
|
526 | + $evtOut = $modx->invokeEvent("OnWUsrFormRender", array( |
|
527 | + "id" => $user |
|
528 | + )); |
|
529 | + if(is_array($evtOut)) { |
|
530 | + echo implode("", $evtOut); |
|
531 | + } |
|
532 | + ?> |
|
533 | 533 | </div> |
534 | 534 | </div> |
535 | 535 | <input type="submit" name="save" style="display:none"> |
@@ -1,9 +1,9 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if(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 | if(!$modx->hasPermission('access_permissions')) { |
6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | // Get table names (alphabetical) |
@@ -18,24 +18,24 @@ discard block |
||
18 | 18 | // find all document groups, for the select :) |
19 | 19 | $rs = $modx->db->select('*', $tbl_documentgroup_names, '', 'name'); |
20 | 20 | if($modx->db->getRecordCount($rs) < 1) { |
21 | - $docgroupselector = '[no groups to add]'; |
|
21 | + $docgroupselector = '[no groups to add]'; |
|
22 | 22 | } else { |
23 | - $docgroupselector = '<select name="docgroup">' . "\n"; |
|
24 | - while($row = $modx->db->getRow($rs)) { |
|
25 | - $docgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n"; |
|
26 | - } |
|
27 | - $docgroupselector .= "</select>\n"; |
|
23 | + $docgroupselector = '<select name="docgroup">' . "\n"; |
|
24 | + while($row = $modx->db->getRow($rs)) { |
|
25 | + $docgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n"; |
|
26 | + } |
|
27 | + $docgroupselector .= "</select>\n"; |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | $rs = $modx->db->select('*', $tbl_membergroup_names, '', 'name'); |
31 | 31 | if($modx->db->getRecordCount($rs) < 1) { |
32 | - $usrgroupselector = '[no user groups]'; |
|
32 | + $usrgroupselector = '[no user groups]'; |
|
33 | 33 | } else { |
34 | - $usrgroupselector = '<select name="usergroup">' . "\n"; |
|
35 | - while($row = $modx->db->getRow($rs)) { |
|
36 | - $usrgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n"; |
|
37 | - } |
|
38 | - $usrgroupselector .= "</select>\n"; |
|
34 | + $usrgroupselector = '<select name="usergroup">' . "\n"; |
|
35 | + while($row = $modx->db->getRow($rs)) { |
|
36 | + $usrgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n"; |
|
37 | + } |
|
38 | + $usrgroupselector .= "</select>\n"; |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | ?> |
@@ -96,24 +96,24 @@ discard block |
||
96 | 96 | </form> |
97 | 97 | </div> |
98 | 98 | <?php |
99 | - $rs = $modx->db->select('groupnames.*, users.id AS user_id, users.username user_name', $tbl_membergroup_names . ' AS groupnames |
|
99 | + $rs = $modx->db->select('groupnames.*, users.id AS user_id, users.username user_name', $tbl_membergroup_names . ' AS groupnames |
|
100 | 100 | LEFT JOIN ' . $tbl_member_groups . ' AS groups ON groups.user_group = groupnames.id |
101 | 101 | LEFT JOIN ' . $tbl_manager_users . ' AS users ON users.id = groups.member', '', 'groupnames.name, user_name'); |
102 | - if($modx->db->getRecordCount($rs) < 1) { |
|
103 | - ?> |
|
102 | + if($modx->db->getRecordCount($rs) < 1) { |
|
103 | + ?> |
|
104 | 104 | <div class="text-danger"><?= $_lang['no_groups_found'] ?></div> |
105 | 105 | <?php |
106 | - } else { |
|
107 | - ?> |
|
106 | + } else { |
|
107 | + ?> |
|
108 | 108 | <div class="form-group"> |
109 | 109 | <?php |
110 | - $pid = ''; |
|
111 | - while($row = $modx->db->getRow($rs)) { |
|
112 | - if($pid != $row['id']) { |
|
113 | - if($pid != '') { |
|
114 | - echo '</div><div class="form-group">'; |
|
115 | - } |
|
116 | - ?> |
|
110 | + $pid = ''; |
|
111 | + while($row = $modx->db->getRow($rs)) { |
|
112 | + if($pid != $row['id']) { |
|
113 | + if($pid != '') { |
|
114 | + echo '</div><div class="form-group">'; |
|
115 | + } |
|
116 | + ?> |
|
117 | 117 | <form method="post" action="index.php" name="accesspermissions"> |
118 | 118 | <input type="hidden" name="a" value="41" /> |
119 | 119 | <input type="hidden" name="groupid" value="<?= $row['id'] ?>" /> |
@@ -128,21 +128,21 @@ discard block |
||
128 | 128 | </form> |
129 | 129 | <?= $_lang['access_permissions_users_in_group'] ?> |
130 | 130 | <?php |
131 | - } |
|
132 | - if(!$row['user_id']) { |
|
133 | - ?> |
|
131 | + } |
|
132 | + if(!$row['user_id']) { |
|
133 | + ?> |
|
134 | 134 | <i><?= $_lang['access_permissions_no_users_in_group'] ?></i> |
135 | 135 | <?php |
136 | - $pid = $row['id']; |
|
137 | - continue; |
|
138 | - } |
|
139 | - ?> |
|
136 | + $pid = $row['id']; |
|
137 | + continue; |
|
138 | + } |
|
139 | + ?> |
|
140 | 140 | <?= ($pid == $row['id'] ? ', ' : '') ?><a href="index.php?a=12&id=<?= $row['user_id'] ?>"><?= $row['user_name'] ?></a> |
141 | 141 | <?php |
142 | - $pid = $row['id']; |
|
143 | - } |
|
144 | - } |
|
145 | - ?> |
|
142 | + $pid = $row['id']; |
|
143 | + } |
|
144 | + } |
|
145 | + ?> |
|
146 | 146 | </div> |
147 | 147 | </div> |
148 | 148 | </div> |
@@ -167,24 +167,24 @@ discard block |
||
167 | 167 | </form> |
168 | 168 | </div> |
169 | 169 | <?php |
170 | - $rs = $modx->db->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $tbl_documentgroup_names . ' AS dgnames |
|
170 | + $rs = $modx->db->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $tbl_documentgroup_names . ' AS dgnames |
|
171 | 171 | LEFT JOIN ' . $tbl_document_groups . ' AS dg ON dg.document_group = dgnames.id |
172 | 172 | LEFT JOIN ' . $tbl_site_content . ' AS sc ON sc.id = dg.document', '', 'dgnames.name, sc.id'); |
173 | - if($modx->db->getRecordCount($rs) < 1) { |
|
174 | - ?> |
|
173 | + if($modx->db->getRecordCount($rs) < 1) { |
|
174 | + ?> |
|
175 | 175 | <div class="text-danger"><?= $_lang['no_groups_found'] ?></div> |
176 | 176 | <?php |
177 | - } else { |
|
178 | - ?> |
|
177 | + } else { |
|
178 | + ?> |
|
179 | 179 | <div class="form-group"> |
180 | 180 | <?php |
181 | - $pid = ''; |
|
182 | - while($row = $modx->db->getRow($rs)) { |
|
183 | - if($pid != $row['id']) { |
|
184 | - if($pid != '') { |
|
185 | - echo '</div><div class="form-group">'; |
|
186 | - } |
|
187 | - ?> |
|
181 | + $pid = ''; |
|
182 | + while($row = $modx->db->getRow($rs)) { |
|
183 | + if($pid != $row['id']) { |
|
184 | + if($pid != '') { |
|
185 | + echo '</div><div class="form-group">'; |
|
186 | + } |
|
187 | + ?> |
|
188 | 188 | <form method="post" action="index.php" name="accesspermissions"> |
189 | 189 | <input type="hidden" name="a" value="41" /> |
190 | 190 | <input type="hidden" name="groupid" value="<?= $row['id'] ?>" /> |
@@ -199,21 +199,21 @@ discard block |
||
199 | 199 | </form> |
200 | 200 | <?= $_lang['access_permissions_resources_in_group'] ?> |
201 | 201 | <?php |
202 | - } |
|
203 | - if(!$row['doc_id']) { |
|
204 | - ?> |
|
202 | + } |
|
203 | + if(!$row['doc_id']) { |
|
204 | + ?> |
|
205 | 205 | <i><?= $_lang['access_permissions_no_resources_in_group'] ?></i> |
206 | 206 | <?php |
207 | - $pid = $row['id']; |
|
208 | - continue; |
|
209 | - } |
|
210 | - ?> |
|
207 | + $pid = $row['id']; |
|
208 | + continue; |
|
209 | + } |
|
210 | + ?> |
|
211 | 211 | <?= ($pid == $row['id'] ? ', ' : '') ?><a href="index.php?a=3&id=<?= $row['doc_id'] ?>" title="<?= $modx->htmlspecialchars($row['doc_title']) ?>"><?= $row['doc_id'] ?></a> |
212 | 212 | <?php |
213 | - $pid = $row['id']; |
|
214 | - } |
|
215 | - } |
|
216 | - ?> |
|
213 | + $pid = $row['id']; |
|
214 | + } |
|
215 | + } |
|
216 | + ?> |
|
217 | 217 | </div> |
218 | 218 | </div> |
219 | 219 | </div> |
@@ -225,16 +225,16 @@ discard block |
||
225 | 225 | <div class="container container-body"> |
226 | 226 | <p class="element-edit-message-tab alert alert-warning"><?= $_lang['access_permissions_links_tab'] ?></p> |
227 | 227 | <?php |
228 | - // User/Document Group Links |
|
229 | - $rs = $modx->db->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $tbl_membergroup_names . ' AS groupnames |
|
228 | + // User/Document Group Links |
|
229 | + $rs = $modx->db->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $tbl_membergroup_names . ' AS groupnames |
|
230 | 230 | LEFT JOIN ' . $tbl_membergroup_access . ' AS groupacc ON groupacc.membergroup = groupnames.id |
231 | 231 | LEFT JOIN ' . $tbl_documentgroup_names . ' AS dgnames ON dgnames.id = groupacc.documentgroup', '', 'name, dg_name'); |
232 | - if($modx->db->getRecordCount($rs) < 1) { |
|
233 | - ?> |
|
232 | + if($modx->db->getRecordCount($rs) < 1) { |
|
233 | + ?> |
|
234 | 234 | <div class="text-danger"><?= $_lang['no_groups_found'] ?></div> |
235 | 235 | <?php |
236 | - } else { |
|
237 | - ?> |
|
236 | + } else { |
|
237 | + ?> |
|
238 | 238 | <div class="form-group"> |
239 | 239 | <b><?= $_lang["access_permissions_group_link"] ?></b> |
240 | 240 | <form method="post" action="index.php" name="accesspermissions"> |
@@ -250,38 +250,38 @@ discard block |
||
250 | 250 | <hr> |
251 | 251 | <ul> |
252 | 252 | <?php |
253 | - $pid = ''; |
|
254 | - while($row = $modx->db->getRow($rs)) { |
|
255 | - if($row['id'] != $pid) { |
|
256 | - if($pid != '') { |
|
257 | - echo '</ul></li>'; |
|
258 | - } // close previous one |
|
259 | - ?> |
|
253 | + $pid = ''; |
|
254 | + while($row = $modx->db->getRow($rs)) { |
|
255 | + if($row['id'] != $pid) { |
|
256 | + if($pid != '') { |
|
257 | + echo '</ul></li>'; |
|
258 | + } // close previous one |
|
259 | + ?> |
|
260 | 260 | <li><b><?= $row['name'] ?></b></li> |
261 | 261 | <?php |
262 | - if(!$row['dg_id']) { |
|
263 | - echo '<i>' . $_lang['no_groups_found'] . '</i></li>'; |
|
264 | - $pid = ''; |
|
265 | - continue; |
|
266 | - } else { |
|
267 | - echo '<ul>'; |
|
268 | - } |
|
269 | - } |
|
270 | - if(!$row['dg_id']) { |
|
271 | - continue; |
|
272 | - } |
|
273 | - ?> |
|
262 | + if(!$row['dg_id']) { |
|
263 | + echo '<i>' . $_lang['no_groups_found'] . '</i></li>'; |
|
264 | + $pid = ''; |
|
265 | + continue; |
|
266 | + } else { |
|
267 | + echo '<ul>'; |
|
268 | + } |
|
269 | + } |
|
270 | + if(!$row['dg_id']) { |
|
271 | + continue; |
|
272 | + } |
|
273 | + ?> |
|
274 | 274 | <li><?= $row['dg_name'] ?> |
275 | 275 | <small><i>(<a class="text-danger" href="index.php?a=41&coupling=<?= $row['link_id'] ?>&operation=remove_document_group_from_user_group"><?= $_lang['remove'] ?></a>)</i></small> |
276 | 276 | </li> |
277 | 277 | <?php |
278 | - $pid = $row['id']; |
|
279 | - } |
|
280 | - ?> |
|
278 | + $pid = $row['id']; |
|
279 | + } |
|
280 | + ?> |
|
281 | 281 | </ul> |
282 | 282 | <?php |
283 | - } |
|
284 | - ?> |
|
283 | + } |
|
284 | + ?> |
|
285 | 285 | </div> |
286 | 286 | </div> |
287 | 287 |
@@ -1,9 +1,9 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if(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 | if(!$modx->hasPermission('edit_user')) { |
6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | // initialize page view state - the $_PAGE object |
@@ -11,12 +11,12 @@ discard block |
||
11 | 11 | |
12 | 12 | // get and save search string |
13 | 13 | if($_REQUEST['op'] == 'reset') { |
14 | - $query = ''; |
|
15 | - $_PAGE['vs']['search'] = ''; |
|
14 | + $query = ''; |
|
15 | + $_PAGE['vs']['search'] = ''; |
|
16 | 16 | } else { |
17 | - $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; |
|
18 | - $sqlQuery = $modx->db->escape($query); |
|
19 | - $_PAGE['vs']['search'] = $query; |
|
17 | + $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; |
|
18 | + $sqlQuery = $modx->db->escape($query); |
|
19 | + $_PAGE['vs']['search'] = $query; |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | // get & save listmode |
@@ -120,55 +120,55 @@ discard block |
||
120 | 120 | <div class="row"> |
121 | 121 | <div class="table-responsive"> |
122 | 122 | <?php |
123 | - $where = ""; |
|
124 | - if(!$modx->hasPermission('save_role')) { |
|
125 | - $where .= (empty($where) ? "" : " AND ") . "mua.role != 1"; |
|
126 | - } |
|
127 | - if(!empty($sqlQuery)) { |
|
128 | - $where .= (empty($where) ? "" : " AND ") . "((mu.username LIKE '{$sqlQuery}%') OR (mua.fullname LIKE '%{$sqlQuery}%') OR (mua.email LIKE '{$sqlQuery}%'))"; |
|
129 | - } |
|
130 | - $ds = $modx->db->select("mu.id, mu.username, rname.name AS role, mua.fullname, mua.email, ELT(mua.gender, '{$_lang['user_male']}', '{$_lang['user_female']}', '{$_lang['user_other']}') AS gender, IF(mua.blocked,'{$_lang['yes']}','-') as blocked, mua.thislogin", $modx->getFullTableName('manager_users') . " AS mu |
|
123 | + $where = ""; |
|
124 | + if(!$modx->hasPermission('save_role')) { |
|
125 | + $where .= (empty($where) ? "" : " AND ") . "mua.role != 1"; |
|
126 | + } |
|
127 | + if(!empty($sqlQuery)) { |
|
128 | + $where .= (empty($where) ? "" : " AND ") . "((mu.username LIKE '{$sqlQuery}%') OR (mua.fullname LIKE '%{$sqlQuery}%') OR (mua.email LIKE '{$sqlQuery}%'))"; |
|
129 | + } |
|
130 | + $ds = $modx->db->select("mu.id, mu.username, rname.name AS role, mua.fullname, mua.email, ELT(mua.gender, '{$_lang['user_male']}', '{$_lang['user_female']}', '{$_lang['user_other']}') AS gender, IF(mua.blocked,'{$_lang['yes']}','-') as blocked, mua.thislogin", $modx->getFullTableName('manager_users') . " AS mu |
|
131 | 131 | INNER JOIN " . $modx->getFullTableName('user_attributes') . " AS mua ON mua.internalKey=mu.id |
132 | 132 | LEFT JOIN " . $modx->getFullTableName('user_roles') . " AS rname ON mua.role=rname.id", $where, 'mua.blocked ASC, mua.thislogin DESC'); |
133 | - include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; |
|
134 | - $grd = new DataGrid('', $ds, $modx->config['number_of_results']); // set page size to 0 t show all items |
|
135 | - $grd->noRecordMsg = $_lang["no_records_found"]; |
|
136 | - $grd->cssClass = "table data"; |
|
137 | - $grd->columnHeaderClass = "tableHeader"; |
|
138 | - $grd->itemClass = "tableItem"; |
|
139 | - $grd->altItemClass = "tableAltItem"; |
|
140 | - $grd->fields = "id,username,fullname,role,email,gender,blocked,thislogin"; |
|
141 | - $grd->columns = implode(',', array( |
|
142 | - $_lang["icon"], |
|
143 | - $_lang["name"], |
|
144 | - $_lang["user_full_name"], |
|
145 | - $_lang['role'], |
|
146 | - $_lang["email"], |
|
147 | - $_lang["user_gender"], |
|
148 | - $_lang["user_block"], |
|
149 | - $_lang["login_button"] |
|
150 | - )); |
|
151 | - $grd->colWidths = "1%,,,,,,1%,1%"; |
|
152 | - $grd->colAligns = "center,,,,,center,center,right' nowrap='nowrap"; |
|
153 | - $grd->colTypes = implode('||', array( |
|
154 | - 'template:<a class="gridRowIcon" href="javascript:;" onclick="return showContentMenu([+id+],event);" title="' . $_lang['click_to_context'] . '"><i class="' . $_style['icons_user'] . '"></i></a>', |
|
155 | - 'template:<a href="index.php?a=12&id=[+id+]" title="' . $_lang['click_to_edit_title'] . '">[+value+]</a>', |
|
156 | - 'template:[+fullname+]', |
|
157 | - 'template:[+role+]', |
|
158 | - 'template:[+email+]', |
|
159 | - 'template:[+gender+]', |
|
160 | - 'template:[+blocked+]', |
|
161 | - 'date: ' . $modx->toDateFormat('[+thislogin+]', 'formatOnly') . ' %H:%M' |
|
162 | - )); |
|
163 | - if($listmode == '1') { |
|
164 | - $grd->pageSize = 0; |
|
165 | - } |
|
166 | - if($_REQUEST['op'] == 'reset') { |
|
167 | - $grd->pageNumber = 1; |
|
168 | - } |
|
169 | - // render grid |
|
170 | - echo $grd->render(); |
|
171 | - ?> |
|
133 | + include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; |
|
134 | + $grd = new DataGrid('', $ds, $modx->config['number_of_results']); // set page size to 0 t show all items |
|
135 | + $grd->noRecordMsg = $_lang["no_records_found"]; |
|
136 | + $grd->cssClass = "table data"; |
|
137 | + $grd->columnHeaderClass = "tableHeader"; |
|
138 | + $grd->itemClass = "tableItem"; |
|
139 | + $grd->altItemClass = "tableAltItem"; |
|
140 | + $grd->fields = "id,username,fullname,role,email,gender,blocked,thislogin"; |
|
141 | + $grd->columns = implode(',', array( |
|
142 | + $_lang["icon"], |
|
143 | + $_lang["name"], |
|
144 | + $_lang["user_full_name"], |
|
145 | + $_lang['role'], |
|
146 | + $_lang["email"], |
|
147 | + $_lang["user_gender"], |
|
148 | + $_lang["user_block"], |
|
149 | + $_lang["login_button"] |
|
150 | + )); |
|
151 | + $grd->colWidths = "1%,,,,,,1%,1%"; |
|
152 | + $grd->colAligns = "center,,,,,center,center,right' nowrap='nowrap"; |
|
153 | + $grd->colTypes = implode('||', array( |
|
154 | + 'template:<a class="gridRowIcon" href="javascript:;" onclick="return showContentMenu([+id+],event);" title="' . $_lang['click_to_context'] . '"><i class="' . $_style['icons_user'] . '"></i></a>', |
|
155 | + 'template:<a href="index.php?a=12&id=[+id+]" title="' . $_lang['click_to_edit_title'] . '">[+value+]</a>', |
|
156 | + 'template:[+fullname+]', |
|
157 | + 'template:[+role+]', |
|
158 | + 'template:[+email+]', |
|
159 | + 'template:[+gender+]', |
|
160 | + 'template:[+blocked+]', |
|
161 | + 'date: ' . $modx->toDateFormat('[+thislogin+]', 'formatOnly') . ' %H:%M' |
|
162 | + )); |
|
163 | + if($listmode == '1') { |
|
164 | + $grd->pageSize = 0; |
|
165 | + } |
|
166 | + if($_REQUEST['op'] == 'reset') { |
|
167 | + $grd->pageNumber = 1; |
|
168 | + } |
|
169 | + // render grid |
|
170 | + echo $grd->render(); |
|
171 | + ?> |
|
172 | 172 | </div> |
173 | 173 | </div> |
174 | 174 | </div> |
@@ -2,24 +2,24 @@ discard block |
||
2 | 2 | if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
3 | 3 | |
4 | 4 | if(!$modx->hasPermission('category_manager')) { |
5 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
5 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | 6 | } |
7 | 7 | |
8 | 8 | $_module_params = array( |
9 | - 'module_version' => '1.0.0', |
|
10 | - 'module_params' => '', |
|
11 | - 'module_id' => $_GET['id'], |
|
12 | - 'package_name' => 'Module_Categories_Manager', |
|
13 | - 'native_language' => 'de', |
|
14 | - 'name' => 'Categories Manager', |
|
15 | - 'dirname' => $site_manager_url, |
|
16 | - 'url' => 'index.php?a=120&id=' . $_GET['id'], |
|
17 | - 'path' => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR, |
|
18 | - 'inc_dir' => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR, |
|
19 | - 'languages_dir' => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'lang' . DIRECTORY_SEPARATOR, |
|
20 | - 'views_dir' => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'skin' . DIRECTORY_SEPARATOR, |
|
21 | - 'request_key' => 'module_categories_manager', |
|
22 | - 'messages' => array() |
|
9 | + 'module_version' => '1.0.0', |
|
10 | + 'module_params' => '', |
|
11 | + 'module_id' => $_GET['id'], |
|
12 | + 'package_name' => 'Module_Categories_Manager', |
|
13 | + 'native_language' => 'de', |
|
14 | + 'name' => 'Categories Manager', |
|
15 | + 'dirname' => $site_manager_url, |
|
16 | + 'url' => 'index.php?a=120&id=' . $_GET['id'], |
|
17 | + 'path' => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR, |
|
18 | + 'inc_dir' => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR, |
|
19 | + 'languages_dir' => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'lang' . DIRECTORY_SEPARATOR, |
|
20 | + 'views_dir' => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'skin' . DIRECTORY_SEPARATOR, |
|
21 | + 'request_key' => 'module_categories_manager', |
|
22 | + 'messages' => array() |
|
23 | 23 | ); |
24 | 24 | |
25 | 25 | require_once $_module_params['inc_dir'] . 'Module_Categories_Manager.php'; |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | // assign module_params to internal params |
29 | 29 | foreach( $_module_params as $param => $value ) |
30 | 30 | { |
31 | - $cm->set( $param, $value ); |
|
31 | + $cm->set( $param, $value ); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | // catch the request actions |
@@ -36,8 +36,8 @@ discard block |
||
36 | 36 | |
37 | 37 | if( !$categories = $cm->getCategories() ) |
38 | 38 | { |
39 | - setcookie('webfxtab_manage-categories-pane', 0 ); |
|
40 | - $cm->addMessage( $cm->txt('Currently no categories available... JUST ADD A NEW ONE!'), 'global' ); |
|
39 | + setcookie('webfxtab_manage-categories-pane', 0 ); |
|
40 | + $cm->addMessage( $cm->txt('Currently no categories available... JUST ADD A NEW ONE!'), 'global' ); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | $cm->renderView('main', $categories ); |
@@ -1,48 +1,48 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if(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 | if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/functions.inc.php')) { |
7 | - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/functions.inc.php'); |
|
7 | + include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/functions.inc.php'); |
|
8 | 8 | } else { |
9 | - include_once(MODX_MANAGER_PATH . 'actions/resources/functions.inc.php'); |
|
9 | + include_once(MODX_MANAGER_PATH . 'actions/resources/functions.inc.php'); |
|
10 | 10 | } |
11 | 11 | if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/mgrResources.class.php')) { |
12 | - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/mgrResources.class.php'); |
|
12 | + include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/mgrResources.class.php'); |
|
13 | 13 | } else { |
14 | - include_once(MODX_MANAGER_PATH . 'actions/resources/mgrResources.class.php'); |
|
14 | + include_once(MODX_MANAGER_PATH . 'actions/resources/mgrResources.class.php'); |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | $resources = new mgrResources(); |
18 | 18 | |
19 | 19 | // Prepare lang-strings for "Lock Elements" |
20 | 20 | $unlockTranslations = array( |
21 | - 'msg' => $_lang["unlock_element_id_warning"], |
|
22 | - 'type1' => $_lang["lock_element_type_1"], |
|
23 | - 'type2' => $_lang["lock_element_type_2"], |
|
24 | - 'type3' => $_lang["lock_element_type_3"], |
|
25 | - 'type4' => $_lang["lock_element_type_4"], |
|
26 | - 'type5' => $_lang["lock_element_type_5"], |
|
27 | - 'type6' => $_lang["lock_element_type_6"], |
|
28 | - 'type7' => $_lang["lock_element_type_7"], |
|
29 | - 'type8' => $_lang["lock_element_type_8"] |
|
21 | + 'msg' => $_lang["unlock_element_id_warning"], |
|
22 | + 'type1' => $_lang["lock_element_type_1"], |
|
23 | + 'type2' => $_lang["lock_element_type_2"], |
|
24 | + 'type3' => $_lang["lock_element_type_3"], |
|
25 | + 'type4' => $_lang["lock_element_type_4"], |
|
26 | + 'type5' => $_lang["lock_element_type_5"], |
|
27 | + 'type6' => $_lang["lock_element_type_6"], |
|
28 | + 'type7' => $_lang["lock_element_type_7"], |
|
29 | + 'type8' => $_lang["lock_element_type_8"] |
|
30 | 30 | ); |
31 | 31 | foreach($unlockTranslations as $key => $value) $unlockTranslations[$key] = iconv($modx->config["modx_charset"], "utf-8", $value); |
32 | 32 | |
33 | 33 | // Prepare lang-strings for mgrResAction() |
34 | 34 | $mraTranslations = array( |
35 | - 'create_new' => $_lang["create_new"], |
|
36 | - 'edit' => $_lang["edit"], |
|
37 | - 'duplicate' => $_lang["duplicate"], |
|
38 | - 'remove' => $_lang["remove"], |
|
39 | - 'confirm_duplicate_record' => $_lang["confirm_duplicate_record"], |
|
40 | - 'confirm_delete_template' => $_lang["confirm_delete_template"], |
|
41 | - 'confirm_delete_tmplvars' => $_lang["confirm_delete_tmplvars"], |
|
42 | - 'confirm_delete_htmlsnippet' => $_lang["confirm_delete_htmlsnippet"], |
|
43 | - 'confirm_delete_snippet' => $_lang["confirm_delete_htmlsnippet"], |
|
44 | - 'confirm_delete_plugin' => $_lang["confirm_delete_plugin"], |
|
45 | - 'confirm_delete_module' => $_lang["confirm_delete_module"], |
|
35 | + 'create_new' => $_lang["create_new"], |
|
36 | + 'edit' => $_lang["edit"], |
|
37 | + 'duplicate' => $_lang["duplicate"], |
|
38 | + 'remove' => $_lang["remove"], |
|
39 | + 'confirm_duplicate_record' => $_lang["confirm_duplicate_record"], |
|
40 | + 'confirm_delete_template' => $_lang["confirm_delete_template"], |
|
41 | + 'confirm_delete_tmplvars' => $_lang["confirm_delete_tmplvars"], |
|
42 | + 'confirm_delete_htmlsnippet' => $_lang["confirm_delete_htmlsnippet"], |
|
43 | + 'confirm_delete_snippet' => $_lang["confirm_delete_htmlsnippet"], |
|
44 | + 'confirm_delete_plugin' => $_lang["confirm_delete_plugin"], |
|
45 | + 'confirm_delete_module' => $_lang["confirm_delete_module"], |
|
46 | 46 | ); |
47 | 47 | foreach($mraTranslations as $key => $value) $mraTranslations[$key] = iconv($modx->config["modx_charset"], "utf-8", $value); |
48 | 48 | ?> |
@@ -65,46 +65,46 @@ discard block |
||
65 | 65 | </script> |
66 | 66 | |
67 | 67 | <?php |
68 | - if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab1_templates.inc.php')) { |
|
69 | - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab1_templates.inc.php'); |
|
70 | - } else { |
|
71 | - include_once(MODX_MANAGER_PATH . '/actions/resources/tab1_templates.inc.php'); |
|
72 | - } |
|
68 | + if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab1_templates.inc.php')) { |
|
69 | + include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab1_templates.inc.php'); |
|
70 | + } else { |
|
71 | + include_once(MODX_MANAGER_PATH . '/actions/resources/tab1_templates.inc.php'); |
|
72 | + } |
|
73 | 73 | |
74 | - if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab2_templatevars.inc.php')) { |
|
75 | - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab2_templatevars.inc.php'); |
|
76 | - } else { |
|
77 | - include_once(MODX_MANAGER_PATH . '/actions/resources/tab2_templatevars.inc.php'); |
|
78 | - } |
|
74 | + if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab2_templatevars.inc.php')) { |
|
75 | + include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab2_templatevars.inc.php'); |
|
76 | + } else { |
|
77 | + include_once(MODX_MANAGER_PATH . '/actions/resources/tab2_templatevars.inc.php'); |
|
78 | + } |
|
79 | 79 | |
80 | - if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab3_chunks.inc.php')) { |
|
81 | - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab3_chunks.inc.php'); |
|
82 | - } else { |
|
83 | - include_once(MODX_MANAGER_PATH . '/actions/resources/tab3_chunks.inc.php'); |
|
84 | - } |
|
80 | + if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab3_chunks.inc.php')) { |
|
81 | + include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab3_chunks.inc.php'); |
|
82 | + } else { |
|
83 | + include_once(MODX_MANAGER_PATH . '/actions/resources/tab3_chunks.inc.php'); |
|
84 | + } |
|
85 | 85 | |
86 | - if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab4_snippets.inc.php')) { |
|
87 | - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab4_snippets.inc.php'); |
|
88 | - } else { |
|
89 | - include_once(MODX_MANAGER_PATH . '/actions/resources/tab4_snippets.inc.php'); |
|
90 | - } |
|
86 | + if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab4_snippets.inc.php')) { |
|
87 | + include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab4_snippets.inc.php'); |
|
88 | + } else { |
|
89 | + include_once(MODX_MANAGER_PATH . '/actions/resources/tab4_snippets.inc.php'); |
|
90 | + } |
|
91 | 91 | |
92 | - if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab5_plugins.inc.php')) { |
|
93 | - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab5_plugins.inc.php'); |
|
94 | - } else { |
|
95 | - include_once(MODX_MANAGER_PATH . '/actions/resources/tab5_plugins.inc.php'); |
|
96 | - } |
|
92 | + if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab5_plugins.inc.php')) { |
|
93 | + include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab5_plugins.inc.php'); |
|
94 | + } else { |
|
95 | + include_once(MODX_MANAGER_PATH . '/actions/resources/tab5_plugins.inc.php'); |
|
96 | + } |
|
97 | 97 | |
98 | - if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab6_categoryview.inc.php')) { |
|
99 | - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab6_categoryview.inc.php'); |
|
100 | - } else { |
|
101 | - include_once(MODX_MANAGER_PATH . '/actions/resources/tab6_categoryview.inc.php'); |
|
102 | - } |
|
98 | + if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab6_categoryview.inc.php')) { |
|
99 | + include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab6_categoryview.inc.php'); |
|
100 | + } else { |
|
101 | + include_once(MODX_MANAGER_PATH . '/actions/resources/tab6_categoryview.inc.php'); |
|
102 | + } |
|
103 | 103 | |
104 | 104 | |
105 | - if(is_numeric($_GET['tab'])) { |
|
106 | - echo '<script type="text/javascript"> tpResources.setSelectedIndex( ' . $_GET['tab'] . ' );</script>'; |
|
107 | - } |
|
108 | - ?> |
|
105 | + if(is_numeric($_GET['tab'])) { |
|
106 | + echo '<script type="text/javascript"> tpResources.setSelectedIndex( ' . $_GET['tab'] . ' );</script>'; |
|
107 | + } |
|
108 | + ?> |
|
109 | 109 | </div> |
110 | 110 | </div> |
@@ -1,9 +1,9 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if(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 | if(!$modx->hasPermission('view_eventlog')) { |
6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | ?> |
9 | 9 | <script type="text/javascript" src="media/script/tablesort.js"></script> |
@@ -17,14 +17,14 @@ discard block |
||
17 | 17 | <div class="form-group" id="lyr1"> |
18 | 18 | <b><?= $_lang["publish_events"] ?></b> |
19 | 19 | <?php |
20 | - $rs = $modx->db->select('id, pagetitle, pub_date', $modx->getFullTableName('site_content'), "pub_date > " . time() . "", 'pub_date ASC'); |
|
21 | - $limit = $modx->db->getRecordCount($rs); |
|
22 | - if($limit < 1) { |
|
23 | - ?> |
|
20 | + $rs = $modx->db->select('id, pagetitle, pub_date', $modx->getFullTableName('site_content'), "pub_date > " . time() . "", 'pub_date ASC'); |
|
21 | + $limit = $modx->db->getRecordCount($rs); |
|
22 | + if($limit < 1) { |
|
23 | + ?> |
|
24 | 24 | <p><?= $_lang["no_docs_pending_publishing"] ?></p> |
25 | 25 | <?php |
26 | - } else { |
|
27 | - ?> |
|
26 | + } else { |
|
27 | + ?> |
|
28 | 28 | <div class="table-responsive"> |
29 | 29 | <table class="grid sortabletable" id="table-1"> |
30 | 30 | <thead> |
@@ -36,34 +36,34 @@ discard block |
||
36 | 36 | </thead> |
37 | 37 | <tbody> |
38 | 38 | <?php |
39 | - while($row = $modx->db->getRow($rs)) { |
|
40 | - ?> |
|
39 | + while($row = $modx->db->getRow($rs)) { |
|
40 | + ?> |
|
41 | 41 | <tr> |
42 | 42 | <td class="text-right"><?= $row['id'] ?></td> |
43 | 43 | <td><a href="index.php?a=3&id=<?= $row['id'] ?>"><?= $row['pagetitle'] ?></a></td> |
44 | 44 | <td class="text-nowrap text-right"><?= $modx->toDateFormat($row['pub_date'] + $server_offset_time) ?></td> |
45 | 45 | </tr> |
46 | 46 | <?php |
47 | - } |
|
48 | - ?> |
|
47 | + } |
|
48 | + ?> |
|
49 | 49 | </tbody> |
50 | 50 | </table> |
51 | 51 | </div> |
52 | 52 | <?php |
53 | - } |
|
54 | - ?> |
|
53 | + } |
|
54 | + ?> |
|
55 | 55 | </div> |
56 | 56 | <div class="form-group" id="lyr2"> |
57 | 57 | <b><?= $_lang["unpublish_events"] ?></b> |
58 | 58 | <?php |
59 | - $rs = $modx->db->select('id, pagetitle, unpub_date', $modx->getFullTableName('site_content'), "unpub_date > " . time() . "", 'unpub_date ASC'); |
|
60 | - $limit = $modx->db->getRecordCount($rs); |
|
61 | - if($limit < 1) { |
|
62 | - ?> |
|
59 | + $rs = $modx->db->select('id, pagetitle, unpub_date', $modx->getFullTableName('site_content'), "unpub_date > " . time() . "", 'unpub_date ASC'); |
|
60 | + $limit = $modx->db->getRecordCount($rs); |
|
61 | + if($limit < 1) { |
|
62 | + ?> |
|
63 | 63 | <p><?= $_lang["no_docs_pending_unpublishing"] ?></p> |
64 | 64 | <?php |
65 | - } else { |
|
66 | - ?> |
|
65 | + } else { |
|
66 | + ?> |
|
67 | 67 | <div class="table-responsive"> |
68 | 68 | <table class="grid sortabletable" id="table-2"> |
69 | 69 | <thead> |
@@ -75,34 +75,34 @@ discard block |
||
75 | 75 | </thead> |
76 | 76 | <tbody> |
77 | 77 | <?php |
78 | - while($row = $modx->db->getRow($rs)) { |
|
79 | - ?> |
|
78 | + while($row = $modx->db->getRow($rs)) { |
|
79 | + ?> |
|
80 | 80 | <tr> |
81 | 81 | <td class="text-right"><?= $row['id'] ?></td> |
82 | 82 | <td><a href="index.php?a=3&id=<?= $row['id'] ?>"><?= $row['pagetitle'] ?></a></td> |
83 | 83 | <td class="text-nowrap text-right"><?= $modx->toDateFormat($row['unpub_date'] + $server_offset_time) ?></td> |
84 | 84 | </tr> |
85 | 85 | <?php |
86 | - } |
|
87 | - ?> |
|
86 | + } |
|
87 | + ?> |
|
88 | 88 | </tbody> |
89 | 89 | </table> |
90 | 90 | </div> |
91 | 91 | <?php |
92 | - } |
|
93 | - ?> |
|
92 | + } |
|
93 | + ?> |
|
94 | 94 | </div> |
95 | 95 | <div class="form-group"> |
96 | 96 | <b><?= $_lang["all_events"] ?></b> |
97 | 97 | <?php |
98 | - $rs = $modx->db->select('id, pagetitle, pub_date, unpub_date', $modx->getFullTableName('site_content'), "pub_date > 0 OR unpub_date > 0", "pub_date DESC"); |
|
99 | - $limit = $modx->db->getRecordCount($rs); |
|
100 | - if($limit < 1) { |
|
101 | - ?> |
|
98 | + $rs = $modx->db->select('id, pagetitle, pub_date, unpub_date', $modx->getFullTableName('site_content'), "pub_date > 0 OR unpub_date > 0", "pub_date DESC"); |
|
99 | + $limit = $modx->db->getRecordCount($rs); |
|
100 | + if($limit < 1) { |
|
101 | + ?> |
|
102 | 102 | <p><?= $_lang["no_docs_pending_pubunpub"] ?></p> |
103 | 103 | <?php |
104 | - } else { |
|
105 | - ?> |
|
104 | + } else { |
|
105 | + ?> |
|
106 | 106 | <div class="table-responsive"> |
107 | 107 | <table class="grid sortabletable" id="table-3"> |
108 | 108 | <thead> |
@@ -115,8 +115,8 @@ discard block |
||
115 | 115 | </thead> |
116 | 116 | <tbody> |
117 | 117 | <?php |
118 | - while($row = $modx->db->getRow($rs)) { |
|
119 | - ?> |
|
118 | + while($row = $modx->db->getRow($rs)) { |
|
119 | + ?> |
|
120 | 120 | <tr> |
121 | 121 | <td class="text-right"><?= $row['id'] ?></td> |
122 | 122 | <td><a href="index.php?a=3&id=<?= $row['id'] ?>"><?= $row['pagetitle'] ?></a></td> |
@@ -124,14 +124,14 @@ discard block |
||
124 | 124 | <td class="text-nowrap text-right"><?= $row['unpub_date'] == 0 ? "" : $modx->toDateFormat($row['unpub_date'] + $server_offset_time) ?></td> |
125 | 125 | </tr> |
126 | 126 | <?php |
127 | - } |
|
128 | - ?> |
|
127 | + } |
|
128 | + ?> |
|
129 | 129 | </tbody> |
130 | 130 | </table> |
131 | 131 | </div> |
132 | 132 | <?php |
133 | - } |
|
134 | - ?> |
|
133 | + } |
|
134 | + ?> |
|
135 | 135 | </div> |
136 | 136 | </div> |
137 | 137 | </div> |
@@ -1,20 +1,20 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if(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 | switch($modx->manager->action) { |
6 | - case 107: |
|
7 | - if(!$modx->hasPermission('new_module')) { |
|
8 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
9 | - } |
|
10 | - break; |
|
11 | - case 108: |
|
12 | - if(!$modx->hasPermission('edit_module')) { |
|
13 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
14 | - } |
|
15 | - break; |
|
16 | - default: |
|
17 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + case 107: |
|
7 | + if(!$modx->hasPermission('new_module')) { |
|
8 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
9 | + } |
|
10 | + break; |
|
11 | + case 108: |
|
12 | + if(!$modx->hasPermission('edit_module')) { |
|
13 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
14 | + } |
|
15 | + break; |
|
16 | + default: |
|
17 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
18 | 18 | } |
19 | 19 | $id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; |
20 | 20 | // Get table names (alphabetical) |
@@ -30,16 +30,16 @@ discard block |
||
30 | 30 | $tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars'); |
31 | 31 | // create globally unique identifiers (guid) |
32 | 32 | function createGUID() { |
33 | - srand((double) microtime() * 1000000); |
|
34 | - $r = rand(); |
|
35 | - $u = uniqid(getmypid() . $r . (double) microtime() * 1000000, 1); |
|
36 | - $m = md5($u); |
|
37 | - return $m; |
|
33 | + srand((double) microtime() * 1000000); |
|
34 | + $r = rand(); |
|
35 | + $u = uniqid(getmypid() . $r . (double) microtime() * 1000000, 1); |
|
36 | + $m = md5($u); |
|
37 | + return $m; |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | // check to see the module editor isn't locked |
41 | 41 | if($lockedEl = $modx->elementIsLocked(6, $id)) { |
42 | - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module'])); |
|
42 | + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module'])); |
|
43 | 43 | } |
44 | 44 | // end check for lock |
45 | 45 | |
@@ -47,22 +47,22 @@ discard block |
||
47 | 47 | $modx->lockElement(6, $id); |
48 | 48 | |
49 | 49 | if(isset($_GET['id'])) { |
50 | - $rs = $modx->db->select('*', $tbl_site_modules, "id='{$id}'"); |
|
51 | - $content = $modx->db->getRow($rs); |
|
52 | - if(!$content) { |
|
53 | - $modx->webAlertAndQuit("Module not found for id '{$id}'."); |
|
54 | - } |
|
55 | - $content['properties'] = str_replace("&", "&", $content['properties']); |
|
56 | - $_SESSION['itemname'] = $content['name']; |
|
57 | - if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { |
|
58 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
59 | - } |
|
50 | + $rs = $modx->db->select('*', $tbl_site_modules, "id='{$id}'"); |
|
51 | + $content = $modx->db->getRow($rs); |
|
52 | + if(!$content) { |
|
53 | + $modx->webAlertAndQuit("Module not found for id '{$id}'."); |
|
54 | + } |
|
55 | + $content['properties'] = str_replace("&", "&", $content['properties']); |
|
56 | + $_SESSION['itemname'] = $content['name']; |
|
57 | + if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { |
|
58 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
59 | + } |
|
60 | 60 | } else { |
61 | - $_SESSION['itemname'] = $_lang["new_module"]; |
|
62 | - $content['wrap'] = '1'; |
|
61 | + $_SESSION['itemname'] = $_lang["new_module"]; |
|
62 | + $content['wrap'] = '1'; |
|
63 | 63 | } |
64 | 64 | if($modx->manager->hasFormValues()) { |
65 | - $modx->manager->loadFormValues(); |
|
65 | + $modx->manager->loadFormValues(); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | // Add lock-element JS-Script |
@@ -433,18 +433,18 @@ discard block |
||
433 | 433 | |
434 | 434 | <form name="mutate" id="mutate" class="module" method="post" action="index.php?a=109"> |
435 | 435 | <?php |
436 | - // invoke OnModFormPrerender event |
|
437 | - $evtOut = $modx->invokeEvent('OnModFormPrerender', array('id' => $id)); |
|
438 | - if(is_array($evtOut)) { |
|
439 | - echo implode('', $evtOut); |
|
440 | - } |
|
441 | - |
|
442 | - // Prepare internal params & info-tab via parseDocBlock |
|
443 | - $modulecode = isset($content['modulecode']) ? $modx->db->escape($content['modulecode']) : ''; |
|
444 | - $docBlock = $modx->parseDocBlockFromString($modulecode); |
|
445 | - $docBlockList = $modx->convertDocBlockIntoList($docBlock); |
|
446 | - $internal = array(); |
|
447 | - ?> |
|
436 | + // invoke OnModFormPrerender event |
|
437 | + $evtOut = $modx->invokeEvent('OnModFormPrerender', array('id' => $id)); |
|
438 | + if(is_array($evtOut)) { |
|
439 | + echo implode('', $evtOut); |
|
440 | + } |
|
441 | + |
|
442 | + // Prepare internal params & info-tab via parseDocBlock |
|
443 | + $modulecode = isset($content['modulecode']) ? $modx->db->escape($content['modulecode']) : ''; |
|
444 | + $docBlock = $modx->parseDocBlockFromString($modulecode); |
|
445 | + $docBlockList = $modx->convertDocBlockIntoList($docBlock); |
|
446 | + $internal = array(); |
|
447 | + ?> |
|
448 | 448 | <input type="hidden" name="id" value="<?= $content['id'] ?>"> |
449 | 449 | <input type="hidden" name="mode" value="<?= $modx->manager->action ?>"> |
450 | 450 | |
@@ -497,11 +497,11 @@ discard block |
||
497 | 497 | <select name="categoryid" class="form-control" onchange="documentDirty=true;"> |
498 | 498 | <option> </option> |
499 | 499 | <?php |
500 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
501 | - foreach(getCategories() as $n => $v) { |
|
502 | - echo "\t\t\t" . '<option value="' . $v['id'] . '"' . ($content['category'] == $v['id'] ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($v['category']) . "</option>\n"; |
|
503 | - } |
|
504 | - ?> |
|
500 | + include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
501 | + foreach(getCategories() as $n => $v) { |
|
502 | + echo "\t\t\t" . '<option value="' . $v['id'] . '"' . ($content['category'] == $v['id'] ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($v['category']) . "</option>\n"; |
|
503 | + } |
|
504 | + ?> |
|
505 | 505 | </select> |
506 | 506 | </div> |
507 | 507 | </div> |
@@ -608,7 +608,7 @@ discard block |
||
608 | 608 | <i class="<?= $_style["actions_save"] ?>"></i> <?= $_lang['manage_depends'] ?></a> |
609 | 609 | </div> |
610 | 610 | <?php |
611 | - $ds = $modx->db->select("smd.id, COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) AS name, |
|
611 | + $ds = $modx->db->select("smd.id, COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) AS name, |
|
612 | 612 | CASE smd.type |
613 | 613 | WHEN 10 THEN 'Chunk' |
614 | 614 | WHEN 20 THEN 'Document' |
@@ -624,17 +624,17 @@ discard block |
||
624 | 624 | LEFT JOIN {$tbl_site_templates} AS st ON st.id = smd.resource AND smd.type = 50 |
625 | 625 | LEFT JOIN {$tbl_site_tmplvars} AS sv ON sv.id = smd.resource AND smd.type = 60", "smd.module='{$id}'", 'smd.type,name'); |
626 | 626 | |
627 | - include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; |
|
628 | - $grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items |
|
629 | - $grd->noRecordMsg = $_lang['no_records_found']; |
|
630 | - $grd->cssClass = 'grid'; |
|
631 | - $grd->columnHeaderClass = 'gridHeader'; |
|
632 | - $grd->itemClass = 'gridItem'; |
|
633 | - $grd->altItemClass = 'gridAltItem'; |
|
634 | - $grd->columns = $_lang['element_name'] . " ," . $_lang['type']; |
|
635 | - $grd->fields = "name,type"; |
|
636 | - echo $grd->render(); |
|
637 | - ?> |
|
627 | + include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; |
|
628 | + $grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items |
|
629 | + $grd->noRecordMsg = $_lang['no_records_found']; |
|
630 | + $grd->cssClass = 'grid'; |
|
631 | + $grd->columnHeaderClass = 'gridHeader'; |
|
632 | + $grd->itemClass = 'gridItem'; |
|
633 | + $grd->altItemClass = 'gridAltItem'; |
|
634 | + $grd->columns = $_lang['element_name'] . " ," . $_lang['type']; |
|
635 | + $grd->fields = "name,type"; |
|
636 | + echo $grd->render(); |
|
637 | + ?> |
|
638 | 638 | </div> |
639 | 639 | </div> |
640 | 640 | <?php endif; ?> |
@@ -646,12 +646,12 @@ discard block |
||
646 | 646 | <div class="container container-body"> |
647 | 647 | <?php if($use_udperms == 1) : ?> |
648 | 648 | <?php |
649 | - // fetch user access permissions for the module |
|
650 | - $rs = $modx->db->select('usergroup', $tbl_site_module_access, "module='{$id}'"); |
|
651 | - $groupsarray = $modx->db->getColumn('usergroup', $rs); |
|
649 | + // fetch user access permissions for the module |
|
650 | + $rs = $modx->db->select('usergroup', $tbl_site_module_access, "module='{$id}'"); |
|
651 | + $groupsarray = $modx->db->getColumn('usergroup', $rs); |
|
652 | 652 | |
653 | - if($modx->hasPermission('access_permissions')) { |
|
654 | - ?> |
|
653 | + if($modx->hasPermission('access_permissions')) { |
|
654 | + ?> |
|
655 | 655 | <!-- User Group Access Permissions --> |
656 | 656 | <script type="text/javascript"> |
657 | 657 | function makePublic(b) { |
@@ -675,28 +675,28 @@ discard block |
||
675 | 675 | </script> |
676 | 676 | <p><?= $_lang['module_group_access_msg'] ?></p> |
677 | 677 | <?php |
678 | - } |
|
679 | - $chk = ''; |
|
680 | - $rs = $modx->db->select('name, id', $tbl_membergroup_names, '', 'name'); |
|
681 | - while($row = $modx->db->getRow($rs)) { |
|
682 | - $groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array(); |
|
683 | - $checked = in_array($row['id'], $groupsarray); |
|
684 | - if($modx->hasPermission('access_permissions')) { |
|
685 | - if($checked) { |
|
686 | - $notPublic = true; |
|
687 | - } |
|
688 | - $chks .= '<label><input type="checkbox" name="usrgroups[]" value="' . $row['id'] . '"' . ($checked ? ' checked="checked"' : '') . ' onclick="makePublic(false)" /> ' . $row['name'] . "</label><br />\n"; |
|
689 | - } else { |
|
690 | - if($checked) { |
|
691 | - $chks = '<input type="hidden" name="usrgroups[]" value="' . $row['id'] . '" />' . "\n" . $chks; |
|
692 | - } |
|
693 | - } |
|
694 | - } |
|
695 | - if($modx->hasPermission('access_permissions')) { |
|
696 | - $chks = '<label><input type="checkbox" name="chkallgroups"' . (!$notPublic ? ' checked="checked"' : '') . ' onclick="makePublic(true)" /><span class="warning"> ' . $_lang['all_usr_groups'] . '</span></label><br />' . "\n" . $chks; |
|
697 | - } |
|
698 | - echo $chks; |
|
699 | - ?> |
|
678 | + } |
|
679 | + $chk = ''; |
|
680 | + $rs = $modx->db->select('name, id', $tbl_membergroup_names, '', 'name'); |
|
681 | + while($row = $modx->db->getRow($rs)) { |
|
682 | + $groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array(); |
|
683 | + $checked = in_array($row['id'], $groupsarray); |
|
684 | + if($modx->hasPermission('access_permissions')) { |
|
685 | + if($checked) { |
|
686 | + $notPublic = true; |
|
687 | + } |
|
688 | + $chks .= '<label><input type="checkbox" name="usrgroups[]" value="' . $row['id'] . '"' . ($checked ? ' checked="checked"' : '') . ' onclick="makePublic(false)" /> ' . $row['name'] . "</label><br />\n"; |
|
689 | + } else { |
|
690 | + if($checked) { |
|
691 | + $chks = '<input type="hidden" name="usrgroups[]" value="' . $row['id'] . '" />' . "\n" . $chks; |
|
692 | + } |
|
693 | + } |
|
694 | + } |
|
695 | + if($modx->hasPermission('access_permissions')) { |
|
696 | + $chks = '<label><input type="checkbox" name="chkallgroups"' . (!$notPublic ? ' checked="checked"' : '') . ' onclick="makePublic(true)" /><span class="warning"> ' . $_lang['all_usr_groups'] . '</span></label><br />' . "\n" . $chks; |
|
697 | + } |
|
698 | + echo $chks; |
|
699 | + ?> |
|
700 | 700 | <?php endif; ?> |
701 | 701 | </div> |
702 | 702 | </div> |
@@ -712,11 +712,11 @@ discard block |
||
712 | 712 | |
713 | 713 | <input type="submit" name="save" style="display:none;"> |
714 | 714 | <?php |
715 | - // invoke OnModFormRender event |
|
716 | - $evtOut = $modx->invokeEvent('OnModFormRender', array('id' => $id)); |
|
717 | - if(is_array($evtOut)) { |
|
718 | - echo implode('', $evtOut); |
|
719 | - } |
|
720 | - ?> |
|
715 | + // invoke OnModFormRender event |
|
716 | + $evtOut = $modx->invokeEvent('OnModFormRender', array('id' => $id)); |
|
717 | + if(is_array($evtOut)) { |
|
718 | + echo implode('', $evtOut); |
|
719 | + } |
|
720 | + ?> |
|
721 | 721 | </form> |
722 | 722 | <script type="text/javascript">setTimeout('showParameters();', 10);</script> |