Skip to content

Commit

Permalink
this is a theme for Moodle for pdas. together with the course format …
Browse files Browse the repository at this point in the history
…"pda" it can be used for small screens. I started to define width of the blocks and the content to 240px. I tested it on a sony th 55 - it looks quite promissing. It's just a start ...
  • Loading branch information
urs_hunkler committed Jan 30, 2005
1 parent dcf1097 commit 8cd1bc7
Show file tree
Hide file tree
Showing 15 changed files with 2,152 additions and 0 deletions.
68 changes: 68 additions & 0 deletions theme/orangewhitepda/config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?PHP // $Id$

////////////////////////////////////////////////////////////////////////////////
/// This file contains a few configuration variables that control
/// how Moodle uses this theme.
////////////////////////////////////////////////////////////////////////////////


$THEME->sheets = array('styles_layout', 'styles_font', 'styles_color');

/// This variable is an array containing the names of all the
/// stylesheet files you want included in this theme, and in what order
////////////////////////////////////////////////////////////////////////////////


$THEME->standardsheets = false;

/// This variable can be set to an array containing
/// filenames from the *STANDARD* theme. If the
/// array exists, it will be used to choose the
/// files to include in the standard style sheet.
/// When false, then no files are used.
/// When true or NON-EXISTENT, then ALL standard files are used.
/// This parameter can be used, for example, to prevent
/// having to override too many classes.
/// Note that the trailing .css should not be included
/// eg $THEME->standardsheets = array('styles_layout', 'styles_fonts',
/// 'styles_color', 'styles_moz');
////////////////////////////////////////////////////////////////////////////////


$THEME->parent = '';

/// This variable can be set to the name of a parent theme
/// which you want to have included before the current theme.
/// This can make it easy to make modifications to another
/// theme without having to actually change the files
/// If this variable is empty or false then a parent theme
/// is not used.
////////////////////////////////////////////////////////////////////////////////


$THEME->parentsheets = false;

/// This variable can be set to an array containing
/// filenames from a chosen *PARENT* theme. If the
/// array exists, it will be used to choose the
/// files to include in the standard style sheet.
/// When false, then no files are used.
/// When true or NON-EXISTENT, then ALL standard files are used.
/// This parameter can be used, for example, to prevent
/// having to override too many classes.
/// Note that the trailing .css should not be included
/// eg $THEME->standardsheets = array('styles_layout', 'styles_fonts',
/// 'styles_color', 'styles_moz');
////////////////////////////////////////////////////////////////////////////////


$THEME->custompix = false;

/// If true, then this theme must have a "pix"
/// subdirectory that contains copies of all
/// files from the moodle/pix directory, plus a
/// "pix/mod" directory containing all the icons
/// for all the activity modules.
////////////////////////////////////////////////////////////////////////////////

?>
Binary file added theme/orangewhitepda/css.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
88 changes: 88 additions & 0 deletions theme/orangewhitepda/csshover.htc
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<attach event="ondocumentready" handler="parseStylesheets" />
<script language="JScript">
/**
* PSUEDOS - V1.21.041022 - hover & active
* ---------------------------------------------
* Peterned - http://www.xs4all.nl/~peterned/
* (c) 2004 - Peter Nederlof
*
* Credits - Arnoud Berendsen
* - Martin Reurings
* for inspiring me and finding really sick bugs
*
* howto: body { behavior:url("csshover.htc"); }
* ---------------------------------------------
*/

var currentSheet, doc = window.document;
var activators = {
onhover:{on:'onmouseover', off:'onmouseout'},
onactive:{on:'onmousedown', off:'onmouseup'}
}

function parseStylesheets() {
var sheets = doc.styleSheets, l = sheets.length;
for(var i=0; i<l; i++)
parseStylesheet(sheets[i]);
}
function parseStylesheet(sheet) {
var l, rules, imports;
if(sheet.imports) {
imports = sheet.imports, l = imports.length;
for(var i=0; i<l; i++)
parseStylesheet(sheet.imports[i]);
}

rules = (currentSheet = sheet).rules, l = rules.length;
for(var j=0; j<l; j++) parseCSSRule(rules[j]);
}

function parseCSSRule(rule) {
var select = rule.selectorText, style = rule.style.cssText;
if(!(/(^|\s)(([^a]([^ ]+)?)|(a([^#.][^ ]+)+)):(hover|active)/i).test(select) || !style) return;

var pseudo = select.replace(/[^:]+:([a-z-]+).*/i, 'on$1');
var newSelect = select.replace(/(\.([a-z0-9_-]+):[a-z]+)|(:[a-z]+)/gi, '.$2' + pseudo);
var className = (/\.([a-z0-9_-]*on(hover|active))/i).exec(newSelect)[1];
var affected = select.replace(/:hover.*$/, '');
var elements = getElementsBySelect(affected);

currentSheet.addRule(newSelect, style);
for(var i=0; i<elements.length; i++)
new HoverElement(elements[i], className, activators[pseudo]);
}

function HoverElement(node, className, events) {
if(!node.hovers) node.hovers = {};
if(node.hovers[className]) return;
node.hovers[className] = true;
node.attachEvent(events.on,
function() { node.className += ' ' + className; });
node.attachEvent(events.off,
function() { node.className =
node.className.replace(new RegExp('\\s+'+className, 'g'),''); });
}

function getElementsBySelect(rule) {
var parts, nodes = [doc];
parts = rule.split(' ');
for(var i=0; i<parts.length; i++) {
nodes = getSelectedNodes(parts[i], nodes);
} return nodes;
}
function getSelectedNodes(select, elements) {
var result, node, nodes = [];
var classname = (/\.([a-z0-9_-]+)/i).exec(select);
var identify = (/\#([a-z0-9_-]+)/i).exec(select);
var tagName = (/^[a-z0-9]+/i).exec(select.toUpperCase()) || '*';
for(var i=0; i<elements.length; i++) {
result = elements[i].getElementsByTagName(tagName);
for(var j=0; j<result.length; j++) {
node = result[j];
if((identify && node.id != identify[1]) || (classname && !(new RegExp('\\b' +
classname[1] + '\\b').exec(node.className)))) continue;
nodes[nodes.length] = node;
}
} return nodes;
}
</script>
102 changes: 102 additions & 0 deletions theme/orangewhitepda/docstyles.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
<?PHP /* $Id$ */

/// We use PHP so we can do value substitutions into the styles

if (!isset($themename)) {
$themename = NULL;
}

$nomoodlecookie = true;
require_once("../../config.php");
$themeurl = style_sheet_setup(filemtime("styles.php"), 300, $themename);

///
/// You can hardcode colours in this file if you
/// don't care about this.

?>
body {
background-color:#FFFFFF;
}
p, a {
font-size:90%;
}

h1, h2, h3 {
padding-left:0px;
background-color:transparent;
color:#000000;
}

h1 {
font-size:1.7em;
margin:0.5em 0 0;
}

h2 {
font-size:1.4em;
margin:0.5em 0 0;
}

h3 {
font-size:1.2em;
margin:0.5em 0 0;
}


li {
margin-bottom: 10px;
}

ul {
margin-top: 10px;
}

.question {
font-size: medium;
font-weight: bold;
border: 1px dotted;
padding: 10px;
background-color: #EEEEEE;
}

.answer {
font-size: medium;
border: none;
padding-left: 40px;
}

.normaltext {
font-size: medium;
border: none;
margin-left: 30px;
}

.answercode {
font-family: "Courier New", Courier, mono;
font-size: small;
border: none;
padding-left: 60px;
}

.questionlink {
font-size: medium;
border: none;
padding-left: 40px;
}

.examplecode {
font-family: "Courier New", Courier, mono;
font-size: small;
border: thin dashed #999999;
background-color: #FBFBFB;
margin: auto;
margin-top: 0.5em;
padding: 30px;
height: auto;
width: auto;
}

.spaced {
margin-bottom: 30px;
}
Binary file added theme/orangewhitepda/farbstreifen_moodle.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added theme/orangewhitepda/favicon.ico
Binary file not shown.
15 changes: 15 additions & 0 deletions theme/orangewhitepda/footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

</div> <!-- end div containerContent -->
<!-- START OF FOOTER -->
<div id="footer">
<p class="logininfo"><?php echo $loggedinas ?></p>
<p class="homelink"><?php echo $homelink ?></p>
<p>
<a href="http://validator.w3.org/check?verbose=1&amp;ss=1&amp;uri=<?php echo urlencode(qualified_me()) ?>"><img src="<?php echo "$CFG->wwwroot/theme/$CFG->theme" ?>/xhtml_1_0.gif" alt="XHTML Validator" /></a>
<a href="http://jigsaw.w3.org/css-validator/validator?uri=<?php echo urlencode(qualified_me()) ?>&amp;warning=1&amp;profile=css2&amp;usermedium=all"><img src="<?php echo "$CFG->wwwroot/theme/$CFG->theme" ?>/css.gif" alt="CSS Validator" /></a>
<a href="http://www.contentquality.com/mynewtester/cynthia.exe?rptmode=-1&amp;url1=<?php echo urlencode(qualified_me()) ?>"><img src="<?php echo "$CFG->wwwroot/theme/$CFG->theme" ?>/section_508.gif" alt="Section 508 Validator" /></a>
</p>
</div>
</div>
</body>
</html>
48 changes: 48 additions & 0 deletions theme/orangewhitepda/header.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html<?php echo $direction ?>>
<head>
<?php echo $meta ?>
<meta name="keywords" content="moodle, <?php echo $title ?> " />
<title><?php echo $title ?></title>
<link rel="stylesheet" type="text/css" href="<?php echo $styles ?>" />
<link rel="shortcut icon" href="<?php echo "$CFG->wwwroot/theme/$CFG->theme" ?>/favicon.ico" />
<?php include("$CFG->javascript"); ?>
</head>

<body<?php
echo " $bodytags";
if ($focus) {
echo " onload=\"setfocus()\"";
};
?>

<div id="page">

<?php if ($home) { // This is what gets printed on the home page only
?>
<div id="header-home">
<div class="headermain"><?php echo $heading ?></div>
<div class="headermenu"><?php echo $menu ?></div>
</div>
<div class="clearer"></div>
<div id="nav-bar">
<div id="breadcrumb">&nbsp;</div>
<div id="navbutton">&nbsp;</div>
</div>
<?php } else if ($heading) { // This is what gets printed on any other page with a heading
?>
<div id="header">
<div class="headermain"><?php echo $heading ?></div>
<div class="headermenu"><?php echo $menu ?></div>
</div>
<?php } ?>
<div class="clearer"></div>
<?php if ($navigation) { // This is the navigation table with breadcrumbs ?>
<div id="nav-bar">
<div id="breadcrumb"><?php print_navigation("$navigation"); ?></div>
<div id="navbutton"><?php echo $button; ?></div>
</div>
<?php } ?>
<div class="clearer"></div>
<!-- END OF HEADER -->
<div id="content">
9 changes: 9 additions & 0 deletions theme/orangewhitepda/nostyle.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
*, body, p, td,
h1, h2, h3, h4, h5, h6
{
font-style:inherit;
font-family:inherit;
font-size:100%;
background-color:#FFFFFF;
color:#000000;
}
Binary file added theme/orangewhitepda/section_508.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions theme/orangewhitepda/styles.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?PHP /* $Id$ */

/// This PHP script is used because it provides a place for setting
/// up any necessary variables, and lets us include raw CSS files.
/// The output of this script should be a completely standard CSS file.

/// There should be no need to modify this file!! Use config.php instead.

$nomoodlecookie = true;
require_once("../../config.php");

$lastmodified = 0;
$lifetime = 600;

/// If we are a parent theme, then check for parent definitions

if (isset($parent)) {
if (!isset($THEME->parentsheets) or $THEME->parentsheets === true) { // Use all the sheets we have
$THEME->sheets = array('styles_layout', 'styles_fonts', 'styles_color', 'styles_moz');
} else if (empty($THEME->parentsheets)) { // We can stop right now!
exit;
} else { // Use the provided subset only
$THEME->sheets = $THEME->parentsheets;
}
}

/// Work out the last modified date for this theme

foreach ($THEME->sheets as $sheet) {
$sheetmodified = filemtime($sheet.'.css');
if ($sheetmodified > $lastmodified) {
$lastmodified = $sheetmodified;
}
}

/// Print out the entire style sheet

style_sheet_setup($lastmodified, $lifetime);

foreach ($THEME->sheets as $sheet) {
echo "/***** $sheet.css start *****/\n\n";
include_once($sheet.'.css');
echo "\n\n/***** $sheet.css end *****/\n\n";
}

?>
Loading

0 comments on commit 8cd1bc7

Please sign in to comment.