[Astrospaces-commits] SF.net SVN: astrospaces: [102] trunk
Brought to you by:
p3net
From: <cal...@us...> - 2007-09-03 04:56:25
|
Revision: 102 http://astrospaces.svn.sourceforge.net/astrospaces/?rev=102&view=rev Author: caleb870 Date: 2007-09-02 21:56:22 -0700 (Sun, 02 Sep 2007) Log Message: ----------- Updated the template system so that it now supports conditional. Also started on a generic template for testing. Modified Paths: -------------- trunk/config.php trunk/develop/template-example/test.tpl trunk/develop/template-example/tester.php trunk/functions/template.php trunk/globals.php Added Paths: ----------- trunk/template/default/header.tpl.htm trunk/template/default/index.tpl.htm trunk/template/default/style.css Modified: trunk/config.php =================================================================== --- trunk/config.php 2007-08-18 22:04:27 UTC (rev 101) +++ trunk/config.php 2007-09-03 04:56:22 UTC (rev 102) @@ -14,9 +14,11 @@ define('AS_LANG', 'en-us'); define('AS_LOC_URL', 'http://localhost/'); -define('AS_LOC_DIRECT', 'C:/path/to/astrospaces/'); +define('AS_LOC_DIRECT', 'C:/Program Files/xampp/htdocs/as/'); define('AS_LOC_CACHE', AS_LOC_DIRECT.'cache/'); +define('AS_SITENAME', 'AstroSPACES Beta'); + /* These settings are constants and must NOT be altered. Doing so will prevent AstroSPACES from functioning. Modified: trunk/develop/template-example/test.tpl =================================================================== --- trunk/develop/template-example/test.tpl 2007-08-18 22:04:27 UTC (rev 101) +++ trunk/develop/template-example/test.tpl 2007-09-03 04:56:22 UTC (rev 102) @@ -1,16 +1,17 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html lang="en"> +<!-- IF head --> <head> <title>[LANG:ERROR_MUST_BE_LOGGEDIN]</title> </head> +<!-- ENDIF head --> <body> <!-- INCLUDE 'header.tpl' --> -<!-- INCLUDE 'leftnav.tpl' --> - <h1>[LANG:BLOG_AUTHOR] Test page</h1> -<!-- START one --> + <h1>[LANG:BLOG_AUTHOR] Test page</h1><!-- START one --> + <div style="background-color: [color]; margin: 3px">[content]</div> <!-- START two --> - <b style="color: [color]">[two.bold] testing my [two.morez]</b> + <b style="color: [color]">[start] testing my [end].</b> <!-- END two --> <p color="green">[var]</p> <!-- START three --> Modified: trunk/develop/template-example/tester.php =================================================================== --- trunk/develop/template-example/tester.php 2007-08-18 22:04:27 UTC (rev 101) +++ trunk/develop/template-example/tester.php 2007-09-03 04:56:22 UTC (rev 102) @@ -3,18 +3,21 @@ $time = microtime(); include '../../functions/template.php'; $tpl = new tpl_base('test.tpl','tester.cache',5); -$tpl->load_lang_file('../../lang/en/lang_main.php'); -$tpl->compile_slices(); - +if ($tpl->compiled === false) +{ + echo 'Not compiled<br />'; + $tpl->load_lang_file('../../lang/en/lang_main.php'); + $tpl->compile(); +} +$tpl->show('head'); +$tpl->define('color','#AABBBB','one'); +$tpl->define('content','Even more sample content.. Just can't get enough!','one'); $tpl->set(array('address' => '123 Sample Street NW')); -$tpl->set_multi(array(array('two.bold' => 'Just', 'two.morez' => ' script <br />'),array('two.bold' => 'Im', 'two.morez' => ' pie.', 'color' => ' red')),'two'); -//echo "<a href=\"http://www.deltalabs.net/othercrap/musicsample.zip\">CLICK ME</a>"; -//$tpl-> -$tpl->parse_slice_to_parent('one'); -//print_r($tpl->slices); +$tpl->set_multiple(array(array('start' => 'Just', 'end' => 'script', 'color' => '#0000AA'), + array('start' => 'And', 'end' => 'template', 'color' => '#AAAAAA')),'two'); +$tpl->parse_to_parent('one'); $tpl->pparse(); $tpl->finish(); -//print_r($tpl->slices); echo microtime() - $time; ?> \ No newline at end of file Modified: trunk/functions/template.php =================================================================== --- trunk/functions/template.php 2007-08-18 22:04:27 UTC (rev 101) +++ trunk/functions/template.php 2007-09-03 04:56:22 UTC (rev 102) @@ -1,6 +1,6 @@ <?php /******************************************************* - * Copyright (C) 2007 http://p3net.net + * Copyright (C) 2007 http://deltalabs.net This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -29,92 +29,112 @@ define('TPL_INCLUDE', '\<\!--\s*INCLUDE\s*\'%s\'\s*--\>'); define('TPL_SLICE_START', '\<\!--\s*START\s+%s\s*--\>'); define('TPL_SLICE_END', '\<\!--\s*END\s+%s\s*--\>'); +define('TPL_COND_FINDER', '[a-zA-Z0-9_.-]+'); +define('TPL_COND_START', '\<\!--\s*IF\s+%s\s*--\>'); +define('TPL_COND_END', '\<\!--\s*ENDIF\s+%s\s*--\>'); -class tpl_base { +class cobalt_tpl { - var $slices; - var $lang; - + var $slices; // Holds slices variables and templates. + var $lang; // Holds language variables var $slice_array; // System-only variable - var $tpl_folder; - var $tpl_file; - var $cache_file; - var $cache_life; - var $cache_age; + var $compiled; // Boolean of wether the slice has been compiled or not. + var $tpl_folder; // Folder where the template file is located. + var $tpl_file; // Template filename. + var $cache_file; // Cache filename. + var $cache_life; // Lifespan of the cache before it expires. + var $booleans; // Holds the booleans of what conditional blocks should + // be parsed and which ones shouldn't. var $cache_exists = false; - function tpl_base($file, $cache_to, $cache_life = 600) + /* =========================== + COMPILATION FUNCTIONS + =========================== */ + + function cobalt_tpl( $file, $cache_to = null, $cache_life = 600 ) { $this->tpl_folder = dirname($file).'/'; $this->tpl_file = $file; $this->cache_file = $cache_to; $this->cache_life = $cache_life; + $this->compiled = false; - if (isset($cache_to)) + /* Caching is disabled if the second parameter is NULL */ + if (isset($cache_to) or $cache_life === 0) { - $cache_age = @filemtime($cache_to); - $this->cache_age = $cache_age; - if ($cache_age === false) + $age = @filemtime( AS_LOC_CACHE.$cache_to ); + if ( $age === false ) { + /* If cache doesn't exist. */ $this->cache_exists = false; return $this->load_from_file($file); } - elseif (time() - $cache_life < $cache_age or $cache_life === 0) + elseif (time() - $cache_life < $age or $cache_life === 0) { - $content = file( $cache_to ); - if ($content === false) + /* If cache exists and hasn't expired */ + $cache = file( AS_LOC_CACHE.$cache_to ); + if ($cache === false) { return false; } $this->cache_exists = true; - $cache = unserialize(implode(null,$content)); - $this->slices = $cache->slices; - $this->lang = $cache->lang; - echo "cache exists<br />"; + $cache = unserialize( implode( null, $cache ) ); + + /* Transfering cached data into the current template object */ + $this->slices = $cache->slices; + $this->slice_array = $cache->slice_array; + $this->lang = $cache->lang; + $this->compiled = true; return true; } - elseif ($cache_age != false) + elseif ($age != false) { + /* If the cache exists, but expired. */ $this->cache_exists = false; - return $this->load_from_file($file); + return $this->load_from_file( $file ); } } - + /* If caching is disabled */ $this->cache_exists = true; return $this->load_from_file($file); - } + } function load_from_file ( $file ) { @$content = file( $file ); if ($content === false) { - return false; + return false; // Loading failed } else { $this->load(implode(null,$content)); - return true; + return true; // Loading completed successfully. } } function load( $template ) { - $template = $this->include_files($template); - $this->slices['root'] = new tpl_slice( $template ); + /* Includes references to other template files */ + $this->slices['root']['template'] = $this->include_files($template); + + /* Searches for all the slices in the template */ $regex = '/'.sprintf(TPL_SLICE_START,'('.TPL_SLICE_FINDER.')').'/smiU'; preg_match_all($regex, $template, $slice_array); $this->slice_array = $slice_array[1]; } - function include_files($template) + function include_files( $template ) { + // Searches for all the inclusion statements in the template. preg_match_all('/'.sprintf(TPL_INCLUDE, '(.*)').'/smU', $template, $files); - if (count($files) === 0) return; + // If there are no inclusion statements, just return. + if ( count($files) === 0 ) return true; - foreach ($files[1] as $file) + // Replaces all inclusion statements with the template specified. + foreach ( $files[1] as $file ) { @$content = file( $this->tpl_folder.$file ); if ($content === false) @@ -123,12 +143,12 @@ } else { $content = implode(null,$content); } - $regex = '/'.sprintf(TPL_INCLUDE, str_replace('/','\/',preg_quote($file))).'/sm'; $template = preg_replace($regex, $content, $template); } - if (preg_match('/'.sprintf(TPL_INCLUDE, '(.*)').'/sm', $template, $files)) + // Checks for any inclusion statements missed. + if ( preg_match('/'.sprintf(TPL_INCLUDE, '(.*)').'/sm', $template, $files) ) { $template = $this->include_files($template); } @@ -139,6 +159,7 @@ { if ($this->cache_exists === false) { + // Load language variables @$array = include($filename); if ($array != false) { @@ -149,23 +170,26 @@ } } - function determine_parent( $name ) // System-only function. No longer usable after compile_slices(). + function determine_parent( $name ) // System-only function. { $name_reg = preg_quote( $name ); - if (count($this->slice_array) === 0) return 'root'; - foreach ($this->slice_array as $slice) + if ( count($this->slice_array) === 0) return 'root'; + // Iterates through every slice finding the parent slice for each slice. + foreach ( $this->slice_array as $slice ) { $slice_reg = preg_quote($slice); $regex = '/'.sprintf(TPL_SLICE_START,$slice_reg).'(?:.*)'.sprintf(TPL_SLICE_START,$name_reg).'(?:.*)'.sprintf(TPL_SLICE_END,$slice_reg).'/sm'; - if (preg_match($regex, $this->slices['root']->template, $results)) + if (preg_match($regex, $this->slices['root']['template'], $results)) $array[$slice] = strlen($results[0]); } - if (count($array) === 0) return 'root'; - foreach ($array as $slice_name => $number) + if ( count($array) === 0) return 'root'; + // Iterates through every slice the slice is within, the one with the + // least amount of data is the parent. + foreach ( $array as $slice_name => $number ) { - if (isset($biggest_num)) + if ( isset($biggest_num) ) { if ($number < $biggest_num) { @@ -181,96 +205,207 @@ return $biggest_slice; } - function compile_slices () + function compile () { // Parse every language variable. - if (!empty($this->lang)) + if ( !empty($this->lang) ) { foreach ($this->lang as $name => $value) { - $this->slices['root']->template = str_replace(sprintf(TPL_VAR,TPL_LANG_PRE.$name), $value, $this->slices['root']->template); + $this->slices['root']['template'] = str_replace(sprintf(TPL_VAR,TPL_LANG_PRE.$name), $value, $this->slices['root']['template']); } } // Find all the slices in the template and make them into tpl_slice objects. $regex = '/'.sprintf(TPL_SLICE_END,'(.*)').'/smiU'; - preg_match_all( $regex, $this->slices['root']->template, $sub_slices); + preg_match_all( $regex, $this->slices['root']['template'], $sub_slices); $slices = $sub_slices[1]; - foreach ($slices as $slice) + foreach ( $slices as $slice ) { // Assemble the slice object $regex = '/'.sprintf(TPL_SLICE_START,$slice).'(.*)\r\n\s*'.sprintf(TPL_SLICE_END,$slice).'\s*\r?\n?/si'; - preg_match($regex, $this->slices['root']->template, $resultset); + preg_match($regex, $this->slices['root']['template'], $resultset); if (count($resultset) > 0) { - $this->slices[$slice] = new tpl_slice($resultset[1]); - $this->slices[$slice]->parent = $this->determine_parent(preg_quote($slice)); - $this->slices['root']->template = preg_replace($regex, sprintf(TPL_VAR,TPL_SLICE_PRE_REG.$slice)."\r\n", $this->slices['root']->template); + $this->slices[$slice]['template'] = $resultset[1]; + $this->slices[$slice]['parent'] = $this->determine_parent(preg_quote($slice)); + $this->slices['root']['template'] = preg_replace($regex, sprintf(TPL_VAR,TPL_SLICE_PRE_REG.$slice)."\r\n", $this->slices['root']['template']); } } + + + reset($this->slices); + // Generates a list of conditional statements in each slice. + while ( $slice = key($this->slices) ) + { + $regex = '/'.sprintf(TPL_COND_END,'('.TPL_COND_FINDER.')').'/s'; + preg_match_all($regex, $this->slices[$slice]['template'], $results); + + if ( !empty($results[1]) ) + { + foreach( $results[1] as $result ) + { + $this->slices[$slice]['conditionals'][$result] = true; + } + } + next($this->slices); + } + $this->slice_array[] = 'root'; + $this->compiled = true; + } + + /* =========================== + DECLARATION FUNCTIONS + =========================== */ + + function define( $name, $value, $slice = 'root' ) + { + $this->slices[$slice]['vars'][$name] .= $value; } - function set($var_array, $slice_name = 'root') + function set( $array, $slice = 'root' ) { - foreach ($var_array as $name => $value) + foreach ($array as $name => $value) { - $this->slices[$slice_name]->vars[$name] = $value; + $this->slices[$slice]['vars'][$name] .= $value; } } - function set_multi($var_array, $slice_name = 'root') + function set_multiple( $array, $slice = 'root' ) { - if ($slice_name == 'root') + if ($slice == 'root') { - foreach ($var_array as $id => $vars) + foreach ( $array as $id => $vars ) { - foreach ($vars as $name => $value) + foreach ( $vars as $name => $value ) { - $this->slices[$slice_name]->vars[$name] = $value; + $this->slices['root']['vars'][$name] .= $value; } - $this->pparse(false); + $this->pparse(); } } else { - foreach ($var_array as $id => $vars) + foreach ($array as $id => $vars) { - foreach ($vars as $name => $value) + foreach ( $vars as $name => $value ) { - $this->slices[$slice_name]->vars[$name] = $value; + $this->slices[$slice]['vars'][$name] .= $value; } - $this->slices[$this->slices[$slice_name]->parent]->define(TPL_SLICE_PRE.$slice_name, $this->slices[$slice_name]->parse()); + $this->parse_to_parent($slice); } } } - function parse_slice_to_parent ( $slice_name ) + function set_global( $name, $value ) { - $parent = $this->slices[$slice_name]->parent; - $root_var_name = TPL_SLICE_PRE.$slice_name; - $content = $this->slices[$slice_name]->parse(); - $this->slices[$parent]->define($root_var_name, $content); - return $parsed_result; + foreach ( $this->slice_array as $slice ) + { + $this->slices[$slice]['vars'][$name] = $value; + } } + + function global_burn ( $name, $value ) + { + foreach ($this->slice_array as $slice) + { + $this->slices[$slice]['template'] = + str_replace(sprintf(TPL_VAR,$name), $value, $this->slices[$slice]['template']); + } + } + + function show( $name ) + { + $this->booleans[$name] = true; + } + + function unshow( $name ) + { + $this->booleans[$name] = null; + } + + function burn_var( $name, $slice = 'root' ) + { + $this->slices[$slice]['template'] = + str_replace(sprintf(TPL_VAR,$name),$this->slices[$slice]['vars'][$name], + $this->slices[$slice]['template']); + } + + /* =========================== + PARSING FUNCTIONS + =========================== */ + + function parse_to_parent ( $slice ) + { + $parent = $this->slices[$slice]['parent']; + $name = TPL_SLICE_PRE.$slice; + $value = $this->parse_slice($slice); + $this->slices[$parent]['vars'][$name] .= $value; + return $value; + } function parse () { - return $this->slices['root']->parse(); + return $this->parse_slice(); } function pparse () { - $result = $this->slices['root']->parse(); + $result = $this->parse_slice(); echo $result; return $result; } - function dir($location, $dir) + function parse_slice( $slice = 'root' ) { + // Adds and removes conditional blocks. + $result = $this->slices[$slice]['template']; + if ( !empty($this->slices[$slice]['conditionals']) ) + { + foreach($this->slices[$slice]['conditionals'] as $name => $useless) + { + if ($this->booleans[$name] === true) + { + $regex = '/\r?\n?\s*'.sprintf(TPL_COND_START, $name).'/s'; + $result = preg_replace($regex,'',$result); + $regex = '/\r?\n?\s*'.sprintf(TPL_COND_END, $name).'/s'; + $result = preg_replace($regex,'',$result); + } else { + $regex = '/\r?\n?\s*'.sprintf(TPL_COND_START, $name).'(.*)'.sprintf(TPL_COND_END, $name).'/sU'; + $result = preg_replace($regex,'',$result); + } + } + } + + // Parses variables. + if ( count($this->slices[$slice]['vars']) > 0) + { + foreach( $this->slices[$slice]['vars'] as $name => $value ) + { + $regex = '/(?:\r\n\s+)?'.sprintf(TPL_VAR_REG, preg_quote($name)).'\r?\n?/si'; + $result = preg_replace( $regex, $value, $result ); + } + } + $regex = '/\r?\n?'.sprintf(TPL_VAR_REG, TPL_VAR_FINDER).'\r?\n?/sU'; + $result = preg_replace( $regex, '', $result ); + $this->flush($slice); + return $result; + } + + function flush( $slice = 'root' ) + { + $this->slices[$slice]['vars'] = array(); + } + + /* =========================== + CACHING FUNCTIONS + =========================== */ + + function dir( $location, $dir ) + { $array = explode('/',$dir); if ($array === '.') return true; $count = count($array); - print_r($array); for ($i = 0; $i < $count; $i++) { @@ -286,7 +421,6 @@ if (!file_exists($location.$path)) { $missing = $i; - //echo $i; break 1; } } @@ -304,7 +438,6 @@ $path .= '/'.$array[$ii]; } } - if (!mkdir($location.$path)) return false; } } @@ -315,13 +448,15 @@ { if ($this->cache_exists === false) { + // If the folder the cache file is going to be put in doesn't exist, + // then it will create the folder. if (!file_exists(dirname(AS_LOC_CACHE.$this->cache_file))) { - $this->dir(AS_LOC_CACHE, dirname($this->cache_file)); } $resource = fopen(AS_LOC_CACHE.$this->cache_file, 'w'); $this->cache_exists = true; + // Writes serialized version of the template object to the cache file. return fwrite($resource, serialize($this)); } return true; @@ -329,55 +464,7 @@ function clear_cache() { - unlink($this->cache_file); + unlink($this->cache_file); // Deletes cache file. Optional function. } } - -class tpl_slice -{ - var $parent; - var $vars; - var $template; - - function tpl_slice($content) - { - $this->template = $content; - } - - function define($name, $value) - { - $this->vars[$name] .= $value; - } - - function burn_var($name) - { - if (!empty($name)) - { - $this->template = str_replace(sprintf(TPL_VAR,$name),$this->vars[$name],$this->template); - } - } - - function parse() - { - $result = $this->template; - if ($this->vars != null) - { - foreach($this->vars as $name => $value) - { - $regex = '/\r?\n?\s*'.sprintf(TPL_VAR_REG, preg_quote($name)).'\r?\n?/si'; - $result = preg_replace( $regex, $value, $result ); - } - } - - $regex = '/\r?\n?'.sprintf(TPL_VAR_REG, TPL_VAR_FINDER).'\r?\n?/sU'; - $result = preg_replace( $regex, '', $result ); - $this->flush(); - return $result; - } - - function flush() - { - $this->vars = null; - } -} ?> \ No newline at end of file Modified: trunk/globals.php =================================================================== --- trunk/globals.php 2007-08-18 22:04:27 UTC (rev 101) +++ trunk/globals.php 2007-09-03 04:56:22 UTC (rev 102) @@ -35,7 +35,7 @@ */ function general($err, $verbose) { - $error =& new template(AS_TPL.'messages/error.tpl'); + $error =& new cobalt_tpl(AS_TPL.'messages/error.tpl.htm'); $error->set('err', $err); $handle = fopen('logs/errors.txt', 'w'); if($handle) @@ -60,7 +60,7 @@ */ function thank($message, $go1, $res1, $go2="", $res2="") { - $message =& new template(AS_TPL.'message/thank.tpl'); + $message =& new cobalt_tpl(AS_TPL.'message/thank.tpl.htm'); $message->set_var('go1', $go1); $message->set_var('go2', $go2); $message->set_var('res1', $res1); @@ -70,7 +70,7 @@ } /* Our functions living in globals.php */ -$error =& new error; +$error =& new error(); $message =& new message(); global $db; Added: trunk/template/default/header.tpl.htm =================================================================== --- trunk/template/default/header.tpl.htm (rev 0) +++ trunk/template/default/header.tpl.htm 2007-09-03 04:56:22 UTC (rev 102) @@ -0,0 +1,38 @@ +<html> + +<head> +<meta http-equiv="Content-Language" content="en-us"> +<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> +<link rel="stylesheet" type="text/css" href="[STYLE_ROOT]style.css" /> +<title>[TITLE]</title> +</head> + +<body> +<div id="center"> +<div class="header"> +<h1 style="color: #5C6366; margin: 15px 5px 20px 15px">[SITE_NAME]</h1> +<div class="nav"> +<a href="localhost"><img src="[STYLE_ROOT]img/home.png" class="nav_img" width="16" height="16" />Site Index</a> +<!-- IF LOGGED_OUT --> + | <a href="localhost"><img src="[STYLE_ROOT]img/login.png" class="nav_img" width="16" height="16" />Login</a> + | <a href="localhost"><img src="[STYLE_ROOT]img/register.png" class="nav_img" width="16" height="16" />Register</a> +<!-- ENDIF LOGGED_OUT --> +<!-- IF LOGGED_IN --> + | <a href="localhost"><img src="[STYLE_ROOT]img/my-profile.png" class="nav_img" width="16" height="16" />My Profile</a> + | <a href="localhost"><img src="[STYLE_ROOT]img/messages.png" class="nav_img" width="16" height="16" />Messages ([MESSAGE_COUNT] new)</a> + | <a href="localhost"><img src="[STYLE_ROOT]img/blog.png" class="nav_img" width="16" height="16" />Blog</a> +<!-- ENDIF LOGGED_IN --> + | <a href="localhost"><img src="[STYLE_ROOT]img/search.png" class="nav_img" width="16" height="16" />Search</a> +</div> +</div> +<!-- IF LOGGED_OUT --> +<div id="login"> +<form method="POST" action="[LOGIN_FORM]" style="display: inline"> + <label for="username" style="margin-left: 5px">[LANG:USERNAME]</label> + <input type="text" name="username" id="username" style="margin-right: 20px" /> + <label for="password">[LANG:PASSWORD]</label> + <input type="text" name="password" id="password" /> + <input type="submit" value="[LANG:LOGIN]" id="login_button" /> +</form> +</div> +<!-- ENDIF LOGGED_OUT --> \ No newline at end of file Added: trunk/template/default/index.tpl.htm =================================================================== --- trunk/template/default/index.tpl.htm (rev 0) +++ trunk/template/default/index.tpl.htm 2007-09-03 04:56:22 UTC (rev 102) @@ -0,0 +1,29 @@ +<!-- INCLUDE 'header.tpl.htm' --> +<!-- IF LOGGED_IN --> +<div id="main"> + <div id="body"> + <h3>[WELCOME_MESSAGE]</h3> + <p> + <!-- IF UNREAD_MESSAGES --> + <b>[UNREAD_MESSAGES]</b><br /> + <!-- ENDIF UNREAD_MESSAGES --> + <!-- IF FRIEND_REQUESTS --> + <b>[PENDING_REQUESTS]</b><br /> + <!-- ENDIF FRIEND_REQUESTS --> + [FRIENDS_COUNT]<br /> + </p> + </div> +</div> +<div id="side"> + <div class="message"> + <h4 style="display: inline">Recent Messages</h4> + <!-- START message --> + <a href="[URL]">[TITLE]</a> <a href="[USER.URL]">[USER]</a> + <!-- END message --> + </div> +</div> +</div> +<!-- ENDIF LOGGED_IN --> +<!-- INCLUDE 'footer.tpl.htm' --> +</body> +</html> \ No newline at end of file Added: trunk/template/default/style.css =================================================================== --- trunk/template/default/style.css (rev 0) +++ trunk/template/default/style.css 2007-09-03 04:56:22 UTC (rev 102) @@ -0,0 +1,115 @@ +/* #################### + ## Header Classes ## + #################### */ +body +{ + background-color: #A2AEB3 +} + +#center +{ +position: absolute; +width: 740px; +right: 50%; +margin: 0 -370px 0 0; +} + +div.header +{ +background-color: #CEDEE5; +border: 1px solid #7C868A; +} + +div.header a, a:link, a:visited +{ +color: #5C6366; +font-family: verdana, tahoma, sans-serif; +font-size: 9pt +} + +div.nav +{ +width: 100%; +border-top: 1px solid #7C868A; +background-color: #B8C6CC +} + +div.header a:hover, a:active +{ +color: #000000; +font-family: verdana, tahoma, sans-serif +} + +img.nav_img +{ +border: 0px none #FFFFFF; +margin: 5px; +vertical-align: middle +} + +#login +{ +background-color: #CEDEE5; +margin-top: 10px; +padding: 5px; +border: 1px solid #7C868A; +font-family: tahoma, sans-serif; +font-size: 9pt; +color: #5C6366; +font-weight: bold +} + +#login_button +{ + border: 1px solid #5C6366; + background-color: #CEDEE5; + color: #5C6366; + font-family: tahoma, sans-serif; + margin-left: 20px; + font-weight: bold +} + +#username, #password +{ + background-color: #E7EFF3; + border: 1px solid #5C6366; + color: #5C6366 +} + +/* ################## + ## Body Classes ## + ################## */ +#main +{ + width: 540px; + margin-top: 10px; + float: left +} + +#body +{ + background-color: #CEDEE5; + border: 1px solid #7C868A; +} + +#wide +{ + margin-top: 10px; + width: 740px; + background-color: #CEDEE5; + border: 1px solid #7C868A; +} + +#side +{ + float: right; + margin-left: 10px; + margin-top: 10px; + width: 190px; +} + +.message +{ + background-color: #CEDEE5; + border: 1px solid #7C868A; +} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |