Plugin Directory

Changeset 2911178


Ignore:
Timestamp:
05/11/2023 01:03:19 PM (3 years ago)
Author:
mndpsingh287
Message:

v2.7.1

Location:
theme-editor/trunk
Files:
1 added
1 deleted
11 edited

Legend:

Unmodified
Added
Removed
  • theme-editor/trunk/app/controller/controller.php

    r2472384 r2911178  
    2424        add_action( 'admin_post_mk_theme_editor_download_te_plugin', array($this, 'download_te_plugin') ); 
    2525        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()) {
    2728           include('theme_controller.php');
    2829           include('plugin_controller.php');
     
    3334       add_action("wp_ajax_mk_te_close_te_help", array($this, "mk_te_close_te_help"));
    3435    }
    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    }
    3642    public function theme_editor_menu_page() {
    3743         add_menu_page(
     
    4147        'theme_editor_theme',
    4248        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 )
    4450    );
    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'));
    4653    add_submenu_page( 'theme_editor_theme', __( 'Settings', 'te-editor' ), __( 'Settings', 'te-editor' ), 'manage_options', 'theme_editor_settings', array(&$this, 'theme_editor_settings_callback'));
    4754    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'));
     
    6370   
    6471    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' );
    6774          $capability = 'manage_options';
    6875          $menu_slug = 'theme_editor_theme';
     
    7582   
    7683    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' );
    7986        $capability = 'manage_options';
    8087        $menu_slug = 'theme_editor_plugin';
     
    9299         if(isset($opt['e_w_d_p_e']) && $opt['e_w_d_p_e'] == 'yes') {
    93100           global $submenu;
    94            unset( $submenu['plugins.php'][15] );
     101           remove_submenu_page('plugins.php', 'plugin-editor.php');
    95102          }
    96103    }
     
    156163    }
    157164     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    }
    162177     public function load_custom_scripts_settings() {
    163178         $current_page = isset($_GET['page']) ? $_GET['page'] : '';
  • theme-editor/trunk/app/view/css/settings_tabs.css

    r1956804 r2911178  
    260260    padding:0;
    261261}
     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}
    262278@media screen and (max-width:767px){
    263279    .te_settings_tabs_sec .form-table td{
     
    293309    }
    294310}
    295 
    296311.ms_theme_conatiner_full_width .CodeMirror{
    297312 width:100% !important;
  • theme-editor/trunk/app/view/css/theme_editor.css

    r1956804 r2911178  
    310310}
    311311
    312 
    313 
     312li.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($){       
    21jQuery('.close_te_help').on('click', function(e) {
    32                    var what_to_do = jQuery(this).data('ct');
     
    1110                        });
    1211});       
    13 });
    1412jQuery(window).on('load',function () {
    1513                jQuery('.wters').delay( 5000 ).slideDown('slow');
  • theme-editor/trunk/app/view/js/settings_tabs.js

    r1730846 r2911178  
    11jQuery(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  
    181181                 if(responsedata.status == '1') {
    182182                    jQuery('.up_response').html("<p class='te_success'>"+responsedata.msg+"</p>");
     183                    closepopup();
    183184                  } else {
    184185                    jQuery('.up_response').html("<p class='te_error'>"+responsedata.msg+"</p>");
     
    200201                if(responsedata.status == '1') {
    201202                    jQuery('.te_response').html("<p class='te_success'>"+responsedata.msg+"</p>");
     203                    closepopup();
    202204                } else {
    203205                    jQuery('.te_response').html("<p class='te_error'>"+responsedata.msg+"</p>");
     
    222224                if(responsedata.status == '1') {
    223225                    jQuery('.te_response').html("<p class='te_success'>"+responsedata.msg+"</p>");
     226                    closepopup();
    224227                } else {
    225228                    jQuery('.te_response').html("<p class='te_error'>"+responsedata.msg+"</p>");
     
    244247                if(responsedata.status == '1') {
    245248                    jQuery('.ter_response').html("<p class='te_success'>"+responsedata.msg+"</p>");
     249                    closepopup();
    246250                } else {
    247251                    jQuery('.ter_response').html("<p class='te_error'>"+responsedata.msg+"</p>");
     
    266270                if(responsedata.status == '1') {
    267271                    jQuery('.ter_response').html("<p class='te_success'>"+responsedata.msg+"</p>");
     272                    closepopup();
    268273                } else {
    269274                    jQuery('.ter_response').html("<p class='te_error'>"+responsedata.msg+"</p>");
     
    345350                        });
    346351}           
     352jQuery('.create_folder_file').click(function(){
     353    jQuery('.te_response').html('')
     354});
     355jQuery('.upload_folder_file').click(function(){
     356    jQuery('.up_response').html('')
     357});
     358jQuery('.remove_folder_file').click(function(){
     359    jQuery('.ter_response').html('')
     360});
    347361           
     362function 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  
    168168                            </p>
    169169                            <input type="hidden" name="current_theme_root" value="<?php echo $crrunt_path["basename"]; ?>" id="current_theme_root" />
     170                           
     171                            <div class="input_fields">
    170172                            <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">
    172176                            <input id="submit" class="button button-primary" name="submit" value="Upload File" type="submit">
     177                          </div>
    173178                    </form>   
    174179</div>
  • theme-editor/trunk/app/view/settings.php

    r1956804 r2911178  
    3535        </tr>
    3636        <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>
    3838        <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');?>
    3939        <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>
     
    5252        </tr>
    5353        <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>
    5555        <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');?>
    5656        <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  
    4444                <strong><label for="plugin"><?php _e( 'Select theme to edit:', 'theme-editor' ); ?></label></strong>
    4545                <select name="theme" id="theme">
    46                     <?php if ( WP_34 ): ?>
     46                    <?php if ( WP_34 ):?>
    4747                        <?php
    4848                            foreach ( wp_get_themes( array( 'errors' => null ) ) as $a_stylesheet => $a_theme ) {
     
    5050                                    continue;
    5151                                }
     52                               
    5253                                $selected = $a_stylesheet == strtolower( $data['stylesheet'] ) ? ' selected="selected"' : '';
     54                           
    5355                                echo "\n\t" . '<option value="' . esc_attr( $a_stylesheet) . '"' . $selected . '>' . $a_theme->display( 'Name' ) . '</option>';
    5456                            }
    5557                        ?>
    56                     <?php else: ?>
     58                    <?php else:?>
    5759                        <?php
    5860                            foreach ( $data['themes'] as $a_theme ) {
     
    6466                                    $selected = '';
    6567                                }
    66                                 $theme_name = esc_attr( $theme_name ); ?>
     68                                $theme_name = esc_attr( $theme_name );
     69                                ?>
    6770                                <option value="<?php echo $theme_name; ?>" <?php echo $selected; ?>><?php echo $theme_name; ?></option>
    6871                            <?php
     
    7174                    <?php endif; ?>
    7275                </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' ); ?>" />
    7478            </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>
    7680        </div>
    7781        <br class="clear" />
     
    8993            if(!empty($parent_files)) {
    9094                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';
    9398                  if(!file_exists($logoImagePath)) {
    9499                       $logoImage = MK_THEME_EDITOR_URL.'app/view/images/def.png'; 
     
    98103                     $folder_path = str_replace(get_theme_root()."/", '', $parent_file['path']);
    99104                     ?>
    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>               
    102107                    </li>
    103108                   <?php  }
    104109                   //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">
    107112 <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>
    108113                    </li>   
    109114                    <?php }
    110115                     //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">
    113118<a href="<?php echo $parent_file['url']?>" class="dwn_file" target="_blank" download><img src="<?php echo $logoImage; ?>" /> <?php echo $parent_file['name']?></a>
    114119                    </li>   
    115120                    <?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>
    118123                    </li>   
    119124                <?php }                 
     
    185190                            </p>
    186191                            <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>   
    191200</div>
    192201</div>
  • theme-editor/trunk/readme.txt

    r2669544 r2911178  
    33Tags: file, editor, plugin, wp, wordpress, theme, theme editor, code editor, Preview Theme, create New Theme, Preview, Duplicate Theme
    44Requires at least: 3.4
    5 Tested up to: 5.9
     5Tested up to: 6.2
    66Requires PHP: 5.2.4
    7 Stable tag: 2.7
     7Stable tag: 2.7.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    9191
    9292== 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
    9397
    9498= 2.7 (27th Jan, 2022)
  • theme-editor/trunk/theme_editor.php

    r2669544 r2911178  
    55Description: create, edit, upload, download, delete Theme Files and folders
    66Author: mndpsingh287
    7 Version: 2.7
     7Version: 2.7.1
    88Author URI: https://profiles.wordpress.org/mndpsingh287
    99Text Domain: theme-editor
Note: See TracChangeset for help on using the changeset viewer.