Plugin Directory

Changeset 161508


Ignore:
Timestamp:
10/08/2009 06:59:08 AM (16 years ago)
Author:
doni2000
Message:

Config fix

Location:
ckeditor-12/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • ckeditor-12/trunk/AjexFileManager/ajax/php/ajax.php

    r161138 r161508  
    3434
    3535require_once(dirname(__FILE__). '/../../../ckeditor_class.php');
    36 if(!$deans_ckeditor->can_upload())
     36if(!$ckeditor->can_upload())
    3737    exit();
    3838   
  • ckeditor-12/trunk/ckeditor.php

    r161138 r161508  
    99*/
    1010require_once('ckeditor_class.php');
    11 add_action('admin_menu', array(&$deans_ckeditor, 'add_option_page'));
    12 add_action('admin_head', array(&$deans_ckeditor, 'add_admin_head'));
    13 add_action('personal_options_update', array(&$deans_ckeditor, 'user_personalopts_update'));
    14 add_action('edit_form_advanced', array(&$deans_ckeditor, 'load_ckeditor'));
    15 add_action('edit_page_form', array(&$deans_ckeditor, 'load_ckeditor'));
    16 add_action('simple_edit_form', array(&$deans_ckeditor, 'load_ckeditor'));
    17 add_action('admin_print_scripts', array(&$deans_ckeditor, 'add_admin_js'));
    18 register_activation_hook(basename(dirname(__FILE__)).'/' . basename(__FILE__), array(&$deans_ckeditor, 'activate'));
    19 register_deactivation_hook(basename(dirname(__FILE__)).'/' . basename(__FILE__), array(&$deans_ckeditor, 'deactivate'));
     11add_action('admin_menu', array(&$ckeditor, 'add_option_page'));
     12add_action('admin_head', array(&$ckeditor, 'add_admin_head'));
     13add_action('personal_options_update', array(&$ckeditor, 'user_personalopts_update'));
     14add_action('edit_form_advanced', array(&$ckeditor, 'load_ckeditor'));
     15add_action('edit_page_form', array(&$ckeditor, 'load_ckeditor'));
     16add_action('simple_edit_form', array(&$ckeditor, 'load_ckeditor'));
     17add_action('admin_print_scripts', array(&$ckeditor, 'add_admin_js'));
     18register_activation_hook(basename(dirname(__FILE__)).'/' . basename(__FILE__), array(&$ckeditor, 'activate'));
     19register_deactivation_hook(basename(dirname(__FILE__)).'/' . basename(__FILE__), array(&$ckeditor, 'deactivate'));
    2020?>
  • ckeditor-12/trunk/ckeditor_class.php

    r161138 r161508  
    22
    33require_once(dirname(__FILE__).'/../../../wp-config.php');
    4 class deans_ckeditor {
     4class ckeditor {
    55    var $version = '1.3';
    66    var $default_options = array();
     
    99
    1010    //var $smiley_images = array();
    11     function deans_ckeditor()
     11    function ckeditor()
    1212    {
    1313        $this->__construct();
     
    2020        $this->ckeditor_path = $siteurl .'wp-content/plugins/' . basename(dirname(__FILE__)) .'/ckeditor/';
    2121        $this->default_options['user_file_path'] = 'wp-content/uploads/';
     22        $this->default_options['ckskin'] = 'kama';
     23       
     24        $options = get_option('ckeditor');
     25        if (!$options) {
     26            add_option('ckeditor', $this->default_options);
     27            $options = $this->default_options;
     28        }
     29        foreach ($options as $option_name => $option_value)
     30            $this-> {$option_name} = $option_value;
    2231    }
    2332    function deactivate()
     
    3645        $message = "";
    3746        if (!empty($_POST['submit_update']) || !empty($_POST['doRebuild'])) {
    38             $new_options = array (
    39                 'user_file_path' => trim($_POST['ch_str_UserFilesPath']),
    40                 'EditorHeight' => trim($_POST['EditorHeight']),
    41                 'file_denied_ext' =>trim($_POST['file_denied_ext']),
    42                 'image_allowed_ext' =>trim($_POST['image_allowed_ext']),
    43                 'flash_allowed_ext' =>trim($_POST['flash_allowed_ext']),
    44                 'smiley_path'=>trim($_POST['ch_smiley_folder']),
    45                 'toolbar_set' =>trim($_POST['cmbToolbars']),
    46                 'skin' =>trim($_POST['cmbSkins']),
    47                 'enable_preview' => trim($_POST['ckEnablePreview']),
    48                 'FirefoxSpellChecker' => trim($_POST['ckFirefoxSpellChecker']),
    49                 'default_link_target' => trim($_POST['cmdefault_link_target'])
    50                 );
    51 
     47            $new_options = array ('ckskin' => trim($_POST['ckskin']));
    5248            if (empty($new_options['user_file_path']))
    5349            {
    5450                $new_options['user_file_path'] = 'wp-content/uploads';
    5551            }
    56             if ( ! ereg( '/$', $new_options["user_file_path"] ) )
    57                 $new_options["user_file_path"] .= '/' ;
    58            
    59             if (empty($new_options['smiley_path']))
    60             {
    61                 $new_options['smiley_path'] = $this->default_options['smiley_path'];
    62             }
    63             $new_options['smiley_path'] = trailingslashit($new_options['smiley_path']);
    64            
    65             $this->build_smiley_images($new_options['smiley_path']);
    66             $new_options['smiley_images'] = $this->smiley_images;
    67             update_option("deans_ckeditor", $new_options);
    68 
     52            update_option("ckeditor", $new_options);
    6953            foreach ($new_options as $option_name => $option_value)
    7054                $this-> {$option_name} = $option_value;
     
    7357        }
    7458        else if (isset($_POST['submit_reset'])) {
    75                 $this->build_smiley_images($this->default_options['smiley_path']);
    76                 $this->default_options['smiley_images'] = $this->smiley_images;
    77                 update_option('deans_ckeditor', $this->default_options);
     59                update_option('ckeditor', $this->default_options);
    7860                foreach ($this->default_options as $option_name => $option_value)
    7961                    $this-> {$option_name} = $option_value;
     
    8466            <fieldset>
    8567                <form method="post" >
    86                 <h2><?php _e('CKeditor', 'ckeditor') ?> <?php echo $this->version?></h2>
     68                <h2><?php _e('CKEditor', 'ckeditor') ?> <?php echo $this->version?></h2>
    8769                    <legend><?php _e('Basic Options', 'ckeditor') ?></legend>
    8870                    <li>
    8971                        <?php _e('Select the skin to load:')?>
    9072                        <select name="ckskin"">
    91                             <option value="kama"  <?php if ($this->skin == 'kama') { ?> selected="selected"<?php } ?>>Kama</option>
    92                             <option value="office2003" <?php if ($this->skin == 'office2003') { ?> selected="selected"<?php } ?>>Office 2003</option>
    93                             <option value="v2" <?php if ($this->skin == 'v2') { ?> selected="selected"<?php } ?>>v2</option>
     73                            <option value="kama"  <?php if ($this->ckskin == 'kama') { ?> selected="selected"<?php } ?>>Kama</option>
     74                            <option value="office2003" <?php if ($this->ckskin == 'office2003') { ?> selected="selected"<?php } ?>>Office 2003</option>
     75                            <option value="v2" <?php if ($this->ckskin == 'v2') { ?> selected="selected"<?php } ?>>v2</option>
    9476                        </select>
    9577                    </li>
     
    119101        var content = CKEDITOR.replace( 'content',
    120102        {
    121             skin : 'kama',
     103            skin : '<?php echo $this->ckskin;?>',
    122104            language : 'en',
    123105            uiColor: '#6B6868',
     
    145127    function add_option_page()
    146128    {
    147         add_options_page('ckeditor', 'ckeditor', 8, 'deans_ckeditor', array(&$this, 'option_page'));
     129        add_options_page('ckeditor', 'CKEditor', 8, 'ckeditor', array(&$this, 'option_page'));
    148130    }
    149131
     
    179161    }
    180162}
    181 $deans_ckeditor = new deans_ckeditor();
     163$ckeditor = new ckeditor();
    182164?>
Note: See TracChangeset for help on using the changeset viewer.