Changeset 3730:5c45a5df9a59 for plugins/dcLegacyEditor
- Timestamp:
- 03/08/18 17:58:39 (7 years ago)
- Branch:
- default
- Location:
- plugins/dcLegacyEditor
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/dcLegacyEditor/_define.php
r3333 r3730 10 10 # 11 11 # -- END LICENSE BLOCK ----------------------------------------- 12 if (!defined('DC_RC_PATH')) { return;}12 if (!defined('DC_RC_PATH')) {return;} 13 13 14 14 $this->registerModule( 15 /* Name */ "dcLegacyEditor", 16 /* Description*/ "dotclear legacy editor", 17 /* Author */ "dotclear Team", 18 /* Version */ '0.1.4', 19 20 'permissions' =>'usage,contentadmin',21 'type' =>'plugin',22 'settings' =>array(23 24 25 26 15 "dcLegacyEditor", // Name 16 "dotclear legacy editor", // Description 17 "dotclear Team", // Author 18 '0.1.4', // Version 19 array( 20 'permissions' => 'usage,contentadmin', 21 'type' => 'plugin', 22 'settings' => array( 23 'self' => '', 24 'pref' => '#user-options.user_options_edition' 25 ) 26 ) 27 27 ); -
plugins/dcLegacyEditor/_install.php
r2861 r3730 11 11 # -- END LICENSE BLOCK ----------------------------------------- 12 12 13 if (!defined('DC_CONTEXT_ADMIN')) { return;}13 if (!defined('DC_CONTEXT_ADMIN')) {return;} 14 14 15 15 $version = $core->plugins->moduleInfo('dcLegacyEditor', 'version'); 16 if (version_compare($core->getVersion('dcLegacyEditor'), $version, '>=')) {17 return;16 if (version_compare($core->getVersion('dcLegacyEditor'), $version, '>=')) { 17 return; 18 18 } 19 19 -
plugins/dcLegacyEditor/_prepend.php
r2614 r3730 11 11 # -- END LICENSE BLOCK ----------------------------------------- 12 12 13 if (!defined('DC_RC_PATH')) { return;}13 if (!defined('DC_RC_PATH')) {return;} 14 14 15 $__autoload['dcLegacyEditorBehaviors'] = dirname(__FILE__) .'/inc/dc.legacy.editor.behaviors.php';15 $__autoload['dcLegacyEditorBehaviors'] = dirname(__FILE__) . '/inc/dc.legacy.editor.behaviors.php'; -
plugins/dcLegacyEditor/css/jsToolBar/jsToolBar.css
r3669 r3730 1 1 .jstEditor { 2 border-width: 0 1px 1px 1px;3 border-style: solid;4 border-color: #ddd;5 background: #f7f7f7;2 border-width: 0 1px 1px 1px; 3 border-style: solid; 4 border-color: #ddd; 5 background: #f7f7f7; 6 6 } 7 7 .jstEditor textarea, .jstEditor iframe { 8 9 10 11 12 13 14 15 8 -webkit-box-sizing: border-box; 9 -moz-box-sizing: border-box; 10 box-sizing: border-box; 11 margin: 0; 12 border: 1px solid #fbfbfb; 13 width: 100%; 14 padding: .5em 0 0 0; 15 min-height: 100px; 16 16 } 17 17 .jstHandle { 18 19 20 21 22 23 24 18 height: 8px; 19 background: #ccc url(?pf=dcLegacyEditor/css/jsToolBar/resize.png) no-repeat center center; 20 font-size: 0.1em; 21 cursor: s-resize; 22 border-color: #ccc #ccc #ccc #000; 23 border-width: 0 1px 1px 1px; 24 border-style: solid; 25 25 } 26 26 .jstEditor textarea:focus, .jstEditor iframe:focus { 27 27 border-color: #bee74b; 28 28 } 29 29 .jstElements { 30 31 32 33 34 35 36 37 38 39 30 -webkit-box-sizing: border-box; 31 -moz-box-sizing: border-box; 32 box-sizing: border-box; 33 padding: 0 32px 0 1rem; 34 border: 1px solid #dfdfdf; 35 overflow: hidden; 36 background: #f5f5f5; 37 border-radius: 4px 4px 0 0; 38 position: relative; 39 line-height: 30px; 40 40 } 41 41 .jstElements select, .jstElements button { 42 42 vertical-align: middle; 43 43 } 44 44 .jstElements select { 45 46 45 width: 12em; 46 margin-right: .6rem; 47 47 } 48 48 .jstElements button { 49 50 51 52 53 54 55 56 background-color: #f7f7f7;57 background-position: 50% 50%;58 59 49 width: 30px; 50 height: 28px; 51 border-style: solid; 52 border-width: 1px; 53 margin-left: 2px; 54 margin-bottom: 2px; 55 border-color: #e5e5e5 #ccc #ccc #e5e5e5; 56 background-color: #f7f7f7; 57 background-position: 50% 50%; 58 background-repeat: no-repeat; 59 background-size: inherit; 60 60 } 61 61 .jstElements button:hover, .jstElements button:focus { 62 border-color: #ddd;63 62 border-color: #ddd; 63 background-color: #fff; 64 64 } 65 65 .jstElements button span { 66 66 display: none; 67 67 } 68 68 .jstElements span { 69 display: inline-block;70 69 display: inline-block; 70 vertical-align: top; 71 71 } 72 72 span.jstSpacer { 73 width: 8px;73 width: 8px; 74 74 } 75 75 .jstSwitcher { 76 77 78 79 80 81 76 display: block; 77 list-style: none; 78 margin: 0; 79 padding: 0 0 5px 0; 80 background: #dfdfdf; 81 border-top: 1px solid #999; 82 82 } 83 83 .jstSwitcher li { 84 85 86 84 display: inline; 85 margin: 0 0 0 5px; 86 padding: 2px 8px; 87 87 } 88 88 .jstSwitcher li.jstSwitcherCurrent { 89 90 91 89 color: #fff; 90 background: #677374; 91 border-radius: 0 0 2px 2px; 92 92 } 93 93 .jstSwitcher a { 94 95 94 font-weight: normal; 95 border-bottom: none !important; 96 96 } 97 98 97 /* Buttons 99 98 -------------------------------------------------------- */ 99 100 100 button.jstb_strong { 101 101 background-image: url(?pf=dcLegacyEditor/css/jsToolBar/bt_strong.png); 102 102 } 103 103 button.jstb_em { 104 104 background-image: url(?pf=dcLegacyEditor/css/jsToolBar/bt_em.png); 105 105 } 106 106 button.jstb_ins { 107 107 background-image: url(?pf=dcLegacyEditor/css/jsToolBar/bt_ins.png); 108 108 } 109 109 button.jstb_del { 110 110 background-image: url(?pf=dcLegacyEditor/css/jsToolBar/bt_del.png); 111 111 } 112 112 button.jstb_quote { 113 113 background-image: url(?pf=dcLegacyEditor/css/jsToolBar/bt_quote.png); 114 114 } 115 115 button.jstb_code { 116 116 background-image: url(?pf=dcLegacyEditor/css/jsToolBar/bt_code.png); 117 117 } 118 118 button.jstb_mark { 119 119 background-image: url(?pf=dcLegacyEditor/css/jsToolBar/bt_mark.png); 120 120 } 121 121 button.jstb_paragraph { 122 122 background-image: url(?pf=dcLegacyEditor/css/jsToolBar/bt_paragraph.png); 123 123 } 124 124 button.jstb_br { 125 125 background-image: url(?pf=dcLegacyEditor/css/jsToolBar/bt_br.png); 126 126 } 127 127 button.jstb_blockquote { 128 128 background-image: url(?pf=dcLegacyEditor/css/jsToolBar/bt_bquote.png); 129 129 } 130 130 button.jstb_pre { 131 131 background-image: url(?pf=dcLegacyEditor/css/jsToolBar/bt_pre.png); 132 132 } 133 133 button.jstb_ul { 134 134 background-image: url(?pf=dcLegacyEditor/css/jsToolBar/bt_ul.png); 135 135 } 136 136 button.jstb_ol { 137 137 background-image: url(?pf=dcLegacyEditor/css/jsToolBar/bt_ol.png); 138 138 } 139 139 button.jstb_link { 140 140 background-image: url(?pf=dcLegacyEditor/css/jsToolBar/bt_link.png); 141 141 } 142 142 button.jstb_img { 143 143 background-image: url(?pf=dcLegacyEditor/css/jsToolBar/bt_img.png); 144 144 } 145 145 button.jstb_img_select { 146 146 background-image: url(?pf=dcLegacyEditor/css/jsToolBar/bt_img_select.png); 147 147 } 148 148 button.jstb_post_link { 149 149 background-image: url(?pf=dcLegacyEditor/css/jsToolBar/bt_post.png); 150 150 } 151 151 button.jstb_removeFormat { 152 153 154 155 156 157 152 background-color: #e5e5e5; 153 background-image: url(?pf=dcLegacyEditor/css/jsToolBar/bt_clean.png); 154 position: absolute; 155 right: 2px; 156 top: 1px; 157 border-color: #ccc; 158 158 } 159 /* WYSIWYG Iframe */ 159 160 160 /* WYSIWYG Iframe */161 161 .wysiwygIframe { 162 border-width: 1px;163 border-style: solid;164 border-color: #000 #ccc #ccc #000;165 width: 100%;162 border-width: 1px; 163 border-style: solid; 164 border-color: #000 #ccc #ccc #000; 165 width: 100%; 166 166 } 167 /* WYSIWYG Document */ 167 168 168 /* WYSIWYG Document */169 169 body.wysiwygDoc { 170 color: #000;171 172 173 padding: 2px;174 170 color: #000; 171 background: #f9f9f9; 172 margin: 0; 173 padding: 2px; 174 border: none; 175 175 } 176 176 .wysiwygDoc code { 177 color: #666;178 font-weight: bold;177 color: #666; 178 font-weight: bold; 179 179 } 180 body.wysiwygDoc >p:first-child {181 180 body.wysiwygDoc>p:first-child { 181 margin-top: 0; 182 182 } -
plugins/dcLegacyEditor/inc/dc.legacy.editor.behaviors.php
r3669 r3730 13 13 class dcLegacyEditorBehaviors 14 14 { 15 15 protected static $p_url = 'index.php?pf=dcLegacyEditor'; 16 16 17 /** 18 * adminPostEditor add javascript to the DOM to load ckeditor depending on context 19 * 20 * @param editor <b>string</b> wanted editor 21 * @param context <b>string</b> page context (post,page,comment,event,...) 22 * @param tags <b>array</b> array of ids to inject editor 23 * @param syntax <b>string</b> wanted syntax (wiki,markdown,...) 24 */ 25 public static function adminPostEditor($editor='',$context='',array $tags=array(),$syntax='') { 26 if (empty($editor) || $editor!='dcLegacyEditor') {return;} 17 /** 18 * adminPostEditor add javascript to the DOM to load ckeditor depending on context 19 * 20 * @param editor <b>string</b> wanted editor 21 * @param context <b>string</b> page context (post,page,comment,event,...) 22 * @param tags <b>array</b> array of ids to inject editor 23 * @param syntax <b>string</b> wanted syntax (wiki,markdown,...) 24 */ 25 public static function adminPostEditor($editor = '', $context = '', array $tags = array(), $syntax = '') 26 { 27 if (empty($editor) || $editor != 'dcLegacyEditor') {return;} 27 28 28 29 self::jsToolBar().30 dcPage::jsLoad(dcPage::getPF('dcLegacyEditor/js/_post_editor.js')).31 '<script type="text/javascript">'."\n".32 dcPage::jsVar('dotclear.legacy_editor_context', $context).33 dcPage::jsVar('dotclear.legacy_editor_syntax', $syntax).34 'dotclear.legacy_editor_tags_context = '.sprintf('{%s:["%s"]};'."\n", $context, implode('","', $tags))."\n".35 36 29 return 30 self::jsToolBar() . 31 dcPage::jsLoad(dcPage::getPF('dcLegacyEditor/js/_post_editor.js')) . 32 '<script type="text/javascript">' . "\n" . 33 dcPage::jsVar('dotclear.legacy_editor_context', $context) . 34 dcPage::jsVar('dotclear.legacy_editor_syntax', $syntax) . 35 'dotclear.legacy_editor_tags_context = ' . sprintf('{%s:["%s"]};' . "\n", $context, implode('","', $tags)) . "\n" . 36 "</script>\n"; 37 } 37 38 38 public static function adminPopupMedia($editor='') { 39 if (empty($editor) || $editor!='dcLegacyEditor') {return;} 39 public static function adminPopupMedia($editor = '') 40 { 41 if (empty($editor) || $editor != 'dcLegacyEditor') {return;} 40 42 41 42 43 return dcPage::jsLoad(dcPage::getPF('dcLegacyEditor/js/jsToolBar/popup_media.js')); 44 } 43 45 44 public static function adminPopupLink($editor='') { 45 if (empty($editor) || $editor!='dcLegacyEditor') {return;} 46 public static function adminPopupLink($editor = '') 47 { 48 if (empty($editor) || $editor != 'dcLegacyEditor') {return;} 46 49 47 48 50 return dcPage::jsLoad(dcPage::getPF('dcLegacyEditor/js/jsToolBar/popup_link.js')); 51 } 49 52 50 public static function adminPopupPosts($editor='') { 51 if (empty($editor) || $editor!='dcLegacyEditor') {return;} 53 public static function adminPopupPosts($editor = '') 54 { 55 if (empty($editor) || $editor != 'dcLegacyEditor') {return;} 52 56 53 54 57 return dcPage::jsLoad(dcPage::getPF('dcLegacyEditor/js/jsToolBar/popup_posts.js')); 58 } 55 59 56 protected static function jsToolBar() { 57 $res = 58 dcPage::cssLoad(dcPage::getPF('dcLegacyEditor/css/jsToolBar/jsToolBar.css')). 59 dcPage::jsLoad(dcPage::getPF('dcLegacyEditor/js/jsToolBar/jsToolBar.js')); 60 protected static function jsToolBar() 61 { 62 $res = 63 dcPage::cssLoad(dcPage::getPF('dcLegacyEditor/css/jsToolBar/jsToolBar.css')) . 64 dcPage::jsLoad(dcPage::getPF('dcLegacyEditor/js/jsToolBar/jsToolBar.js')); 60 65 61 62 63 66 if (isset($GLOBALS['core']->auth) && $GLOBALS['core']->auth->getOption('enable_wysiwyg')) { 67 $res .= dcPage::jsLoad(dcPage::getPF('dcLegacyEditor/js/jsToolBar/jsToolBar.wysiwyg.js')); 68 } 64 69 65 66 dcPage::jsLoad(dcPage::getPF('dcLegacyEditor/js/jsToolBar/jsToolBar.dotclear.js')).67 '<script type="text/javascript">'."\n".68 "jsToolBar.prototype.dialog_url = 'popup.php'; "."\n".69 "jsToolBar.prototype.iframe_css = '".70 'body {'.71 ' color: #000;'.72 ' background: #f9f9f9;'.73 ' margin: 0;'.74 ' padding: 2px;'.75 ' border: none;'.76 (l10n::getTextDirection($GLOBALS['_lang']) == 'rtl' ? ' direction: rtl;' : '').77 '}'.78 'code {'.79 ' color: #666;'.80 ' font-weight: bold;'.81 '}'.82 'body > p:first-child {'.83 ' margin-top: 0;'.84 '}'.85 "'; "."\n".86 "jsToolBar.prototype.base_url = '".html::escapeJS($GLOBALS['core']->blog->host)."'; "."\n".87 "jsToolBar.prototype.switcher_visual_title = '".html::escapeJS(__('visual'))."'; "."\n".88 "jsToolBar.prototype.switcher_source_title = '".html::escapeJS(__('source'))."'; "."\n".89 "jsToolBar.prototype.legend_msg = '".90 html::escapeJS(__('You can use the following shortcuts to format your text.'))."'; "."\n".91 "jsToolBar.prototype.elements.blocks.options.none = '".html::escapeJS(__('-- none --'))."'; "."\n".92 "jsToolBar.prototype.elements.blocks.options.nonebis = '".html::escapeJS(__('-- block format --'))."'; "."\n".93 "jsToolBar.prototype.elements.blocks.options.p = '".html::escapeJS(__('Paragraph'))."'; "."\n".94 "jsToolBar.prototype.elements.blocks.options.h1 = '".html::escapeJS(__('Level 1 header'))."'; "."\n".95 "jsToolBar.prototype.elements.blocks.options.h2 = '".html::escapeJS(__('Level 2 header'))."'; "."\n".96 "jsToolBar.prototype.elements.blocks.options.h3 = '".html::escapeJS(__('Level 3 header'))."'; "."\n".97 "jsToolBar.prototype.elements.blocks.options.h4 = '".html::escapeJS(__('Level 4 header'))."'; "."\n".98 "jsToolBar.prototype.elements.blocks.options.h5 = '".html::escapeJS(__('Level 5 header'))."'; "."\n".99 "jsToolBar.prototype.elements.blocks.options.h6 = '".html::escapeJS(__('Level 6 header'))."'; "."\n".100 "jsToolBar.prototype.elements.strong.title = '".html::escapeJS(__('Strong emphasis'))."'; "."\n".101 "jsToolBar.prototype.elements.em.title = '".html::escapeJS(__('Emphasis'))."'; "."\n".102 "jsToolBar.prototype.elements.ins.title = '".html::escapeJS(__('Inserted'))."'; "."\n".103 "jsToolBar.prototype.elements.del.title = '".html::escapeJS(__('Deleted'))."'; "."\n".104 "jsToolBar.prototype.elements.quote.title = '".html::escapeJS(__('Inline quote'))."'; "."\n".105 "jsToolBar.prototype.elements.code.title = '".html::escapeJS(__('Code'))."'; "."\n".106 "jsToolBar.prototype.elements.mark.title = '".html::escapeJS(__('Mark'))."'; "."\n".107 "jsToolBar.prototype.elements.br.title = '".html::escapeJS(__('Line break'))."'; "."\n".108 "jsToolBar.prototype.elements.blockquote.title = '".html::escapeJS(__('Blockquote'))."'; "."\n".109 "jsToolBar.prototype.elements.pre.title = '".html::escapeJS(__('Preformated text'))."'; "."\n".110 "jsToolBar.prototype.elements.ul.title = '".html::escapeJS(__('Unordered list'))."'; "."\n".111 "jsToolBar.prototype.elements.ol.title = '".html::escapeJS(__('Ordered list'))."'; "."\n".70 $res .= 71 dcPage::jsLoad(dcPage::getPF('dcLegacyEditor/js/jsToolBar/jsToolBar.dotclear.js')) . 72 '<script type="text/javascript">' . "\n" . 73 "jsToolBar.prototype.dialog_url = 'popup.php'; " . "\n" . 74 "jsToolBar.prototype.iframe_css = '" . 75 'body {' . 76 ' color: #000;' . 77 ' background: #f9f9f9;' . 78 ' margin: 0;' . 79 ' padding: 2px;' . 80 ' border: none;' . 81 (l10n::getTextDirection($GLOBALS['_lang']) == 'rtl' ? ' direction: rtl;' : '') . 82 '}' . 83 'code {' . 84 ' color: #666;' . 85 ' font-weight: bold;' . 86 '}' . 87 'body > p:first-child {' . 88 ' margin-top: 0;' . 89 '}' . 90 "'; " . "\n" . 91 "jsToolBar.prototype.base_url = '" . html::escapeJS($GLOBALS['core']->blog->host) . "'; " . "\n" . 92 "jsToolBar.prototype.switcher_visual_title = '" . html::escapeJS(__('visual')) . "'; " . "\n" . 93 "jsToolBar.prototype.switcher_source_title = '" . html::escapeJS(__('source')) . "'; " . "\n" . 94 "jsToolBar.prototype.legend_msg = '" . 95 html::escapeJS(__('You can use the following shortcuts to format your text.')) . "'; " . "\n" . 96 "jsToolBar.prototype.elements.blocks.options.none = '" . html::escapeJS(__('-- none --')) . "'; " . "\n" . 97 "jsToolBar.prototype.elements.blocks.options.nonebis = '" . html::escapeJS(__('-- block format --')) . "'; " . "\n" . 98 "jsToolBar.prototype.elements.blocks.options.p = '" . html::escapeJS(__('Paragraph')) . "'; " . "\n" . 99 "jsToolBar.prototype.elements.blocks.options.h1 = '" . html::escapeJS(__('Level 1 header')) . "'; " . "\n" . 100 "jsToolBar.prototype.elements.blocks.options.h2 = '" . html::escapeJS(__('Level 2 header')) . "'; " . "\n" . 101 "jsToolBar.prototype.elements.blocks.options.h3 = '" . html::escapeJS(__('Level 3 header')) . "'; " . "\n" . 102 "jsToolBar.prototype.elements.blocks.options.h4 = '" . html::escapeJS(__('Level 4 header')) . "'; " . "\n" . 103 "jsToolBar.prototype.elements.blocks.options.h5 = '" . html::escapeJS(__('Level 5 header')) . "'; " . "\n" . 104 "jsToolBar.prototype.elements.blocks.options.h6 = '" . html::escapeJS(__('Level 6 header')) . "'; " . "\n" . 105 "jsToolBar.prototype.elements.strong.title = '" . html::escapeJS(__('Strong emphasis')) . "'; " . "\n" . 106 "jsToolBar.prototype.elements.em.title = '" . html::escapeJS(__('Emphasis')) . "'; " . "\n" . 107 "jsToolBar.prototype.elements.ins.title = '" . html::escapeJS(__('Inserted')) . "'; " . "\n" . 108 "jsToolBar.prototype.elements.del.title = '" . html::escapeJS(__('Deleted')) . "'; " . "\n" . 109 "jsToolBar.prototype.elements.quote.title = '" . html::escapeJS(__('Inline quote')) . "'; " . "\n" . 110 "jsToolBar.prototype.elements.code.title = '" . html::escapeJS(__('Code')) . "'; " . "\n" . 111 "jsToolBar.prototype.elements.mark.title = '" . html::escapeJS(__('Mark')) . "'; " . "\n" . 112 "jsToolBar.prototype.elements.br.title = '" . html::escapeJS(__('Line break')) . "'; " . "\n" . 113 "jsToolBar.prototype.elements.blockquote.title = '" . html::escapeJS(__('Blockquote')) . "'; " . "\n" . 114 "jsToolBar.prototype.elements.pre.title = '" . html::escapeJS(__('Preformated text')) . "'; " . "\n" . 115 "jsToolBar.prototype.elements.ul.title = '" . html::escapeJS(__('Unordered list')) . "'; " . "\n" . 116 "jsToolBar.prototype.elements.ol.title = '" . html::escapeJS(__('Ordered list')) . "'; " . "\n" . 112 117 113 "jsToolBar.prototype.elements.link.title = '".html::escapeJS(__('Link'))."'; "."\n".114 "jsToolBar.prototype.elements.link.accesskey = '".html::escapeJS(__('l'))."'; "."\n".115 "jsToolBar.prototype.elements.link.href_prompt = '".html::escapeJS(__('URL?'))."'; "."\n".116 "jsToolBar.prototype.elements.link.hreflang_prompt = '".html::escapeJS(__('Language?'))."'; "."\n".118 "jsToolBar.prototype.elements.link.title = '" . html::escapeJS(__('Link')) . "'; " . "\n" . 119 "jsToolBar.prototype.elements.link.accesskey = '" . html::escapeJS(__('l')) . "'; " . "\n" . 120 "jsToolBar.prototype.elements.link.href_prompt = '" . html::escapeJS(__('URL?')) . "'; " . "\n" . 121 "jsToolBar.prototype.elements.link.hreflang_prompt = '" . html::escapeJS(__('Language?')) . "'; " . "\n" . 117 122 118 "jsToolBar.prototype.elements.img.title = '".html::escapeJS(__('External image'))."'; "."\n".119 "jsToolBar.prototype.elements.img.src_prompt = '".html::escapeJS(__('URL?'))."'; "."\n".123 "jsToolBar.prototype.elements.img.title = '" . html::escapeJS(__('External image')) . "'; " . "\n" . 124 "jsToolBar.prototype.elements.img.src_prompt = '" . html::escapeJS(__('URL?')) . "'; " . "\n" . 120 125 121 "jsToolBar.prototype.elements.img_select.title = '".html::escapeJS(__('Media chooser'))."'; "."\n".122 "jsToolBar.prototype.elements.img_select.accesskey = '".html::escapeJS(__('m'))."'; "."\n".123 "jsToolBar.prototype.elements.post_link.title = '".html::escapeJS(__('Link to an entry'))."'; "."\n".124 "jsToolBar.prototype.elements.removeFormat = jsToolBar.prototype.elements.removeFormat || {}; "."\n".125 "jsToolBar.prototype.elements.removeFormat.title = '".html::escapeJS(__('Remove text formating'))."'; "."\n";126 "jsToolBar.prototype.elements.img_select.title = '" . html::escapeJS(__('Media chooser')) . "'; " . "\n" . 127 "jsToolBar.prototype.elements.img_select.accesskey = '" . html::escapeJS(__('m')) . "'; " . "\n" . 128 "jsToolBar.prototype.elements.post_link.title = '" . html::escapeJS(__('Link to an entry')) . "'; " . "\n" . 129 "jsToolBar.prototype.elements.removeFormat = jsToolBar.prototype.elements.removeFormat || {}; " . "\n" . 130 "jsToolBar.prototype.elements.removeFormat.title = '" . html::escapeJS(__('Remove text formating')) . "'; " . "\n"; 126 131 127 if (!$GLOBALS['core']->auth->check('media,media_admin',$GLOBALS['core']->blog->id)) {128 129 132 if (!$GLOBALS['core']->auth->check('media,media_admin', $GLOBALS['core']->blog->id)) { 133 $res .= "jsToolBar.prototype.elements.img_select.disabled = true;\n"; 134 } 130 135 131 $res .= "jsToolBar.prototype.toolbar_bottom = ".132 (isset($GLOBALS['core']->auth) && $GLOBALS['core']->auth->getOption('toolbar_bottom') ? 'true' : 'false').";\n";136 $res .= "jsToolBar.prototype.toolbar_bottom = " . 137 (isset($GLOBALS['core']->auth) && $GLOBALS['core']->auth->getOption('toolbar_bottom') ? 'true' : 'false') . ";\n"; 133 138 134 135 139 $res .= 140 "</script>\n"; 136 141 137 138 139 '<script type="text/javascript">'."\n".140 dcPage::jsVar('dotclear_htmlFontSize',$GLOBALS['core']->auth->user_prefs->interface->htmlfontsize)."\n".141 142 142 if ($GLOBALS['core']->auth->user_prefs->interface->htmlfontsize) { 143 $res .= 144 '<script type="text/javascript">' . "\n" . 145 dcPage::jsVar('dotclear_htmlFontSize', $GLOBALS['core']->auth->user_prefs->interface->htmlfontsize) . "\n" . 146 "</script>\n"; 147 } 143 148 144 145 149 return $res; 150 } 146 151 } -
plugins/dcLegacyEditor/index.php
r2855 r3730 11 11 # -- END LICENSE BLOCK ----------------------------------------- 12 12 13 if (!defined('DC_CONTEXT_ADMIN')) { return;}13 if (!defined('DC_CONTEXT_ADMIN')) {return;} 14 14 15 15 $is_admin = $core->auth->check('admin,contentadmin', $core->blog->id) || $core->auth->isSuperAdmin(); … … 20 20 if (!empty($_POST['saveconfig'])) { 21 21 try { 22 $dclegacyeditor_active = (empty($_POST['dclegacyeditor_active'])) ?false:true;22 $dclegacyeditor_active = (empty($_POST['dclegacyeditor_active'])) ? false : true; 23 23 $core->blog->settings->dclegacyeditor->put('active', $dclegacyeditor_active, 'boolean'); 24 24 25 25 dcPage::addSuccessNotice(__('The configuration has been updated.')); 26 26 http::redirect($p_url); 27 } catch (Exception $e) {28 27 } catch (Exception $e) { 28 $core->error->add($e->getMessage()); 29 29 } 30 30 } 31 31 32 include dirname(__FILE__).'/tpl/index.tpl'; 33 32 include dirname(__FILE__) . '/tpl/index.tpl'; -
plugins/dcLegacyEditor/tpl/index.tpl
r2855 r3730 1 1 <html> 2 3 4 5 6 <?php echo dcPage::breadcrumb(array(__('Plugins') => '',__('dcLegacyEditor') => '')).dcPage::notices(); ?>2 <head> 3 <title>dcLegacyEditor</title> 4 </head> 5 <body> 6 <?php echo dcPage::breadcrumb(array(__('Plugins') => '', __('dcLegacyEditor') => '')) . dcPage::notices(); ?> 7 7 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 12 <h3><?php echo __('Plugin activation');?></h3>13 14 15 <?php echo form::checkbox('dclegacyeditor_active', 1, $dclegacyeditor_active);?>16 <?php echo __('Enable dcLegacyEditor plugin');?>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="dclegacyeditor_active"> 15 <?php echo form::checkbox('dclegacyeditor_active', 1, $dclegacyeditor_active); ?> 16 <?php echo __('Enable dcLegacyEditor plugin'); ?> 17 </label> 18 </p> 19 </div> 20 20 21 22 23 <?php echo $core->formNonce();?>24 <input type="submit" name="saveconfig" value="<?php echo __('Save configuration');?>" />25 26 27 21 <p> 22 <input type="hidden" name="p" value="dcLegacyEditor"/> 23 <?php echo $core->formNonce(); ?> 24 <input type="submit" name="saveconfig" value="<?php echo __('Save configuration'); ?>" /> 25 </p> 26 </form> 27 <?php endif;?> 28 28 29 30 29 <?php dcPage::helpBlock('dcLegacyEditor');?> 30 </body> 31 31 </html>
Note: See TracChangeset
for help on using the changeset viewer.