diff --git a/application/ApplicationUtils.php b/application/ApplicationUtils.php
index 7f963e9..c0b03a3 100644
--- a/application/ApplicationUtils.php
+++ b/application/ApplicationUtils.php
@@ -149,7 +149,7 @@ class ApplicationUtils
'application',
'inc',
'plugins',
- $conf->get('resource.raintpl_tpl'),
+ 'tpl/'.$conf->get('resource.theme'),
) as $path) {
if (! is_readable(realpath($path))) {
$errors[] = '"'.$path.'" directory is not readable';
diff --git a/application/PageBuilder.php b/application/PageBuilder.php
index 32c7f9f..7cddb71 100644
--- a/application/PageBuilder.php
+++ b/application/PageBuilder.php
@@ -79,7 +79,7 @@ class PageBuilder
$this->tpl->assign('hide_timestamps', $this->conf->get('privacy.hide_timestamps', false));
$this->tpl->assign('token', getToken($this->conf));
// To be removed with a proper theme configuration.
- $this->tpl->assign('conf', $this->conf);
+ $this->tpl->assign('conf', $this->conf->get('resource.theme', 'Default'));
}
/**
diff --git a/application/Utils.php b/application/Utils.php
index 0166ee2..d03af31 100644
--- a/application/Utils.php
+++ b/application/Utils.php
@@ -227,3 +227,13 @@ function autoLocale($headerLocale)
}
setlocale(LC_ALL, $attempts);
}
+
+function getAllTheme()
+{
+ $allTheme = glob('tpl/*', GLOB_ONLYDIR);
+ foreach ($allTheme as $value) {
+ $themes[] = str_replace('tpl/', '', $value);
+ }
+
+ return $themes;
+}
diff --git a/application/config/ConfigManager.php b/application/config/ConfigManager.php
index f5f753f..77804b8 100644
--- a/application/config/ConfigManager.php
+++ b/application/config/ConfigManager.php
@@ -189,7 +189,7 @@ class ConfigManager
'general.title',
'general.header_link',
'privacy.default_private_links',
- 'redirector.url',
+ 'redirector.url'
);
// Only logged in user can alter config.
@@ -296,7 +296,7 @@ class ConfigManager
$this->setEmpty('resource.updates', 'data/updates.txt');
$this->setEmpty('resource.log', 'data/log.txt');
$this->setEmpty('resource.update_check', 'data/lastupdatecheck.txt');
- $this->setEmpty('resource.raintpl_tpl', 'tpl/');
+ $this->setEmpty('resource.theme', 'Default');
$this->setEmpty('resource.raintpl_tmp', 'tmp/');
$this->setEmpty('resource.thumbnails_cache', 'cache');
$this->setEmpty('resource.page_cache', 'pagecache');
diff --git a/application/config/ConfigPhp.php b/application/config/ConfigPhp.php
index 27187b6..5752d37 100644
--- a/application/config/ConfigPhp.php
+++ b/application/config/ConfigPhp.php
@@ -40,7 +40,7 @@ class ConfigPhp implements ConfigIO
'resource.updates' => 'config.UPDATES_FILE',
'resource.log' => 'config.LOG_FILE',
'resource.update_check' => 'config.UPDATECHECK_FILENAME',
- 'resource.raintpl_tpl' => 'config.RAINTPL_TPL',
+ 'resource.theme' => 'config.theme',
'resource.raintpl_tmp' => 'config.RAINTPL_TMP',
'resource.thumbnails_cache' => 'config.CACHEDIR',
'resource.page_cache' => 'config.PAGECACHE',
diff --git a/doc/Shaarli-configuration.html b/doc/Shaarli-configuration.html
index 6d717c6..3494506 100644
--- a/doc/Shaarli-configuration.html
+++ b/doc/Shaarli-configuration.html
@@ -172,7 +172,7 @@ It might be useful if your IP adress often changes.
updates: File path for the ran updates file.
log: Log file path.
update_check: Last update check file path.
-raintpl_tpl: Templates directory.
+theme: Templates directory.
raintpl_tmp: Template engine cache directory.
thumbnails_cache: Thumbnails cache directory.
page_cache: Shaarli's internal cache directory.
@@ -220,7 +220,7 @@ It might be useful if your IP adress often changes.
"log": "data\/log.txt",
"update_check": "data\/lastupdatecheck.txt",
"raintpl_tmp": "tmp\/",
- "raintpl_tpl": "tpl\/",
+ "theme": "tpl\/",
"thumbnails_cache": "cache",
"page_cache": "pagecache"
},
diff --git a/doc/Shaarli-configuration.md b/doc/Shaarli-configuration.md
index 4a783c0..430bc5f 100644
--- a/doc/Shaarli-configuration.md
+++ b/doc/Shaarli-configuration.md
@@ -73,7 +73,7 @@ It might be useful if your IP adress often changes.
**updates**: File path for the ran updates file.
**log**: Log file path.
**update_check**: Last update check file path.
-**raintpl_tpl**: Templates directory.
+**theme**: Templates directory.
**raintpl_tmp**: Template engine cache directory.
**thumbnails_cache**: Thumbnails cache directory.
**page_cache**: Shaarli's internal cache directory.
@@ -134,7 +134,7 @@ It might be useful if your IP adress often changes.
"log": "data\/log.txt",
"update_check": "data\/lastupdatecheck.txt",
"raintpl_tmp": "tmp\/",
- "raintpl_tpl": "tpl\/",
+ "theme": "tpl\/",
"thumbnails_cache": "cache",
"page_cache": "pagecache"
},
diff --git a/doc/Theming.html b/doc/Theming.html
index 13e6acf..13dda02 100644
--- a/doc/Theming.html
+++ b/doc/Theming.html
@@ -120,7 +120,7 @@ code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Inf
my-template/
directory under the tpl/
dir, containing directly all the template files.Edit data/config.php
to have Shaarli use this template, e.g.
$GLOBALS['config'['RAINTPL_TPL'] = 'tpl/my-template/';]('RAINTPL_TPL']-=-'tpl/my-template/';.html)
$GLOBALS['config'['theme'] = 'tpl/my-template/';]('theme']-=-'tpl/my-template/';.html)
diff --git a/tpl/dailyrss.html b/tpl/Default/dailyrss.html similarity index 100% rename from tpl/dailyrss.html rename to tpl/Default/dailyrss.html diff --git a/tpl/editlink.html b/tpl/Default/editlink.html similarity index 100% rename from tpl/editlink.html rename to tpl/Default/editlink.html diff --git a/tpl/export.bookmarks.html b/tpl/Default/export.bookmarks.html similarity index 100% rename from tpl/export.bookmarks.html rename to tpl/Default/export.bookmarks.html diff --git a/tpl/export.html b/tpl/Default/export.html similarity index 100% rename from tpl/export.html rename to tpl/Default/export.html diff --git a/tpl/feed.atom.html b/tpl/Default/feed.atom.html similarity index 100% rename from tpl/feed.atom.html rename to tpl/Default/feed.atom.html diff --git a/tpl/feed.rss.html b/tpl/Default/feed.rss.html similarity index 100% rename from tpl/feed.rss.html rename to tpl/Default/feed.rss.html diff --git a/tpl/import.html b/tpl/Default/import.html similarity index 100% rename from tpl/import.html rename to tpl/Default/import.html diff --git a/tpl/includes.html b/tpl/Default/includes.html similarity index 83% rename from tpl/includes.html rename to tpl/Default/includes.html index 7b2997c..50298da 100644 --- a/tpl/includes.html +++ b/tpl/Default/includes.html @@ -6,9 +6,9 @@ - - -{if="is_file('inc/user.css')"}{/if} + + +{if="is_file('inc/user.css')"}{/if} {loop="$plugins_includes.css_files"} {/loop} diff --git a/tpl/install.html b/tpl/Default/install.html similarity index 100% rename from tpl/install.html rename to tpl/Default/install.html diff --git a/tpl/linklist.html b/tpl/Default/linklist.html similarity index 98% rename from tpl/linklist.html rename to tpl/Default/linklist.html index ddfd729..a06cec3 100644 --- a/tpl/linklist.html +++ b/tpl/Default/linklist.html @@ -1,7 +1,7 @@
- + {include="includes"}