Changeset 161508
- Timestamp:
- 10/08/2009 06:59:08 AM (16 years ago)
- Location:
- ckeditor-12/trunk
- Files:
-
- 3 edited
-
AjexFileManager/ajax/php/ajax.php (modified) (1 diff)
-
ckeditor.php (modified) (1 diff)
-
ckeditor_class.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ckeditor-12/trunk/AjexFileManager/ajax/php/ajax.php
r161138 r161508 34 34 35 35 require_once(dirname(__FILE__). '/../../../ckeditor_class.php'); 36 if(!$ deans_ckeditor->can_upload())36 if(!$ckeditor->can_upload()) 37 37 exit(); 38 38 -
ckeditor-12/trunk/ckeditor.php
r161138 r161508 9 9 */ 10 10 require_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'));11 add_action('admin_menu', array(&$ckeditor, 'add_option_page')); 12 add_action('admin_head', array(&$ckeditor, 'add_admin_head')); 13 add_action('personal_options_update', array(&$ckeditor, 'user_personalopts_update')); 14 add_action('edit_form_advanced', array(&$ckeditor, 'load_ckeditor')); 15 add_action('edit_page_form', array(&$ckeditor, 'load_ckeditor')); 16 add_action('simple_edit_form', array(&$ckeditor, 'load_ckeditor')); 17 add_action('admin_print_scripts', array(&$ckeditor, 'add_admin_js')); 18 register_activation_hook(basename(dirname(__FILE__)).'/' . basename(__FILE__), array(&$ckeditor, 'activate')); 19 register_deactivation_hook(basename(dirname(__FILE__)).'/' . basename(__FILE__), array(&$ckeditor, 'deactivate')); 20 20 ?> -
ckeditor-12/trunk/ckeditor_class.php
r161138 r161508 2 2 3 3 require_once(dirname(__FILE__).'/../../../wp-config.php'); 4 class deans_ckeditor {4 class ckeditor { 5 5 var $version = '1.3'; 6 6 var $default_options = array(); … … 9 9 10 10 //var $smiley_images = array(); 11 function deans_ckeditor()11 function ckeditor() 12 12 { 13 13 $this->__construct(); … … 20 20 $this->ckeditor_path = $siteurl .'wp-content/plugins/' . basename(dirname(__FILE__)) .'/ckeditor/'; 21 21 $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; 22 31 } 23 32 function deactivate() … … 36 45 $message = ""; 37 46 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'])); 52 48 if (empty($new_options['user_file_path'])) 53 49 { 54 50 $new_options['user_file_path'] = 'wp-content/uploads'; 55 51 } 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); 69 53 foreach ($new_options as $option_name => $option_value) 70 54 $this-> {$option_name} = $option_value; … … 73 57 } 74 58 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); 78 60 foreach ($this->default_options as $option_name => $option_value) 79 61 $this-> {$option_name} = $option_value; … … 84 66 <fieldset> 85 67 <form method="post" > 86 <h2><?php _e('CK editor', 'ckeditor') ?> <?php echo $this->version?></h2>68 <h2><?php _e('CKEditor', 'ckeditor') ?> <?php echo $this->version?></h2> 87 69 <legend><?php _e('Basic Options', 'ckeditor') ?></legend> 88 70 <li> 89 71 <?php _e('Select the skin to load:')?> 90 72 <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> 94 76 </select> 95 77 </li> … … 119 101 var content = CKEDITOR.replace( 'content', 120 102 { 121 skin : ' kama',103 skin : '<?php echo $this->ckskin;?>', 122 104 language : 'en', 123 105 uiColor: '#6B6868', … … 145 127 function add_option_page() 146 128 { 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')); 148 130 } 149 131 … … 179 161 } 180 162 } 181 $ deans_ckeditor = new deans_ckeditor();163 $ckeditor = new ckeditor(); 182 164 ?>
Note: See TracChangeset
for help on using the changeset viewer.