Commit 4e390a5b authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Merge "WIP remove unused skins features from codebase"

parents 08134bb1 78374cb0
......@@ -66,20 +66,20 @@ class Skin {
'body_background_attachment' => 'scroll',
'body_background_position' => 1,
'header_background_color' => '#DDDDDD',
'header_text_font_color' => '#000000',
'header_link_normal_color' => '#000000',
'header_link_normal_underline' => true,
'header_link_hover_color' => '#808080',
'header_link_hover_underline' => true,
'header_logo_image' => 'normal',
'view_background_color' => '#FFFFFF',
'view_background_image' => 0,
'view_background_repeat' => 4,
'view_background_attachment' => 'scroll',
'view_background_position' => 1,
'view_background_width' => 80,
'header_background_color' => '#DDDDDD', // TODO remove this
'header_text_font_color' => '#000000', // TODO remove this
'header_link_normal_color' => '#000000', // TODO remove this
'header_link_normal_underline' => true, // TODO remove this
'header_link_hover_color' => '#808080', // TODO remove this
'header_link_hover_underline' => true, // TODO remove this
'header_logo_image' => 'normal', // TODO remove this
'view_background_color' => '#FFFFFF', // TODO remove this
'view_background_image' => 0, // TODO remove this
'view_background_repeat' => 4, // TODO remove this
'view_background_attachment' => 'scroll', // TODO remove this
'view_background_position' => 1, // TODO remove this
'view_background_width' => 80, // TODO remove this
'view_text_font_family' => 'Arial',
'view_heading_font_family' => 'Arial',
......@@ -93,15 +93,15 @@ class Skin {
'view_link_hover_color' => '##551A8B',
'view_link_hover_underline' => true,
'view_table_border_color' => '#CCCCCC',
'view_table_header_color' => '#CCCCCC',
'view_table_header_text_color' => '#000000',
'view_table_odd_row_color' => '#EEEEEE',
'view_table_even_row_color' => '#FFFFFF',
'view_table_border_color' => '#CCCCCC', // TODO remove this
'view_table_header_color' => '#CCCCCC', // TODO remove this
'view_table_header_text_color' => '#000000', // TODO remove this
'view_table_odd_row_color' => '#EEEEEE', // TODO remove this
'view_table_even_row_color' => '#FFFFFF', // TODO remove this
'view_button_normal_color' => '#DDDDDD',
'view_button_hover_color' => '#CCCCCC',
'view_button_text_color' => '#000000',
'view_button_normal_color' => '#DDDDDD', // TODO remove this
'view_button_hover_color' => '#CCCCCC', // TODO remove this
'view_button_text_color' => '#000000', // TODO remove this
'view_custom_css' => '',
);
......@@ -655,6 +655,7 @@ class Skin {
}
// TODO remove this - collection nav isn't tabs any more
/**
* Get the height to use for tabs, based on which font is selected. (For unknown faults we just deault to 25px)
* TODO: It would be good to provide a way for sites to provide the heights of further types of fonts. Perhaps
......@@ -953,7 +954,7 @@ class Skin {
self::imagebackgroundfill($img, $bodybackgroundfill, Skin::PREVIEW_THUMBNAIL_ZOOM, intval($skin['body_background_repeat']), intval($skin['body_background_position']));
}
// ========== VIEW BACKGROUND COLOR ==========
// ========== VIEW BACKGROUND COLOR ========== // TODO remove this
$viewwidth = Skin::PREVIEW_WIDTH-intval(((100 - $skin['view_background_width']) / 100) * Skin::PREVIEW_WIDTH);
$viewheight = Skin::PREVIEW_HEIGHT;
......@@ -972,7 +973,7 @@ class Skin {
imagefill($img2, 0, 0, $transparentcolor);
}
/* ========== VIEW BACKGROUND IMAGE ========== */
/* ========== VIEW BACKGROUND IMAGE ========== */ // TODO remove this
if ($skin['view_background_image'] <> null) {
require_once(get_config('docroot') . 'artefact/file/lib.php');
$fileid = $skin['view_background_image'];
......@@ -1075,7 +1076,7 @@ class Skin {
if (isset($viewskin['body_background_image']) && $viewskin['body_background_image'] == $aid) {
$viewskin['body_background_image'] = 0;
}
if (isset($viewskin['view_background_image']) && $viewskin['view_background_image'] == $aid) {
if (isset($viewskin['view_background_image']) && $viewskin['view_background_image'] == $aid) { // TODO remove this
$viewskin['view_background_image'] = 0;
}
$skin->set('viewskin', $viewskin);
......
......@@ -55,7 +55,7 @@ if ($id > 0) {
$viewskin['body_background_image'] = false;
}
}
if (!empty($viewskin['view_background_image'])) {
if (!empty($viewskin['view_background_image'])) { // TODO remove this
if (!record_exists('artefact', 'id', $viewskin['view_background_image'])) {
$viewskin['view_background_image'] = false;
}
......@@ -207,7 +207,7 @@ if (!$designsiteskin) {
)
));
}
$elements['viewbg'] = array(
$elements['viewbg'] = array( // TODO remove this
'type' => 'fieldset',
'legend' => get_string('viewbackgroundoptions', 'skin'),
'class' => 'hidden',
......@@ -223,7 +223,7 @@ $elements['viewbg'] = array(
)
)
);
if (!$designsiteskin) {
if (!$designsiteskin) { // TODO remove this
$elements['viewbg']['elements'] = array_merge($elements['viewbg']['elements'], array(
'view_background_image' => array(
'type' => 'filebrowser',
......@@ -293,7 +293,7 @@ if (!$designsiteskin) {
),
));
}
$elements['viewheader'] = array(
$elements['viewheader'] = array( // TODO remove this
'type' => 'fieldset',
'legend' => get_string('viewheaderoptions', 'skin'),
'class' => 'hidden',
......@@ -452,7 +452,7 @@ $elements['viewcontent'] = array(
),
),
);
$elements['viewtable'] = array(
$elements['viewtable'] = array( // TODO remove this
'type' => 'fieldset',
'legend' => get_string('viewtableoptions', 'skin'),
'class' => 'hidden',
......@@ -624,15 +624,15 @@ function designskinform_submit(Pieform $form, $values) {
$skin['body_background_attachment'] = $values['body_background_attachment'];
$skin['body_background_position'] = $values['body_background_position'];
}
$skin['header_background_color'] = $values['header_background_color'];
$skin['header_text_font_color'] = $values['header_text_font_color'];
$skin['header_link_normal_color'] = $values['header_link_normal_color'];
$skin['header_link_normal_underline'] = $values['header_link_normal_underline'];
$skin['header_link_hover_color'] = $values['header_link_hover_color'];
$skin['header_link_hover_underline'] = $values['header_link_hover_underline'];
$skin['header_logo_image'] = $values['header_logo_image'];
$skin['view_background_color'] = $values['view_background_color'];
if (!$siteskin) {
$skin['header_background_color'] = $values['header_background_color']; // TODO remove this
$skin['header_text_font_color'] = $values['header_text_font_color']; // TODO remove this
$skin['header_link_normal_color'] = $values['header_link_normal_color']; // TODO remove this
$skin['header_link_normal_underline'] = $values['header_link_normal_underline']; // TODO remove this
$skin['header_link_hover_color'] = $values['header_link_hover_color']; // TODO remove this
$skin['header_link_hover_underline'] = $values['header_link_hover_underline']; // TODO remove this
$skin['header_logo_image'] = $values['header_logo_image']; // TODO remove this
$skin['view_background_color'] = $values['view_background_color']; // TODO remove this
if (!$siteskin) { // TODO remove this
$skin['view_background_image'] = $values['view_background_image'];
$skin['view_background_repeat'] = $values['view_background_repeat'];
$skin['view_background_attachment'] = $values['view_background_attachment'];
......@@ -649,14 +649,14 @@ function designskinform_submit(Pieform $form, $values) {
$skin['view_link_normal_underline'] = $values['view_link_normal_underline'];
$skin['view_link_hover_color'] = $values['view_link_hover_color'];
$skin['view_link_hover_underline'] = $values['view_link_hover_underline'];
$skin['view_table_border_color'] = $values['view_table_border_color'];
$skin['view_table_header_color'] = $values['view_table_header_color'];
$skin['view_table_header_text_color'] = $values['view_table_header_text_color'];
$skin['view_table_odd_row_color'] = $values['view_table_odd_row_color'];
$skin['view_table_even_row_color'] = $values['view_table_even_row_color'];
$skin['view_button_normal_color'] = $values['view_button_normal_color'];
$skin['view_button_hover_color'] = $values['view_button_hover_color'];
$skin['view_button_text_color'] = $values['view_button_text_color'];
$skin['view_table_border_color'] = $values['view_table_border_color']; // TODO remove this
$skin['view_table_header_color'] = $values['view_table_header_color']; // TODO remove this
$skin['view_table_header_text_color'] = $values['view_table_header_text_color']; // TODO remove this
$skin['view_table_odd_row_color'] = $values['view_table_odd_row_color']; // TODO remove this
$skin['view_table_even_row_color'] = $values['view_table_even_row_color']; // TODO remove this
$skin['view_button_normal_color'] = $values['view_button_normal_color']; // TODO remove this
$skin['view_button_hover_color'] = $values['view_button_hover_color']; // TODO remove this
$skin['view_button_text_color'] = $values['view_button_text_color']; // TODO remove this
$skin['view_custom_css'] = clean_css($values['view_custom_css'], $preserve_css=true);
$viewskin = array();
......
......@@ -73,7 +73,7 @@ if (!empty($exportskins)) {
$itemnode->setAttribute('background-attachment', $viewskin['body_background_attachment']);
$itemnode->setAttribute('background-position', Skin::background_position_number_to_value($viewskin['body_background_position']));
// Header element...
// Header element... // TODO remove this
$childelement = $xmldoc->createElement('header');
$itemnode = $rootelement->appendChild($childelement);
$itemnode->setAttribute('background-color', $viewskin['header_background_color']);
......@@ -94,7 +94,7 @@ if (!empty($exportskins)) {
}
$itemnode->setAttribute('logo-image', $viewskin['header_logo_image']);
// View (page) element...
// View (page) element... // TODO remove this
$childelement = $xmldoc->createElement('view');
$itemnode = $rootelement->appendChild($childelement);
$itemnode->setAttribute('background-color', $viewskin['view_background_color']);
......@@ -131,7 +131,7 @@ if (!empty($exportskins)) {
$itemnode->setAttribute('hover-decoration', 'underline');
}
// Table element...
// Table element... // TODO remove this
$childelement = $xmldoc->createElement('table');
$itemnode = $rootelement->appendChild($childelement);
$itemnode->setAttribute('border-color', $viewskin['view_table_border_color']);
......@@ -165,7 +165,7 @@ if (!empty($exportskins)) {
}
}
// Page background image element...
// Page background image element... // TODO remove this
$viewbg = $viewskin['view_background_image'];
if (!empty($viewbg) && $viewbg > 0) {
// Get existing page background image data...
......
......@@ -122,7 +122,7 @@ function importskinform_submit(Pieform $form, $values) {
$skin = array_merge($skin, array('body_background_position' => Skin::background_position_value_to_number($item->getAttribute('background-position'))));
}
// Header element...
// Header element... // TODO remove this
$items = $skindata->getElementsByTagName('header');
foreach ($items as $item) {
$skin = array_merge($skin, array('header_background_color' => $item->getAttribute('background-color')));
......@@ -144,7 +144,7 @@ function importskinform_submit(Pieform $form, $values) {
$skin = array_merge($skin, array('header_logo_image' => $item->getAttribute('logo-image')));
}
// View element...
// View element... // TODO remove this
$items = $skindata->getElementsByTagName('view');
foreach ($items as $item) {
$skin = array_merge($skin, array('view_background_color' => $item->getAttribute('background-color')));
......@@ -186,7 +186,7 @@ function importskinform_submit(Pieform $form, $values) {
}
}
// Table element...
// Table element... // TODO remove this
$items = $skindata->getElementsByTagName('table');
foreach ($items as $item) {
$skin = array_merge($skin, array('view_table_border_color' => $item->getAttribute('border-color')));
......@@ -252,7 +252,7 @@ function importskinform_submit(Pieform $form, $values) {
if ($type == 'body-background-image') {
$skin['body_background_image'] = $id;
}
if ($type == 'view-background-image') {
if ($type == 'view-background-image') { // TODO remove this
$skin['view_background_image'] = $id;
}
}
......
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