Index: branches/5.2.x/core/units/categories/categories_tag_processor.php =================================================================== diff -u -N -r16374 -r16409 --- branches/5.2.x/core/units/categories/categories_tag_processor.php (.../categories_tag_processor.php) (revision 16374) +++ branches/5.2.x/core/units/categories/categories_tag_processor.php (.../categories_tag_processor.php) (revision 16409) @@ -1,6 +1,6 @@ Application->ProcessParsedTag($content->getPrefixSpecial(), 'AdminEditButton', $params); + if ( $inline_editing ) { + $params['name'] = 'content_block_' . $num; - $edit_code_before = ' -
- ' . $button_code . ' -
'; + $editing_hint = $this->Application->Phrase('la_hint_ClickToEdit', false, true); - $edit_code_after = '
'; + $edit_code_before = ' +
+
+
+
'; + + $edit_code_after = '
' . $this->FCKEditor($params); + } + else { + $button_code = $this->Application->ProcessParsedTag($content->getPrefixSpecial(), 'AdminEditButton', $params); + + $edit_code_before = ' +
+ ' . $button_code . ' +
'; + + $edit_code_after = '
'; + } } if ( $this->Application->GetVar('_editor_preview_') == 1 ) { $data = $this->Application->RecallVar('_editor_preview_content_'); } + elseif ( EDITING_MODE == EDITING_MODE_CONTENT && $inline_editing ) { + // don't use formatter, that replaced "@@ID@@" links + $content->SetFieldOption('Content', 'using_fck', false); + $data = $content->GetField('Content'); + $content->SetFieldOption('Content', 'using_fck', true); + } else { + // use formatter, that replaced "@@ID@@" links $data = $content->GetField('Content'); } @@ -1472,17 +1495,22 @@ $url_params = Array ('theme-file_event' => 'OnSaveLayout', 'source' => $template, 'pass' => 'all,theme-file', '__NO_REWRITE__' => 1); $save_layout_url = $this->Application->HREF('index', '', $url_params); + $url_params = Array ('content_event' => 'OnSaveContentBlock', 'pass' => 'all,content', '__NO_REWRITE__' => 1, 'no_amp' => 1); + $save_content_url = $this->Application->HREF('index', ADMIN_DIRECTORY, $url_params, 'index.php'); + $page =& $this->_getPage($params); $page_helper = $this->Application->recallObject('PageHelper'); /* @var $page_helper PageHelper */ $class_params = Array ( + 'languagePrefix' => 'l' . $this->Application->GetVar('m_lang') . '_', 'pageId' => $page->GetID(), 'pageInfo' => $page->isLoaded() ? $page_helper->getPageInfo( $page->GetID() ) : Array (), 'editUrl' => $edit_template_url, 'browseUrl' => $this->Application->HREF('', '', Array ('editing_mode' => '#EDITING_MODE#', '__NO_REWRITE__' => 1)), 'saveLayoutUrl' => $save_layout_url, + 'saveContentUrl' => $save_content_url, 'editingMode' => (int)EDITING_MODE, ); @@ -1652,18 +1680,13 @@ $revision = $this->Application->recallObject('page-revision.current'); /* @var $revision kDBItem */ - if ( !$revision->GetDBField('IsDraft') ) { - $edit_code .= $tabs . 'a_toolbar.DisableButton("select");' . $tabs . 'a_toolbar.DisableButton("delete");' . $tabs . 'a_toolbar.DisableButton("preview");'; - } + $page_helper = $this->Application->recallObject('PageHelper'); + /* @var $page_helper PageHelper */ - if ( $revision->GetDBField('Status') == STATUS_ACTIVE || $revision->GetDBField('IsDraft') ) { - $edit_code .= $tabs . 'a_toolbar.DisableButton("approve");'; + foreach ( $page_helper->getToolbarButtonsState($revision) as $toolbar_button => $is_enabled ) { + $edit_code .= $tabs . 'a_toolbar.SetEnabled("' . $toolbar_button . '", ' . json_encode($is_enabled) . ');'; } - if ( $revision->GetDBField('Status') == STATUS_DISABLED || $revision->GetDBField('IsLive') || $revision->GetDBField('IsDraft') ) { - $edit_code .= $tabs . 'a_toolbar.DisableButton("decline");'; - } - $publishing_tools = $this->Application->Phrase('la_btn_PublishingTools', false, true); $edit_code .= substr($tabs, 0, -1) . ' @@ -1732,9 +1755,10 @@ function toolbarButton($name, $title, $tabs) { - $phrase = $this->Application->Phrase($title, false, true); + $action = 'function() { aTemplateManager.revisionToolbarClick("' . $name . '"); }'; + $phrase = kUtil::escape($this->Application->Phrase($title, false, true), kUtil::ESCAPE_HTML . '+' . kUtil::ESCAPE_JS); - return $tabs . 'a_toolbar.AddButton( new ToolBarButton("' . $name . '", "' . kUtil::escape($phrase, kUtil::ESCAPE_HTML . '+' . kUtil::ESCAPE_JS) . '") );'; + return $tabs . 'a_toolbar.AddButton(new ToolBarButton("' . $name . '", "' . $phrase . '", ' . $action . '));'; } function _getThemeFileId()