1<?php 2/** 3 * This file reads the style.ini of the used template and displays the 4 * replacements defined in it. Color replacements will be displayed 5 * visually. This should help with adjusting and using the styles 6 * specified in the style.ini 7 * 8 * @author Andreas Gohr <andi@splitbrain.org> 9 * @author Anika Henke <anika@selfthinker.org> 10 */ 11if(!defined('DOKU_INC')) define('DOKU_INC',dirname(__FILE__).'/../../'); 12if(!defined('NOSESSION')) define('NOSESSION',1); 13require_once(DOKU_INC.'inc/init.php'); 14?> 15<!DOCTYPE html> 16<html lang="en" dir="ltr"> 17<head> 18 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 19 <title>Template Replacements</title> 20 <style type="text/css"> 21 body { 22 background-color: #fff; 23 color: #000; 24 } 25 caption { 26 font-weight: bold; 27 } 28 td { 29 margin: 0; 30 padding: 0.5em 2em; 31 font-family: monospace; 32 font-size: 120%; 33 border: 1px solid #fff; 34 } 35 tr:hover td { 36 border: 1px solid #ccc; 37 } 38 .color { 39 padding: 0.25em 1em; 40 border: 1px #000 solid; 41 } 42 </style> 43</head> 44<body> 45<?php 46$styleini = ''; 47if(@file_exists($conf['template'].'/style.local.ini')) 48 $styleini = $conf['template'].'/style.local.ini'; 49else if(@file_exists($conf['template'].'/style.ini')) 50 $styleini = $conf['template'].'/style.ini'; 51$ini = @parse_ini_file($styleini, true); 52 53if ($ini) { 54 echo '<table>'; 55 echo "<caption>".htmlspecialchars($conf['template'])."'s style.ini</caption>"; 56 foreach($ini['replacements'] as $key => $val){ 57 echo '<tr>'; 58 echo '<td>'.htmlspecialchars($key).'</td>'; 59 echo '<td>'.htmlspecialchars($val).'</td>'; 60 echo '<td>'; 61 if(preg_match('/^#[0-f]{3,6}$/i',$val)){ 62 echo '<div class="color" style="background-color:'.$val.';"> </div>'; 63 } 64 echo '</td>'; 65 echo '</tr>'; 66 } 67 echo '</table>'; 68} else { 69 echo "<p>Non-existent or invalid template or style.ini: <strong>".htmlspecialchars($conf['template'])."</strong></p>"; 70} 71?> 72</body> 73</html> 74