Index: core/admin_templates/categories/edit_content.tpl =================================================================== --- core/admin_templates/categories/edit_content.tpl (revision 14318) +++ core/admin_templates/categories/edit_content.tpl (working copy) @@ -1,6 +1,7 @@ + @@ -51,24 +52,33 @@ -
- - - - -
- - - - - + - -
-
+ + \ No newline at end of file Index: core/admin_templates/incs/form_blocks.tpl =================================================================== --- core/admin_templates/incs/form_blocks.tpl (revision 14319) +++ core/admin_templates/incs/form_blocks.tpl (working copy) @@ -406,15 +406,16 @@ - - + + + Index: core/admin_templates/incs/style_template.css =================================================================== --- core/admin_templates/incs/style_template.css (revision 14318) +++ core/admin_templates/incs/style_template.css (working copy) @@ -751,4 +751,17 @@ .summary-box li { padding-bottom: 4px; +} + +span.cke_skin_kama { + border-width: 0px !important; + -moz-border-radius: 0px !important; + -webkit-border-radius: 0px !important; + padding: 0px !important; +} + +.cke_wrapper{ + border-width: 0px !important; + -moz-border-radius: 0px !important; + -webkit-border-radius: 0px !important; } \ No newline at end of file Index: core/admin_templates/js/forms.js =================================================================== --- core/admin_templates/js/forms.js (revision 14318) +++ core/admin_templates/js/forms.js (working copy) @@ -59,18 +59,17 @@ } function InitEditors() { - // process all FCKEditor instances - var iframes = document.getElementsByTagName('IFRAME'); + if ( !$.isEmptyObject($CKEditors) ) { + // process all CKEditor instances + CKEDITOR.on( + 'instanceReady', + function( ev ) { + FCKeditor_OnComplete( CKEDITOR.instances[ ev.editor.name ] ); + } + ) - for (var i = 0; i < iframes.length; i++) { - if (iframes[i].id.match(/___Frame$/) && iframes[i].getAttribute('latesrc')) { - var $iframe = iframes[i]; - - setTimeout( - function () { - LoadFCKEditor($iframe); - }, 0 - ); + for (var $editor_id in $CKEditors) { + CKEDITOR.replace($editor_id, $CKEditors[$editor_id]); } } @@ -80,10 +79,6 @@ } } -function LoadFCKEditor($iframe) { - $iframe.contentWindow.location = $iframe.getAttribute('latesrc'); -} - function Form() {} Form = new Form(); @@ -143,7 +138,7 @@ addEvent(window, 'resize', function() {Form.Resize()}) - this.Resize(); + this.Resize(false); if (isset(first_error)) { for (var i in first_error) { @@ -213,11 +208,19 @@ return parseInt($size); } -Form.Resize = function() { +Form.Resize = function($init_done) { if (!this.Div) { return ; } + if ( ($init_done === true || $init_done === undefined) && !$.isEmptyObject($CKEditors) ) { + // process all CKEditor instances + for (var $editor_id in $CKEditors) { + var $ckeditor_textarea = $( '#' + jq($editor_id) ); + CKEDITOR.instances[ $editor_id ].resize( $ckeditor_textarea.width(), $ckeditor_textarea.height() ); + } + } + var h = (document.all ? window.document.body.offsetHeight : window.innerHeight); var $div = $(this.Div); Index: core/admin_templates/js/inp_ckconfig.js =================================================================== --- core/admin_templates/js/inp_ckconfig.js (revision 0) +++ core/admin_templates/js/inp_ckconfig.js (revision 0) @@ -0,0 +1,80 @@ +// Preview +//CKEDITOR.config.PreviewUrl = ''; +//CKEDITOR.config.ContentId = ''; + +//CKEDITOR.config.PreloadImages = [ CKEDITOR.config.SkinPath + 'images/toolbar.start.gif', CKEDITOR.config.SkinPath + 'images/toolbar.buttonarrow.gif', CKEDITOR.config.BasePath + 'plugins/images/document.gif' ] ; + +//CKEDITOR.config.PluginsPath = CKEDITOR.config.BasePath + 'plugins/' ; + +CKEDITOR.config.extraPlugins = 'my_link,my_document'; + +//CKEDITOR.plugins.add('MySource'); +//CKEDITOR.plugins.add('MyPreview'); +//CKEDITOR.plugins.add('MyLink'); +//CKEDITOR.plugins.add('MyImage'); +//CKEDITOR.plugins.add('document', 'en,ru'); + +CKEDITOR.config.protectedSource.push( /(]+>)|(<\/inp2:[^\>]+>)|(]+\/>)/gi ) ; + +CKEDITOR.config.documentIconsUrl = '/system/user_files/icons'; // for document custom plugin + +CKEDITOR.config.toolbar_Default = [ + ['Cut','Copy','Paste','PasteText','PasteFromWord','-','NewPage','SelectAll','-','Find','Replace','-','Print','-',/*My*/ 'Link','Unlink','Anchor','HorizontalRule','-',/*My*/ 'Image','Flash','Document','Table','SpecialChar'], + '/', + ['Bold','Italic','Underline','Strike','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','-','NumberedList','BulletedList','Outdent','Indent','-','Subscript','Superscript','-','TextColor','BGColor','-','Undo','Redo'], + '/', + ['Styles','Font','FontSize','RemoveFormat','-','SpellChecker','-', /*My*/'Source'] +]; + +CKEDITOR.config.toolbar_Advanced = [ + ['Cut','Copy','Paste','PasteText','PasteFromWord','-','NewPage','SelectAll','-','Find','Replace','-','Print','MyPreview','-',/*My*/ 'Link','Unlink','Anchor','HorizontalRule','-',/*My*/ 'Image','Flash','Document','Table','SpecialChar'], + '/', + ['Bold','Italic','Underline','Strike','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','-','NumberedList','BulletedList','Outdent','Indent','-','Subscript','Superscript','-','TextColor','BGColor','-','Undo','Redo'], + '/', + ['Styles','Font','FontSize','RemoveFormat','-','SpellChecker','-', /*My*/'Source'] +] ; + +CKEDITOR.config.enterMode = CKEDITOR.ENTER_BR ; // p | div | br +CKEDITOR.config.shiftEnterMode = CKEDITOR.ENTER_P ; // p | div | br + +CKEDITOR.config.keystrokes = [ + [ CKEDITOR.CTRL + 65 /*A*/, true ], + [ CKEDITOR.CTRL + 67 /*C*/, true ], + [ CKEDITOR.CTRL + 70 /*F*/, true ], + [ CKEDITOR.CTRL + 83 /*S*/, true ], + [ CKEDITOR.CTRL + 84 /*T*/, true ], + [ CKEDITOR.CTRL + 88 /*X*/, true ], + [ CKEDITOR.CTRL + 86 /*V*/, 'Paste' ], + [ CKEDITOR.CTRL + 45 /*INS*/, true ], + [ CKEDITOR.SHIFT + 45 /*INS*/, 'Paste' ], + [ CKEDITOR.CTRL + 88 /*X*/, 'Cut' ], + [ CKEDITOR.SHIFT + 46 /*DEL*/, 'Cut' ], + [ CKEDITOR.CTRL + 90 /*Z*/, 'Undo' ], + [ CKEDITOR.CTRL + 89 /*Y*/, 'Redo' ], + [ CKEDITOR.CTRL + CKEDITOR.SHIFT + 90 /*Z*/, 'Redo' ], + [ CKEDITOR.CTRL + 76 /*L*/, 'Link' ], + [ CKEDITOR.CTRL + 66 /*B*/, 'Bold' ], + [ CKEDITOR.CTRL + 73 /*I*/, 'Italic' ], + [ CKEDITOR.CTRL + 85 /*U*/, 'Underline' ], + [ CKEDITOR.CTRL + CKEDITOR.SHIFT + 83 /*S*/, 'Save' ], + [ CKEDITOR.CTRL + CKEDITOR.ALT + 13 /*ENTER*/, 'FitWindow' ] +] ; + +//CKEDITOR.config.menu_groups = 'generic,anchor,flash,select,textarea,checkbox,radio,textfield,hiddenfield,imagebutton,button,bulletedlist,numberedlist,table,form'; + +CKEDITOR.config.font_names = 'Arial Narrow;Arial;Sans-Serif;Serif;Comic Sans MS;Courier New;Tahoma;Times New Roman;Verdana' ; +CKEDITOR.config.fontSize_sizes = 'xx-small;x-small;small;medium;large;x-large;xx-large' ; + +CKEDITOR.config.filebrowserBrowseUrl = CKEDITOR.basePath + 'ckfinder/ckfinder.html'; +CKEDITOR.config.filebrowserUploadUrl = CKEDITOR.basePath + 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files'; + +CKEDITOR.config.filebrowserImageBrowseUrl = CKEDITOR.basePath + 'ckfinder/ckfinder.html?type=Images'; +CKEDITOR.config.filebrowserImageUploadUrl = CKEDITOR.basePath + 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images'; + +CKEDITOR.config.filebrowserFlashBrowseUrl = CKEDITOR.basePath + 'ckfinder/ckfinder.html?type=Flash'; +CKEDITOR.config.filebrowserFlashUploadUrl = CKEDITOR.basePath + 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash'; + +CKEDITOR.config.filebrowserDocumentBrowseUrl = CKEDITOR.basePath + 'ckfinder/ckfinder.html?type=Documents'; + +// add ability to browse for documents +//CKEDITOR.config.documentsBrowser = true ; \ No newline at end of file Index: core/admin_templates/js/jquery/thickbox/thickbox.js =================================================================== --- core/admin_templates/js/jquery/thickbox/thickbox.js (revision 14318) +++ core/admin_templates/js/jquery/thickbox/thickbox.js (working copy) @@ -659,6 +659,10 @@ var $iframe = $('#' + TB.getId('TB_iframeContent')); $iframe.width( $iframe.width() + $width_diff ); $iframe.height( $iframe.height() + $height_diff ); + + if ( $('#scroll_container').length == 1 ) { + Form.Resize(); + } } ); Index: core/admin_templates/js/script.js =================================================================== --- core/admin_templates/js/script.js (revision 14318) +++ core/admin_templates/js/script.js (working copy) @@ -8,6 +8,8 @@ var $nls_menus = new Array(); var $MenuNames = new Array(); + var $CKEditors = {}; // input name VS ck options mapping + var $form_name = 'kernel_form'; if(!$fw_menus) var $fw_menus = new Array(); Index: core/admin_templates/popups/editor.tpl =================================================================== --- core/admin_templates/popups/editor.tpl (revision 14318) +++ core/admin_templates/popups/editor.tpl (working copy) @@ -1,90 +1,87 @@ - + + + - - - - - + + +
- + -
- -
- - -
- - var $opener = getWindowOpener(window); - - if (!$opener) { - return; - } - - if (!$opener.closed) { - current = $opener.document.getElementById($TargetField); - current.value = document.getElementById('Content').value; - } - - window_close(); - } - - -
- - - - - -
- -
-
\ No newline at end of file Index: core/install/upgrades.css =================================================================== --- core/install/upgrades.css (revision 14318) +++ core/install/upgrades.css (working copy) @@ -673,3 +673,28 @@ + padding-bottom: 4px; } \ No newline at end of file + +# ===== v 5.1.3-B2 ===== +Index: style_template.css +=================================================================== +--- style_template.css (revision 14318) ++++ style_template.css (working copy) +@@ -751,4 +751,17 @@ + + .summary-box li { + padding-bottom: 4px; ++} ++ ++span.cke_skin_kama { ++ border-width: 0px !important; ++ -moz-border-radius: 0px !important; ++ -webkit-border-radius: 0px !important; ++ padding: 0px !important; ++} ++ ++.cke_wrapper{ ++ border-width: 0px !important; ++ -moz-border-radius: 0px !important; ++ -webkit-border-radius: 0px !important; + } +\ No newline at end of file Index: core/kernel/db/db_tag_processor.php =================================================================== --- core/kernel/db/db_tag_processor.php (revision 14345) +++ core/kernel/db/db_tag_processor.php (working copy) @@ -2399,18 +2399,21 @@ if (!file_exists(FULL_PATH . '/' . $theme_path . 'style.css')) { $theme_path = EDITOR_PATH; } + $theme_path = rtrim($theme_path, '/'); - $styles_xml = $this->Application->BaseURL() . $theme_path . 'styles.xml'; - $styles_css = $this->Application->BaseURL() . $theme_path . 'style.css'; + $styles_js = $this->Application->BaseURL($theme_path) . 'styles.js'; + $styles_css = $this->Application->BaseURL($theme_path) . 'style.css'; - $bgcolor = array_key_exists('bgcolor', $params) ? $params['bgcolor'] : $this->Application->GetVar('bgcolor'); + $bgcolor = isset($params['bgcolor']) ? $params['bgcolor'] : $this->Application->GetVar('bgcolor'); + if (!$bgcolor) { $bgcolor = '#ffffff'; } - $preview_url = ''; $page_id = $this->Application->GetVar('c_id'); $content_id = $this->Application->GetVar('content_id'); + + /*$preview_url = ''; if ($page_id && $content_id) { // editing content block from Front-End, not category in admin $sql = 'SELECT NamedParentPath @@ -2421,39 +2424,59 @@ $url_params = Array ('m_cat_id' => $page_id, 'no_amp' => 1, 'editing_mode' => EDITING_MODE_CONTENT, 'pass' => 'm'); $preview_url = $this->Application->HREF($template, '_FRONT_END_', $url_params, 'index.php'); $preview_url = preg_replace('/&(admin|editing_mode)=[\d]/', '', $preview_url); + }*/ + + include_once(FULL_PATH . EDITOR_PATH . 'ckeditor.php'); + + $oFCKeditor = new CKeditor(BASE_PATH . EDITOR_PATH); + +// $oFCKeditor->FullUrl = $this->Application->BaseURL(); +// $oFCKeditor->BaseUrl = BASE_PATH . '/'; // used by custom document plugin +// $oFCKeditor->PreviewUrl = $preview_url; // used by custom MyPreview plugin + + $oFCKeditor->lateLoad = array_key_exists('late_load', $params) && $params['late_load']; + + $width = $params['width']; + $height = $params['height']; + + if ( preg_match('/^[\d]+$/', $width) ) { + $width .= 'px'; } - include_once(FULL_PATH . EDITOR_PATH . 'fckeditor.php'); + if ( preg_match('/^[\d]+$/', $height) ) { + $height .= 'px'; + } - $oFCKeditor = new FCKeditor($name); - $oFCKeditor->FullUrl = $this->Application->BaseURL(); - $oFCKeditor->BaseUrl = BASE_PATH . '/'; - $oFCKeditor->BasePath = BASE_PATH . EDITOR_PATH; - $oFCKeditor->Width = $params['width'] ; - $oFCKeditor->Height = $params['height'] ; - $oFCKeditor->ToolbarSet = $page_id && $content_id ? 'Advanced' : 'Default'; - $oFCKeditor->Value = $value; - $oFCKeditor->PreviewUrl = $preview_url; - $oFCKeditor->DefaultLanguage = $this->_getFCKLanguage(); - $oFCKeditor->LateLoad = array_key_exists('late_load', $params) && $params['late_load']; - $oFCKeditor->Config = Array ( - //'UserFilesPath' => $pathtoroot.'kernel/user_files', - 'ProjectPath' => BASE_PATH . '/', - 'CustomConfigurationsPath' => $this->Application->BaseURL() . 'core/admin_templates/js/inp_fckconfig.js', - 'StylesXmlPath' => $styles_xml, - 'EditorAreaCSS' => $styles_css, - 'DefaultStyleLabel' => $this->Application->Phrase('la_editor_default_style'), -// 'Debug' => 1, - 'Admin' => 1, - 'K4' => 1, + $oFCKeditor->textareaAttributes = Array ( + 'style' => 'width: ' . $width . '; height: ' . $height . ';' + ); + + $oFCKeditor->config = Array ( + 'toolbar' => $page_id && $content_id ? 'Advanced' : 'Default', + + 'baseHref' => $this->Application->BaseURL( trim(EDITOR_PATH, '/') ), + +// 'ProjectPath' => BASE_PATH . '/', // used by custom MyPreview plugin + + 'customConfig' => $this->Application->BaseURL() . 'core/admin_templates/js/inp_ckconfig.js', + 'stylesSet' => 'portal:' . $styles_js, + 'contentsCss' => $styles_css, +// 'DefaultStyleLabel' => $this->Application->Phrase('la_editor_default_style'), // not ported to ckeditor + 'Admin' => 1, // for custom file browser to work + 'K4' => 1, // for custom file browser to work 'newBgColor' => $bgcolor, - 'PreviewUrl' => $preview_url, - 'BaseUrl' => BASE_PATH . '/', - 'DefaultLanguage' => $this->_getFCKLanguage(), - 'EditorAreaStyles' => 'body { background-color: '.$bgcolor.' }', +// 'PreviewUrl' => $preview_url, +// 'BaseUrl' => BASE_PATH . '/', // used by custom document plugin & by file browser + 'language' => $this->_getFCKLanguage(), + +// 'EditorAreaStyles' => 'body { background-color: '.$bgcolor.' }', // TODO + + 'height' => $height, // editor area height ); - return $oFCKeditor->CreateHtml(); + $oFCKeditor->returnOutput = true; + + return $oFCKeditor->editor($name, $value); } function IsNewItem($params)