@@ -5,8 +5,8 @@ |
||
| 5 | 5 | <div class="sectionHeader">Changelog</div> |
| 6 | 6 | <div class="sectionBody"> |
| 7 | 7 | <?php |
| 8 | - $changeLog = MODX_BASE_PATH . 'assets/docs/changelog.txt'; |
|
| 9 | - if(is_readable($changeLog)) |
|
| 10 | - echo str_replace("\n",'<br>',file_get_contents($changeLog)); |
|
| 8 | + $changeLog = MODX_BASE_PATH . 'assets/docs/changelog.txt'; |
|
| 9 | + if(is_readable($changeLog)) |
|
| 10 | + echo str_replace("\n",'<br>',file_get_contents($changeLog)); |
|
| 11 | 11 | ?> |
| 12 | 12 | </div> |
| 13 | 13 | \ No newline at end of file |
@@ -2,38 +2,38 @@ |
||
| 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 | $logo= '<img src="media/style/default/images/misc/login-logo.png" height="54" width="358" border="0">'; |
| 4 | 4 | $downloadLinks = array( |
| 5 | - 0=>array('title'=>$_lang["information"],'link'=>'https://evo.im/'), |
|
| 6 | - 1=>array('title'=>$_lang["download"],'link'=>'https://github.com/evolution-cms/evolution/releases'), |
|
| 7 | - 2=>array('title'=>$_lang["previous_releases"],'link'=>'https://modx.com/download/evolution/previous-releases.html'), |
|
| 8 | - 3=>array('title'=>$_lang["extras"],'link'=>array( |
|
| 9 | - 'http://extras.evolution-cms.com/', |
|
| 10 | - 'https://github.com/extras-evolution' |
|
| 11 | - )), |
|
| 5 | + 0=>array('title'=>$_lang["information"],'link'=>'https://evo.im/'), |
|
| 6 | + 1=>array('title'=>$_lang["download"],'link'=>'https://github.com/evolution-cms/evolution/releases'), |
|
| 7 | + 2=>array('title'=>$_lang["previous_releases"],'link'=>'https://modx.com/download/evolution/previous-releases.html'), |
|
| 8 | + 3=>array('title'=>$_lang["extras"],'link'=>array( |
|
| 9 | + 'http://extras.evolution-cms.com/', |
|
| 10 | + 'https://github.com/extras-evolution' |
|
| 11 | + )), |
|
| 12 | 12 | ); |
| 13 | 13 | |
| 14 | 14 | $translationLinks = array( |
| 15 | - 0=>array('title'=>'Evolution CMS','link'=>'https://www.transifex.com/evolutioncms/evolution/'), |
|
| 16 | - 1=>array('title'=>$_lang["extras"],'link'=>'https://www.transifex.com/evolutioncms/extras/'), |
|
| 15 | + 0=>array('title'=>'Evolution CMS','link'=>'https://www.transifex.com/evolutioncms/evolution/'), |
|
| 16 | + 1=>array('title'=>$_lang["extras"],'link'=>'https://www.transifex.com/evolutioncms/extras/'), |
|
| 17 | 17 | ); |
| 18 | 18 | |
| 19 | 19 | function createList($sectionHeader, $linkArr) { |
| 20 | - $output = '<div class="sectionHeader">'.$sectionHeader.'</div><div class="sectionBody">'."\n"; |
|
| 21 | - $output .= '<table width="500" border="0" cellspacing="0" cellpadding="0">'."\n"; |
|
| 22 | - $links = ''; |
|
| 23 | - foreach($linkArr as $row) { |
|
| 24 | - if (!is_array($row['link'])) $row['link'] = array($row['link']); |
|
| 25 | - foreach ($row['link'] as $link) { |
|
| 26 | - $links .= $links != '' ? '<br/>' : ''; |
|
| 27 | - $links .= '<a href="' . $link . '" target="_blank">' . $link . '</a>'; |
|
| 28 | - } |
|
| 29 | - $output .= ' |
|
| 20 | + $output = '<div class="sectionHeader">'.$sectionHeader.'</div><div class="sectionBody">'."\n"; |
|
| 21 | + $output .= '<table width="500" border="0" cellspacing="0" cellpadding="0">'."\n"; |
|
| 22 | + $links = ''; |
|
| 23 | + foreach($linkArr as $row) { |
|
| 24 | + if (!is_array($row['link'])) $row['link'] = array($row['link']); |
|
| 25 | + foreach ($row['link'] as $link) { |
|
| 26 | + $links .= $links != '' ? '<br/>' : ''; |
|
| 27 | + $links .= '<a href="' . $link . '" target="_blank">' . $link . '</a>'; |
|
| 28 | + } |
|
| 29 | + $output .= ' |
|
| 30 | 30 | <tr> |
| 31 | 31 | <td align="left"><strong>' . $row["title"] . '</strong></td> |
| 32 | 32 | <td align="left">' . $links . '</td> |
| 33 | 33 | </tr>'; |
| 34 | - $links = ''; |
|
| 35 | - } |
|
| 36 | - $output .= '</table></div>'."\n"; |
|
| 34 | + $links = ''; |
|
| 35 | + } |
|
| 36 | + $output .= '</table></div>'."\n"; |
|
| 37 | 37 | return $output; |
| 38 | 38 | } |
| 39 | 39 | echo $logo; |
@@ -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((int) $modx->manager->action) { |
| 7 | - case 35: |
|
| 8 | - if(!$modx->hasPermission('edit_role')) { |
|
| 9 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 10 | - } |
|
| 11 | - break; |
|
| 12 | - case 38: |
|
| 13 | - if(!$modx->hasPermission('new_role')) { |
|
| 14 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 15 | - } |
|
| 16 | - break; |
|
| 17 | - default: |
|
| 18 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 7 | + case 35: |
|
| 8 | + if(!$modx->hasPermission('edit_role')) { |
|
| 9 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 10 | + } |
|
| 11 | + break; |
|
| 12 | + case 38: |
|
| 13 | + if(!$modx->hasPermission('new_role')) { |
|
| 14 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 15 | + } |
|
| 16 | + break; |
|
| 17 | + default: |
|
| 18 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | $role = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | |
| 25 | 25 | // check to see the snippet editor isn't locked |
| 26 | 26 | if($lockedEl = $modx->elementIsLocked(8, $role)) { |
| 27 | - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['role'])); |
|
| 27 | + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['role'])); |
|
| 28 | 28 | } |
| 29 | 29 | // end check for lock |
| 30 | 30 | |
@@ -32,15 +32,15 @@ discard block |
||
| 32 | 32 | $modx->lockElement(8, $role); |
| 33 | 33 | |
| 34 | 34 | if($modx->manager->action == '35') { |
| 35 | - $rs = $modx->db->select('*', $tbl_user_roles, "id='{$role}'"); |
|
| 36 | - $roledata = $modx->db->getRow($rs); |
|
| 37 | - if(!$roledata) { |
|
| 38 | - $modx->webAlertAndQuit("No role returned!"); |
|
| 39 | - } |
|
| 40 | - $_SESSION['itemname'] = $roledata['name']; |
|
| 35 | + $rs = $modx->db->select('*', $tbl_user_roles, "id='{$role}'"); |
|
| 36 | + $roledata = $modx->db->getRow($rs); |
|
| 37 | + if(!$roledata) { |
|
| 38 | + $modx->webAlertAndQuit("No role returned!"); |
|
| 39 | + } |
|
| 40 | + $_SESSION['itemname'] = $roledata['name']; |
|
| 41 | 41 | } else { |
| 42 | - $roledata = 0; |
|
| 43 | - $_SESSION['itemname'] = $_lang["new_role"]; |
|
| 42 | + $roledata = 0; |
|
| 43 | + $_SESSION['itemname'] = $_lang["new_role"]; |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | // Add lock-element JS-Script |
@@ -107,63 +107,63 @@ discard block |
||
| 107 | 107 | <div class="form-group"> |
| 108 | 108 | <h3><?= $_lang['page_data_general'] ?></h3> |
| 109 | 109 | <?php |
| 110 | - echo render_form('frames', $_lang['role_frames'], 'disabled'); |
|
| 111 | - echo render_form('home', $_lang['role_home'], 'disabled'); |
|
| 112 | - echo render_form('messages', $_lang['role_messages']); |
|
| 113 | - echo render_form('logout', $_lang['role_logout'], 'disabled'); |
|
| 114 | - echo render_form('help', $_lang['role_help']); |
|
| 115 | - echo render_form('action_ok', $_lang['role_actionok'], 'disabled'); |
|
| 116 | - echo render_form('error_dialog', $_lang['role_errors'], 'disabled'); |
|
| 117 | - echo render_form('about', $_lang['role_about'], 'disabled'); |
|
| 118 | - echo render_form('credits', $_lang['role_credits'], 'disabled'); |
|
| 119 | - echo render_form('change_password', $_lang['role_change_password']); |
|
| 120 | - echo render_form('save_password', $_lang['role_save_password']); |
|
| 121 | - ?> |
|
| 110 | + echo render_form('frames', $_lang['role_frames'], 'disabled'); |
|
| 111 | + echo render_form('home', $_lang['role_home'], 'disabled'); |
|
| 112 | + echo render_form('messages', $_lang['role_messages']); |
|
| 113 | + echo render_form('logout', $_lang['role_logout'], 'disabled'); |
|
| 114 | + echo render_form('help', $_lang['role_help']); |
|
| 115 | + echo render_form('action_ok', $_lang['role_actionok'], 'disabled'); |
|
| 116 | + echo render_form('error_dialog', $_lang['role_errors'], 'disabled'); |
|
| 117 | + echo render_form('about', $_lang['role_about'], 'disabled'); |
|
| 118 | + echo render_form('credits', $_lang['role_credits'], 'disabled'); |
|
| 119 | + echo render_form('change_password', $_lang['role_change_password']); |
|
| 120 | + echo render_form('save_password', $_lang['role_save_password']); |
|
| 121 | + ?> |
|
| 122 | 122 | </div> |
| 123 | 123 | </div> |
| 124 | 124 | <div class="col-sm-6 col-lg-3"> |
| 125 | 125 | <div class="form-group"> |
| 126 | 126 | <h3><?= $_lang['role_content_management'] ?></h3> |
| 127 | 127 | <?php |
| 128 | - echo render_form('view_document', $_lang['role_view_docdata'], 'disabled'); |
|
| 129 | - echo render_form('new_document', $_lang['role_create_doc']); |
|
| 130 | - echo render_form('edit_document', $_lang['role_edit_doc']); |
|
| 131 | - echo render_form('change_resourcetype', $_lang['role_change_resourcetype']); |
|
| 132 | - echo render_form('save_document', $_lang['role_save_doc']); |
|
| 133 | - echo render_form('publish_document', $_lang['role_publish_doc']); |
|
| 134 | - echo render_form('delete_document', $_lang['role_delete_doc']); |
|
| 135 | - echo render_form('empty_trash', $_lang['role_empty_trash']); |
|
| 136 | - echo render_form('empty_cache', $_lang['role_cache_refresh']); |
|
| 137 | - echo render_form('view_unpublished', $_lang['role_view_unpublished']); |
|
| 138 | - ?> |
|
| 128 | + echo render_form('view_document', $_lang['role_view_docdata'], 'disabled'); |
|
| 129 | + echo render_form('new_document', $_lang['role_create_doc']); |
|
| 130 | + echo render_form('edit_document', $_lang['role_edit_doc']); |
|
| 131 | + echo render_form('change_resourcetype', $_lang['role_change_resourcetype']); |
|
| 132 | + echo render_form('save_document', $_lang['role_save_doc']); |
|
| 133 | + echo render_form('publish_document', $_lang['role_publish_doc']); |
|
| 134 | + echo render_form('delete_document', $_lang['role_delete_doc']); |
|
| 135 | + echo render_form('empty_trash', $_lang['role_empty_trash']); |
|
| 136 | + echo render_form('empty_cache', $_lang['role_cache_refresh']); |
|
| 137 | + echo render_form('view_unpublished', $_lang['role_view_unpublished']); |
|
| 138 | + ?> |
|
| 139 | 139 | </div> |
| 140 | 140 | </div> |
| 141 | 141 | <div class="col-sm-6 col-lg-3 form-group"> |
| 142 | 142 | <div class="form-group"> |
| 143 | 143 | <h3><?= $_lang['role_file_management'] ?></h3> |
| 144 | 144 | <?php |
| 145 | - echo render_form('file_manager', $_lang['role_file_manager']); |
|
| 146 | - echo render_form('assets_files', $_lang['role_assets_files']); |
|
| 147 | - echo render_form('assets_images', $_lang['role_assets_images']); |
|
| 148 | - ?> |
|
| 145 | + echo render_form('file_manager', $_lang['role_file_manager']); |
|
| 146 | + echo render_form('assets_files', $_lang['role_assets_files']); |
|
| 147 | + echo render_form('assets_images', $_lang['role_assets_images']); |
|
| 148 | + ?> |
|
| 149 | 149 | </div> |
| 150 | 150 | <div class="form-group"> |
| 151 | 151 | <h3><?= $_lang['category_management'] ?></h3> |
| 152 | 152 | <?php |
| 153 | - echo render_form('category_manager', $_lang['role_category_manager']); |
|
| 154 | - ?> |
|
| 153 | + echo render_form('category_manager', $_lang['role_category_manager']); |
|
| 154 | + ?> |
|
| 155 | 155 | </div> |
| 156 | 156 | </div> |
| 157 | 157 | <div class="col-sm-6 col-lg-3"> |
| 158 | 158 | <div class="form-group"> |
| 159 | 159 | <h3><?= $_lang['role_module_management'] ?></h3> |
| 160 | 160 | <?php |
| 161 | - echo render_form('new_module', $_lang['role_new_module']); |
|
| 162 | - echo render_form('edit_module', $_lang['role_edit_module']); |
|
| 163 | - echo render_form('save_module', $_lang['role_save_module']); |
|
| 164 | - echo render_form('delete_module', $_lang['role_delete_module']); |
|
| 165 | - echo render_form('exec_module', $_lang['role_run_module']); |
|
| 166 | - ?> |
|
| 161 | + echo render_form('new_module', $_lang['role_new_module']); |
|
| 162 | + echo render_form('edit_module', $_lang['role_edit_module']); |
|
| 163 | + echo render_form('save_module', $_lang['role_save_module']); |
|
| 164 | + echo render_form('delete_module', $_lang['role_delete_module']); |
|
| 165 | + echo render_form('exec_module', $_lang['role_run_module']); |
|
| 166 | + ?> |
|
| 167 | 167 | </div> |
| 168 | 168 | </div> |
| 169 | 169 | </div> |
@@ -173,44 +173,44 @@ discard block |
||
| 173 | 173 | <div class="form-group"> |
| 174 | 174 | <h3><?= $_lang['role_template_management'] ?></h3> |
| 175 | 175 | <?php |
| 176 | - echo render_form('new_template', $_lang['role_create_template']); |
|
| 177 | - echo render_form('edit_template', $_lang['role_edit_template']); |
|
| 178 | - echo render_form('save_template', $_lang['role_save_template']); |
|
| 179 | - echo render_form('delete_template', $_lang['role_delete_template']); |
|
| 180 | - ?> |
|
| 176 | + echo render_form('new_template', $_lang['role_create_template']); |
|
| 177 | + echo render_form('edit_template', $_lang['role_edit_template']); |
|
| 178 | + echo render_form('save_template', $_lang['role_save_template']); |
|
| 179 | + echo render_form('delete_template', $_lang['role_delete_template']); |
|
| 180 | + ?> |
|
| 181 | 181 | </div> |
| 182 | 182 | </div> |
| 183 | 183 | <div class="col-sm-6 col-lg-3"> |
| 184 | 184 | <div class="form-group"> |
| 185 | 185 | <h3><?= $_lang['role_snippet_management'] ?></h3> |
| 186 | 186 | <?php |
| 187 | - echo render_form('new_snippet', $_lang['role_create_snippet']); |
|
| 188 | - echo render_form('edit_snippet', $_lang['role_edit_snippet']); |
|
| 189 | - echo render_form('save_snippet', $_lang['role_save_snippet']); |
|
| 190 | - echo render_form('delete_snippet', $_lang['role_delete_snippet']); |
|
| 191 | - ?> |
|
| 187 | + echo render_form('new_snippet', $_lang['role_create_snippet']); |
|
| 188 | + echo render_form('edit_snippet', $_lang['role_edit_snippet']); |
|
| 189 | + echo render_form('save_snippet', $_lang['role_save_snippet']); |
|
| 190 | + echo render_form('delete_snippet', $_lang['role_delete_snippet']); |
|
| 191 | + ?> |
|
| 192 | 192 | </div> |
| 193 | 193 | </div> |
| 194 | 194 | <div class="col-sm-6 col-lg-3"> |
| 195 | 195 | <div class="form-group"> |
| 196 | 196 | <h3><?= $_lang['role_chunk_management'] ?></h3> |
| 197 | 197 | <?php |
| 198 | - echo render_form('new_chunk', $_lang['role_create_chunk']); |
|
| 199 | - echo render_form('edit_chunk', $_lang['role_edit_chunk']); |
|
| 200 | - echo render_form('save_chunk', $_lang['role_save_chunk']); |
|
| 201 | - echo render_form('delete_chunk', $_lang['role_delete_chunk']); |
|
| 202 | - ?> |
|
| 198 | + echo render_form('new_chunk', $_lang['role_create_chunk']); |
|
| 199 | + echo render_form('edit_chunk', $_lang['role_edit_chunk']); |
|
| 200 | + echo render_form('save_chunk', $_lang['role_save_chunk']); |
|
| 201 | + echo render_form('delete_chunk', $_lang['role_delete_chunk']); |
|
| 202 | + ?> |
|
| 203 | 203 | </div> |
| 204 | 204 | </div> |
| 205 | 205 | <div class="col-sm-6 col-lg-3"> |
| 206 | 206 | <div class="form-group"> |
| 207 | 207 | <h3><?= $_lang['role_plugin_management'] ?></h3> |
| 208 | 208 | <?php |
| 209 | - echo render_form('new_plugin', $_lang['role_create_plugin']); |
|
| 210 | - echo render_form('edit_plugin', $_lang['role_edit_plugin']); |
|
| 211 | - echo render_form('save_plugin', $_lang['role_save_plugin']); |
|
| 212 | - echo render_form('delete_plugin', $_lang['role_delete_plugin']); |
|
| 213 | - ?> |
|
| 209 | + echo render_form('new_plugin', $_lang['role_create_plugin']); |
|
| 210 | + echo render_form('edit_plugin', $_lang['role_edit_plugin']); |
|
| 211 | + echo render_form('save_plugin', $_lang['role_save_plugin']); |
|
| 212 | + echo render_form('delete_plugin', $_lang['role_delete_plugin']); |
|
| 213 | + ?> |
|
| 214 | 214 | </div> |
| 215 | 215 | </div> |
| 216 | 216 | </div> |
@@ -220,42 +220,42 @@ discard block |
||
| 220 | 220 | <div class="form-group"> |
| 221 | 221 | <h3><?= $_lang['role_user_management'] ?></h3> |
| 222 | 222 | <?php |
| 223 | - echo render_form('new_user', $_lang['role_new_user']); |
|
| 224 | - echo render_form('edit_user', $_lang['role_edit_user']); |
|
| 225 | - echo render_form('save_user', $_lang['role_save_user']); |
|
| 226 | - echo render_form('delete_user', $_lang['role_delete_user']); |
|
| 227 | - ?> |
|
| 223 | + echo render_form('new_user', $_lang['role_new_user']); |
|
| 224 | + echo render_form('edit_user', $_lang['role_edit_user']); |
|
| 225 | + echo render_form('save_user', $_lang['role_save_user']); |
|
| 226 | + echo render_form('delete_user', $_lang['role_delete_user']); |
|
| 227 | + ?> |
|
| 228 | 228 | </div> |
| 229 | 229 | </div> |
| 230 | 230 | <div class="col-sm-6 col-lg-3"> |
| 231 | 231 | <div class="form-group"> |
| 232 | 232 | <h3><?= $_lang['role_web_user_management'] ?></h3> |
| 233 | 233 | <?php |
| 234 | - echo render_form('new_web_user', $_lang['role_new_web_user']); |
|
| 235 | - echo render_form('edit_web_user', $_lang['role_edit_web_user']); |
|
| 236 | - echo render_form('save_web_user', $_lang['role_save_web_user']); |
|
| 237 | - echo render_form('delete_web_user', $_lang['role_delete_web_user']); |
|
| 238 | - ?> |
|
| 234 | + echo render_form('new_web_user', $_lang['role_new_web_user']); |
|
| 235 | + echo render_form('edit_web_user', $_lang['role_edit_web_user']); |
|
| 236 | + echo render_form('save_web_user', $_lang['role_save_web_user']); |
|
| 237 | + echo render_form('delete_web_user', $_lang['role_delete_web_user']); |
|
| 238 | + ?> |
|
| 239 | 239 | </div> |
| 240 | 240 | </div> |
| 241 | 241 | <div class="col-sm-6 col-lg-3"> |
| 242 | 242 | <div class="form-group"> |
| 243 | 243 | <h3><?= $_lang['role_udperms'] ?></h3> |
| 244 | 244 | <?php |
| 245 | - echo render_form('access_permissions', $_lang['role_access_persmissions']); |
|
| 246 | - echo render_form('web_access_permissions', $_lang['role_web_access_persmissions']); |
|
| 247 | - ?> |
|
| 245 | + echo render_form('access_permissions', $_lang['role_access_persmissions']); |
|
| 246 | + echo render_form('web_access_permissions', $_lang['role_web_access_persmissions']); |
|
| 247 | + ?> |
|
| 248 | 248 | </div> |
| 249 | 249 | </div> |
| 250 | 250 | <div class="col-sm-6 col-lg-3"> |
| 251 | 251 | <div class="form-group"> |
| 252 | 252 | <h3><?= $_lang['role_role_management'] ?></h3> |
| 253 | 253 | <?php |
| 254 | - echo render_form('new_role', $_lang['role_new_role']); |
|
| 255 | - echo render_form('edit_role', $_lang['role_edit_role']); |
|
| 256 | - echo render_form('save_role', $_lang['role_save_role']); |
|
| 257 | - echo render_form('delete_role', $_lang['role_delete_role']); |
|
| 258 | - ?> |
|
| 254 | + echo render_form('new_role', $_lang['role_new_role']); |
|
| 255 | + echo render_form('edit_role', $_lang['role_edit_role']); |
|
| 256 | + echo render_form('save_role', $_lang['role_save_role']); |
|
| 257 | + echo render_form('delete_role', $_lang['role_delete_role']); |
|
| 258 | + ?> |
|
| 259 | 259 | </div> |
| 260 | 260 | </div> |
| 261 | 261 | </div> |
@@ -265,23 +265,23 @@ discard block |
||
| 265 | 265 | <div class="form-group"> |
| 266 | 266 | <h3><?= $_lang['role_eventlog_management'] ?></h3> |
| 267 | 267 | <?php |
| 268 | - echo render_form('view_eventlog', $_lang['role_view_eventlog']); |
|
| 269 | - echo render_form('delete_eventlog', $_lang['role_delete_eventlog']); |
|
| 270 | - ?> |
|
| 268 | + echo render_form('view_eventlog', $_lang['role_view_eventlog']); |
|
| 269 | + echo render_form('delete_eventlog', $_lang['role_delete_eventlog']); |
|
| 270 | + ?> |
|
| 271 | 271 | </div> |
| 272 | 272 | </div> |
| 273 | 273 | <div class="col-sm-6 col-lg-3"> |
| 274 | 274 | <div class="form-group"> |
| 275 | 275 | <h3><?= $_lang['role_config_management'] ?></h3> |
| 276 | 276 | <?php |
| 277 | - echo render_form('logs', $_lang['role_view_logs']); |
|
| 278 | - echo render_form('settings', $_lang['role_edit_settings']); |
|
| 279 | - echo render_form('bk_manager', $_lang['role_bk_manager']); |
|
| 280 | - echo render_form('import_static', $_lang['role_import_static']); |
|
| 281 | - echo render_form('export_static', $_lang['role_export_static']); |
|
| 282 | - echo render_form('remove_locks', $_lang['role_remove_locks']); |
|
| 283 | - echo render_form('display_locks', $_lang['role_display_locks']); |
|
| 284 | - ?> |
|
| 277 | + echo render_form('logs', $_lang['role_view_logs']); |
|
| 278 | + echo render_form('settings', $_lang['role_edit_settings']); |
|
| 279 | + echo render_form('bk_manager', $_lang['role_bk_manager']); |
|
| 280 | + echo render_form('import_static', $_lang['role_import_static']); |
|
| 281 | + echo render_form('export_static', $_lang['role_export_static']); |
|
| 282 | + echo render_form('remove_locks', $_lang['role_remove_locks']); |
|
| 283 | + echo render_form('display_locks', $_lang['role_display_locks']); |
|
| 284 | + ?> |
|
| 285 | 285 | </div> |
| 286 | 286 | </div> |
| 287 | 287 | </div> |
@@ -294,32 +294,32 @@ discard block |
||
| 294 | 294 | |
| 295 | 295 | <?php |
| 296 | 296 | function render_form($name, $label, $status = '') { |
| 297 | - global $modx, $roledata; |
|
| 297 | + global $modx, $roledata; |
|
| 298 | 298 | |
| 299 | - $tpl = '<label class="d-block" for="[+name+]check"> |
|
| 299 | + $tpl = '<label class="d-block" for="[+name+]check"> |
|
| 300 | 300 | <input name="[+name+]check" id="[+name+]check" class="click" type="checkbox" onchange="changestate(document.userform.[+name+])" [+checked+] [+status+]> |
| 301 | 301 | <input type="hidden" class="[+set+]" name="[+name+]" value="[+value+]"> |
| 302 | 302 | [+label+] |
| 303 | 303 | </label>'; |
| 304 | 304 | |
| 305 | - $checked = ($roledata[$name] == 1) ? 'checked' : ''; |
|
| 306 | - $value = ($roledata[$name] == 1) ? 1 : 0; |
|
| 307 | - if($status == 'disabled') { |
|
| 308 | - $checked = 'checked'; |
|
| 309 | - $value = 1; |
|
| 310 | - $set = 'fix'; |
|
| 311 | - } else { |
|
| 312 | - $set = 'set'; |
|
| 313 | - } |
|
| 305 | + $checked = ($roledata[$name] == 1) ? 'checked' : ''; |
|
| 306 | + $value = ($roledata[$name] == 1) ? 1 : 0; |
|
| 307 | + if($status == 'disabled') { |
|
| 308 | + $checked = 'checked'; |
|
| 309 | + $value = 1; |
|
| 310 | + $set = 'fix'; |
|
| 311 | + } else { |
|
| 312 | + $set = 'set'; |
|
| 313 | + } |
|
| 314 | 314 | |
| 315 | - $ph = array( |
|
| 316 | - 'name' => $name, |
|
| 317 | - 'checked' => $checked, |
|
| 318 | - 'status' => $status, |
|
| 319 | - 'value' => $value, |
|
| 320 | - 'label' => $label, |
|
| 321 | - 'set' => $set |
|
| 322 | - ); |
|
| 315 | + $ph = array( |
|
| 316 | + 'name' => $name, |
|
| 317 | + 'checked' => $checked, |
|
| 318 | + 'status' => $status, |
|
| 319 | + 'value' => $value, |
|
| 320 | + 'label' => $label, |
|
| 321 | + 'set' => $set |
|
| 322 | + ); |
|
| 323 | 323 | |
| 324 | - return $modx->parseText($tpl, $ph); |
|
| 324 | + return $modx->parseText($tpl, $ph); |
|
| 325 | 325 | } |
@@ -1,9 +1,9 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | if(IN_MANAGER_MODE != "true") {
|
| 3 | - die("<b>INCLUDE_ORDERING_ERROR</b><br />Please use the EVO Content Manager instead of accessing this file directly.");
|
|
| 3 | + die("<b>INCLUDE_ORDERING_ERROR</b><br />Please use the EVO Content Manager instead of accessing this file directly.");
|
|
| 4 | 4 | } |
| 5 | 5 | if(!$modx->hasPermission('settings')) {
|
| 6 | - $modx->webAlertAndQuit($_lang['error_no_privileges']); |
|
| 6 | + $modx->webAlertAndQuit($_lang['error_no_privileges']); |
|
| 7 | 7 | } |
| 8 | 8 | |
| 9 | 9 | include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/functions.inc.php'); |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | // check to see the edit settings page isn't locked |
| 12 | 12 | $rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=17 AND internalKey!='" . $modx->getLoginUserID() . "'");
|
| 13 | 13 | if($username = $modx->db->getValue($rs)) {
|
| 14 | - $modx->webAlertAndQuit(sprintf($_lang['lock_settings_msg'], $username)); |
|
| 14 | + $modx->webAlertAndQuit(sprintf($_lang['lock_settings_msg'], $username)); |
|
| 15 | 15 | } |
| 16 | 16 | // end check for lock |
| 17 | 17 | |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | include_once(MODX_MANAGER_PATH . 'includes/default_config.php'); |
| 22 | 22 | $rs = $modx->db->select('setting_name, setting_value', '[+prefix+]system_settings');
|
| 23 | 23 | while($row = $modx->db->getRow($rs)) {
|
| 24 | - $settings[$row['setting_name']] = $row['setting_value']; |
|
| 24 | + $settings[$row['setting_name']] = $row['setting_value']; |
|
| 25 | 25 | } |
| 26 | 26 | $settings['filemanager_path'] = preg_replace('@^' . preg_quote(MODX_BASE_PATH) . '@', '[(base_path)]', $settings['filemanager_path']);
|
| 27 | 27 | $settings['rb_base_dir'] = preg_replace('@^' . preg_quote(MODX_BASE_PATH) . '@', '[(base_path)]', $settings['rb_base_dir']);
|
@@ -32,11 +32,11 @@ discard block |
||
| 32 | 32 | $lang_keys = array(); |
| 33 | 33 | $dir = dir('includes/lang');
|
| 34 | 34 | while($file = $dir->read()) {
|
| 35 | - if(strpos($file, '.inc.php') > 0) {
|
|
| 36 | - $endpos = strpos($file, '.'); |
|
| 37 | - $languagename = substr($file, 0, $endpos); |
|
| 38 | - $lang_keys[$languagename] = get_lang_keys($file); |
|
| 39 | - } |
|
| 35 | + if(strpos($file, '.inc.php') > 0) {
|
|
| 36 | + $endpos = strpos($file, '.'); |
|
| 37 | + $languagename = substr($file, 0, $endpos); |
|
| 38 | + $lang_keys[$languagename] = get_lang_keys($file); |
|
| 39 | + } |
|
| 40 | 40 | } |
| 41 | 41 | $dir->close(); |
| 42 | 42 | $displayStyle = ($_SESSION['browser'] === 'modern') ? 'table-row' : 'block'; |
@@ -78,14 +78,14 @@ discard block |
||
| 78 | 78 | </script> |
| 79 | 79 | |
| 80 | 80 | <?php |
| 81 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab1_site_settings.inc.php'); |
|
| 82 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab2_furl_settings.inc.php'); |
|
| 83 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab3_user_settings.inc.php'); |
|
| 84 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab4_manager_settings.inc.php'); |
|
| 85 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab5_security_settings.inc.php'); |
|
| 86 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab6_filemanager_settings.inc.php'); |
|
| 87 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab7_filebrowser_settings.inc.php'); |
|
| 88 | - ?> |
|
| 81 | + include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab1_site_settings.inc.php'); |
|
| 82 | + include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab2_furl_settings.inc.php'); |
|
| 83 | + include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab3_user_settings.inc.php'); |
|
| 84 | + include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab4_manager_settings.inc.php'); |
|
| 85 | + include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab5_security_settings.inc.php'); |
|
| 86 | + include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab6_filemanager_settings.inc.php'); |
|
| 87 | + include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab7_filebrowser_settings.inc.php'); |
|
| 88 | + ?> |
|
| 89 | 89 | </div> |
| 90 | 90 | </div> |
| 91 | 91 | </form> |
@@ -132,5 +132,5 @@ discard block |
||
| 132 | 132 | </script> |
| 133 | 133 | <?php |
| 134 | 134 | if(is_numeric($_GET['tab'])) {
|
| 135 | - echo '<script type="text/javascript">tpSettings.setSelectedIndex( ' . $_GET['tab'] . ' );</script>'; |
|
| 135 | + echo '<script type="text/javascript">tpSettings.setSelectedIndex( ' . $_GET['tab'] . ' );</script>'; |
|
| 136 | 136 | } |
@@ -1,10 +1,10 @@ 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(!$modx->hasPermission('edit_module')) { |
| 7 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 7 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 8 | 8 | } |
| 9 | 9 | |
| 10 | 10 | $id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; |
@@ -26,91 +26,91 @@ discard block |
||
| 26 | 26 | // check to see the editor isn't locked |
| 27 | 27 | $rs = $modx->db->select('username', $tbl_active_users, "action=108 AND id='{$id}' AND internalKey!='" . $modx->getLoginUserID() . "'"); |
| 28 | 28 | if($username = $modx->db->getValue($rs)) { |
| 29 | - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $username, 'module')); |
|
| 29 | + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $username, 'module')); |
|
| 30 | 30 | } |
| 31 | 31 | // end check for lock |
| 32 | 32 | |
| 33 | 33 | // take action |
| 34 | 34 | switch($_REQUEST['op']) { |
| 35 | - case 'add': |
|
| 36 | - // convert ids to numbers |
|
| 37 | - $opids = array_filter(array_map('intval', explode(',', $_REQUEST['newids']))); |
|
| 38 | - |
|
| 39 | - if(count($opids) > 0) { |
|
| 40 | - // 1-snips, 2-tpls, 3-tvs, 4-chunks, 5-plugins, 6-docs |
|
| 41 | - $rt = strtolower($_REQUEST["rt"]); |
|
| 42 | - if($rt == 'chunk') { |
|
| 43 | - $type = 10; |
|
| 44 | - } |
|
| 45 | - if($rt == 'doc') { |
|
| 46 | - $type = 20; |
|
| 47 | - } |
|
| 48 | - if($rt == 'plug') { |
|
| 49 | - $type = 30; |
|
| 50 | - } |
|
| 51 | - if($rt == 'snip') { |
|
| 52 | - $type = 40; |
|
| 53 | - } |
|
| 54 | - if($rt == 'tpl') { |
|
| 55 | - $type = 50; |
|
| 56 | - } |
|
| 57 | - if($rt == 'tv') { |
|
| 58 | - $type = 60; |
|
| 59 | - } |
|
| 60 | - $modx->db->delete($tbl_site_module_depobj, "module='{$id}' AND resource IN (" . implode(',', $opids) . ") AND type='{$type}'"); |
|
| 61 | - foreach($opids as $opid) { |
|
| 62 | - $modx->db->insert(array( |
|
| 63 | - 'module' => $id, |
|
| 64 | - 'resource' => $opid, |
|
| 65 | - 'type' => $type, |
|
| 66 | - ), $tbl_site_module_depobj); |
|
| 67 | - } |
|
| 68 | - } |
|
| 69 | - break; |
|
| 70 | - case 'del': |
|
| 71 | - // convert ids to numbers |
|
| 72 | - $opids = array_filter(array_map('intval', $_REQUEST['depid'])); |
|
| 73 | - |
|
| 74 | - // get resources that needs to be removed |
|
| 75 | - $ds = $modx->db->select('*', $tbl_site_module_depobj, "id IN (" . implode(",", $opids) . ")"); |
|
| 76 | - // loop through resources and look for plugins and snippets |
|
| 77 | - $plids = array(); |
|
| 78 | - $snid = array(); |
|
| 79 | - while($row = $modx->db->getRow($ds)) { |
|
| 80 | - if($row['type'] == '30') { |
|
| 81 | - $plids[$i] = $row['resource']; |
|
| 82 | - } |
|
| 83 | - if($row['type'] == '40') { |
|
| 84 | - $snids[$i] = $row['resource']; |
|
| 85 | - } |
|
| 86 | - } |
|
| 87 | - // get guid |
|
| 88 | - $ds = $modx->db->select('guid', $tbl_site_modules, "id='{$id}'"); |
|
| 89 | - $guid = $modx->db->getValue($ds); |
|
| 90 | - // reset moduleguid for deleted resources |
|
| 91 | - if(($cp = count($plids)) || ($cs = count($snids))) { |
|
| 92 | - if($cp) { |
|
| 93 | - $modx->db->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $plids) . ") AND moduleguid='{$guid}'"); |
|
| 94 | - } |
|
| 95 | - if($cs) { |
|
| 96 | - $modx->db->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $snids) . ") AND moduleguid='{$guid}'"); |
|
| 97 | - } |
|
| 98 | - // reset cache |
|
| 99 | - $modx->clearCache('full'); |
|
| 100 | - } |
|
| 101 | - $modx->db->delete($tbl_site_module_depobj, "id IN (" . implode(',', $opids) . ")"); |
|
| 102 | - break; |
|
| 35 | + case 'add': |
|
| 36 | + // convert ids to numbers |
|
| 37 | + $opids = array_filter(array_map('intval', explode(',', $_REQUEST['newids']))); |
|
| 38 | + |
|
| 39 | + if(count($opids) > 0) { |
|
| 40 | + // 1-snips, 2-tpls, 3-tvs, 4-chunks, 5-plugins, 6-docs |
|
| 41 | + $rt = strtolower($_REQUEST["rt"]); |
|
| 42 | + if($rt == 'chunk') { |
|
| 43 | + $type = 10; |
|
| 44 | + } |
|
| 45 | + if($rt == 'doc') { |
|
| 46 | + $type = 20; |
|
| 47 | + } |
|
| 48 | + if($rt == 'plug') { |
|
| 49 | + $type = 30; |
|
| 50 | + } |
|
| 51 | + if($rt == 'snip') { |
|
| 52 | + $type = 40; |
|
| 53 | + } |
|
| 54 | + if($rt == 'tpl') { |
|
| 55 | + $type = 50; |
|
| 56 | + } |
|
| 57 | + if($rt == 'tv') { |
|
| 58 | + $type = 60; |
|
| 59 | + } |
|
| 60 | + $modx->db->delete($tbl_site_module_depobj, "module='{$id}' AND resource IN (" . implode(',', $opids) . ") AND type='{$type}'"); |
|
| 61 | + foreach($opids as $opid) { |
|
| 62 | + $modx->db->insert(array( |
|
| 63 | + 'module' => $id, |
|
| 64 | + 'resource' => $opid, |
|
| 65 | + 'type' => $type, |
|
| 66 | + ), $tbl_site_module_depobj); |
|
| 67 | + } |
|
| 68 | + } |
|
| 69 | + break; |
|
| 70 | + case 'del': |
|
| 71 | + // convert ids to numbers |
|
| 72 | + $opids = array_filter(array_map('intval', $_REQUEST['depid'])); |
|
| 73 | + |
|
| 74 | + // get resources that needs to be removed |
|
| 75 | + $ds = $modx->db->select('*', $tbl_site_module_depobj, "id IN (" . implode(",", $opids) . ")"); |
|
| 76 | + // loop through resources and look for plugins and snippets |
|
| 77 | + $plids = array(); |
|
| 78 | + $snid = array(); |
|
| 79 | + while($row = $modx->db->getRow($ds)) { |
|
| 80 | + if($row['type'] == '30') { |
|
| 81 | + $plids[$i] = $row['resource']; |
|
| 82 | + } |
|
| 83 | + if($row['type'] == '40') { |
|
| 84 | + $snids[$i] = $row['resource']; |
|
| 85 | + } |
|
| 86 | + } |
|
| 87 | + // get guid |
|
| 88 | + $ds = $modx->db->select('guid', $tbl_site_modules, "id='{$id}'"); |
|
| 89 | + $guid = $modx->db->getValue($ds); |
|
| 90 | + // reset moduleguid for deleted resources |
|
| 91 | + if(($cp = count($plids)) || ($cs = count($snids))) { |
|
| 92 | + if($cp) { |
|
| 93 | + $modx->db->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $plids) . ") AND moduleguid='{$guid}'"); |
|
| 94 | + } |
|
| 95 | + if($cs) { |
|
| 96 | + $modx->db->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $snids) . ") AND moduleguid='{$guid}'"); |
|
| 97 | + } |
|
| 98 | + // reset cache |
|
| 99 | + $modx->clearCache('full'); |
|
| 100 | + } |
|
| 101 | + $modx->db->delete($tbl_site_module_depobj, "id IN (" . implode(',', $opids) . ")"); |
|
| 102 | + break; |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | // load record |
| 106 | 106 | $rs = $modx->db->select('*', $tbl_site_modules, "id = '{$id}'"); |
| 107 | 107 | $content = $modx->db->getRow($rs); |
| 108 | 108 | if(!$content) { |
| 109 | - $modx->webAlertAndQuit("Module not found for id '{$id}'."); |
|
| 109 | + $modx->webAlertAndQuit("Module not found for id '{$id}'."); |
|
| 110 | 110 | } |
| 111 | 111 | $_SESSION['itemname'] = $content['name']; |
| 112 | 112 | if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { |
| 113 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 113 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | ?> |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | <tr> |
| 204 | 204 | <td valign="top" align="left"> |
| 205 | 205 | <?php |
| 206 | - $ds = $modx->db->select("smd.id,COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) as name, |
|
| 206 | + $ds = $modx->db->select("smd.id,COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) as name, |
|
| 207 | 207 | CASE smd.type |
| 208 | 208 | WHEN 10 THEN 'Chunk' |
| 209 | 209 | WHEN 20 THEN 'Document' |
@@ -218,18 +218,18 @@ discard block |
||
| 218 | 218 | LEFT JOIN {$tbl_site_snippets} AS ss ON ss.id = smd.resource AND smd.type = '40' |
| 219 | 219 | LEFT JOIN {$tbl_site_templates} AS st ON st.id = smd.resource AND smd.type = '50' |
| 220 | 220 | LEFT JOIN {$tbl_site_tmplvars} AS sv ON sv.id = smd.resource AND smd.type = '60'", "smd.module={$id}", "smd.type,name"); |
| 221 | - include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; |
|
| 222 | - $grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items |
|
| 223 | - $grd->noRecordMsg = $_lang["no_records_found"]; |
|
| 224 | - $grd->cssClass = "grid"; |
|
| 225 | - $grd->columnHeaderClass = "gridHeader"; |
|
| 226 | - $grd->itemClass = "gridItem"; |
|
| 227 | - $grd->altItemClass = "gridAltItem"; |
|
| 228 | - $grd->columns = $_lang["element_name"] . " ," . $_lang["type"]; |
|
| 229 | - $grd->colTypes = "template:<input type='checkbox' name='depid[]' value='[+id+]'> [+value+]"; |
|
| 230 | - $grd->fields = "name,type"; |
|
| 231 | - echo $grd->render(); |
|
| 232 | - ?> |
|
| 221 | + include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; |
|
| 222 | + $grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items |
|
| 223 | + $grd->noRecordMsg = $_lang["no_records_found"]; |
|
| 224 | + $grd->cssClass = "grid"; |
|
| 225 | + $grd->columnHeaderClass = "gridHeader"; |
|
| 226 | + $grd->itemClass = "gridItem"; |
|
| 227 | + $grd->altItemClass = "gridAltItem"; |
|
| 228 | + $grd->columns = $_lang["element_name"] . " ," . $_lang["type"]; |
|
| 229 | + $grd->colTypes = "template:<input type='checkbox' name='depid[]' value='[+id+]'> [+value+]"; |
|
| 230 | + $grd->fields = "name,type"; |
|
| 231 | + echo $grd->render(); |
|
| 232 | + ?> |
|
| 233 | 233 | </td> |
| 234 | 234 | <td valign="top" style="width: 150px;"> |
| 235 | 235 | <a class="btn btn-block btn-danger text-left" style="margin-bottom:10px;" href="javascript:;" onclick="removeDependencies();return false;"><i class="<?php echo $_style["actions_delete"] ?>"></i> <?php echo $_lang['remove']; ?></a> |
@@ -1,12 +1,12 @@ 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_template') && $modx->manager->action == '301') { |
| 6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 7 | 7 | } |
| 8 | 8 | if(!$modx->hasPermission('new_template') && $modx->manager->action == '300') { |
| 9 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 9 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 10 | 10 | } |
| 11 | 11 | |
| 12 | 12 | $id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | |
| 21 | 21 | // check to see the snippet editor isn't locked |
| 22 | 22 | if($lockedEl = $modx->elementIsLocked(2, $id)) { |
| 23 | - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['tmplvar'])); |
|
| 23 | + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['tmplvar'])); |
|
| 24 | 24 | } |
| 25 | 25 | // end check for lock |
| 26 | 26 | |
@@ -30,25 +30,25 @@ discard block |
||
| 30 | 30 | global $content; |
| 31 | 31 | $content = array(); |
| 32 | 32 | if(isset($_GET['id'])) { |
| 33 | - $rs = $modx->db->select('*', $tbl_site_tmplvars, "id='{$id}'"); |
|
| 34 | - $content = $modx->db->getRow($rs); |
|
| 35 | - if(!$content) { |
|
| 36 | - header("Location: " . MODX_SITE_URL . "index.php?id={$site_start}"); |
|
| 37 | - } |
|
| 38 | - |
|
| 39 | - $_SESSION['itemname'] = $content['caption']; |
|
| 40 | - if($content['locked'] == 1 && $modx->hasPermission('save_role') != 1) { |
|
| 41 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 42 | - } |
|
| 33 | + $rs = $modx->db->select('*', $tbl_site_tmplvars, "id='{$id}'"); |
|
| 34 | + $content = $modx->db->getRow($rs); |
|
| 35 | + if(!$content) { |
|
| 36 | + header("Location: " . MODX_SITE_URL . "index.php?id={$site_start}"); |
|
| 37 | + } |
|
| 38 | + |
|
| 39 | + $_SESSION['itemname'] = $content['caption']; |
|
| 40 | + if($content['locked'] == 1 && $modx->hasPermission('save_role') != 1) { |
|
| 41 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 42 | + } |
|
| 43 | 43 | } else if(isset($_REQUEST['itemname'])) { |
| 44 | - $content['name'] = $_REQUEST['itemname']; |
|
| 44 | + $content['name'] = $_REQUEST['itemname']; |
|
| 45 | 45 | } else { |
| 46 | - $_SESSION['itemname'] = $_lang["new_tmplvars"]; |
|
| 47 | - $content['category'] = intval($_REQUEST['catid']); |
|
| 46 | + $_SESSION['itemname'] = $_lang["new_tmplvars"]; |
|
| 47 | + $content['category'] = intval($_REQUEST['catid']); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | if($modx->manager->hasFormValues()) { |
| 51 | - $modx->manager->loadFormValues(); |
|
| 51 | + $modx->manager->loadFormValues(); |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | $content = array_merge($content, $_POST); |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | $RTEditors = ''; |
| 63 | 63 | $evtOut = $modx->invokeEvent('OnRichTextEditorRegister', array('forfrontend' => 1)); |
| 64 | 64 | if(is_array($evtOut)) { |
| 65 | - $RTEditors = implode(',', $evtOut); |
|
| 65 | + $RTEditors = implode(',', $evtOut); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | ?> |
@@ -277,12 +277,12 @@ discard block |
||
| 277 | 277 | |
| 278 | 278 | <form name="mutate" method="post" action="index.php" enctype="multipart/form-data"> |
| 279 | 279 | <?php |
| 280 | - // invoke OnTVFormPrerender event |
|
| 281 | - $evtOut = $modx->invokeEvent('OnTVFormPrerender', array('id' => $id)); |
|
| 282 | - if(is_array($evtOut)) { |
|
| 283 | - echo implode("", $evtOut); |
|
| 284 | - } |
|
| 285 | - ?> |
|
| 280 | + // invoke OnTVFormPrerender event |
|
| 281 | + $evtOut = $modx->invokeEvent('OnTVFormPrerender', array('id' => $id)); |
|
| 282 | + if(is_array($evtOut)) { |
|
| 283 | + echo implode("", $evtOut); |
|
| 284 | + } |
|
| 285 | + ?> |
|
| 286 | 286 | <input type="hidden" name="id" value="<?= $content['id'] ?>"> |
| 287 | 287 | <input type="hidden" name="a" value="302"> |
| 288 | 288 | <input type="hidden" name="or" value="<?= $origin ?>"> |
@@ -343,11 +343,11 @@ discard block |
||
| 343 | 343 | <select name="categoryid" class="form-control" onChange="documentDirty=true;"> |
| 344 | 344 | <option> </option> |
| 345 | 345 | <?php |
| 346 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
| 347 | - foreach(getCategories() as $n => $v) { |
|
| 348 | - echo "<option value='" . $v['id'] . "'" . ($content["category"] == $v["id"] ? " selected='selected'" : "") . ">" . $modx->htmlspecialchars($v["category"]) . "</option>"; |
|
| 349 | - } |
|
| 350 | - ?> |
|
| 346 | + include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
| 347 | + foreach(getCategories() as $n => $v) { |
|
| 348 | + echo "<option value='" . $v['id'] . "'" . ($content["category"] == $v["id"] ? " selected='selected'" : "") . ">" . $modx->htmlspecialchars($v["category"]) . "</option>"; |
|
| 349 | + } |
|
| 350 | + ?> |
|
| 351 | 351 | </select> |
| 352 | 352 | </div> |
| 353 | 353 | </div> |
@@ -383,14 +383,14 @@ discard block |
||
| 383 | 383 | <optgroup label="Custom Type"> |
| 384 | 384 | <option value="custom_tv" <?= ($content['type'] == 'custom_tv' ? "selected='selected'" : "") ?>>Custom Input</option> |
| 385 | 385 | <?php |
| 386 | - $custom_tvs = scandir(MODX_BASE_PATH . 'assets/tvs'); |
|
| 387 | - foreach($custom_tvs as $ctv) { |
|
| 388 | - if(strpos($ctv, '.') !== 0 && $ctv != 'index.html') { |
|
| 389 | - $selected = ($content['type'] == 'custom_tv:' . $ctv ? "selected='selected'" : ""); |
|
| 390 | - echo '<option value="custom_tv:' . $ctv . '" ' . $selected . '>' . $ctv . '</option>'; |
|
| 391 | - } |
|
| 392 | - } |
|
| 393 | - ?> |
|
| 386 | + $custom_tvs = scandir(MODX_BASE_PATH . 'assets/tvs'); |
|
| 387 | + foreach($custom_tvs as $ctv) { |
|
| 388 | + if(strpos($ctv, '.') !== 0 && $ctv != 'index.html') { |
|
| 389 | + $selected = ($content['type'] == 'custom_tv:' . $ctv ? "selected='selected'" : ""); |
|
| 390 | + echo '<option value="custom_tv:' . $ctv . '" ' . $selected . '>' . $ctv . '</option>'; |
|
| 391 | + } |
|
| 392 | + } |
|
| 393 | + ?> |
|
| 394 | 394 | </optgroup> |
| 395 | 395 | </select> |
| 396 | 396 | </div> |
@@ -455,63 +455,63 @@ discard block |
||
| 455 | 455 | <a class="btn btn-secondary btn-sm" href="javascript:;" onClick="check_toggle(); return false;"><?= $_lang['check_toggle'] ?></a> |
| 456 | 456 | </div> |
| 457 | 457 | <?php |
| 458 | - $rs = $modx->db->select(sprintf("tpl.id AS id, templatename, tpl.description AS tpldescription, tpl.locked AS tpllocked, tpl.selectable AS selectable, tmplvarid, if(isnull(cat.category),'%s',cat.category) AS category, cat.id AS catid", $_lang['no_category']), sprintf("%s as tpl |
|
| 458 | + $rs = $modx->db->select(sprintf("tpl.id AS id, templatename, tpl.description AS tpldescription, tpl.locked AS tpllocked, tpl.selectable AS selectable, tmplvarid, if(isnull(cat.category),'%s',cat.category) AS category, cat.id AS catid", $_lang['no_category']), sprintf("%s as tpl |
|
| 459 | 459 | LEFT JOIN %s as stt ON stt.templateid=tpl.id AND stt.tmplvarid='%s' |
| 460 | 460 | LEFT JOIN %s as cat ON tpl.category=cat.id", $modx->getFullTableName('site_templates'), $modx->getFullTableName('site_tmplvar_templates'), $id, $modx->getFullTableName('categories')), '', "category, templatename"); |
| 461 | 461 | |
| 462 | - $tplList = '<ul>'; |
|
| 463 | - $preCat = ''; |
|
| 464 | - $insideUl = 0; |
|
| 465 | - while($row = $modx->db->getRow($rs)) { |
|
| 466 | - $row['category'] = stripslashes($row['category']); //pixelchutes |
|
| 467 | - if($preCat !== $row['category']) { |
|
| 468 | - $tplList .= $insideUl ? '</ul>' : ''; |
|
| 469 | - $tplList .= '<li><strong>' . $row['category'] . ($row['catid'] != '' ? ' <small>(' . $row['catid'] . ')</small>' : '') . '</strong><ul>'; |
|
| 470 | - $insideUl = 1; |
|
| 471 | - } |
|
| 472 | - |
|
| 473 | - if($modx->manager->action == '300' && $modx->config['default_template'] == $row['id']) { |
|
| 474 | - $checked = true; |
|
| 475 | - } elseif(isset($_GET['tpl']) && $_GET['tpl'] == $row['id']) { |
|
| 476 | - $checked = true; |
|
| 477 | - } elseif($id == 0 && is_array($_POST['template'])) { |
|
| 478 | - $checked = in_array($row['id'], $_POST['template']); |
|
| 479 | - } else { |
|
| 480 | - $checked = $row['tmplvarid']; |
|
| 481 | - } |
|
| 482 | - $selectable = !$row['selectable'] ? ' class="disabled"' : ''; |
|
| 483 | - $checked = $checked ? ' checked="checked"' : ''; |
|
| 484 | - $tplId = ' <small>(' . $row['id'] . ')</small>'; |
|
| 485 | - $desc = !empty($row['tpldescription']) ? ' - ' . $row['tpldescription'] : ''; |
|
| 486 | - |
|
| 487 | - $tplInfo = array(); |
|
| 488 | - if($row['tpllocked']) { |
|
| 489 | - $tplInfo[] = $_lang['locked']; |
|
| 490 | - } |
|
| 491 | - if($row['id'] == $modx->config['default_template']) { |
|
| 492 | - $tplInfo[] = $_lang['defaulttemplate_title']; |
|
| 493 | - } |
|
| 494 | - $tplInfo = !empty($tplInfo) ? ' <em>(' . join(', ', $tplInfo) . ')</em>' : ''; |
|
| 495 | - |
|
| 496 | - $tplList .= sprintf('<li><label%s><input name="template[]" value="%s" type="checkbox" %s onchange="documentDirty=true;"> %s%s%s%s</label></li>', $selectable, $row['id'], $checked, $row['templatename'], $tplId, $desc, $tplInfo); |
|
| 497 | - $tplList .= '</li>'; |
|
| 498 | - |
|
| 499 | - $preCat = $row['category']; |
|
| 500 | - } |
|
| 501 | - $tplList .= $insideUl ? '</ul>' : ''; |
|
| 502 | - $tplList .= '</ul>'; |
|
| 503 | - echo $tplList; |
|
| 504 | - |
|
| 505 | - ?> |
|
| 462 | + $tplList = '<ul>'; |
|
| 463 | + $preCat = ''; |
|
| 464 | + $insideUl = 0; |
|
| 465 | + while($row = $modx->db->getRow($rs)) { |
|
| 466 | + $row['category'] = stripslashes($row['category']); //pixelchutes |
|
| 467 | + if($preCat !== $row['category']) { |
|
| 468 | + $tplList .= $insideUl ? '</ul>' : ''; |
|
| 469 | + $tplList .= '<li><strong>' . $row['category'] . ($row['catid'] != '' ? ' <small>(' . $row['catid'] . ')</small>' : '') . '</strong><ul>'; |
|
| 470 | + $insideUl = 1; |
|
| 471 | + } |
|
| 472 | + |
|
| 473 | + if($modx->manager->action == '300' && $modx->config['default_template'] == $row['id']) { |
|
| 474 | + $checked = true; |
|
| 475 | + } elseif(isset($_GET['tpl']) && $_GET['tpl'] == $row['id']) { |
|
| 476 | + $checked = true; |
|
| 477 | + } elseif($id == 0 && is_array($_POST['template'])) { |
|
| 478 | + $checked = in_array($row['id'], $_POST['template']); |
|
| 479 | + } else { |
|
| 480 | + $checked = $row['tmplvarid']; |
|
| 481 | + } |
|
| 482 | + $selectable = !$row['selectable'] ? ' class="disabled"' : ''; |
|
| 483 | + $checked = $checked ? ' checked="checked"' : ''; |
|
| 484 | + $tplId = ' <small>(' . $row['id'] . ')</small>'; |
|
| 485 | + $desc = !empty($row['tpldescription']) ? ' - ' . $row['tpldescription'] : ''; |
|
| 486 | + |
|
| 487 | + $tplInfo = array(); |
|
| 488 | + if($row['tpllocked']) { |
|
| 489 | + $tplInfo[] = $_lang['locked']; |
|
| 490 | + } |
|
| 491 | + if($row['id'] == $modx->config['default_template']) { |
|
| 492 | + $tplInfo[] = $_lang['defaulttemplate_title']; |
|
| 493 | + } |
|
| 494 | + $tplInfo = !empty($tplInfo) ? ' <em>(' . join(', ', $tplInfo) . ')</em>' : ''; |
|
| 495 | + |
|
| 496 | + $tplList .= sprintf('<li><label%s><input name="template[]" value="%s" type="checkbox" %s onchange="documentDirty=true;"> %s%s%s%s</label></li>', $selectable, $row['id'], $checked, $row['templatename'], $tplId, $desc, $tplInfo); |
|
| 497 | + $tplList .= '</li>'; |
|
| 498 | + |
|
| 499 | + $preCat = $row['category']; |
|
| 500 | + } |
|
| 501 | + $tplList .= $insideUl ? '</ul>' : ''; |
|
| 502 | + $tplList .= '</ul>'; |
|
| 503 | + echo $tplList; |
|
| 504 | + |
|
| 505 | + ?> |
|
| 506 | 506 | |
| 507 | 507 | <!-- Access Permissions --> |
| 508 | 508 | <?php |
| 509 | - if($use_udperms == 1) { |
|
| 510 | - // fetch permissions for the variable |
|
| 511 | - $rs = $modx->db->select('documentgroup', $modx->getFullTableName('site_tmplvar_access'), "tmplvarid='{$id}'"); |
|
| 512 | - $groupsarray = $modx->db->getColumn('documentgroup', $rs); |
|
| 509 | + if($use_udperms == 1) { |
|
| 510 | + // fetch permissions for the variable |
|
| 511 | + $rs = $modx->db->select('documentgroup', $modx->getFullTableName('site_tmplvar_access'), "tmplvarid='{$id}'"); |
|
| 512 | + $groupsarray = $modx->db->getColumn('documentgroup', $rs); |
|
| 513 | 513 | |
| 514 | - ?> |
|
| 514 | + ?> |
|
| 515 | 515 | <?php if($modx->hasPermission('access_permissions')) { ?> |
| 516 | 516 | <script type="text/javascript"> |
| 517 | 517 | function makePublic(b) { |
@@ -539,29 +539,29 @@ discard block |
||
| 539 | 539 | <!--<b><?php /*echo $_lang['access_permissions']; */ ?></b>--> |
| 540 | 540 | <p><?= $_lang['tmplvar_access_msg'] ?></p> |
| 541 | 541 | <?php |
| 542 | - $chk = ''; |
|
| 543 | - $rs = $modx->db->select('name, id', $tbl_documentgroup_names); |
|
| 544 | - if(empty($groupsarray) && is_array($_POST['docgroups']) && empty($_POST['id'])) { |
|
| 545 | - $groupsarray = $_POST['docgroups']; |
|
| 546 | - } |
|
| 547 | - while($row = $modx->db->getRow($rs)) { |
|
| 548 | - $checked = in_array($row['id'], $groupsarray); |
|
| 549 | - if($modx->hasPermission('access_permissions')) { |
|
| 550 | - if($checked) { |
|
| 551 | - $notPublic = true; |
|
| 552 | - } |
|
| 553 | - $chks .= "<li><label><input type='checkbox' name='docgroups[]' value='" . $row['id'] . "' " . ($checked ? "checked='checked'" : '') . " onclick=\"makePublic(false)\" /> " . $row['name'] . "</label></li>"; |
|
| 554 | - } else { |
|
| 555 | - if($checked) { |
|
| 556 | - echo "<input type='hidden' name='docgroups[]' value='" . $row['id'] . "' />"; |
|
| 557 | - } |
|
| 558 | - } |
|
| 559 | - } |
|
| 560 | - if($modx->hasPermission('access_permissions')) { |
|
| 561 | - $chks = "<li><label><input type='checkbox' name='chkalldocs' " . (!$notPublic ? "checked='checked'" : '') . " onclick=\"makePublic(true)\" /> <span class='warning'>" . $_lang['all_doc_groups'] . "</span></label></li>" . $chks; |
|
| 562 | - } |
|
| 563 | - echo '<ul>' . $chks . '</ul>'; |
|
| 564 | - ?> |
|
| 542 | + $chk = ''; |
|
| 543 | + $rs = $modx->db->select('name, id', $tbl_documentgroup_names); |
|
| 544 | + if(empty($groupsarray) && is_array($_POST['docgroups']) && empty($_POST['id'])) { |
|
| 545 | + $groupsarray = $_POST['docgroups']; |
|
| 546 | + } |
|
| 547 | + while($row = $modx->db->getRow($rs)) { |
|
| 548 | + $checked = in_array($row['id'], $groupsarray); |
|
| 549 | + if($modx->hasPermission('access_permissions')) { |
|
| 550 | + if($checked) { |
|
| 551 | + $notPublic = true; |
|
| 552 | + } |
|
| 553 | + $chks .= "<li><label><input type='checkbox' name='docgroups[]' value='" . $row['id'] . "' " . ($checked ? "checked='checked'" : '') . " onclick=\"makePublic(false)\" /> " . $row['name'] . "</label></li>"; |
|
| 554 | + } else { |
|
| 555 | + if($checked) { |
|
| 556 | + echo "<input type='hidden' name='docgroups[]' value='" . $row['id'] . "' />"; |
|
| 557 | + } |
|
| 558 | + } |
|
| 559 | + } |
|
| 560 | + if($modx->hasPermission('access_permissions')) { |
|
| 561 | + $chks = "<li><label><input type='checkbox' name='chkalldocs' " . (!$notPublic ? "checked='checked'" : '') . " onclick=\"makePublic(true)\" /> <span class='warning'>" . $_lang['all_doc_groups'] . "</span></label></li>" . $chks; |
|
| 562 | + } |
|
| 563 | + echo '<ul>' . $chks . '</ul>'; |
|
| 564 | + ?> |
|
| 565 | 565 | <?php } ?> |
| 566 | 566 | <?php } ?> |
| 567 | 567 | |
@@ -571,12 +571,12 @@ discard block |
||
| 571 | 571 | <input type="submit" name="save" style="display:none"> |
| 572 | 572 | |
| 573 | 573 | <?php |
| 574 | - // invoke OnTVFormRender event |
|
| 575 | - $evtOut = $modx->invokeEvent('OnTVFormRender', array('id' => $id)); |
|
| 576 | - if(is_array($evtOut)) { |
|
| 577 | - echo implode('', $evtOut); |
|
| 578 | - } |
|
| 579 | - ?> |
|
| 574 | + // invoke OnTVFormRender event |
|
| 575 | + $evtOut = $modx->invokeEvent('OnTVFormRender', array('id' => $id)); |
|
| 576 | + if(is_array($evtOut)) { |
|
| 577 | + echo implode('', $evtOut); |
|
| 578 | + } |
|
| 579 | + ?> |
|
| 580 | 580 | </div> |
| 581 | 581 | </form> |
| 582 | 582 | <script type="text/javascript">setTimeout('showParameters()', 10);</script> |
@@ -1,240 +1,240 @@ |
||
| 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 | $tpl = array( |
| 7 | - 'viewForm' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_viewForm.tpl'), |
|
| 8 | - 'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'), |
|
| 9 | - 'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'), |
|
| 10 | - 'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'), |
|
| 11 | - 'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl') |
|
| 7 | + 'viewForm' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_viewForm.tpl'), |
|
| 8 | + 'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'), |
|
| 9 | + 'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'), |
|
| 10 | + 'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'), |
|
| 11 | + 'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl') |
|
| 12 | 12 | ); |
| 13 | 13 | |
| 14 | 14 | function parsePh($tpl, $ph) {
|
| 15 | - global $modx, $_lang; |
|
| 16 | - $tpl = $modx->parseText($tpl, $_lang, '[%', '%]'); |
|
| 17 | - return $modx->parseText($tpl, $ph); |
|
| 15 | + global $modx, $_lang; |
|
| 16 | + $tpl = $modx->parseText($tpl, $_lang, '[%', '%]'); |
|
| 17 | + return $modx->parseText($tpl, $ph); |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | function renderViewSwitchButtons($cssId) {
|
| 21 | - global $modx, $_lang, $tpl; |
|
| 21 | + global $modx, $_lang, $tpl; |
|
| 22 | 22 | |
| 23 | - return parsePh($tpl['viewForm'], array( |
|
| 24 | - 'cssId' => $cssId |
|
| 25 | - )); |
|
| 23 | + return parsePh($tpl['viewForm'], array( |
|
| 24 | + 'cssId' => $cssId |
|
| 25 | + )); |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | function createResourceList($resourceTable, $resources) {
|
| 29 | - global $modx, $_lang, $_style, $modx_textdir, $tpl; |
|
| 30 | - |
|
| 31 | - $items = isset($resources->items[$resourceTable]) ? $resources->items[$resourceTable] : false; |
|
| 32 | - $types = isset($resources->types[$resourceTable]) ? $resources->types[$resourceTable] : false; |
|
| 33 | - |
|
| 34 | - if(!$items) {
|
|
| 35 | - return $_lang['no_results']; |
|
| 36 | - } |
|
| 37 | - |
|
| 38 | - // Prepare elements- and categories-list |
|
| 39 | - $elements = array(); |
|
| 40 | - $categories = array(); |
|
| 41 | - foreach($items as $row) {
|
|
| 42 | - $catid = $row['catid'] ? $row['catid'] : 0; |
|
| 43 | - $categories[$catid] = array('name' => stripslashes($row['category']));
|
|
| 44 | - $elements[$catid][] = prepareElementRowPh($row, $resourceTable, $resources); |
|
| 45 | - } |
|
| 46 | - |
|
| 47 | - // Now render categories / panel-collapse |
|
| 48 | - $panelGroup = ''; |
|
| 49 | - foreach($elements as $catid => $elList) {
|
|
| 50 | - // Add panel-heading / category-collapse to output |
|
| 51 | - $panelGroup .= parsePh($tpl['panelHeading'], array( |
|
| 52 | - 'tab' => $resourceTable, |
|
| 53 | - 'category' => $categories[$catid]['name'], |
|
| 54 | - 'categoryid' => $catid != '' ? ' <small>(' . $catid . ')</small>' : '',
|
|
| 55 | - 'catid' => $catid, |
|
| 56 | - )); |
|
| 57 | - |
|
| 58 | - // Prepare content for panel-collapse |
|
| 59 | - $panelCollapse = ''; |
|
| 60 | - foreach($elList as $el) {
|
|
| 61 | - $panelCollapse .= parsePh($tpl['elementsRow'], $el); |
|
| 62 | - } |
|
| 63 | - |
|
| 64 | - // Add panel-collapse with elements to output |
|
| 65 | - $panelGroup .= parsePh($tpl['panelCollapse'], array( |
|
| 66 | - 'tab' => $resourceTable, |
|
| 67 | - 'catid' => $catid, |
|
| 68 | - 'wrapper' => $panelCollapse, |
|
| 69 | - )); |
|
| 70 | - } |
|
| 71 | - |
|
| 72 | - return parsePh($tpl['panelGroup'], array( |
|
| 73 | - 'resourceTable' => $resourceTable, |
|
| 74 | - 'wrapper' => $panelGroup |
|
| 75 | - )); |
|
| 29 | + global $modx, $_lang, $_style, $modx_textdir, $tpl; |
|
| 30 | + |
|
| 31 | + $items = isset($resources->items[$resourceTable]) ? $resources->items[$resourceTable] : false; |
|
| 32 | + $types = isset($resources->types[$resourceTable]) ? $resources->types[$resourceTable] : false; |
|
| 33 | + |
|
| 34 | + if(!$items) {
|
|
| 35 | + return $_lang['no_results']; |
|
| 36 | + } |
|
| 37 | + |
|
| 38 | + // Prepare elements- and categories-list |
|
| 39 | + $elements = array(); |
|
| 40 | + $categories = array(); |
|
| 41 | + foreach($items as $row) {
|
|
| 42 | + $catid = $row['catid'] ? $row['catid'] : 0; |
|
| 43 | + $categories[$catid] = array('name' => stripslashes($row['category']));
|
|
| 44 | + $elements[$catid][] = prepareElementRowPh($row, $resourceTable, $resources); |
|
| 45 | + } |
|
| 46 | + |
|
| 47 | + // Now render categories / panel-collapse |
|
| 48 | + $panelGroup = ''; |
|
| 49 | + foreach($elements as $catid => $elList) {
|
|
| 50 | + // Add panel-heading / category-collapse to output |
|
| 51 | + $panelGroup .= parsePh($tpl['panelHeading'], array( |
|
| 52 | + 'tab' => $resourceTable, |
|
| 53 | + 'category' => $categories[$catid]['name'], |
|
| 54 | + 'categoryid' => $catid != '' ? ' <small>(' . $catid . ')</small>' : '',
|
|
| 55 | + 'catid' => $catid, |
|
| 56 | + )); |
|
| 57 | + |
|
| 58 | + // Prepare content for panel-collapse |
|
| 59 | + $panelCollapse = ''; |
|
| 60 | + foreach($elList as $el) {
|
|
| 61 | + $panelCollapse .= parsePh($tpl['elementsRow'], $el); |
|
| 62 | + } |
|
| 63 | + |
|
| 64 | + // Add panel-collapse with elements to output |
|
| 65 | + $panelGroup .= parsePh($tpl['panelCollapse'], array( |
|
| 66 | + 'tab' => $resourceTable, |
|
| 67 | + 'catid' => $catid, |
|
| 68 | + 'wrapper' => $panelCollapse, |
|
| 69 | + )); |
|
| 70 | + } |
|
| 71 | + |
|
| 72 | + return parsePh($tpl['panelGroup'], array( |
|
| 73 | + 'resourceTable' => $resourceTable, |
|
| 74 | + 'wrapper' => $panelGroup |
|
| 75 | + )); |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | function createCombinedView($resources) {
|
| 79 | - global $modx, $_lang, $_style, $modx_textdir; |
|
| 80 | - |
|
| 81 | - $itemsPerCategory = isset($resources->itemsPerCategory) ? $resources->itemsPerCategory : false; |
|
| 82 | - $types = isset($resources->types) ? $resources->types : false; |
|
| 83 | - $categories = isset($resources->categories) ? $resources->categories : false; |
|
| 84 | - |
|
| 85 | - if(!$itemsPerCategory) {
|
|
| 86 | - return $_lang['no_results']; |
|
| 87 | - } |
|
| 88 | - |
|
| 89 | - $tpl = array( |
|
| 90 | - 'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'), |
|
| 91 | - 'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'), |
|
| 92 | - 'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'), |
|
| 93 | - 'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl'), |
|
| 94 | - ); |
|
| 95 | - |
|
| 96 | - // Easily loop through $itemsPerCategory-Array |
|
| 97 | - $panelGroup = ''; |
|
| 98 | - foreach($categories as $catid => $category) {
|
|
| 99 | - // Prepare collapse content / elements-list |
|
| 100 | - $panelCollapse = ''; |
|
| 101 | - foreach($itemsPerCategory[$catid] as $el) {
|
|
| 102 | - $resourceTable = $el['type']; |
|
| 103 | - $ph = prepareElementRowPh($el, $resourceTable, $resources); |
|
| 104 | - $panelCollapse .= parsePh($tpl['elementsRow'], $ph); |
|
| 105 | - } |
|
| 106 | - |
|
| 107 | - // Add panel-heading / button |
|
| 108 | - $panelGroup .= parsePh($tpl['panelHeading'], array( |
|
| 109 | - 'tab' => 'categories_list', |
|
| 110 | - 'category' => $categories[$catid], |
|
| 111 | - 'categoryid' => $catid != '' ? ' <small>(' . $catid . ')</small>' : '',
|
|
| 112 | - 'catid' => $catid, |
|
| 113 | - )); |
|
| 114 | - |
|
| 115 | - // Add panel |
|
| 116 | - $panelGroup .= parsePh($tpl['panelCollapse'], array( |
|
| 117 | - 'tab' => 'categories_list', |
|
| 118 | - 'catid' => $catid, |
|
| 119 | - 'wrapper' => $panelCollapse, |
|
| 120 | - )); |
|
| 121 | - } |
|
| 122 | - |
|
| 123 | - return parsePh($tpl['panelGroup'], array( |
|
| 124 | - 'resourceTable' => 'categories_list', |
|
| 125 | - 'wrapper' => $panelGroup |
|
| 126 | - )); |
|
| 79 | + global $modx, $_lang, $_style, $modx_textdir; |
|
| 80 | + |
|
| 81 | + $itemsPerCategory = isset($resources->itemsPerCategory) ? $resources->itemsPerCategory : false; |
|
| 82 | + $types = isset($resources->types) ? $resources->types : false; |
|
| 83 | + $categories = isset($resources->categories) ? $resources->categories : false; |
|
| 84 | + |
|
| 85 | + if(!$itemsPerCategory) {
|
|
| 86 | + return $_lang['no_results']; |
|
| 87 | + } |
|
| 88 | + |
|
| 89 | + $tpl = array( |
|
| 90 | + 'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'), |
|
| 91 | + 'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'), |
|
| 92 | + 'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'), |
|
| 93 | + 'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl'), |
|
| 94 | + ); |
|
| 95 | + |
|
| 96 | + // Easily loop through $itemsPerCategory-Array |
|
| 97 | + $panelGroup = ''; |
|
| 98 | + foreach($categories as $catid => $category) {
|
|
| 99 | + // Prepare collapse content / elements-list |
|
| 100 | + $panelCollapse = ''; |
|
| 101 | + foreach($itemsPerCategory[$catid] as $el) {
|
|
| 102 | + $resourceTable = $el['type']; |
|
| 103 | + $ph = prepareElementRowPh($el, $resourceTable, $resources); |
|
| 104 | + $panelCollapse .= parsePh($tpl['elementsRow'], $ph); |
|
| 105 | + } |
|
| 106 | + |
|
| 107 | + // Add panel-heading / button |
|
| 108 | + $panelGroup .= parsePh($tpl['panelHeading'], array( |
|
| 109 | + 'tab' => 'categories_list', |
|
| 110 | + 'category' => $categories[$catid], |
|
| 111 | + 'categoryid' => $catid != '' ? ' <small>(' . $catid . ')</small>' : '',
|
|
| 112 | + 'catid' => $catid, |
|
| 113 | + )); |
|
| 114 | + |
|
| 115 | + // Add panel |
|
| 116 | + $panelGroup .= parsePh($tpl['panelCollapse'], array( |
|
| 117 | + 'tab' => 'categories_list', |
|
| 118 | + 'catid' => $catid, |
|
| 119 | + 'wrapper' => $panelCollapse, |
|
| 120 | + )); |
|
| 121 | + } |
|
| 122 | + |
|
| 123 | + return parsePh($tpl['panelGroup'], array( |
|
| 124 | + 'resourceTable' => 'categories_list', |
|
| 125 | + 'wrapper' => $panelGroup |
|
| 126 | + )); |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | function prepareElementRowPh($row, $resourceTable, $resources) {
|
| 130 | - global $modx, $modx_textdir, $_style, $_lang; |
|
| 131 | - |
|
| 132 | - $types = isset($resources->types[$resourceTable]) ? $resources->types[$resourceTable] : false; |
|
| 133 | - |
|
| 134 | - $class = ''; |
|
| 135 | - $_lang["confirm_delete"] = $_lang["delete"]; |
|
| 136 | - |
|
| 137 | - if($resourceTable == 'site_templates') {
|
|
| 138 | - $class = $row['selectable'] ? '' : 'disabledPlugin'; |
|
| 139 | - $lockElementType = 1; |
|
| 140 | - $_lang["confirm_delete"] = $_lang["confirm_delete_template"]; |
|
| 141 | - } |
|
| 142 | - if($resourceTable == 'site_tmplvars') {
|
|
| 143 | - $class = $row['reltpl'] ? '' : 'disabledPlugin'; |
|
| 144 | - $lockElementType = 2; |
|
| 145 | - $_lang["confirm_delete"] = $_lang["confirm_delete_tmplvars"]; |
|
| 146 | - } |
|
| 147 | - if($resourceTable == 'site_htmlsnippets') {
|
|
| 130 | + global $modx, $modx_textdir, $_style, $_lang; |
|
| 131 | + |
|
| 132 | + $types = isset($resources->types[$resourceTable]) ? $resources->types[$resourceTable] : false; |
|
| 133 | + |
|
| 134 | + $class = ''; |
|
| 135 | + $_lang["confirm_delete"] = $_lang["delete"]; |
|
| 136 | + |
|
| 137 | + if($resourceTable == 'site_templates') {
|
|
| 138 | + $class = $row['selectable'] ? '' : 'disabledPlugin'; |
|
| 139 | + $lockElementType = 1; |
|
| 140 | + $_lang["confirm_delete"] = $_lang["confirm_delete_template"]; |
|
| 141 | + } |
|
| 142 | + if($resourceTable == 'site_tmplvars') {
|
|
| 143 | + $class = $row['reltpl'] ? '' : 'disabledPlugin'; |
|
| 144 | + $lockElementType = 2; |
|
| 145 | + $_lang["confirm_delete"] = $_lang["confirm_delete_tmplvars"]; |
|
| 146 | + } |
|
| 147 | + if($resourceTable == 'site_htmlsnippets') {
|
|
| 148 | 148 | $class = $row['disabled'] ? 'disabledPlugin' : ''; |
| 149 | - $lockElementType = 3; |
|
| 150 | - $_lang["confirm_delete"] = $_lang["confirm_delete_htmlsnippet"]; |
|
| 151 | - } |
|
| 152 | - if($resourceTable == 'site_snippets') {
|
|
| 149 | + $lockElementType = 3; |
|
| 150 | + $_lang["confirm_delete"] = $_lang["confirm_delete_htmlsnippet"]; |
|
| 151 | + } |
|
| 152 | + if($resourceTable == 'site_snippets') {
|
|
| 153 | 153 | $class = $row['disabled'] ? 'disabledPlugin' : ''; |
| 154 | - $lockElementType = 4; |
|
| 155 | - $_lang["confirm_delete"] = $_lang["confirm_delete_snippet"]; |
|
| 156 | - } |
|
| 157 | - if($resourceTable == 'site_plugins') {
|
|
| 158 | - $class = $row['disabled'] ? 'disabledPlugin' : ''; |
|
| 159 | - $lockElementType = 5; |
|
| 160 | - $_lang["confirm_delete"] = $_lang["confirm_delete_plugin"]; |
|
| 161 | - } |
|
| 162 | - if($resourceTable == 'site_modules') {
|
|
| 154 | + $lockElementType = 4; |
|
| 155 | + $_lang["confirm_delete"] = $_lang["confirm_delete_snippet"]; |
|
| 156 | + } |
|
| 157 | + if($resourceTable == 'site_plugins') {
|
|
| 158 | + $class = $row['disabled'] ? 'disabledPlugin' : ''; |
|
| 159 | + $lockElementType = 5; |
|
| 160 | + $_lang["confirm_delete"] = $_lang["confirm_delete_plugin"]; |
|
| 161 | + } |
|
| 162 | + if($resourceTable == 'site_modules') {
|
|
| 163 | 163 | $class = $row['disabled'] ? '' : 'disabledPlugin'; |
| 164 | - $_lang["confirm_delete"] = $_lang["confirm_delete_module"]; |
|
| 165 | - } |
|
| 166 | - |
|
| 167 | - // Prepare displaying user-locks |
|
| 168 | - $lockedByUser = ''; |
|
| 169 | - $rowLock = $modx->elementIsLocked($lockElementType, $row['id'], true); |
|
| 170 | - if($rowLock && $modx->hasPermission('display_locks')) {
|
|
| 171 | - if($rowLock['sid'] == $modx->sid) {
|
|
| 172 | - $title = $modx->parseText($_lang["lock_element_editing"], array( |
|
| 173 | - 'element_type' => $_lang["lock_element_type_" . $lockElementType], |
|
| 174 | - 'lasthit_df' => $rowLock['lasthit_df'] |
|
| 175 | - )); |
|
| 176 | - $lockedByUser = '<span title="' . $title . '" class="editResource" style="cursor:context-menu;">' . $_style['tree_preview_resource'] . '</span> '; |
|
| 177 | - } else {
|
|
| 178 | - $title = $modx->parseText($_lang["lock_element_locked_by"], array( |
|
| 179 | - 'element_type' => $_lang["lock_element_type_" . $lockElementType], |
|
| 180 | - 'username' => $rowLock['username'], |
|
| 181 | - 'lasthit_df' => $rowLock['lasthit_df'] |
|
| 182 | - )); |
|
| 183 | - if($modx->hasPermission('remove_locks')) {
|
|
| 184 | - $lockedByUser = '<a href="javascript:;" onclick="unlockElement(' . $lockElementType . ', ' . $row['id'] . ', this);return false;" title="' . $title . '" class="lockedResource"><i class="' . $_style['icons_secured'] . '"></i></a>';
|
|
| 185 | - } else {
|
|
| 186 | - $lockedByUser = '<span title="' . $title . '" class="lockedResource" style="cursor:context-menu;"><i class="' . $_style['icons_secured'] . '"></i></span>'; |
|
| 187 | - } |
|
| 188 | - } |
|
| 189 | - } |
|
| 190 | - if($lockedByUser) {
|
|
| 191 | - $lockedByUser = '<div class="lockCell">' . $lockedByUser . '</div>'; |
|
| 192 | - } |
|
| 193 | - |
|
| 194 | - // Caption |
|
| 195 | - if($resourceTable == 'site_tmplvars') {
|
|
| 196 | - $caption = !empty($row['description']) ? ' ' . $row['caption'] . ' <small>(' . $row['description'] . ')</small>' : ' ' . $row['caption'];
|
|
| 197 | - } else {
|
|
| 198 | - $caption = !empty($row['description']) ? ' ' . $row['description'] : ''; |
|
| 199 | - } |
|
| 200 | - |
|
| 201 | - // Special marks |
|
| 202 | - $tplInfo = array(); |
|
| 203 | - if($row['locked']) {
|
|
| 204 | - $tplInfo[] = $_lang['locked']; |
|
| 205 | - } |
|
| 206 | - if($row['id'] == $modx->config['default_template'] && $resourceTable == 'site_templates') {
|
|
| 207 | - $tplInfo[] = $_lang['defaulttemplate_title']; |
|
| 208 | - } |
|
| 209 | - $marks = !empty($tplInfo) ? ' <em>(' . join(', ', $tplInfo) . ')</em>' : '';
|
|
| 210 | - |
|
| 211 | - /* row buttons */ |
|
| 212 | - $buttons = ''; |
|
| 213 | - if($modx->hasPermission($types['actions']['edit'][1])) {
|
|
| 214 | - $buttons .= '<li><a title="' . $_lang["edit_resource"] . '" href="index.php?a=' . $types['actions']['edit'][0] . '&id=' . $row['id'] . '"><i class="fa fa-edit fa-fw"></i></a></li>'; |
|
| 215 | - } |
|
| 216 | - if($modx->hasPermission($types['actions']['duplicate'][1])) {
|
|
| 217 | - $buttons .= '<li><a onclick="return confirm(\'' . $_lang["confirm_duplicate_record"] . '\')" title="' . $_lang["resource_duplicate"] . '" href="index.php?a=' . $types['actions']['duplicate'][0] . '&id=' . $row['id'] . '"><i class="fa fa-clone fa-fw"></i></a></li>'; |
|
| 218 | - } |
|
| 219 | - if($modx->hasPermission($types['actions']['remove'][1])) {
|
|
| 220 | - $buttons .= '<li><a onclick="return confirm(\'' . $_lang["confirm_delete"] . '\')" title="' . $_lang["delete"] . '" href="index.php?a=' . $types['actions']['remove'][0] . '&id=' . $row['id'] . '"><i class="fa fa-trash fa-fw"></i></a></li>'; |
|
| 221 | - } |
|
| 222 | - $buttons = $buttons ? '<div class="btnCell"><ul class="elements_buttonbar">' . $buttons . '</ul></div>' : ''; |
|
| 223 | - |
|
| 224 | - $catid = $row['catid'] ? $row['catid'] : 0; |
|
| 225 | - |
|
| 226 | - // Placeholders for elements-row |
|
| 227 | - return array( |
|
| 228 | - 'class' => $class ? ' class="' . $class . '"' : '', |
|
| 229 | - 'lockedByUser' => $lockedByUser, |
|
| 230 | - 'name' => $row['name'], |
|
| 231 | - 'caption' => $caption, |
|
| 232 | - 'buttons' => $buttons, |
|
| 233 | - 'marks' => $marks, |
|
| 234 | - 'id' => $row['id'], |
|
| 235 | - 'resourceTable' => $resourceTable, |
|
| 236 | - 'actionEdit' => $types['actions']['edit'][0], |
|
| 237 | - 'catid' => $catid, |
|
| 238 | - 'textdir' => $modx_textdir ? '‏' : '', |
|
| 239 | - ); |
|
| 164 | + $_lang["confirm_delete"] = $_lang["confirm_delete_module"]; |
|
| 165 | + } |
|
| 166 | + |
|
| 167 | + // Prepare displaying user-locks |
|
| 168 | + $lockedByUser = ''; |
|
| 169 | + $rowLock = $modx->elementIsLocked($lockElementType, $row['id'], true); |
|
| 170 | + if($rowLock && $modx->hasPermission('display_locks')) {
|
|
| 171 | + if($rowLock['sid'] == $modx->sid) {
|
|
| 172 | + $title = $modx->parseText($_lang["lock_element_editing"], array( |
|
| 173 | + 'element_type' => $_lang["lock_element_type_" . $lockElementType], |
|
| 174 | + 'lasthit_df' => $rowLock['lasthit_df'] |
|
| 175 | + )); |
|
| 176 | + $lockedByUser = '<span title="' . $title . '" class="editResource" style="cursor:context-menu;">' . $_style['tree_preview_resource'] . '</span> '; |
|
| 177 | + } else {
|
|
| 178 | + $title = $modx->parseText($_lang["lock_element_locked_by"], array( |
|
| 179 | + 'element_type' => $_lang["lock_element_type_" . $lockElementType], |
|
| 180 | + 'username' => $rowLock['username'], |
|
| 181 | + 'lasthit_df' => $rowLock['lasthit_df'] |
|
| 182 | + )); |
|
| 183 | + if($modx->hasPermission('remove_locks')) {
|
|
| 184 | + $lockedByUser = '<a href="javascript:;" onclick="unlockElement(' . $lockElementType . ', ' . $row['id'] . ', this);return false;" title="' . $title . '" class="lockedResource"><i class="' . $_style['icons_secured'] . '"></i></a>';
|
|
| 185 | + } else {
|
|
| 186 | + $lockedByUser = '<span title="' . $title . '" class="lockedResource" style="cursor:context-menu;"><i class="' . $_style['icons_secured'] . '"></i></span>'; |
|
| 187 | + } |
|
| 188 | + } |
|
| 189 | + } |
|
| 190 | + if($lockedByUser) {
|
|
| 191 | + $lockedByUser = '<div class="lockCell">' . $lockedByUser . '</div>'; |
|
| 192 | + } |
|
| 193 | + |
|
| 194 | + // Caption |
|
| 195 | + if($resourceTable == 'site_tmplvars') {
|
|
| 196 | + $caption = !empty($row['description']) ? ' ' . $row['caption'] . ' <small>(' . $row['description'] . ')</small>' : ' ' . $row['caption'];
|
|
| 197 | + } else {
|
|
| 198 | + $caption = !empty($row['description']) ? ' ' . $row['description'] : ''; |
|
| 199 | + } |
|
| 200 | + |
|
| 201 | + // Special marks |
|
| 202 | + $tplInfo = array(); |
|
| 203 | + if($row['locked']) {
|
|
| 204 | + $tplInfo[] = $_lang['locked']; |
|
| 205 | + } |
|
| 206 | + if($row['id'] == $modx->config['default_template'] && $resourceTable == 'site_templates') {
|
|
| 207 | + $tplInfo[] = $_lang['defaulttemplate_title']; |
|
| 208 | + } |
|
| 209 | + $marks = !empty($tplInfo) ? ' <em>(' . join(', ', $tplInfo) . ')</em>' : '';
|
|
| 210 | + |
|
| 211 | + /* row buttons */ |
|
| 212 | + $buttons = ''; |
|
| 213 | + if($modx->hasPermission($types['actions']['edit'][1])) {
|
|
| 214 | + $buttons .= '<li><a title="' . $_lang["edit_resource"] . '" href="index.php?a=' . $types['actions']['edit'][0] . '&id=' . $row['id'] . '"><i class="fa fa-edit fa-fw"></i></a></li>'; |
|
| 215 | + } |
|
| 216 | + if($modx->hasPermission($types['actions']['duplicate'][1])) {
|
|
| 217 | + $buttons .= '<li><a onclick="return confirm(\'' . $_lang["confirm_duplicate_record"] . '\')" title="' . $_lang["resource_duplicate"] . '" href="index.php?a=' . $types['actions']['duplicate'][0] . '&id=' . $row['id'] . '"><i class="fa fa-clone fa-fw"></i></a></li>'; |
|
| 218 | + } |
|
| 219 | + if($modx->hasPermission($types['actions']['remove'][1])) {
|
|
| 220 | + $buttons .= '<li><a onclick="return confirm(\'' . $_lang["confirm_delete"] . '\')" title="' . $_lang["delete"] . '" href="index.php?a=' . $types['actions']['remove'][0] . '&id=' . $row['id'] . '"><i class="fa fa-trash fa-fw"></i></a></li>'; |
|
| 221 | + } |
|
| 222 | + $buttons = $buttons ? '<div class="btnCell"><ul class="elements_buttonbar">' . $buttons . '</ul></div>' : ''; |
|
| 223 | + |
|
| 224 | + $catid = $row['catid'] ? $row['catid'] : 0; |
|
| 225 | + |
|
| 226 | + // Placeholders for elements-row |
|
| 227 | + return array( |
|
| 228 | + 'class' => $class ? ' class="' . $class . '"' : '', |
|
| 229 | + 'lockedByUser' => $lockedByUser, |
|
| 230 | + 'name' => $row['name'], |
|
| 231 | + 'caption' => $caption, |
|
| 232 | + 'buttons' => $buttons, |
|
| 233 | + 'marks' => $marks, |
|
| 234 | + 'id' => $row['id'], |
|
| 235 | + 'resourceTable' => $resourceTable, |
|
| 236 | + 'actionEdit' => $types['actions']['edit'][0], |
|
| 237 | + 'catid' => $catid, |
|
| 238 | + 'textdir' => $modx_textdir ? '‏' : '', |
|
| 239 | + ); |
|
| 240 | 240 | } |
@@ -2,123 +2,123 @@ |
||
| 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 | class mgrResources { |
| 5 | - var $types = array(); |
|
| 6 | - var $items = array(); |
|
| 7 | - var $categories = array(); |
|
| 8 | - var $itemsPerCategory = array(); |
|
| 5 | + var $types = array(); |
|
| 6 | + var $items = array(); |
|
| 7 | + var $categories = array(); |
|
| 8 | + var $itemsPerCategory = array(); |
|
| 9 | 9 | |
| 10 | - function __construct() { |
|
| 11 | - $this->setTypes(); |
|
| 12 | - $this->queryItemsFromDB(); |
|
| 13 | - $this->prepareCategoryArrays(); |
|
| 14 | - } |
|
| 10 | + function __construct() { |
|
| 11 | + $this->setTypes(); |
|
| 12 | + $this->queryItemsFromDB(); |
|
| 13 | + $this->prepareCategoryArrays(); |
|
| 14 | + } |
|
| 15 | 15 | |
| 16 | - function setTypes() { |
|
| 17 | - global $_lang; |
|
| 18 | - $this->types['site_templates'] = array( |
|
| 19 | - 'title'=>$_lang["manage_templates"], |
|
| 20 | - 'actions'=>array( 'edit'=>array(16,'edit_template'), 'duplicate'=>array(96,'new_template'), 'remove'=>array(21,'delete_template') ), |
|
| 21 | - 'permissions'=>array('new_template','edit_template'), |
|
| 22 | - 'name'=>'templatename' |
|
| 23 | - ); |
|
| 24 | - $this->types['site_tmplvars'] = array( |
|
| 25 | - 'title'=>$_lang["tmplvars"], |
|
| 26 | - 'actions'=>array('edit'=>array(301,'edit_template'), 'duplicate'=>array(304,'edit_template'), 'remove'=>array(303,'edit_template')), |
|
| 27 | - 'permissions'=>array('new_template','edit_template'), |
|
| 28 | - ); |
|
| 29 | - $this->types['site_htmlsnippets'] = array( |
|
| 30 | - 'title'=>$_lang["manage_htmlsnippets"], |
|
| 31 | - 'actions'=>array('edit'=>array(78,'edit_chunk'), 'duplicate'=>array(97,'new_chunk'), 'remove'=>array(80,'delete_chunk')), |
|
| 32 | - 'permissions'=>array('new_chunk','edit_chunk'), |
|
| 33 | - ); |
|
| 34 | - $this->types['site_snippets'] = array( |
|
| 35 | - 'title'=>$_lang["manage_snippets"], |
|
| 36 | - 'actions'=>array('edit'=>array(22,'edit_snippet'), 'duplicate'=>array(98,'new_snippet'), 'remove'=>array(25,'delete_snippet')), |
|
| 37 | - 'permissions'=>array('new_snippet','edit_snippet'), |
|
| 38 | - ); |
|
| 39 | - $this->types['site_plugins'] = array( |
|
| 40 | - 'title'=>$_lang["manage_plugins"], |
|
| 41 | - 'actions'=>array('edit'=>array(102,'edit_plugin'), 'duplicate'=>array(105,'new_plugin'), 'remove'=>array(104,'delete_plugin')), |
|
| 42 | - 'permissions'=>array('new_plugin','edit_plugin'), |
|
| 43 | - ); |
|
| 44 | - $this->types['site_modules'] = array( |
|
| 45 | - 'title'=>$_lang["manage_modules"], |
|
| 46 | - 'actions'=>array('edit'=>array(108,'edit_module'), 'duplicate'=>array(111,'new_module'), 'remove'=>array(110,'delete_module')), |
|
| 47 | - 'permissions'=>array('new_module','edit_module'), |
|
| 48 | - ); |
|
| 49 | - } |
|
| 16 | + function setTypes() { |
|
| 17 | + global $_lang; |
|
| 18 | + $this->types['site_templates'] = array( |
|
| 19 | + 'title'=>$_lang["manage_templates"], |
|
| 20 | + 'actions'=>array( 'edit'=>array(16,'edit_template'), 'duplicate'=>array(96,'new_template'), 'remove'=>array(21,'delete_template') ), |
|
| 21 | + 'permissions'=>array('new_template','edit_template'), |
|
| 22 | + 'name'=>'templatename' |
|
| 23 | + ); |
|
| 24 | + $this->types['site_tmplvars'] = array( |
|
| 25 | + 'title'=>$_lang["tmplvars"], |
|
| 26 | + 'actions'=>array('edit'=>array(301,'edit_template'), 'duplicate'=>array(304,'edit_template'), 'remove'=>array(303,'edit_template')), |
|
| 27 | + 'permissions'=>array('new_template','edit_template'), |
|
| 28 | + ); |
|
| 29 | + $this->types['site_htmlsnippets'] = array( |
|
| 30 | + 'title'=>$_lang["manage_htmlsnippets"], |
|
| 31 | + 'actions'=>array('edit'=>array(78,'edit_chunk'), 'duplicate'=>array(97,'new_chunk'), 'remove'=>array(80,'delete_chunk')), |
|
| 32 | + 'permissions'=>array('new_chunk','edit_chunk'), |
|
| 33 | + ); |
|
| 34 | + $this->types['site_snippets'] = array( |
|
| 35 | + 'title'=>$_lang["manage_snippets"], |
|
| 36 | + 'actions'=>array('edit'=>array(22,'edit_snippet'), 'duplicate'=>array(98,'new_snippet'), 'remove'=>array(25,'delete_snippet')), |
|
| 37 | + 'permissions'=>array('new_snippet','edit_snippet'), |
|
| 38 | + ); |
|
| 39 | + $this->types['site_plugins'] = array( |
|
| 40 | + 'title'=>$_lang["manage_plugins"], |
|
| 41 | + 'actions'=>array('edit'=>array(102,'edit_plugin'), 'duplicate'=>array(105,'new_plugin'), 'remove'=>array(104,'delete_plugin')), |
|
| 42 | + 'permissions'=>array('new_plugin','edit_plugin'), |
|
| 43 | + ); |
|
| 44 | + $this->types['site_modules'] = array( |
|
| 45 | + 'title'=>$_lang["manage_modules"], |
|
| 46 | + 'actions'=>array('edit'=>array(108,'edit_module'), 'duplicate'=>array(111,'new_module'), 'remove'=>array(110,'delete_module')), |
|
| 47 | + 'permissions'=>array('new_module','edit_module'), |
|
| 48 | + ); |
|
| 49 | + } |
|
| 50 | 50 | |
| 51 | - function queryItemsFromDB() { |
|
| 52 | - foreach($this->types as $resourceTable=>$type) { |
|
| 53 | - if($this->hasAnyPermissions($type['permissions'])) { |
|
| 54 | - $nameField = isset($type['name']) ? $type['name'] : 'name'; |
|
| 55 | - $this->items[$resourceTable] = $this->queryResources($resourceTable, $nameField); |
|
| 56 | - } |
|
| 57 | - } |
|
| 58 | - } |
|
| 51 | + function queryItemsFromDB() { |
|
| 52 | + foreach($this->types as $resourceTable=>$type) { |
|
| 53 | + if($this->hasAnyPermissions($type['permissions'])) { |
|
| 54 | + $nameField = isset($type['name']) ? $type['name'] : 'name'; |
|
| 55 | + $this->items[$resourceTable] = $this->queryResources($resourceTable, $nameField); |
|
| 56 | + } |
|
| 57 | + } |
|
| 58 | + } |
|
| 59 | 59 | |
| 60 | - function hasAnyPermissions($permissions) { |
|
| 61 | - global $modx; |
|
| 60 | + function hasAnyPermissions($permissions) { |
|
| 61 | + global $modx; |
|
| 62 | 62 | |
| 63 | - foreach($permissions as $p) |
|
| 64 | - if($modx->hasPermission($p)) return true; |
|
| 63 | + foreach($permissions as $p) |
|
| 64 | + if($modx->hasPermission($p)) return true; |
|
| 65 | 65 | |
| 66 | - return false; |
|
| 67 | - } |
|
| 66 | + return false; |
|
| 67 | + } |
|
| 68 | 68 | |
| 69 | - function queryResources($resourceTable, $nameField = 'name') { |
|
| 70 | - global $modx, $_lang; |
|
| 69 | + function queryResources($resourceTable, $nameField = 'name') { |
|
| 70 | + global $modx, $_lang; |
|
| 71 | 71 | |
| 72 | - $pluginsql = ($resourceTable == 'site_htmlsnippets' || $resourceTable == 'site_snippets' || $resourceTable == 'site_plugins' || $resourceTable == 'site_modules') ? $resourceTable . '.disabled, ' : ''; |
|
| 72 | + $pluginsql = ($resourceTable == 'site_htmlsnippets' || $resourceTable == 'site_snippets' || $resourceTable == 'site_plugins' || $resourceTable == 'site_modules') ? $resourceTable . '.disabled, ' : ''; |
|
| 73 | 73 | |
| 74 | - $tvsql = ''; |
|
| 75 | - $tvjoin = ''; |
|
| 76 | - if ($resourceTable == 'site_tmplvars') { |
|
| 77 | - $tvsql = 'site_tmplvars.caption, '; |
|
| 78 | - $tvjoin = sprintf('LEFT JOIN %s AS stt ON site_tmplvars.id=stt.tmplvarid GROUP BY site_tmplvars.id,reltpl', $modx->getFullTableName('site_tmplvar_templates')); |
|
| 79 | - $sttfield = 'IF(stt.templateid,1,0) AS reltpl,'; |
|
| 80 | - } |
|
| 81 | - else $sttfield = ''; |
|
| 74 | + $tvsql = ''; |
|
| 75 | + $tvjoin = ''; |
|
| 76 | + if ($resourceTable == 'site_tmplvars') { |
|
| 77 | + $tvsql = 'site_tmplvars.caption, '; |
|
| 78 | + $tvjoin = sprintf('LEFT JOIN %s AS stt ON site_tmplvars.id=stt.tmplvarid GROUP BY site_tmplvars.id,reltpl', $modx->getFullTableName('site_tmplvar_templates')); |
|
| 79 | + $sttfield = 'IF(stt.templateid,1,0) AS reltpl,'; |
|
| 80 | + } |
|
| 81 | + else $sttfield = ''; |
|
| 82 | 82 | |
| 83 | - $selectableTemplates = $resourceTable == 'site_templates' ? "{$resourceTable}.selectable, " : ""; |
|
| 83 | + $selectableTemplates = $resourceTable == 'site_templates' ? "{$resourceTable}.selectable, " : ""; |
|
| 84 | 84 | |
| 85 | - $rs = $modx->db->select( |
|
| 86 | - "{$sttfield} {$pluginsql} {$tvsql} {$resourceTable}.{$nameField} as name, {$resourceTable}.id, {$resourceTable}.description, {$resourceTable}.locked, {$selectableTemplates}IF(isnull(categories.category),'{$_lang['no_category']}',categories.category) as category, categories.id as catid", |
|
| 87 | - $modx->getFullTableName($resourceTable) . " AS {$resourceTable} |
|
| 85 | + $rs = $modx->db->select( |
|
| 86 | + "{$sttfield} {$pluginsql} {$tvsql} {$resourceTable}.{$nameField} as name, {$resourceTable}.id, {$resourceTable}.description, {$resourceTable}.locked, {$selectableTemplates}IF(isnull(categories.category),'{$_lang['no_category']}',categories.category) as category, categories.id as catid", |
|
| 87 | + $modx->getFullTableName($resourceTable) . " AS {$resourceTable} |
|
| 88 | 88 | LEFT JOIN " . $modx->getFullTableName('categories') . " AS categories ON {$resourceTable}.category = categories.id {$tvjoin}", |
| 89 | - "", |
|
| 90 | - "category,name" |
|
| 91 | - ); |
|
| 92 | - $limit = $modx->db->getRecordCount($rs); |
|
| 89 | + "", |
|
| 90 | + "category,name" |
|
| 91 | + ); |
|
| 92 | + $limit = $modx->db->getRecordCount($rs); |
|
| 93 | 93 | |
| 94 | - if($limit < 1) return false; |
|
| 94 | + if($limit < 1) return false; |
|
| 95 | 95 | |
| 96 | - $result = array(); |
|
| 97 | - while ($row = $modx->db->getRow($rs)) { |
|
| 98 | - $result[] = $row; |
|
| 99 | - } |
|
| 100 | - return $result; |
|
| 101 | - } |
|
| 96 | + $result = array(); |
|
| 97 | + while ($row = $modx->db->getRow($rs)) { |
|
| 98 | + $result[] = $row; |
|
| 99 | + } |
|
| 100 | + return $result; |
|
| 101 | + } |
|
| 102 | 102 | |
| 103 | - function prepareCategoryArrays() { |
|
| 104 | - foreach($this->items as $type=>$items) { |
|
| 105 | - foreach((array)$items as $item) { |
|
| 106 | - $catid = $item['catid'] ? $item['catid'] : 0; |
|
| 107 | - $this->categories[$catid] = $item['category']; |
|
| 103 | + function prepareCategoryArrays() { |
|
| 104 | + foreach($this->items as $type=>$items) { |
|
| 105 | + foreach((array)$items as $item) { |
|
| 106 | + $catid = $item['catid'] ? $item['catid'] : 0; |
|
| 107 | + $this->categories[$catid] = $item['category']; |
|
| 108 | 108 | |
| 109 | - $item['type'] = $type; |
|
| 110 | - $this->itemsPerCategory[$catid][] = $item; |
|
| 111 | - } |
|
| 112 | - } |
|
| 109 | + $item['type'] = $type; |
|
| 110 | + $this->itemsPerCategory[$catid][] = $item; |
|
| 111 | + } |
|
| 112 | + } |
|
| 113 | 113 | |
| 114 | - // Sort categories by name |
|
| 115 | - natcasesort($this->categories); |
|
| 114 | + // Sort categories by name |
|
| 115 | + natcasesort($this->categories); |
|
| 116 | 116 | |
| 117 | - // Now sort by name |
|
| 118 | - foreach($this->itemsPerCategory as $catid=>$items) { |
|
| 119 | - usort($this->itemsPerCategory[$catid], function ($a, $b) { |
|
| 120 | - return strcasecmp($a['name'], $b['name']); |
|
| 121 | - }); |
|
| 122 | - } |
|
| 123 | - } |
|
| 117 | + // Now sort by name |
|
| 118 | + foreach($this->itemsPerCategory as $catid=>$items) { |
|
| 119 | + usort($this->itemsPerCategory[$catid], function ($a, $b) { |
|
| 120 | + return strcasecmp($a['name'], $b['name']); |
|
| 121 | + }); |
|
| 122 | + } |
|
| 123 | + } |
|
| 124 | 124 | } |
@@ -1,9 +1,9 @@ |
||
| 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('change_password')) {
|
| 6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 7 | 7 | } |
| 8 | 8 | ?> |
| 9 | 9 | |