Changeset 2972:8099686135fe for plugins/dcCKEditor
- Timestamp:
- 03/22/15 15:10:20 (10 years ago)
- Branch:
- default
- Location:
- plugins/dcCKEditor
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/dcCKEditor/_define.php
r2894 r2972 4 4 # This file is part of Dotclear 2. 5 5 # 6 # Copyright (c) 2003-201 3Olivier Meunier & Association Dotclear6 # Copyright (c) 2003-2015 Olivier Meunier & Association Dotclear 7 7 # Licensed under the GPL version 2.0 license. 8 8 # See LICENSE file or … … 16 16 /* Description*/ "dotclear CKEditor integration", 17 17 /* Author */ "dotclear Team", 18 /* Version */ " 0.9.0",18 /* Version */ "1.0.0", 19 19 array( 20 20 'permissions' => 'usage,contentadmin', -
plugins/dcCKEditor/_install.php
r2854 r2972 27 27 $settings->dcckeditor->put('cancollapse_button', false, 'boolean', 'Add collapse button?', false, true); 28 28 $settings->dcckeditor->put('format_select', false, 'boolean', 'Add format selection?', false, true); 29 $settings->dcckeditor->put('format_tags', 'p;h1;h2;h3;h4;h5;h6;pre;address', 'string', 'Custom formats', false, true); 29 30 $settings->dcckeditor->put('table_button', false, 'boolean', 'Add table button?', false, true); 30 31 $settings->dcckeditor->put('clipboard_buttons', false, 'boolean', 'Add clipboard buttons?', false, true); -
plugins/dcCKEditor/_post_config.php
r2962 r2972 4 4 # This file is part of Dotclear 2. 5 5 # 6 # Copyright (c) 2003-201 4Olivier Meunier & Association Dotclear6 # Copyright (c) 2003-2015 Olivier Meunier & Association Dotclear 7 7 # Licensed under the GPL version 2.0 license. 8 8 # See LICENSE file or … … 113 113 <?php if (!empty($dcckeditor_format_select)):?> 114 114 // format tags 115 <?php if (!empty($dcckeditor_format_tags)):?> 116 format_tags: '<?php echo $dcckeditor_format_tags;?>', 117 <?php else:?> 115 118 format_tags: 'p;h1;h2;h3;h4;h5;h6;pre;address', 116 119 <?php endif;?> 117 120 // following definition are needed to be specialized 118 121 format_p: { element: 'p' }, -
plugins/dcCKEditor/inc/_config.php
r2854 r2972 4 4 # This file is part of Dotclear 2. 5 5 # 6 # Copyright (c) 2003-201 4Olivier Meunier & Association Dotclear6 # Copyright (c) 2003-2015 Olivier Meunier & Association Dotclear 7 7 # Licensed under the GPL version 2.0 license. 8 8 # See LICENSE file or … … 16 16 17 17 if (!empty($_POST['saveconfig'])) { 18 19 20 18 try { 19 $dcckeditor_active = (empty($_POST['dcckeditor_active']))?false:true; 20 $core->blog->settings->dcckeditor->put('active', $dcckeditor_active, 'boolean'); 21 21 22 23 24 25 22 // change other settings only if they were in html page 23 if ($dcckeditor_was_actived) { 24 $dcckeditor_alignement_buttons = (empty($_POST['dcckeditor_alignment_buttons']))?false:true; 25 $core->blog->settings->dcckeditor->put('alignment_buttons', $dcckeditor_alignement_buttons, 'boolean'); 26 26 27 28 27 $dcckeditor_list_buttons = (empty($_POST['dcckeditor_list_buttons']))?false:true; 28 $core->blog->settings->dcckeditor->put('list_buttons', $dcckeditor_list_buttons, 'boolean'); 29 29 30 31 30 $dcckeditor_textcolor_button = (empty($_POST['dcckeditor_textcolor_button']))?false:true; 31 $core->blog->settings->dcckeditor->put('textcolor_button', $dcckeditor_textcolor_button, 'boolean'); 32 32 33 34 33 $dcckeditor_cancollapse_button = (empty($_POST['dcckeditor_cancollapse_button']))?false:true; 34 $core->blog->settings->dcckeditor->put('cancollapse_button', $dcckeditor_cancollapse_button, 'boolean'); 35 35 36 37 36 $dcckeditor_format_select = (empty($_POST['dcckeditor_format_select']))?false:true; 37 $core->blog->settings->dcckeditor->put('format_select', $dcckeditor_format_select, 'boolean'); 38 38 39 $dcckeditor_table_button = (empty($_POST['dcckeditor_table_button']))?false:true; 40 $core->blog->settings->dcckeditor->put('table_button', $dcckeditor_table_button, 'boolean'); 39 // default tags : p;h1;h2;h3;h4;h5;h6;pre;address 40 $allowed_tags = array('p','h1','h2','h3','h4','h5','h6','pre','address'); 41 if (!empty($_POST['dcckeditor_format_tags'])) { 42 $tags = explode(';', $_POST['dcckeditor_format_tags']); 43 $new_tags = true; 44 foreach ($tags as $tag) { 45 if (!in_array($tag, $allowed_tags)) { 46 $new_tags = false; 47 break; 48 } 49 } 50 if ($new_tags) { 51 $dcckeditor_format_tags = $_POST['dcckeditor_format_tags']; 52 } 53 } else { 54 $dcckeditor_format_tags = 'p;h1;h2;h3;h4;h5;h6;pre;address'; 55 } 56 $core->blog->settings->dcckeditor->put('format_tags', $dcckeditor_format_tags, 'string'); 41 57 42 $dcckeditor_clipboard_buttons = (empty($_POST['dcckeditor_clipboard_buttons']))?false:true;43 $core->blog->settings->dcckeditor->put('clipboard_buttons', $dcckeditor_clipboard_buttons, 'boolean');44 }45 58 46 dcPage::addSuccessNotice(__('The configuration has been updated.')); 47 http::redirect($p_url); 48 } catch(Exception $e) { 59 $dcckeditor_table_button = (empty($_POST['dcckeditor_table_button']))?false:true; 60 $core->blog->settings->dcckeditor->put('table_button', $dcckeditor_table_button, 'boolean'); 61 62 $dcckeditor_clipboard_buttons = (empty($_POST['dcckeditor_clipboard_buttons']))?false:true; 63 $core->blog->settings->dcckeditor->put('clipboard_buttons', $dcckeditor_clipboard_buttons, 'boolean'); 64 } 65 66 dcPage::addSuccessNotice(__('The configuration has been updated.')); 67 http::redirect($p_url); 68 } catch(Exception $e) { 49 69 $core->error->add($e->getMessage()); 50 70 } 51 71 } 52 72 -
plugins/dcCKEditor/index.php
r2855 r2972 4 4 # This file is part of Dotclear 2. 5 5 # 6 # Copyright (c) 2003-201 4Olivier Meunier & Association Dotclear6 # Copyright (c) 2003-2015 Olivier Meunier & Association Dotclear 7 7 # Licensed under the GPL version 2.0 license. 8 8 # See LICENSE file or … … 22 22 $dcckeditor_cancollapse_button = $core->blog->settings->dcckeditor->cancollapse_button; 23 23 $dcckeditor_format_select = $core->blog->settings->dcckeditor->format_select; 24 $dcckeditor_format_tags = $core->blog->settings->dcckeditor->format_tags; 24 25 $dcckeditor_table_button = $core->blog->settings->dcckeditor->table_button; 25 26 $dcckeditor_clipboard_buttons = $core->blog->settings->dcckeditor->clipboard_buttons; -
plugins/dcCKEditor/tpl/index.tpl
r2855 r2972 1 1 <html> 2 3 4 5 6 2 <head> 3 <title>dcCKEditor</title> 4 </head> 5 <body> 6 <?php echo dcPage::breadcrumb(array(__('Plugins') => '',__('dcCKEditor') => '')).dcPage::notices(); ?> 7 7 8 9 10 11 12 13 14 15 16 17 18 19 8 <?php if ($is_admin):?> 9 <h3 class="hidden-if-js"><?php echo __('Settings');?></h3> 10 <form action="<?php echo $p_url;?>" method="post" enctype="multipart/form-data"> 11 <div class="fieldset"> 12 <h3><?php echo __('Plugin activation');?></h3> 13 <p> 14 <label class="classic" for="dcckeditor_active"> 15 <?php echo form::checkbox('dcckeditor_active', 1, $dcckeditor_active);?> 16 <?php echo __('Enable dcCKEditor plugin');?> 17 </label> 18 </p> 19 </div> 20 20 21 <?php if ($dcckeditor_active):?> 22 <div class="fieldset"> 23 <h3><?php echo __('Options'); ?></h3> 24 <p> 25 <?php echo form::checkbox('dcckeditor_alignment_buttons', 1, $dcckeditor_alignment_buttons); ?> 26 <label class="classic" for="dcckeditor_alignment_buttons"> <?php echo __('Add alignment buttons');?></label> 27 </p> 28 <p> 29 <?php echo form::checkbox('dcckeditor_list_buttons', 1, $dcckeditor_list_buttons); ?> 30 <label class="classic" for="dcckeditor_list_buttons"> <?php echo __('Add lists buttons');?></label> 31 </p> 32 <p> 33 <?php echo form::checkbox('dcckeditor_textcolor_button', 1, $dcckeditor_textcolor_button); ?> 34 <label class="classic" for="dcckeditor_textcolor_button"> <?php echo __('Add text color button');?></label> 35 </p> 36 <p> 37 <?php echo form::checkbox('dcckeditor_cancollapse_button', 1, $dcckeditor_cancollapse_button); ?> 38 <label class="classic" for="dcckeditor_cancollapse_button"> <?php echo __('Add collapse button');?></label> 39 </p> 40 <p> 41 <?php echo form::checkbox('dcckeditor_format_select', 1, $dcckeditor_format_select);?> 42 <label class="classic" for="dcckeditor_format_select"> <?php echo __('Add format selection');?></label> 43 </p> 44 <p> 45 <?php echo form::checkbox('dcckeditor_table_button', 1, $dcckeditor_table_button);?> 46 <label class="classic" for="dcckeditor_table_button"> <?php echo __('Add table button');?></label> 47 </p> 48 <p> 49 <?php echo form::checkbox('dcckeditor_clipboard_buttons', 1, $dcckeditor_clipboard_buttons);?> 50 <label class="classic" for="dcckeditor_clipboard_buttons"> <?php echo __('Add clipboard buttons');?></label> 51 </p> 52 <p class="clear form-note"> 53 <?php echo __('Copy, Paste, Paste Text, Paste from Word');?> 54 </p> 55 </div> 56 <?php endif;?> 21 <?php if ($dcckeditor_active):?> 22 <div class="fieldset"> 23 <h3><?php echo __('Options'); ?></h3> 24 <p> 25 <?php echo form::checkbox('dcckeditor_alignment_buttons', 1, $dcckeditor_alignment_buttons); ?> 26 <label class="classic" for="dcckeditor_alignment_buttons"> <?php echo __('Add alignment buttons');?></label> 27 </p> 28 <p> 29 <?php echo form::checkbox('dcckeditor_list_buttons', 1, $dcckeditor_list_buttons); ?> 30 <label class="classic" for="dcckeditor_list_buttons"> <?php echo __('Add lists buttons');?></label> 31 </p> 32 <p> 33 <?php echo form::checkbox('dcckeditor_textcolor_button', 1, $dcckeditor_textcolor_button); ?> 34 <label class="classic" for="dcckeditor_textcolor_button"> <?php echo __('Add text color button');?></label> 35 </p> 36 <p> 37 <?php echo form::checkbox('dcckeditor_cancollapse_button', 1, $dcckeditor_cancollapse_button); ?> 38 <label class="classic" for="dcckeditor_cancollapse_button"> <?php echo __('Add collapse button');?></label> 39 </p> 40 <p> 41 <?php echo form::checkbox('dcckeditor_format_select', 1, $dcckeditor_format_select);?> 42 <label class="classic" for="dcckeditor_format_select"> <?php echo __('Add format selection');?></label> 43 </p> 44 <p> 45 <label class="classic" for="dcckeditor_format_tags"> <?php echo __('Custom formats');?></label> 46 <?php echo form::field('dcckeditor_format_tags',100,255, $dcckeditor_format_tags);?> 47 </p> 48 <p class="clear form-note"> 49 <?php echo __('Default formats are p;h1;h2;h3;h4;h5;h6;pre;address');?> 50 </p> 51 <p> 52 <?php echo form::checkbox('dcckeditor_table_button', 1, $dcckeditor_table_button);?> 53 <label class="classic" for="dcckeditor_table_button"> <?php echo __('Add table button');?></label> 54 </p> 55 <p> 56 <?php echo form::checkbox('dcckeditor_clipboard_buttons', 1, $dcckeditor_clipboard_buttons);?> 57 <label class="classic" for="dcckeditor_clipboard_buttons"> <?php echo __('Add clipboard buttons');?></label> 58 </p> 59 <p class="clear form-note"> 60 <?php echo __('Copy, Paste, Paste Text, Paste from Word');?> 61 </p> 62 </div> 63 <?php endif;?> 57 64 58 59 60 61 62 63 64 65 <p> 66 <input type="hidden" name="p" value="dcCKEditor"/> 67 <?php echo $core->formNonce();?> 68 <input type="submit" name="saveconfig" value="<?php echo __('Save configuration');?>" /> 69 </p> 70 </form> 71 <?php endif;?> 65 72 66 67 73 <?php dcPage::helpBlock('dcCKEditor');?> 74 </body> 68 75 </html>
Note: See TracChangeset
for help on using the changeset viewer.