Commit b0c2c1bf authored by Lisa Seeto's avatar Lisa Seeto
Browse files

Bug 1847005: More skin font options for new header



- added block heading settings options and headings on text tab page

behatnotneeded

Change-Id: Ibb949f9508a2e4fb7e47bf809c0d44801498c00b
Signed-off-by: default avatarLisa Seeto <lisaseeto@catalyst.net.nz>
parent 09b45db2
......@@ -16,7 +16,12 @@ $string['pluginname'] = 'Skin';
$string['myskins'] = 'Skins';
$string['siteskinmenu'] = 'Skins';
$string['header'] = 'Header';
$string['blockheading'] = 'Block heading';
$string['themedefault'] = 'Theme default';
$string['blockheaderfontfamily'] = 'Block header font';
$string['blockheaderfontcolor'] = 'Block header font color';
$string['headerbackgroundcolor'] = 'Header background colour';
$string['headerbackgroundcolordescription'] = 'Background color for page header - this will not show if a header image has been selected';
$string['headerbackgroundimage'] = 'Header background image';
......
......@@ -27,7 +27,7 @@ function pieform_element_color(Pieform $form, $element) {
$value = Pieform::hsc($form->get_value($element));
$themedefault = (!empty($element['options']['themedefault'])) ? $element['options']['themedefault'] : '';
// Transparency optional control
// Theme default checkbox optional control
if ($themedefault) {
$optional = <<<EOF
<script>
......
......@@ -276,6 +276,7 @@ if (!isset($themelinkcolor)) {
$themetextcolor = isset($THEME->themetextcolor) ? $THEME->themetextcolor : '#333333'; // $view_text_font_color
$themeemphasizedtextcolor = isset($THEME->themeemphasizedtextcolor) ? $THEME->themeemphasizedtextcolor : '#333333'; // $view_text_emphasized_color
$themefocusedlinkcolor = isset($THEME->themefocusedlinkcolor) ? $THEME->themefocusedlinkcolor : '#475c2a'; // $view_link_hover_color
$themeblockheadingfontcolor = '#FFFFFF'; // $theme-block-header-color
// Text
$elements['viewcontent'] = array(
......@@ -283,93 +284,125 @@ $elements['viewcontent'] = array(
'legend' => get_string('sampletext', 'skin'),
'class' => $fieldset != 'viewcontent' ? 'collapsed' : '',
'elements' => array(
'view_heading_font_family' => array(
'type' => 'select',
'title' => get_string('headingfontfamily', 'skin'),
'defaultvalue' => (!empty($viewskin['view_heading_font_family']) ? $viewskin['view_heading_font_family'] : '' ),
'width' => 144,
'options' => $headerfontoptions
),
'view_text_heading_color' => array(
'type' => 'color',
'title' => get_string('headingcolor', 'skin'),
'description' => get_string('headingcolordescription', 'skin'),
'defaultvalue' => (!empty($viewskin['view_text_heading_color']) ? $viewskin['view_text_heading_color'] : $themeheadingcolor),
'size' => 7,
'options' => array(
'themedefault' => $themeheadingcolor,
),
),
'view_text_font_family' => array(
'type' => 'select',
'title' => get_string('textfontfamily', 'skin'),
'defaultvalue' => (!empty($viewskin['view_text_font_family']) ? $viewskin['view_text_font_family'] : ''),
'width' => 144,
'options' => $fontoptions
),
'view_text_font_size' => array(
'type' => 'select',
'title' => get_string('fontsize', 'skin'),
'defaultvalue' => (!empty($viewskin['view_text_font_size']) ? $viewskin['view_text_font_size'] : 'small'),
'width' => 144,
'options' => array(
'xx-small' => array('value' => get_string('fontsizesmallest', 'skin'), 'style' => 'font-size: xx-small;'),
'x-small' => array('value' => get_string('fontsizesmaller', 'skin'), 'style' => 'font-size: x-small;'),
'small' => array('value' => get_string('fontsizesmall', 'skin'), 'style' => 'font-size: small;'),
'medium' => array('value' => get_string('fontsizemedium', 'skin'), 'style' => 'font-size: medium;'),
'large' => array('value' => get_string('fontsizelarge', 'skin'), 'style' => 'font-size: large;'),
'x-large' => array('value' => get_string('fontsizelarger', 'skin'), 'style' => 'font-size: x-large;'),
'xx-large' => array('value' => get_string('fontsizelargest', 'skin'), 'style' => 'font-size: xx-large;'),
),
),
'view_text_font_color' => array(
'type' => 'color',
'title' => get_string('textcolor', 'skin'),
'description' => get_string('textcolordescription', 'skin'),
'defaultvalue' => (!empty($viewskin['view_text_font_color']) ? $viewskin['view_text_font_color'] : $themetextcolor),
'size' => 7,
'options' => array(
'themedefault' => $themetextcolor,
),
),
'view_text_emphasized_color' => array(
'type' => 'color',
'title' => get_string('emphasizedcolor', 'skin'),
'description' => get_string('emphasizedcolordescription', 'skin'),
'defaultvalue' => (!empty($viewskin['view_text_emphasized_color']) ? $viewskin['view_text_emphasized_color'] : $themeemphasizedtextcolor),
'size' => 7,
'options' => array(
'themedefault' => $themeemphasizedtextcolor,
),
),
'view_link_normal_color' => array(
'type' => 'color',
'title' => get_string('normallinkcolor', 'skin'),
'defaultvalue' => (!empty($viewskin['view_link_normal_color']) ? $viewskin['view_link_normal_color'] : $themelinkcolor),
'size' => 7,
'options' => array(
'themedefault' => $themelinkcolor,
),
),
'view_link_normal_underline' => array(
'type' => 'switchbox',
'title' => get_string('linkunderlined', 'skin'),
'defaultvalue' => (isset($viewskin['view_link_normal_underline']) and intval($viewskin['view_link_normal_underline']) == 1 ? 'checked' : ''),
),
'view_link_hover_color' => array(
'type' => 'color',
'title' => get_string('hoverlinkcolor', 'skin'),
'defaultvalue' => (!empty($viewskin['view_link_hover_color']) ? $viewskin['view_link_hover_color'] : $themefocusedlinkcolor),
'size' => 7,
'options' => array(
'themedefault' => $themefocusedlinkcolor,
),
),
'view_link_hover_underline' => array(
'type' => 'switchbox',
'title' => get_string('linkunderlined', 'skin'),
'defaultvalue' => (isset($viewskin['view_link_hover_underline']) and intval($viewskin['view_link_hover_underline']) == 1 ? 'checked' : ''),
'header_title' => array(
'type' => 'html',
'value' => '<h4>' . get_string('header', 'skin') .'</h4>',
'class' => 'title card-header',
),
'view_heading_font_family' => array(
'type' => 'select',
'title' => get_string('headingfontfamily', 'skin'),
'defaultvalue' => (!empty($viewskin['view_heading_font_family']) ? $viewskin['view_heading_font_family'] : '' ),
'width' => 144,
'options' => $headerfontoptions
),
'view_text_heading_color' => array(
'type' => 'color',
'title' => get_string('headingcolor', 'skin'),
'description' => get_string('headingcolordescription', 'skin'),
'defaultvalue' => (!empty($viewskin['view_text_heading_color']) ? $viewskin['view_text_heading_color'] : $themeheadingcolor),
'size' => 7,
'options' => array(
'themedefault' => $themeheadingcolor,
),
),
'block_header_title' => array(
'type' => 'html',
'value' => '<h4>' . get_string('blockheading', 'skin') .'</h4>',
'class' => 'title card-header',
),
'view_block_header_font' => array(
'type' => 'select',
'title' => get_string('blockheaderfontfamily', 'skin'),
'defaultvalue' => (!empty($viewskin['view_block_header_font']) ? $viewskin['view_block_header_font'] : ''),
'width' => 144,
'options' => $fontoptions
),
'view_block_header_font_color' => array(
'type' => 'color',
'title' => get_string('blockheaderfontcolor', 'skin'),
'defaultvalue' => (!empty($viewskin['view_block_header_font_color']) ? $viewskin['view_block_header_font_color'] : $themeblockheadingfontcolor),
'size' => 7,
'options' => array(
'themedefault' => $themeblockheadingfontcolor,
),
),
'content_title' => array(
'type' => 'html',
'value' => '<h4>' . get_string('content', 'mahara') .'</h4>',
'class' => 'title card-header',
),
'view_text_font_family' => array(
'type' => 'select',
'title' => get_string('textfontfamily', 'skin'),
'defaultvalue' => (!empty($viewskin['view_text_font_family']) ? $viewskin['view_text_font_family'] : ''),
'width' => 144,
'options' => $fontoptions
),
'view_text_font_size' => array(
'type' => 'select',
'title' => get_string('fontsize', 'skin'),
'defaultvalue' => (!empty($viewskin['view_text_font_size']) ? $viewskin['view_text_font_size'] : 'small'),
'width' => 144,
'options' => array(
'xx-small' => array('value' => get_string('fontsizesmallest', 'skin'), 'style' => 'font-size: xx-small;'),
'x-small' => array('value' => get_string('fontsizesmaller', 'skin'), 'style' => 'font-size: x-small;'),
'small' => array('value' => get_string('fontsizesmall', 'skin'), 'style' => 'font-size: small;'),
'medium' => array('value' => get_string('fontsizemedium', 'skin'), 'style' => 'font-size: medium;'),
'large' => array('value' => get_string('fontsizelarge', 'skin'), 'style' => 'font-size: large;'),
'x-large' => array('value' => get_string('fontsizelarger', 'skin'), 'style' => 'font-size: x-large;'),
'xx-large' => array('value' => get_string('fontsizelargest', 'skin'), 'style' => 'font-size: xx-large;'),
),
),
'view_text_font_color' => array(
'type' => 'color',
'title' => get_string('textcolor', 'skin'),
'description' => get_string('textcolordescription', 'skin'),
'defaultvalue' => (!empty($viewskin['view_text_font_color']) ? $viewskin['view_text_font_color'] : $themetextcolor),
'size' => 7,
'options' => array(
'themedefault' => $themetextcolor,
),
),
'view_text_emphasized_color' => array(
'type' => 'color',
'title' => get_string('emphasizedcolor', 'skin'),
'description' => get_string('emphasizedcolordescription', 'skin'),
'defaultvalue' => (!empty($viewskin['view_text_emphasized_color']) ? $viewskin['view_text_emphasized_color'] : $themeemphasizedtextcolor),
'size' => 7,
'options' => array(
'themedefault' => $themeemphasizedtextcolor,
),
),
'view_link_normal_color' => array(
'type' => 'color',
'title' => get_string('normallinkcolor', 'skin'),
'defaultvalue' => (!empty($viewskin['view_link_normal_color']) ? $viewskin['view_link_normal_color'] : $themelinkcolor),
'size' => 7,
'options' => array(
'themedefault' => $themelinkcolor,
),
),
'view_link_normal_underline' => array(
'type' => 'switchbox',
'title' => get_string('linkunderlined', 'skin'),
'defaultvalue' => (isset($viewskin['view_link_normal_underline']) and intval($viewskin['view_link_normal_underline']) == 1 ? 'checked' : ''),
),
'view_link_hover_color' => array(
'type' => 'color',
'title' => get_string('hoverlinkcolor', 'skin'),
'defaultvalue' => (!empty($viewskin['view_link_hover_color']) ? $viewskin['view_link_hover_color'] : $themefocusedlinkcolor),
'size' => 7,
'options' => array(
'themedefault' => $themefocusedlinkcolor,
),
),
'view_link_hover_underline' => array(
'type' => 'switchbox',
'title' => get_string('linkunderlined', 'skin'),
'defaultvalue' => (isset($viewskin['view_link_hover_underline']) and intval($viewskin['view_link_hover_underline']) == 1 ? 'checked' : ''),
),
),
);
$elements['viewadvanced'] = array(
......@@ -496,6 +529,8 @@ function designskinform_submit(Pieform $form, $values) {
$skin['body_background_attachment'] = $values['body_background_attachment'];
$skin['body_background_position'] = $values['body_background_position'];
}
$skin['view_block_header_font'] = $values['view_block_header_font'];
$skin['view_block_header_font_color'] = $values['view_block_header_font_color'];
$skin['view_text_font_family'] = $values['view_text_font_family'];
$skin['view_heading_font_family'] = $values['view_heading_font_family'];
$skin['view_text_font_size'] = $values['view_text_font_size'];
......
......@@ -79,6 +79,8 @@ $smarty->assign('view_text_font_family', Skin::get_css_font_family_from_font_nam
$smarty->assign('tabs_height', Skin::get_tabs_height_from_font_name($skin->viewskin['view_text_font_family'])); // TODO remove this
$smarty->assign('view_heading_font_face', Skin::get_css_font_face_from_font_name($skin->viewskin['view_heading_font_family']));
$smarty->assign('view_heading_font_family', Skin::get_css_font_family_from_font_name($skin->viewskin['view_heading_font_family'], 'heading'));
$smarty->assign('view_block_header_font', Skin::get_css_font_family_from_font_name($skin->viewskin['view_block_header_font']));
$smarty->assign('view_block_header_font_color', $skin->viewskin['view_block_header_font_color']);
$smarty->assign('view_text_font_size', $skin->viewskin['view_text_font_size']);
$smarty->assign('view_text_font_color', $skin->viewskin['view_text_font_color']);
$smarty->assign('view_text_heading_color', $skin->viewskin['view_text_heading_color']);
......
......@@ -91,6 +91,11 @@ body > .main-content > .row {
/* blocks */
.user-page-content .block-header a {
color: {$view_block_header_font_color};
font-family: {$view_block_header_font|safe};
}
.user-page-content .card .title:not(.feedtitle) {
font-weight: bold;
color: {$view_text_emphasized_color};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment