Index: admin/system_presets/.htaccess =================================================================== --- admin/system_presets/.htaccess (revision 15041) +++ admin/system_presets/.htaccess (working copy) @@ -1,2 +1,8 @@ deny from all satisfy all + + + order allow,deny + allow from all + satisfy all + \ No newline at end of file Index: admin/system_presets/simple/inp_ckconfig.js =================================================================== --- admin/system_presets/simple/inp_ckconfig.js (revision 0) +++ admin/system_presets/simple/inp_ckconfig.js (revision 0) @@ -0,0 +1,96 @@ +// 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,my_maximize,MediaEmbed'; + +//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 = [ + ['Styles'], + ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat'], + ['NumberedList', 'BulletedList', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'], + ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo'], + ['Find', 'Replace', 'Scayt'] +]; + +CKEDITOR.config.toolbar_DebugMode = [ + ['Cut','Copy','Paste','PasteText','PasteFromWord','-','NewPage','SelectAll','-','Find','Replace','-','Print','Preview','-',/*My*/ 'Link','Unlink','Anchor','HorizontalRule','-',/*My*/ 'Image','Flash','MediaEmbed','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','-','Scayt','-', /*My*/'Source', 'Maximize', 'ShowBlocks'] +]; + +//CKEDITOR.config.toolbar_Full = [ +// [ 'Source','-','Save','NewPage','DocProps','Preview','Print','-','Templates' ], +// [ 'Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo' ], +// [ 'Find','Replace','-','SelectAll','-','SpellChecker', 'Scayt' ], +// [ 'Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField' ], +// '/', +// [ 'Bold','Italic','Underline','Strike','Subscript','Superscript','-','RemoveFormat' ], +// [ 'NumberedList','BulletedList','-','Outdent','Indent','-','Blockquote','CreateDiv','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','-','BidiLtr','BidiRtl' ], +// [ 'Link','Unlink','Anchor' ], +// [ 'Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak' ], +// '/', +// [ 'Styles','Format','Font','FontSize' ], +// [ 'TextColor','BGColor' ], +// [ 'Maximize', 'ShowBlocks','-','About' ] +//]; + +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 ; Index: core/admin_templates/categories/edit_content.tpl =================================================================== --- core/admin_templates/categories/edit_content.tpl (revision 15041) +++ core/admin_templates/categories/edit_content.tpl (working copy) @@ -1,6 +1,7 @@ + @@ -44,40 +45,38 @@ -
- - - - -
- - - - - + - - - -
-
-
Index: core/admin_templates/incs/style_template.css =================================================================== --- core/admin_templates/incs/style_template.css (revision 15041) +++ core/admin_templates/incs/style_template.css (working copy) @@ -781,4 +781,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 15041) +++ 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,104 @@ +// 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,my_maximize,MediaEmbed'; + +//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','Preview','-',/*My*/ 'Link','Unlink','Anchor','HorizontalRule','-',/*My*/ 'Image','Flash','MediaEmbed','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','-','Scayt','-', /*My*/'Source', 'Maximize', 'ShowBlocks'] +]; + +CKEDITOR.config.toolbar_DebugMode = [ + ['Cut','Copy','Paste','PasteText','PasteFromWord','-','NewPage','SelectAll','-','Find','Replace','-','Print','Preview','-',/*My*/ 'Link','Unlink','Anchor','HorizontalRule','-',/*My*/ 'Image','Flash','MediaEmbed','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','-','Scayt','-', /*My*/'Source', 'Maximize', 'ShowBlocks'] +]; + +/*CKEDITOR.config.toolbar_Simple = [ + ['Styles'], + ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat'], + ['NumberedList', 'BulletedList', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'], + ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo'], + ['Find', 'Replace', 'Scayt'] +];*/ + +//CKEDITOR.config.toolbar_Full = [ +// [ 'Source','-','Save','NewPage','DocProps','Preview','Print','-','Templates' ], +// [ 'Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo' ], +// [ 'Find','Replace','-','SelectAll','-','SpellChecker', 'Scayt' ], +// [ 'Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField' ], +// '/', +// [ 'Bold','Italic','Underline','Strike','Subscript','Superscript','-','RemoveFormat' ], +// [ 'NumberedList','BulletedList','-','Outdent','Indent','-','Blockquote','CreateDiv','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','-','BidiLtr','BidiRtl' ], +// [ 'Link','Unlink','Anchor' ], +// [ 'Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak' ], +// '/', +// [ 'Styles','Format','Font','FontSize' ], +// [ 'TextColor','BGColor' ], +// [ 'Maximize', 'ShowBlocks','-','About' ] +//]; + +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 ; Property changes on: core\admin_templates\js\inp_ckconfig.js ___________________________________________________________________ Added: svn:eol-style + LF Index: core/admin_templates/js/jquery/thickbox/thickbox.js =================================================================== --- core/admin_templates/js/jquery/thickbox/thickbox.js (revision 15041) +++ 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 15041) +++ 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 15041) +++ 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/install_data.sql =================================================================== --- core/install/install_data.sql (revision 15041) +++ core/install/install_data.sql (working copy) @@ -102,6 +102,8 @@ INSERT INTO SystemSettings VALUES(DEFAULT, 'CSVExportEncoding', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsCSVExport', 'la_config_CSVExportEncoding', 'radio', NULL, '0=la_Unicode||1=la_Regular', 70.04, 0, 1, NULL); INSERT INTO SystemSettings VALUES(DEFAULT, 'YahooApplicationId', '', 'In-Portal', 'in-portal:configure_advanced', 'la_section_Settings3rdPartyAPI', 'la_config_YahooApplicationId', 'text', NULL, NULL, 80.01, 0, 0, NULL); INSERT INTO SystemSettings VALUES(DEFAULT, 'l_GoogleMapsAPIKey', '', 'In-Portal', 'in-portal:configure_advanced', 'la_section_Settings3rdPartyAPI', 'la_fld_LinkGoogleMapsAPIKey', 'text', NULL, NULL, 80.02, 0, 1, NULL); +INSERT INTO SystemSettings VALUES(DEFAULT, 'CKFinderLicenseName', '', 'In-Portal', 'in-portal:configure_advanced', 'la_section_Settings3rdPartyAPI', 'la_config_CKFinderLicenseName', 'text', NULL, NULL, 80.03, 0, 0, NULL); +INSERT INTO SystemSettings VALUES(DEFAULT, 'CKFinderLicenseKey', '', 'In-Portal', 'in-portal:configure_advanced', 'la_section_Settings3rdPartyAPI', 'la_config_CKFinderLicenseKey', 'text', NULL, NULL, 80.04, 0, 0, NULL); # Section "in-portal:configure_users": INSERT INTO SystemSettings VALUES(DEFAULT, 'User_Allow_New', '3', 'In-Portal:Users', 'in-portal:configure_users', 'la_title_General', 'la_users_allow_new', 'radio', '', '1=la_opt_UserInstantRegistration||2=la_opt_UserNotAllowedRegistration||3=la_opt_UserUponApprovalRegistration||4=la_opt_UserEmailActivation', 10.01, 0, 1, NULL); Index: core/install/upgrades.css =================================================================== --- core/install/upgrades.css (revision 15041) +++ core/install/upgrades.css (working copy) @@ -765,3 +765,22 @@ .priority { color: red; padding-left: 1px; +@@ -751,4 +781,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/install/upgrades.sql =================================================================== --- core/install/upgrades.sql (revision 15041) +++ core/install/upgrades.sql (working copy) @@ -2598,3 +2598,6 @@ DELETE FROM LanguageLabels WHERE PhraseKey = 'LA_FLD_RUNMODE'; ALTER TABLE ScheduledTasks DROP RunMode; + +INSERT INTO SystemSettings VALUES(DEFAULT, 'CKFinderLicenseName', '', 'In-Portal', 'in-portal:configure_advanced', 'la_section_Settings3rdPartyAPI', 'la_config_CKFinderLicenseName', 'text', NULL, NULL, 80.03, 0, 0, NULL); +INSERT INTO SystemSettings VALUES(DEFAULT, 'CKFinderLicenseKey', '', 'In-Portal', 'in-portal:configure_advanced', 'la_section_Settings3rdPartyAPI', 'la_config_CKFinderLicenseKey', 'text', NULL, NULL, 80.04, 0, 0, NULL); Index: core/kernel/db/db_tag_processor.php =================================================================== --- core/kernel/db/db_tag_processor.php (revision 15041) +++ core/kernel/db/db_tag_processor.php (working copy) @@ -2548,22 +2548,32 @@ $value = $this->Field($params); $name = array_key_exists('name', $params) ? $params['name'] : $this->InputName($params); - $theme_path = substr($this->Application->GetFrontThemePath(), 1) . '/inc/'; - if (!file_exists(FULL_PATH . '/' . $theme_path . 'style.css')) { - $theme_path = EDITOR_PATH; + $theme_path = $this->Application->GetFrontThemePath() . '/inc'; + + if ( file_exists(FULL_PATH . $theme_path . '/style.css') ) { + $url_params = Array ( + 'events[fck]' => 'OnGetsEditorStyles', + 'no_pass_through' => 1, 'pass' => 'm', 'no_amp' => 1 + ); + + $styles_css = $this->Application->HREF('index', '_FRONT_END_', $url_params, 'index.php'); } + else { + $theme_path = rtrim(EDITOR_PATH, '/'); + $styles_css = $this->Application->BaseURL($theme_path) . 'style.css'; + } - $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'; + $bgcolor = isset($params['bgcolor']) ? $params['bgcolor'] : $this->Application->GetVar('bgcolor'); - $bgcolor = array_key_exists('bgcolor', $params) ? $params['bgcolor'] : $this->Application->GetVar('bgcolor'); - if (!$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 @@ -2574,39 +2584,69 @@ $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'); + + $oCKeditor = 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 + + $oCKeditor->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, + $oCKeditor->textareaAttributes = Array ( + 'style' => 'width: ' . $width . '; height: ' . $height . ';' + ); + + if ( file_exists(SYSTEM_PRESET_PATH . DIRECTORY_SEPARATOR . 'inp_ckconfig.js') ) { + $file_helper =& $this->Application->recallObject('FileHelper'); + /* @var $file_helper FileHelper */ + + $config_js = $file_helper->pathToUrl(SYSTEM_PRESET_PATH . DIRECTORY_SEPARATOR . 'inp_ckconfig.js'); + } + else { + $config_js = $this->Application->BaseURL() . 'core/admin_templates/js/inp_ckconfig.js'; + } + + $oCKeditor->config = Array ( + 'toolbar' => $this->Application->isDebugMode() ? 'DebugMode' : 'Default', // $page_id && $content_id ? 'Advanced' : 'Default', + + 'baseHref' => $this->Application->BaseURL( trim(EDITOR_PATH, '/') ), + +// 'ProjectPath' => BASE_PATH . '/', // used by custom MyPreview plugin + + 'customConfig' => $config_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(); + $oCKeditor->returnOutput = true; + + return $oCKeditor->editor($name, $value); } function IsNewItem($params) Index: core/kernel/startup.php =================================================================== --- core/kernel/startup.php (revision 15041) +++ core/kernel/startup.php (working copy) @@ -110,7 +110,7 @@ define('IMAGES_PENDING_PATH', IMAGES_PATH . 'pending/'); define('MAX_UPLOAD_SIZE', min(ini_get('upload_max_filesize'), ini_get('post_max_size'))*1024*1024); - define('EDITOR_PATH', isset($vars['EditorPath']) ? $vars['EditorPath'] : '/core/editor/'); + define('EDITOR_PATH', isset($vars['EditorPath']) ? $vars['EditorPath'] : '/core/ckeditor/'); // caching types define('CACHING_TYPE_NONE', 0); Index: core/units/content/content_eh.php =================================================================== --- core/units/content/content_eh.php (revision 15041) +++ core/units/content/content_eh.php (working copy) @@ -45,12 +45,12 @@ function OnSaveContentBlock(&$event) { if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { - $event->status = erFAIL; + $event->status = kEvent::erFAIL; return ; } if ( !$this->saveContentBlock($event, false) ) { - $event->status = erFAIL; + $event->status = kEvent::erFAIL; } $event->SetRedirectParam('opener', 'u'); @@ -63,7 +63,7 @@ */ function OnAutoSave(&$event) { - $event->status = erSTOP; + $event->status = kEvent::erSTOP; if ( $this->Application->GetVar('ajax') != 'yes' ) { return ; @@ -86,10 +86,11 @@ $items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) ); if ( !$items_info ) { - return ; + return ''; } list ($object, $revision) = $this->getContentBlockAndRevision($event); + /* @var $revision kDBItem */ list (, $field_values) = each($items_info); $object->SetFieldsFromHash($field_values); @@ -123,13 +124,14 @@ */ function OnGetAutoSaveTime(&$event) { - $event->status = erSTOP; + $event->status = kEvent::erSTOP; if ( $this->Application->GetVar('ajax') != 'yes' ) { return ; } list ($object, $revision) = $this->getContentBlockAndRevision($event); + /* @var $revision kDBItem */ $page_helper =& $this->Application->recallObject('PageHelper'); /* @var $page_helper PageHelper */ Index: core/units/fck/fck_eh.php =================================================================== --- core/units/fck/fck_eh.php (revision 15041) +++ core/units/fck/fck_eh.php (working copy) @@ -17,6 +17,24 @@ class FckEventHandler extends kDBEventHandler { /** + * Allows to override standard permission mapping + * + * @return void + * @access protected + * @see kEventHandler::$permMapping + */ + protected function mapPermissions() + { + parent::mapPermissions(); + + $permissions = Array ( + 'OnGetsEditorStyles' => Array ('self' => true), + ); + + $this->permMapping = array_merge($this->permMapping, $permissions); + } + + /** * Checks user permission to execute given $event * * @param kEvent $event @@ -25,7 +43,7 @@ */ public function CheckPermission(kEvent &$event) { - if ( $this->Application->isAdminUser ) { + if ( $this->Application->isAdminUser || $event->Name == 'OnGetsEditorStyles' ) { // this limits all event execution only to logged-in users in admin return true; } @@ -54,33 +72,35 @@ function OnLoadCmsTree(&$event) { $event->status = kEvent::erSTOP; - $this->CreateXmlHeader(); - $res = ''."\n" ; - $res.= ""."\n"; - $lang = $this->Application->GetVar('m_lang'); + $category_helper =& $this->Application->recallObject('CategoryHelper'); + /* @var $category_helper CategoryHelper */ - $st =& $this->Application->recallObject('st.-dummy'); - /* @var $st kDBItem */ + $pages = $category_helper->getStructureTreeAsOptions(); - $st_options = $this->Application->getUnitOption('st'.'.ParentId', 'Fields'); - $pages = $st_options['options']; - $page_ids = array_keys($pages); - $sql = 'SELECT NamedParentPath, CategoryId FROM ' . TABLE_PREFIX . 'Categories - WHERE CategoryId IN (' . implode(',', $page_ids) . ')'; - $tpls = $this->Application->Conn->GetCol($sql, 'CategoryId'); + WHERE CategoryId IN (' . implode(',', array_keys($pages)) . ')'; + $templates = $this->Conn->GetCol($sql, 'CategoryId'); - //$res = ''; + $templates[$this->Application->getBaseCategory()] .= '/Index'; // "Content" category will act as "Home Page" + + $res = '' . "\n"; + $res .= '' . "\n"; + foreach ($pages as $id => $title) { - $page_path = preg_replace('/^Content\//i', '', strtolower($tpls[$id]).'.html'); - $title = $title.' ('.$page_path.')'; - $real_url = $this->Application->HREF($tpls[$id], '_FRONT_END_', array('pass'=>'m'), 'index.php'); - $res .= ''."\n"; + $template = $templates[$id]; + $page_path = preg_replace('/^Content\//i', '', strtolower($template).'.html'); + + $title = $title . ' (' . $page_path . ')'; + $real_url = $this->Application->HREF($template, '_FRONT_END_', array('pass' => 'm'), 'index.php'); + + $res .= '' . "\n"; } $res.= ""; + + $this->CreateXmlHeader(); echo $res; } @@ -214,4 +234,20 @@ $fck_helper->UploadFile(); } + + /** + * Returns compressed CSS file + * + * @param kEvent $event + */ + function OnGetsEditorStyles(&$event) + { + $minify_helper =& $this->Application->recallObject('MinifyHelper'); + /* @var $minify_helper MinifyHelper */ + + $this->Application->InitParser(); + $styles_css = $minify_helper->CompressScriptTag( Array ('files' => 'inc/style.css') ); + + $event->redirect = 'external:' . $styles_css; + } } \ No newline at end of file Index: core/units/helpers/category_helper.php =================================================================== --- core/units/helpers/category_helper.php (revision 15041) +++ core/units/helpers/category_helper.php (working copy) @@ -380,7 +380,7 @@ } $category_language = $data['l' . $language_id . '_Name'] ? $language_id : $this->_primaryLanguageId; - $ret = Array($parent_category_id => str_repeat('-', $level).' '.$data['l' . $category_language . '_Name']); + $ret = Array($parent_category_id => str_repeat('—', $level).' '.$data['l' . $category_language . '_Name']); if ($data['children']) { $level++; @@ -411,8 +411,8 @@ $fields[] = 'l' . $language_id . '_Name'; } - $sql = 'SELECT CategoryId AS id, ' . implode(', ', $fields) . ', ParentId, ThemeId - FROM ' . $this->Application->getUnitOption('c', 'TableName') . ' + $sql = 'SELECT CategoryId AS id, ' . implode(', ', $fields) . ', ParentId, Template, ThemeId + FROM ' . TABLE_PREFIX . 'Categories ORDER BY Priority DESC'; $items = $this->Conn->Query($sql, 'id'); @@ -428,6 +428,16 @@ $parent_mapping[$item_id] = $item_parent_id; $items_by_parent[$item_parent_id][$item_id] = $item_data; } + + $base_category = $this->Application->getBaseCategory(); // "Content" category + $index_category = $this->findIndexCategoryId($items_by_parent[$base_category]); + + // rename "Content" into "Home" keeping it's ID + $items_by_parent[ $parent_mapping[$base_category] ][$base_category]['l1_Name'] = $this->Application->Phrase('la_rootcategory_name'); + + // remove category of "index.tpl" template + unset($items_by_parent[$base_category][$index_category]); + unset($parent_mapping[$index_category]); } $data = $items_by_parent[ $parent_mapping[$parent_category_id] ][$parent_category_id]; @@ -445,6 +455,17 @@ return $data; } + function findIndexCategoryId($top_categories) + { + foreach ($top_categories as $category_id => $category_info) { + if ($category_info['Template'] == 'index') { + return $category_id; + } + } + + return false; + } + /** * Generates OR retrieves from cache structure tree * @@ -580,10 +601,9 @@ $data = $this->_getStructureTree(); $theme_id = (int)$themes_helper->getCurrentThemeId(); - $root_category = $this->Application->getBaseCategory(); $this->_primaryLanguageId = $this->Application->GetDefaultLanguageId(); - $this->_structureTree = $this->_printChildren($data, $root_category, $this->Application->GetVar('m_lang'), $theme_id); + $this->_structureTree = $this->_printChildren($data, $data['id'], $this->Application->GetVar('m_lang'), $theme_id); return $this->_structureTree; } @@ -607,13 +627,16 @@ WHERE CategoryId IN (' . implode(',', $page_ids) . ')'; $templates = $this->Conn->GetCol($sql, 'CategoryId'); + $base_category = $this->Application->getBaseCategory(); + $templates[$base_category] .= '/Index'; // "Content" category will act as "Home Page" + foreach ($page_ids as $page_id) { - if (!array_key_exists($page_id, $templates)) { + if ( !isset($templates[$page_id]) ) { // internal page was deleted, but link to it was found in given content block data continue; } - $url_params = Array ('m_cat_id' => $page_id, 'pass' => 'm'); + $url_params = Array ('m_cat_id' => $page_id == $base_category ? 0 : $page_id, 'pass' => 'm'); $page_url = $this->Application->HREF(strtolower($templates[$page_id]), '', $url_params); /*if ($this->Application->isAdmin) { $page_url = preg_replace('/&(admin|editing_mode)=[\d]/', '', $page_url); Index: core/units/page_revisions/page_revision_eh.php =================================================================== --- core/units/page_revisions/page_revision_eh.php (revision 15041) +++ core/units/page_revisions/page_revision_eh.php (working copy) @@ -224,7 +224,7 @@ */ function OnGetInfo(&$event) { - $event->status = erSTOP; + $event->status = kEvent::erSTOP; if ( $this->Application->GetVar('ajax') != 'yes' ) { return ;