Skip to content

Commit

Permalink
Add support for user-selected override themes
Browse files Browse the repository at this point in the history
Add highcontrast and highcontrast_dark themes
  • Loading branch information
drlippman committed Apr 28, 2015
1 parent 0159a83 commit 66013bd
Show file tree
Hide file tree
Showing 8 changed files with 529 additions and 3 deletions.
3 changes: 2 additions & 1 deletion actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,8 @@
} else {
$chguserimg = '';
}
$query = "UPDATE imas_users SET FirstName='{$_POST['firstname']}',LastName='{$_POST['lastname']}',email='{$_POST['email']}',msgnotify=$msgnot,qrightsdef=$qrightsdef,deflib='$deflib',usedeflib='$usedeflib',homelayout='$layoutstr',listperpage='$perpage'$chguserimg ";
$_POST['theme'] = str_replace(array('/','..'), '', $_POST['theme']);
$query = "UPDATE imas_users SET FirstName='{$_POST['firstname']}',LastName='{$_POST['lastname']}',email='{$_POST['email']}',msgnotify=$msgnot,qrightsdef=$qrightsdef,deflib='$deflib',usedeflib='$usedeflib',homelayout='$layoutstr',theme='{$_POST['theme']}',listperpage='$perpage'$chguserimg ";
$query .= "WHERE id='$userid'";
mysql_query($query) or die("Query failed : " . mysql_error());

Expand Down
3 changes: 3 additions & 0 deletions assessment/showtest.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,9 @@
$sessiondata['courseid'] = intval($_GET['cid']);
$sessiondata['coursename'] = mysql_result($result,0,0);
$sessiondata['coursetheme'] = mysql_result($result,0,1);
if (isset($usertheme) && $usertheme!='') {
$sessiondata['coursetheme'] = $usertheme;
}
$sessiondata['coursetopbar'] = mysql_result($result,0,2);
$sessiondata['msgqtoinstr'] = (floor( mysql_result($result,0,3)/5))&2;
$sessiondata['coursetoolset'] = mysql_result($result,0,4);
Expand Down
1 change: 1 addition & 0 deletions dbsetup.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
. ' `homelayout` VARCHAR(32) NOT NULL DEFAULT \'|0,1,2||0,1\','
. ' `hasuserimg` TINYINT(1) UNSIGNED NOT NULL DEFAULT \'0\','
. ' `remoteaccess` VARCHAR(10) NOT NULL DEFAULT \'\', '
. ' `theme` VARCHAR(32) NOT NULL DEFAULT \'\', '
. ' `listperpage` TINYINT(3) UNSIGNED NOT NULL DEFAULT \'20\', '
. ' `hideonpostswidget` TEXT NOT NULL, '
. ' INDEX (`lastaccess`), INDEX (`rights`), '
Expand Down
13 changes: 13 additions & 0 deletions forms.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,19 @@
echo '</span><br class="form" />';

}
echo '<span class="form">'._('Overwrite default course theme on all pages:').'</span><span class="formright">';
echo '<select name="theme">';
echo '<option value="" '.($line['theme']==''?'selected':'').'>'._('Use course default theme').'</option>';
if (isset($CFG['GEN']['stuthemes'])) {
foreach ($CFG['GEN']['stuthemes'] as $k=>$v) {
echo '<option value="'.$k.'" '.($line['theme']==$k?'selected':'').'>'._($v).'</option>';
}
} else {
echo '<option value="highcontrast.css" '.($line['theme']=='highcontrast.css'?'selected':'').'>'._('High contrast, dark on light').'</option>';
echo '<option value="highcontrast_dark.css" '.($line['theme']=='highcontrast_dark.css'?'selected':'').'>'._('High contrast, light on dark').'</option>';
}
echo '</select><br class="form" />';

if (isset($CFG['GEN']['translatewidgetID'])) {
echo '<span class="form">Attempt to translate pages into another language:</span>';
echo '<span class="formright">';
Expand Down
241 changes: 241 additions & 0 deletions themes/highcontrast.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,241 @@
/*General settings - fonts, overall page background, etc*/
body {
font-family: "Trebuchet MS", "Arial", "Helvetica", sans-serif;
font-size: 90%;
}

/*Link styles*/
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}

/*Container for course items*/
div.item {
/*border: 1px solid #000;*/
background-color: #fff;
}

/*Container for editor*/
div.editor {
border: 1px solid #000;
}

/*Default block container*/
div.block, div.blockitems div.blockitems div.block {
border: 1px solid #ddf;
background-color: #fff;
}

/*Default block item container*/
div.blockitems, div.blockitems div.blockitems div.blockitems {
border: 1px solid #eef;
border-top: 0px;
background-color: #fff;
}

/*Second level default block container*/
div.blockitems div.block {
border: 1px solid #dfd;
background-color: #fff;
}

/*Second level default block item container */
div.blockitems div.blockitems {
border: 1px solid #efe;
border-top: 0px;
background-color: #fff;
}

/*Icons*/
div.icon {
color:#00d;
border: 1px solid #00f;
font-weight: bolder;
}

/*Breadcrumb bar*/
div.breadcrumb {
border: 1px solid #ddddff;
background-color: #fff;
}

/*Control panels*/
div.cp {
border: 1px solid #ddd;
background-color: #fff;
}
div.cpmid {
border: 1px solid #ddd;
background-color: #fff;
}




table thead th {
font-weight:bold;
cursor:pointer;
}

/*Tables */
table.gb thead th, table.gbl thead th, table.gbl thead th.locked {
border-bottom: 2px solid #00f;
background-color: #fff;
}
tr.even {
background-color: #fff;
}
tr.odd {
background-color: #efe;
}
tr.bordered td {
border-top: 1px solid #000;
border-bottom: 1px solid #000;
}
tr.highlight {
background-color: #ddf;
}
tr.grid td {
border: 1px solid #000;
}
tr.dbltop td {
border-top: 3px double #000;
}

table.gbl td.locked, table.gbl th.locked {
border-right: 2px solid #00f;
}

/*Category header colors*/
table.gb .catdf {
background-color: #eef;
}
table.gb .cat0 {
background-color: #ddf;
}
table.gb .cat1 {
background-color: #dfd;
}
table.gb .cat2 {
background-color: #fdd;
}
table.gb .cat3 {
background-color: #dff;
}
table.gb .cat4 {
background-color: #ffd;
}
table.gb .cat5 {
background-color: #fdf;
}
table.gb .cat6 {
background-color: #aaf;
}
table.gb .cat7 {
background-color: #afa;
}
table.gb .cat8 {
background-color: #faa;
}
table.gb .cat9 {
background-color: #aff;
}
.cattothdr {
font-variant: small-caps
}

/*Fake look of links for Javascript onclicks*/
span.link {
text-decoration: underline;
color: #00f;
cursor: pointer;
}


/*Containers for instructor leftbar, main content*/
#leftcontent {
background:#fff;
border:1px solid #ddd;
color:#000;
}

#centercontent {
background:#fff;
}

div.ddmenu {
padding: 5px;
background: #eeffee;
}

/*colors and borders for assessments*/
/*seq question css*/
div.curquestion {

}
div.inactive {
border: 1px solid #bbd;
}
div.prequestion {
border: 1px solid #bbd;
}
hr.seq {

}
div.seqqinfocur {

}
div.seqqinfocur span.current{

}
div.seqqinfoavail {

}
div.seqqinfoinactive {

}
div.todoquestion {
background-color: #ffffcc;
border: 0px;
}
/*all questions*/
div.question {
background-color: #fff;
border: 1px solid #bbd;
}


div.review { /*info bar*/
margin-top: -6px;
background-color: #fff;
border: 1px solid #bbd;
}
div.intro {
border: 0px;
background-color: #fff;
}
div.navbar {
background:#fff;
border: 1px solid #bbb;
color:#000;
}
div.navbar a {
color: blue;
}
span.current {
background-color: #ffa;
}
span.done {
text-decoration: line-through;
}
a.newnote {
font-size: 90%;
}


Loading

0 comments on commit 66013bd

Please sign in to comment.