diff options
author | Anika Henke <anika@selfthinker.org> | 2012-10-07 15:30:38 +0100 |
---|---|---|
committer | Anika Henke <anika@selfthinker.org> | 2012-10-07 15:30:38 +0100 |
commit | 0e6f9f08b1c948f45d1867346a4502021afa55bc (patch) | |
tree | 0c80d4ee3f48fabab4ecedd2d448baea5d97e2e7 /lib/tpl | |
parent | 3046a46462b44f28b1e5b1b25240a8ac4a859020 (diff) | |
download | rpg-0e6f9f08b1c948f45d1867346a4502021afa55bc.tar.gz rpg-0e6f9f08b1c948f45d1867346a4502021afa55bc.tar.bz2 |
added support for local style.ini files
Diffstat (limited to 'lib/tpl')
-rw-r--r-- | lib/tpl/default/style.ini | 3 | ||||
-rw-r--r-- | lib/tpl/dokuwiki/style.ini | 3 | ||||
-rw-r--r-- | lib/tpl/index.php | 10 |
3 files changed, 14 insertions, 2 deletions
diff --git a/lib/tpl/default/style.ini b/lib/tpl/default/style.ini index 7d27381c9..b9e1e9424 100644 --- a/lib/tpl/default/style.ini +++ b/lib/tpl/default/style.ini @@ -1,6 +1,9 @@ ; Please see http://www.php.net/manual/en/function.parse-ini-file.php ; for limitations of the ini format used here +; Please only make changes in style.local.ini. If it doesn't exist, +; just create it by copying style.ini. + ; Define the stylesheets your template uses here. The second value ; defines for which output media the style should be loaded. Currently ; print, screen and rtl are supported. rtl styles are loaded additionally diff --git a/lib/tpl/dokuwiki/style.ini b/lib/tpl/dokuwiki/style.ini index 242b43080..bcb5a1a2e 100644 --- a/lib/tpl/dokuwiki/style.ini +++ b/lib/tpl/dokuwiki/style.ini @@ -1,6 +1,9 @@ ; Please see http://www.php.net/manual/en/function.parse-ini-file.php ; for limitations of the ini format used here +; Please only make changes in style.local.ini. If it doesn't exist, +; just create it by copying style.ini. + ; Define the stylesheets your template uses here. The second value ; defines for which output media the style should be loaded. Currently ; print, screen and all are supported. diff --git a/lib/tpl/index.php b/lib/tpl/index.php index 357cc1f0d..7cdec9774 100644 --- a/lib/tpl/index.php +++ b/lib/tpl/index.php @@ -43,7 +43,13 @@ require_once(DOKU_INC.'inc/init.php'); </head> <body> <?php -$ini = @parse_ini_file($conf['template'].'/style.ini',true); +$styleini = ''; +if(@file_exists($conf['template'].'/style.local.ini')) + $styleini = $conf['template'].'/style.local.ini'; +else if(@file_exists($conf['template'].'/style.ini')) + $styleini = $conf['template'].'/style.ini'; +$ini = @parse_ini_file($styleini, true); + if ($ini) { echo '<table>'; echo "<caption>".htmlspecialchars($conf['template'])."'s style.ini</caption>"; @@ -60,7 +66,7 @@ if ($ini) { } echo '</table>'; } else { - echo "<p>Non-existent template: <strong>".htmlspecialchars($conf['template'])."</strong></p>"; + echo "<p>Non-existent or invalid template or style.ini: <strong>".htmlspecialchars($conf['template'])."</strong></p>"; } ?> </body> |