Page MenuHomeIn-Portal Phabricator

D204.id496.diff
No OneTemporary

File Metadata

Created
Wed, Feb 26, 9:05 AM

D204.id496.diff

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 @@
<inp2:m_phrase name="lu_title_WelcomeTitle"/>
</inp2:m_Capture>
- <inp2:st_ContentBlock num="1"/>
+ <inp2:st_ContentBlock num="1" mode="inline"/>
</inp2:m_RenderElement>
</div>
<div class="movable-element">
@@ -55,4 +55,4 @@
<!--## DESIGN TEMPLATE ##-->
<inp2:m_include template="platform/designs/default_design.des" pass_params="1"/>
-<!--## /DESIGN TEMPLATE ##-->
\ No newline at end of file
+<!--## /DESIGN TEMPLATE ##-->
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' } }
+] );

Event Timeline