Skip to content
Snippets Groups Projects
Commit b5676fcf authored by Anika Henke's avatar Anika Henke
Browse files

adjusted and moved style.ini viewer to represent style.ini of current template...

adjusted and moved style.ini viewer to represent style.ini of current template (not just default template)

darcs-hash:20090124184033-f7d6d-b8d5aab351089866fecbb07f3fb3516f753bb077.gz
parent 96fbf406
No related branches found
No related tags found
No related merge requests found
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="refresh" content="0; URL=../../" />
<meta name="robots" content="noindex" />
<title>nothing here...</title>
</head>
<body>
<!-- this is just here to prevent directory browsing -->
</body>
</html>
<?php
/**
* This file reads the style.ini and displays the replacements defined in
* it. Color replacements will be displayed visually. This should help
* with adjusting and using the styles specified in the style.ini
*
* You don't need this file when you create your own template, but it might
* help others. Just copy it from the default. No modification needed.
* This file reads the style.ini of the used template and displays the
* replacements defined in it. Color replacements will be displayed
* visually. This should help with adjusting and using the styles
* specified in the style.ini
*
* @author Andreas Gohr <andi@splitbrain.org>
* @author Anika Henke <anika@selfthinker.org>
*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
......@@ -19,6 +18,10 @@
<style type="text/css">
body {
background-color: #fff;
color: #000;
}
caption {
font-weight: bold;
}
td {
margin: 0;
......@@ -26,28 +29,40 @@
font-family: monospace;
font-size: 120%;
border: 1px solid #fff;
}
}
tr:hover td {
border: 1px solid #ccc;
}
.color {
padding: 0.25em 1em;
border: 1px #000 solid;
}
</style>
</head>
<body>
<?php
$ini = parse_ini_file('style.ini',true);
echo '<table>';
foreach($ini['replacements'] as $key => $val){
echo '<tr>';
echo '<td>'.htmlspecialchars($key).'</td>';
echo '<td>'.htmlspecialchars($val).'</td>';
echo '<td>';
if(preg_match('/^#[0-f]{3,6}$/i',$val)){
echo '<div style="width: 40px; height:25px; background-color:'.$val.';border: 1px #000 solid"></div>';
if(!defined('DOKU_INC')) define('DOKU_INC',dirname(__FILE__).'/../../');
require_once(DOKU_INC.'inc/init.php');
$ini = @parse_ini_file($conf['template'].'/style.ini',true);
if ($ini) {
echo '<table>';
echo "<caption>".htmlspecialchars($conf['template'])."'s style.ini</caption>";
foreach($ini['replacements'] as $key => $val){
echo '<tr>';
echo '<td>'.htmlspecialchars($key).'</td>';
echo '<td>'.htmlspecialchars($val).'</td>';
echo '<td>';
if(preg_match('/^#[0-f]{3,6}$/i',$val)){
echo '<div class="color" style="background-color:'.$val.';">&nbsp;</div>';
}
echo '</td>';
echo '</tr>';
}
echo '</td>';
echo '</tr>';
echo '</table>';
} else {
echo "<p>Non-existent template: <strong>".htmlspecialchars($conf['template'])."</strong></p>";
}
echo '</table>';
?>
</body>
</html>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment