Changeset 602500
- Timestamp:
- 09/22/2012 08:45:24 PM (14 years ago)
- Location:
- rich-text-excerpts/trunk
- Files:
-
- 1 added
- 2 edited
-
languages (added)
-
rich-text-excerpts.js (modified) (1 diff)
-
rich-text-excerpts.php (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
rich-text-excerpts/trunk/rich-text-excerpts.js
r601970 r602500 5 5 Author: Peter Edwards 6 6 Author URI: http://bjorsq.net 7 Version: 1. 07 Version: 1.2beta 8 8 License: GPLv3 9 9 -
rich-text-excerpts/trunk/rich-text-excerpts.php
r601976 r602500 6 6 Author: Peter Edwards 7 7 Author URI: http://bjorsq.net 8 Version: 1. 18 Version: 1.2beta 9 9 License: GPLv3 10 10 … … 52 52 add_action( 'admin_menu', array('RichTextExcerpts', 'add_plugin_admin_menu') ); 53 53 add_action( 'admin_init', array('RichTextExcerpts', 'register_plugin_options') ); 54 /** 55 * register text domain 56 */ 57 add_action('plugins_loaded', array('RichTextExcerpts', 'load_text_domain')); 58 } 59 60 /** 61 * i18n 62 */ 63 public static function load_text_domain() 64 { 65 load_plugin_textdomain( 'rich-text-excerpts', false, dirname(plugin_basename(__FILE__)) . '/languages/'); 54 66 } 55 67 … … 83 95 global $post; 84 96 $plugin_options = self::get_plugin_options(); 85 print ('<div style="margin-bottom:1em;clear:both;width:100%;"><h3><label for="excerpt">Excerpt</label></h3>');97 printf('<div style="margin-bottom:1em;clear:both;width:100%%;"><h3><label for="excerpt">%s</label></h3>', __('Excerpt', 'rich-text-excerpts')); 86 98 /* options for editor */ 87 99 $options = array( … … 134 146 { 135 147 /* Plugin Options page */ 136 $options_page = add_submenu_page("options-general.php", "Rich Text Excerpts", "Rich Text Excerpts", "manage_options", "rich_text_excerpts_options", array('RichTextExcerpts', "plugin_options_page") );148 $options_page = add_submenu_page("options-general.php", __('Rich Text Excerpts', 'rich-text-excerpts'), __('Rich Text Excerpts', 'rich-text-excerpts'), "manage_options", "rich_text_excerpts_options", array('RichTextExcerpts', "plugin_options_page") ); 137 149 /* Use the admin_print_scripts action to add scripts for theme options */ 138 150 add_action( 'admin_print_scripts-' . $options_page, array('RichTextExcerpts', 'plugin_admin_scripts') ); … … 154 166 public static function plugin_options_page() 155 167 { 156 print ('<div class="wrap"><div class="icon32" id="icon-options-general"><br /></div><h2>Rich Text Excerpts Options</h2>');168 printf('<div class="wrap"><div class="icon32" id="icon-options-general"><br /></div><h2>%s</h2>', __('Rich Text Excerpts Options', 'rich-text-excerpts')); 157 169 settings_errors('rich_text_excerpts_options'); 158 170 print('<form method="post" action="options.php">'); 159 171 settings_fields('rich_text_excerpts_options'); 160 172 do_settings_sections('rte'); 161 printf('<p class="submit"><input type="submit" class="button-primary" name="Submit" value="%s" /></p>', _ ('Save Changes'));173 printf('<p class="submit"><input type="submit" class="button-primary" name="Submit" value="%s" /></p>', __('Save Changes', 'rich-text-excerpts')); 162 174 print('</form></div>'); 163 175 } … … 179 191 add_settings_field( 180 192 'supported_post_types', 181 'Choose which post types will have rich text editor for excerpts',193 __('Choose which post types will have rich text editor for excerpts', 'rich-text-excerpts'), 182 194 array('RichTextExcerpts', 'options_setting_post_types'), 183 195 'rte', … … 188 200 add_settings_section( 189 201 'editor-options', 190 'Editor Options',202 __('Editor Options', 'rich-text-excerpts'), 191 203 array('RichTextExcerpts', 'options_section_text'), 192 204 'rte' … … 194 206 add_settings_field( 195 207 'editor_type', 196 'Choose which Editor is used for excerpts',208 __('Choose which Editor is used for excerpts', 'rich-text-excerpts'), 197 209 array('RichTextExcerpts', 'options_setting_editor_type'), 198 210 'rte', … … 202 214 add_settings_field( 203 215 'editor_settings', 204 'Editor Settings',216 __('Editor Settings', 'rich-text-excerpts'), 205 217 array('RichTextExcerpts', 'options_editor_settings'), 206 218 'rte', … … 256 268 } 257 269 } 258 print('<p>Post types not selected here will use the regular plain text editor for excerpts. If the post type you want is not listed here, it does not currently support excerpts - to add support for excerpts to a post type, see <a href="http://codex.wordpress.org/Function_Reference/add_post_type_support">add_post_type_support()</a> in the Wordpress Codex.</p>'); 270 print('<p>'); 271 printf(__('Post types not selected here will use the regular plain text editor for excerpts. If the post type you want is not listed here, it does not currently support excerpts - to add support for excerpts to a post type, see %s in the Wordpress Codex', 'rich-text-excerpts'), '<a href="http://codex.wordpress.org/Function_Reference/add_post_type_support">add_post_type_support()</a>'); 272 print('.</p>'); 259 273 } 260 274 … … 266 280 $options = self::get_plugin_options(); 267 281 $chckd = ($options["editor_type"] === "teeny")? ' checked="checked"': ''; 268 printf('<p><input type="radio" name="rich_text_excerpts_options[editor_type]" id="rich_text_excerpts_options-editor_type-teeny" class="rte-options-editor-type" value="teeny"%s /> <label for="rich_text_excerpts_options-editor_type-teeny"> Use the minimal editor configuration used in PressThis</label></p>', $chckd);282 printf('<p><input type="radio" name="rich_text_excerpts_options[editor_type]" id="rich_text_excerpts_options-editor_type-teeny" class="rte-options-editor-type" value="teeny"%s /> <label for="rich_text_excerpts_options-editor_type-teeny">%s</label></p>', $chckd, __('Use the minimal editor configuration used in PressThis', 'rich-text-excerpts')); 269 283 $chckd = ($options["editor_type"] === "teeny")? '': ' checked="checked"'; 270 printf('<p><input type="radio" name="rich_text_excerpts_options[editor_type]" id="rich_text_excerpts_options-editor_type-tiny" class="rte-options-editor-type" value="tiny"%s /> <label for="rich_text_excerpts_options-editor_type-tiny"> Use the full version of the editor</label></p>', $chckd);271 print ('<p>Choose whether to use the full TinyMCE editor, or the “teeny” version of the editor (recommended). Customising the full TinyMCE editor is best carried out using a plugin like TinyMCE Advanced. If you choose to use the “teeny” version of the editor, you can customise the controls it will have here.</p>');284 printf('<p><input type="radio" name="rich_text_excerpts_options[editor_type]" id="rich_text_excerpts_options-editor_type-tiny" class="rte-options-editor-type" value="tiny"%s /> <label for="rich_text_excerpts_options-editor_type-tiny">%s</label></p>', $chckd, __('Use the full version of the editor', 'rich-text-excerpts')); 285 printf('<p>%s.</p>', __('Choose whether to use the full TinyMCE editor, or the “teeny” version of the editor (recommended). Customising the full TinyMCE editor is best carried out using a plugin like TinyMCE Advanced. If you choose to use the “teeny” version of the editor, you can customise the controls it will have here', 'rich-text-excerpts')); 272 286 } 273 287 … … 279 293 $options = self::get_plugin_options(); 280 294 $chckd = $options['editor_settings']['wpautop']? '': ' checked="checked"'; 281 printf('<p><input type="checkbox" name="rich_text_excerpts_options[editor_settings][wpautop]" id="rich_text_excerpts_options-editor_settings-wpautop"%s /> <label for="rich_text_excerpts_options-editor_settings-wpautop"> Stop removing the <p> and <br> tags when saving and show them in the HTML editor This will make it possible to use more advanced coding in the HTML editor without the back-end filtering affecting it much. However it may behave unexpectedly in rare cases, so test it thoroughly before enabling it permanently.</label></p>', $chckd);295 printf('<p><input type="checkbox" name="rich_text_excerpts_options[editor_settings][wpautop]" id="rich_text_excerpts_options-editor_settings-wpautop"%s /> <label for="rich_text_excerpts_options-editor_settings-wpautop">%s.</label></p>', $chckd, __('Stop removing the <p> and <br> tags when saving and show them in the HTML editor This will make it possible to use more advanced coding in the HTML editor without the back-end filtering affecting it much. However it may behave unexpectedly in rare cases, so test it thoroughly before enabling it permanently', 'rich-text-excerpts')); 282 296 $chckd = $options['editor_settings']['media_buttons']? 'checked="checked"': ''; 283 printf('<p><input type="checkbox" name="rich_text_excerpts_options[editor_settings][media_buttons]" id="rich_text_excerpts_options-editor_settings-media_buttons"%s /> <label for="rich_text_excerpts_options-editor_settings-media_buttons"> Enable upload media button</label></p>', $chckd);284 printf('<p><input type="text" length="2" name="rich_text_excerpts_options[editor_settings][textarea_rows]" id="rich_text_excerpts_options-editor_settings-textarea_rows" value="%d" /> <label for="rich_text_excerpts_options-editor_settings-textarea_rows"> Number of rows to use in the text editor (minimum is 3)</label></p>', intVal($options['editor_settings']['textarea_rows']));285 print ('<p><strong>Toolbar Buttons and Plugins</strong></p>');297 printf('<p><input type="checkbox" name="rich_text_excerpts_options[editor_settings][media_buttons]" id="rich_text_excerpts_options-editor_settings-media_buttons"%s /> <label for="rich_text_excerpts_options-editor_settings-media_buttons">%s</label></p>', $chckd, __('Enable upload media button', 'rich-text-excerpts')); 298 printf('<p><input type="text" length="2" name="rich_text_excerpts_options[editor_settings][textarea_rows]" id="rich_text_excerpts_options-editor_settings-textarea_rows" value="%d" /> <label for="rich_text_excerpts_options-editor_settings-textarea_rows">%s</label></p>', intVal($options['editor_settings']['textarea_rows']), __('Number of rows to use in the text editor (minimum is 3)', 'rich-text-excerpts')); 299 printf('<p><strong>%s</strong></p>', __('Toolbar Buttons and Plugins', 'rich-text-excerpts')); 286 300 /** 287 301 * settings for teeny text editor 288 302 */ 289 303 print('<div id="editor_type_teeny_options">'); 290 print ('<p>For a list of buttons and plugins in TinyMCE, <a href="http://www.tinymce.com/wiki.php/Buttons/controls">see this page on the TinyMCE wiki</a>. There is also some documentation on the <a href="http://codex.wordpress.org/TinyMCE">implementation of TinyMCE in Wordpress on the Wordpress Codex</a>.</p><p>Button and plugin names should be separated using commas.</p>');291 printf('<p><label for="rich_text_excerpts_options-editor_settings-plugins"> Plugins to add - make sure you add any plugin specific buttons to the editor below.</label><br /><input type="text" length="50" name="rich_text_excerpts_options[editor_settings][plugins]" id="rich_text_excerpts_options-editor_settings-plugins" value="%s" /></p>', implode(',', $options['editor_settings']['plugins']));292 printf('<p><label for="rich_text_excerpts_options-editor_settings-buttons"> Toolbar buttons - use the word ‘separator’ to separate groups of buttons</label><br /><textarea name="rich_text_excerpts_options[editor_settings][buttons]" id="rich_text_excerpts_options-editor_settings-buttons" cols="100" rows="3">%s</textarea></p>', implode(',', $options['editor_settings']['buttons']));304 printf('<p>%s.</p>', __('For a list of buttons and plugins in TinyMCE, <a href="http://www.tinymce.com/wiki.php/Buttons/controls">see this page on the TinyMCE wiki</a>. There is also some documentation on the <a href="http://codex.wordpress.org/TinyMCE">implementation of TinyMCE in Wordpress on the Wordpress Codex</a>.</p><p>Button and plugin names should be separated using commas', 'rich-text-excerpts')); 305 printf('<p><label for="rich_text_excerpts_options-editor_settings-plugins">%s.</label><br /><input type="text" length="50" name="rich_text_excerpts_options[editor_settings][plugins]" id="rich_text_excerpts_options-editor_settings-plugins" value="%s" /></p>', __('Plugins to add - make sure you add any plugin specific buttons to the editor below', 'rich-text-excerpts'), implode(',', $options['editor_settings']['plugins'])); 306 printf('<p><label for="rich_text_excerpts_options-editor_settings-buttons">%s</label><br /><textarea name="rich_text_excerpts_options[editor_settings][buttons]" id="rich_text_excerpts_options-editor_settings-buttons" cols="100" rows="3">%s</textarea></p>', __('Toolbar buttons - use the word ‘separator’ to separate groups of buttons', 'rich-text-excerpts'), implode(',', $options['editor_settings']['buttons'])); 293 307 print('</div>'); 294 308 /** … … 297 311 print('<div id="editor_type_tiny_options">'); 298 312 if (is_plugin_active('tinymce-advanced/tinymce-advanced.php')) { 299 printf('<p id=""><a href="%s">Configure the buttons for the advanced editor using the TinyMCE Advanced plugin</a>.</p>', admin_url('options-general.php?page=tinymce-advanced'));313 printf('<p><a href="%s">%s</a>.</p>', admin_url('options-general.php?page=tinymce-advanced'), __('Configure the buttons for the advanced editor using the TinyMCE Advanced plugin', 'rich-text-excerpts')); 300 314 } else { 301 printf('<p> If you want to configure the buttons for the advanced editor, <a href="%s">install and activate the TinyMCE Advanced plugin</a>.</p>', admin_url('plugins.php'));315 printf('<p><a href="%s">%s</a>.</p>', admin_url('plugins.php'), __('If you want to configure the buttons for the advanced editor, install and activate the TinyMCE Advanced plugin', 'rich-text-excerpts')); 302 316 } 303 317 print('</div>');
Note: See TracChangeset
for help on using the changeset viewer.