Changeset 2911178
- Timestamp:
- 05/11/2023 01:03:19 PM (3 years ago)
- Location:
- theme-editor/trunk
- Files:
-
- 1 added
- 1 deleted
- 11 edited
-
app/controller/controller.php (modified) (7 diffs)
-
app/view/css/settings_tabs.css (modified) (2 diffs)
-
app/view/css/theme_editor.css (modified) (1 diff)
-
app/view/images/te.png (deleted)
-
app/view/images/te.svg (added)
-
app/view/js/help_desk.js (modified) (2 diffs)
-
app/view/js/settings_tabs.js (modified) (1 diff)
-
app/view/js/theme_editor.js (modified) (6 diffs)
-
app/view/plugin_editor.php (modified) (1 diff)
-
app/view/settings.php (modified) (2 diffs)
-
app/view/theme_editor.php (modified) (7 diffs)
-
readme.txt (modified) (2 diffs)
-
theme_editor.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
theme-editor/trunk/app/controller/controller.php
r2472384 r2911178 24 24 add_action( 'admin_post_mk_theme_editor_download_te_plugin', array($this, 'download_te_plugin') ); 25 25 add_action( 'admin_init', array($this, 'load_custom_scripts_settings')); 26 if(is_admin()) { 26 add_action( 'admin_menu',array($this,'remove_plugin_editor_submenu'), 999 ); 27 if(is_admin()) { 27 28 include('theme_controller.php'); 28 29 include('plugin_controller.php'); … … 33 34 add_action("wp_ajax_mk_te_close_te_help", array($this, "mk_te_close_te_help")); 34 35 } 35 36 function remove_plugin_editor_submenu() { 37 $opt = get_option('mk_te_settings_options'); 38 if(isset($opt['e_w_d_p_e']) && $opt['e_w_d_p_e'] == 'yes') { 39 remove_submenu_page( 'tools.php', 'plugin-editor.php' ); 40 } 41 } 36 42 public function theme_editor_menu_page() { 37 43 add_menu_page( … … 41 47 'theme_editor_theme', 42 48 array($this, 'add_themes_page'), 43 plugins_url( '/app/view/images/te. png', MK_THEME_EDITOR_FILE )49 plugins_url( '/app/view/images/te.svg', MK_THEME_EDITOR_FILE ) 44 50 ); 45 add_submenu_page( 'theme_editor_theme', __( 'Plugin Editor', 'te-editor' ), __( 'Plugin Editor', 'te-editor' ), 'manage_options', 'theme_editor_plugin', array(&$this, 'add_plugin_page')); 51 add_submenu_page( 'theme_editor_theme', __( 'Theme Code Editor', 'te-editor' ), __( 'Theme Code Editor', 'te-editor' ), 'manage_options', 'theme_editor_theme', array(&$this, 'add_themes_page')); 52 add_submenu_page( 'theme_editor_theme', __( 'Plugin Code Editor', 'te-editor' ), __( 'Plugin Code Editor', 'te-editor' ), 'manage_options', 'theme_editor_plugin', array(&$this, 'add_plugin_page')); 46 53 add_submenu_page( 'theme_editor_theme', __( 'Settings', 'te-editor' ), __( 'Settings', 'te-editor' ), 'manage_options', 'theme_editor_settings', array(&$this, 'theme_editor_settings_callback')); 47 54 add_submenu_page( 'theme_editor_theme', __( 'Access Control', 'te-editor' ), __( 'Access Control', 'te-editor' ), 'manage_options', 'theme_editor_permisions', array(&$this, 'theme_editor_settings_permisions')); … … 63 70 64 71 public function theme_editor_themes_page() { 65 $page_title = __( 'Theme Editor', 'te-editor' );66 $menu_title = __( 'Theme Editor', 'te-editor' );72 $page_title = __( 'Theme Code Editor', 'te-editor' ); 73 $menu_title = __( 'Theme Code Editor', 'te-editor' ); 67 74 $capability = 'manage_options'; 68 75 $menu_slug = 'theme_editor_theme'; … … 75 82 76 83 public function theme_editor_plugins_page() { 77 $page_title = __( 'Plugin Editor', 'te-editor' );78 $menu_title = __( 'Plugin Editor', 'te-editor' );84 $page_title = __( 'Plugin Code Editor', 'te-editor' ); 85 $menu_title = __( 'Plugin Code Editor', 'te-editor' ); 79 86 $capability = 'manage_options'; 80 87 $menu_slug = 'theme_editor_plugin'; … … 92 99 if(isset($opt['e_w_d_p_e']) && $opt['e_w_d_p_e'] == 'yes') { 93 100 global $submenu; 94 unset( $submenu['plugins.php'][15]);101 remove_submenu_page('plugins.php', 'plugin-editor.php'); 95 102 } 96 103 } … … 156 163 } 157 164 public function redirect($url) { 158 echo '<script>'; 159 echo 'window.location.href="'.$url.'"'; 160 echo '</script>' ; 161 } 165 ?> 166 <script> 167 var get_last_Selecetd_tab =localStorage.getItem('theme_editor_selected_tab'); 168 if(get_last_Selecetd_tab==null){ 169 window.location.href='<?php echo $url; ?>'; 170 }else{ 171 window.history.pushState(null,null,'<?php echo $url; ?>'+get_last_Selecetd_tab); 172 window.location.reload(true); 173 } 174 </script> 175 <?php 176 } 162 177 public function load_custom_scripts_settings() { 163 178 $current_page = isset($_GET['page']) ? $_GET['page'] : ''; -
theme-editor/trunk/app/view/css/settings_tabs.css
r1956804 r2911178 260 260 padding:0; 261 261 } 262 .input_fields { 263 display: -webkit-box; 264 display: -ms-flexbox; 265 display: flex; 266 } 267 #theme_upload_form #upload_file { 268 margin-left: 10px; 269 } 270 #theme_upload_form .submit_btn { 271 display: block; 272 margin-top: 20px; 273 } 274 .fileedit-sub .theme_action_section 275 { 276 padding: 10px 0px 10px; 277 } 262 278 @media screen and (max-width:767px){ 263 279 .te_settings_tabs_sec .form-table td{ … … 293 309 } 294 310 } 295 296 311 .ms_theme_conatiner_full_width .CodeMirror{ 297 312 width:100% !important; -
theme-editor/trunk/app/view/css/theme_editor.css
r1956804 r2911178 310 310 } 311 311 312 313 312 li.toplevel_page_theme_editor_theme img { 313 width: 18px; 314 } -
theme-editor/trunk/app/view/js/help_desk.js
r2370916 r2911178 1 jQuery(document).ready(function($){2 1 jQuery('.close_te_help').on('click', function(e) { 3 2 var what_to_do = jQuery(this).data('ct'); … … 11 10 }); 12 11 }); 13 });14 12 jQuery(window).on('load',function () { 15 13 jQuery('.wters').delay( 5000 ).slideDown('slow'); -
theme-editor/trunk/app/view/js/settings_tabs.js
r1730846 r2911178 1 1 jQuery(document).ready(function($){ 2 jQuery("#tabs").tabs(); 3 }); 2 jQuery("#tabs").tabs(); 3 jQuery('li.ui-tabs-tab').on("click", function(){ 4 var href = jQuery(this).find('a').attr('href'); 5 localStorage.setItem('theme_editor_selected_tab',href); 6 }); 7 }); 8 -
theme-editor/trunk/app/view/js/theme_editor.js
r2472384 r2911178 181 181 if(responsedata.status == '1') { 182 182 jQuery('.up_response').html("<p class='te_success'>"+responsedata.msg+"</p>"); 183 closepopup(); 183 184 } else { 184 185 jQuery('.up_response').html("<p class='te_error'>"+responsedata.msg+"</p>"); … … 200 201 if(responsedata.status == '1') { 201 202 jQuery('.te_response').html("<p class='te_success'>"+responsedata.msg+"</p>"); 203 closepopup(); 202 204 } else { 203 205 jQuery('.te_response').html("<p class='te_error'>"+responsedata.msg+"</p>"); … … 222 224 if(responsedata.status == '1') { 223 225 jQuery('.te_response').html("<p class='te_success'>"+responsedata.msg+"</p>"); 226 closepopup(); 224 227 } else { 225 228 jQuery('.te_response').html("<p class='te_error'>"+responsedata.msg+"</p>"); … … 244 247 if(responsedata.status == '1') { 245 248 jQuery('.ter_response').html("<p class='te_success'>"+responsedata.msg+"</p>"); 249 closepopup(); 246 250 } else { 247 251 jQuery('.ter_response').html("<p class='te_error'>"+responsedata.msg+"</p>"); … … 266 270 if(responsedata.status == '1') { 267 271 jQuery('.ter_response').html("<p class='te_success'>"+responsedata.msg+"</p>"); 272 closepopup(); 268 273 } else { 269 274 jQuery('.ter_response').html("<p class='te_error'>"+responsedata.msg+"</p>"); … … 345 350 }); 346 351 } 352 jQuery('.create_folder_file').click(function(){ 353 jQuery('.te_response').html('') 354 }); 355 jQuery('.upload_folder_file').click(function(){ 356 jQuery('.up_response').html('') 357 }); 358 jQuery('.remove_folder_file').click(function(){ 359 jQuery('.ter_response').html('') 360 }); 347 361 362 function closepopup(){ 363 setTimeout(function(){ 364 jQuery('#TB_closeWindowButton').click(); 365 jQuery('.theme-btn').click(); 366 window.location.reload(); 367 },2000); 368 } -
theme-editor/trunk/app/view/plugin_editor.php
r2472384 r2911178 168 168 </p> 169 169 <input type="hidden" name="current_theme_root" value="<?php echo $crrunt_path["basename"]; ?>" id="current_theme_root" /> 170 171 <div class="input_fields"> 170 172 <input type="text" name="directory" id="file_directory" style="width:190px" placeholder="<?php _e( 'Optional: Sub-Directory', 'theme-editor' ); ?>" /> 171 <input name="file" type="file" id="upload_file" style="width:180px" /> 173 <input name="file" type="file" id="upload_file"/> 174 </div> 175 <div class="submit_btn"> 172 176 <input id="submit" class="button button-primary" name="submit" value="Upload File" type="submit"> 177 </div> 173 178 </form> 174 179 </div> -
theme-editor/trunk/app/view/settings.php
r1956804 r2911178 35 35 </tr> 36 36 <tr> 37 <th scope="row"><label for="e_w_d_t_e"><?php _e('Disable Default Theme Editor?', 'theme-editor');?></label></th>37 <th scope="row"><label for="e_w_d_t_e"><?php _e('Disable wordpress theme file editor?', 'theme-editor');?></label></th> 38 38 <td><input type="radio" value="yes" name="e_w_d_t_e" <?php if(isset($opt['e_w_d_t_e']) && $opt['e_w_d_t_e'] == 'yes') { ?>checked="checked"<?php } ?> /><?php _e('Yes', 'theme-editor');?> <input type="radio" value="no" name="e_w_d_t_e" <?php if(isset($opt['e_w_d_t_e']) && $opt['e_w_d_t_e'] == 'no') { ?>checked="checked"<?php } ?> /><?php _e('No', 'theme-editor');?> 39 39 <p class="description" id="tagline-e_w_d_t_e"><?php _e('This will Enable/Disable the Default theme editor.<br/><strong>Default: </strong>Yes', 'theme-editor');?></p></td> … … 52 52 </tr> 53 53 <tr> 54 <th scope="row"><label for="e_w_d_p_e"><?php _e('Disable Default Plugin Editor?', 'theme-editor');?></label></th>54 <th scope="row"><label for="e_w_d_p_e"><?php _e('Disable wordpress plugin file editor?', 'theme-editor');?></label></th> 55 55 <td><input type="radio" value="yes" name="e_w_d_p_e" <?php if(isset($opt['e_w_d_p_e']) && $opt['e_w_d_p_e'] == 'yes') { ?>checked="checked"<?php } ?> /><?php _e('Yes', 'theme-editor');?> <input type="radio" value="no" name="e_w_d_p_e" <?php if(isset($opt['e_w_d_p_e']) && $opt['e_w_d_p_e'] == 'no') { ?>checked="checked"<?php } ?> /><?php _e('No', 'theme-editor');?> 56 56 <p class="description" id="tagline-e_w_d_p_e"><?php _e('This will Enable/Disable the Default plugin editor.<br/><strong>Default: </strong>Yes', 'theme-editor');?></p></td> -
theme-editor/trunk/app/view/theme_editor.php
r2472384 r2911178 44 44 <strong><label for="plugin"><?php _e( 'Select theme to edit:', 'theme-editor' ); ?></label></strong> 45 45 <select name="theme" id="theme"> 46 <?php if ( WP_34 ): ?>46 <?php if ( WP_34 ):?> 47 47 <?php 48 48 foreach ( wp_get_themes( array( 'errors' => null ) ) as $a_stylesheet => $a_theme ) { … … 50 50 continue; 51 51 } 52 52 53 $selected = $a_stylesheet == strtolower( $data['stylesheet'] ) ? ' selected="selected"' : ''; 54 53 55 echo "\n\t" . '<option value="' . esc_attr( $a_stylesheet) . '"' . $selected . '>' . $a_theme->display( 'Name' ) . '</option>'; 54 56 } 55 57 ?> 56 <?php else: ?>58 <?php else:?> 57 59 <?php 58 60 foreach ( $data['themes'] as $a_theme ) { … … 64 66 $selected = ''; 65 67 } 66 $theme_name = esc_attr( $theme_name ); ?> 68 $theme_name = esc_attr( $theme_name ); 69 ?> 67 70 <option value="<?php echo $theme_name; ?>" <?php echo $selected; ?>><?php echo $theme_name; ?></option> 68 71 <?php … … 71 74 <?php endif; ?> 72 75 </select> 73 <input type='submit' name='submit' class="button-secondary" value="<?php _e( 'Select', 'theme-editor' ); ?>" /> 76 77 <input type='submit' name='submit' class="theme-btn button-secondary" value="<?php _e( 'Select', 'theme-editor' ); ?>" /> 74 78 </form> 75 <div class="theme_action_section"><a href="#TB_inline?width=600&height=200&inlineId=theme_upload" class="thickbox button button-primary " title="Upload Files and Folders"><?php _e( 'Upload', 'theme-editor' ); ?></a> <a href="#TB_inline?width=600&height=450&inlineId=create_folder" class="thickbox button button-primary" title="Create Folder and File"><?php _e( 'Create', 'theme-editor' ); ?></a> <a href="#TB_inline?width=600&height=450&inlineId=remove_folder" class="thickbox button button-primary" title="Remove Folder and File"><?php _e( 'Remove ', 'theme-editor' ); ?></a></div>79 <div class="theme_action_section"><a href="#TB_inline?width=600&height=200&inlineId=theme_upload" class="thickbox button button-primary upload_folder_file" title="Upload Files and Folders"><?php _e( 'Upload', 'theme-editor' ); ?></a> <a href="#TB_inline?width=600&height=450&inlineId=create_folder" class="thickbox button button-primary create_folder_file" title="Create Folder and File"><?php _e( 'Create', 'theme-editor' ); ?></a> <a href="#TB_inline?width=600&height=450&inlineId=remove_folder" class="thickbox button button-primary remove_folder_file"" title="Remove Folder and File"><?php _e( 'Remove ', 'theme-editor' ); ?></a></div> 76 80 </div> 77 81 <br class="clear" /> … … 89 93 if(!empty($parent_files)) { 90 94 foreach($parent_files as $parent_file) { 91 $logoImagePath = MK_THEME_EDITOR_PATH.'app/view/images/'.$parent_file['extension'].'.png'; 92 $logoImage = MK_THEME_EDITOR_URL.'app/view/images/'.$parent_file['extension'].'.png'; 95 $parent_file_ext = isset($parent_file['extension'])?$parent_file['extension']:'def'; 96 $logoImagePath = MK_THEME_EDITOR_PATH.'app/view/images/'.$parent_file_ext.'.png'; 97 $logoImage = MK_THEME_EDITOR_URL.'app/view/images/'.$parent_file_ext.'.png'; 93 98 if(!file_exists($logoImagePath)) { 94 99 $logoImage = MK_THEME_EDITOR_URL.'app/view/images/def.png'; … … 98 103 $folder_path = str_replace(get_theme_root()."/", '', $parent_file['path']); 99 104 ?> 100 <li class="<?php echo $parent_file ['extension'];?> small_icons"><a href="javascript:void(0)" class="open_folder" data-path="<?php echo $folder_path;?>" data-name="<?php echo $parent_file['extension'].$parent_file['name']?>"><img src="<?php echo MK_THEME_EDITOR_URL.'app/view/images/'.$parent_file['extension']?>.png" /> <?php echo $parent_file['name']?></a>101 <span class="<?php echo $parent_file ['extension'].$parent_file['name'];?>"></span>105 <li class="<?php echo $parent_file_ext;?> small_icons"><a href="javascript:void(0)" class="open_folder" data-path="<?php echo $folder_path;?>" data-name="<?php echo $parent_file['extension'].$parent_file['name']?>"><img src="<?php echo MK_THEME_EDITOR_URL.'app/view/images/'.$parent_file['extension']?>.png" /> <?php echo $parent_file['name']?></a> 106 <span class="<?php echo $parent_file_ext.$parent_file['name'];?>"></span> 102 107 </li> 103 108 <?php } 104 109 //img 105 else if(in_array($parent_file ['extension'], $this->theme_controller->image_type_posibilities)) { ?>106 <li class="<?php echo $parent_file ['extension'];?> small_icons">110 else if(in_array($parent_file_ext, $this->theme_controller->image_type_posibilities)) { ?> 111 <li class="<?php echo $parent_file_ext;?> small_icons"> 107 112 <a href="<?php echo $parent_file['url']?>" class="open_image thickbox" target="_blank"><img src="<?php echo $parent_file['url']?>" /> <?php echo $parent_file['name']?> </a> 108 113 </li> 109 114 <?php } 110 115 //dwn 111 else if(in_array($parent_file ['extension'], $this->theme_controller->download_type_possibilities)) { ?>112 <li class="<?php echo $parent_file ['extension'];?> small_icons">116 else if(in_array($parent_file_ext, $this->theme_controller->download_type_possibilities)) { ?> 117 <li class="<?php echo $parent_file_ext;?> small_icons"> 113 118 <a href="<?php echo $parent_file['url']?>" class="dwn_file" target="_blank" download><img src="<?php echo $logoImage; ?>" /> <?php echo $parent_file['name']?></a> 114 119 </li> 115 120 <?php } else { ?> 116 <li class="<?php echo $parent_file ['extension'];?> small_icons">117 <a href="javascript:void(0)" class="open_file" data-path="<?php echo str_replace(get_theme_root()."/", '', $parent_file['path'])?>" data-name="<?php echo $parent_file ['extension'].$parent_file['name']?>" data-file="<?php echo $parent_file['file'];?>" data-downloadfile="<?php echo str_replace(WP_CONTENT_URL."/themes", '', $parent_file['url']);?>"><img src="<?php echo $logoImage;?>" /> <?php echo $parent_file['name']?></a>121 <li class="<?php echo $parent_file_ext;?> small_icons"> 122 <a href="javascript:void(0)" class="open_file" data-path="<?php echo str_replace(get_theme_root()."/", '', $parent_file['path'])?>" data-name="<?php echo $parent_file_ext.$parent_file['name']?>" data-file="<?php echo $parent_file['file'];?>" data-downloadfile="<?php echo str_replace(WP_CONTENT_URL."/themes", '', $parent_file['url']);?>"><img src="<?php echo $logoImage;?>" /> <?php echo $parent_file['name']?></a> 118 123 </li> 119 124 <?php } … … 185 190 </p> 186 191 <input type="hidden" name="current_theme_root" value="<?php echo $crrunt_path["basename"]; ?>" id="current_theme_root" /> 187 <input type="text" name="directory" id="file_directory" placeholder="<?php _e( 'Optional: Sub-Directory', 'theme-editor' ); ?>" class="regular-text" /> 188 <input name="file" type="file" id="upload_file" style="width:180px" /> 189 <input id="submit" class="button button-primary" name="submit" value="Upload File" type="submit"> 190 </form> 192 <div class="input_fields"> 193 <input type="text" name="directory" id="file_directory" placeholder="<?php _e( 'Optional: Sub-Directory', 'theme-editor' ); ?>" /> 194 <input name="file" type="file" id="upload_file" /> 195 </div> 196 <div class="submit_btn"> 197 <input id="submit" class="button button-primary upload_button" name="submit" value="Upload File" type="submit"> 198 </div> 199 </form> 191 200 </div> 192 201 </div> -
theme-editor/trunk/readme.txt
r2669544 r2911178 3 3 Tags: file, editor, plugin, wp, wordpress, theme, theme editor, code editor, Preview Theme, create New Theme, Preview, Duplicate Theme 4 4 Requires at least: 3.4 5 Tested up to: 5.95 Tested up to: 6.2 6 6 Requires PHP: 5.2.4 7 Stable tag: 2.7 7 Stable tag: 2.7.1 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 91 91 92 92 == Changelog == 93 = 2.7.1 (11th May, 2023) 94 95 * Resolved Issue for Plugin Settings - not able to disabled default plugin Editor 96 * Compatible with wp 6.2 93 97 94 98 = 2.7 (27th Jan, 2022) -
theme-editor/trunk/theme_editor.php
r2669544 r2911178 5 5 Description: create, edit, upload, download, delete Theme Files and folders 6 6 Author: mndpsingh287 7 Version: 2.7 7 Version: 2.7.1 8 8 Author URI: https://profiles.wordpress.org/mndpsingh287 9 9 Text Domain: theme-editor
Note: See TracChangeset
for help on using the changeset viewer.