Index: core/units/helpers/fck_helper.php =================================================================== --- core/units/helpers/fck_helper.php +++ core/units/helpers/fck_helper.php @@ -514,6 +514,13 @@ $editor->config[$param_key] = $param_value; } + + if ( isset($editor->config['styleSetName']) ) { + $style_set_parts = explode(':', $editor->config['stylesSet']); + $style_set_parts[0] = $editor->config['styleSetName']; + $editor->config['stylesSet'] = implode(':', $style_set_parts); + unset($editor->config['styleSetName']); + } } /** @@ -604,17 +611,18 @@ } /** - * Returns transit parameters, that should be passed to every used CKEditor instance + * Returns transit parameters, that should be passed to every used CKEditor instance. * - * @param Array $tag_params - * @return Array + * @param array $tag_params Tag params. + * + * @return array */ - public function getTransitParams($tag_params = Array ()) + public function getTransitParams(array $tag_params = array()) { - $ret = Array (); - $transit_params = Array ('bgcolor' => '', 'body_class' => '', 'body_id' => ''); + $ret = array(); + $transit_params = array('bgcolor' => '', 'body_class' => '', 'body_id' => '', 'style_set_name' => 'portal'); - foreach ($transit_params as $param_name => $default_value) { + foreach ( $transit_params as $param_name => $default_value ) { $param_value = isset($tag_params[$param_name]) ? $tag_params[$param_name] : $this->Application->GetVar($param_name); if ( $param_value || $default_value ) { Index: themes/advanced/index.tpl =================================================================== --- themes/advanced/index.tpl +++ themes/advanced/index.tpl @@ -41,7 +41,7 @@ - +
@@ -55,4 +55,4 @@ - \ No newline at end of file + Index: themes/advanced/platform/inc/styles.js =================================================================== --- themes/advanced/platform/inc/styles.js +++ themes/advanced/platform/inc/styles.js @@ -46,3 +46,13 @@ } ] ); + +CKEDITOR.stylesSet.add( 'my_styles', [ + // Block-level styles + { name: 'Blue Title', element: 'h2', styles: { 'color': 'Blue' } }, + { name: 'Red Title' , element: 'h3', styles: { 'color': 'Red' } }, + + // Inline styles + { name: 'CSS Style', element: 'span', attributes: { 'class': 'my_style' } }, + { name: 'Marker: Yellow', element: 'span', styles: { 'background-color': 'Yellow' } } +] );