aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/config.default.php9
-rw-r--r--data/templates/default/about.tpl.php (renamed from data/templates/about.tpl.php)0
-rw-r--r--data/templates/default/admin.tpl.php (renamed from data/templates/admin.tpl.php)0
-rw-r--r--data/templates/default/bookmarkcommondescriptionedit.tpl.php (renamed from data/templates/bookmarkcommondescriptionedit.tpl.php)0
-rw-r--r--data/templates/default/bookmarklet.inc.php (renamed from data/templates/bookmarklet.inc.php)0
-rw-r--r--data/templates/default/bookmarks-thumbnail.inc.tpl.php (renamed from data/templates/bookmarks-thumbnail.inc.tpl.php)0
-rw-r--r--data/templates/default/bookmarks-vote-horizontal.inc.tpl.php (renamed from data/templates/bookmarks-vote-horizontal.inc.tpl.php)0
-rw-r--r--data/templates/default/bookmarks-vote.inc.tpl.php (renamed from data/templates/bookmarks-vote.inc.tpl.php)0
-rw-r--r--data/templates/default/bookmarks.tpl.php (renamed from data/templates/bookmarks.tpl.php)0
-rw-r--r--data/templates/default/bottom.inc.php (renamed from data/templates/bottom.inc.php)0
-rw-r--r--data/templates/default/dojo.inc.php (renamed from data/templates/dojo.inc.php)0
-rw-r--r--data/templates/default/dynamictags.inc.php (renamed from data/templates/dynamictags.inc.php)0
-rw-r--r--data/templates/default/editbookmark.tpl.php (renamed from data/templates/editbookmark.tpl.php)0
-rw-r--r--data/templates/default/editprofile-sslclientcerts.tpl.php (renamed from data/templates/editprofile-sslclientcerts.tpl.php)0
-rw-r--r--data/templates/default/editprofile.tpl.php (renamed from data/templates/editprofile.tpl.php)0
-rw-r--r--data/templates/default/error.404.tpl.php (renamed from data/templates/error.404.tpl.php)0
-rw-r--r--data/templates/default/error.500.tpl.php (renamed from data/templates/error.500.tpl.php)0
-rw-r--r--data/templates/default/importDelicious.tpl.php (renamed from data/templates/importDelicious.tpl.php)0
-rw-r--r--data/templates/default/importNetscape.tpl.php (renamed from data/templates/importNetscape.tpl.php)0
-rw-r--r--data/templates/default/importStructure.tpl.php (renamed from data/templates/importStructure.tpl.php)0
-rw-r--r--data/templates/default/login.tpl.php (renamed from data/templates/login.tpl.php)0
-rw-r--r--data/templates/default/password.tpl.php (renamed from data/templates/password.tpl.php)0
-rw-r--r--data/templates/default/profile.tpl.php (renamed from data/templates/profile.tpl.php)0
-rw-r--r--data/templates/default/register.tpl.php (renamed from data/templates/register.tpl.php)0
-rw-r--r--data/templates/default/rss.tpl.php (renamed from data/templates/rss.tpl.php)0
-rw-r--r--data/templates/default/search.menu.php (renamed from data/templates/search.menu.php)0
-rw-r--r--data/templates/default/sidebar.block.common.php (renamed from data/templates/sidebar.block.common.php)0
-rw-r--r--data/templates/default/sidebar.block.linked.php (renamed from data/templates/sidebar.block.linked.php)0
-rw-r--r--data/templates/default/sidebar.block.menu.php (renamed from data/templates/sidebar.block.menu.php)0
-rw-r--r--data/templates/default/sidebar.block.menu2.php (renamed from data/templates/sidebar.block.menu2.php)0
-rw-r--r--data/templates/default/sidebar.block.popular.php (renamed from data/templates/sidebar.block.popular.php)0
-rw-r--r--data/templates/default/sidebar.block.recent.php (renamed from data/templates/sidebar.block.recent.php)0
-rw-r--r--data/templates/default/sidebar.block.related.php (renamed from data/templates/sidebar.block.related.php)0
-rw-r--r--data/templates/default/sidebar.block.search.php (renamed from data/templates/sidebar.block.search.php)0
-rw-r--r--data/templates/default/sidebar.block.tagactions.php (renamed from data/templates/sidebar.block.tagactions.php)0
-rw-r--r--data/templates/default/sidebar.block.users.php (renamed from data/templates/sidebar.block.users.php)0
-rw-r--r--data/templates/default/sidebar.block.watchlist.php (renamed from data/templates/sidebar.block.watchlist.php)0
-rw-r--r--data/templates/default/sidebar.block.watchstatus.php (renamed from data/templates/sidebar.block.watchstatus.php)0
-rw-r--r--data/templates/default/sidebar.linkedtags.inc.php (renamed from data/templates/sidebar.linkedtags.inc.php)0
-rw-r--r--data/templates/default/sidebar.tpl.php (renamed from data/templates/sidebar.tpl.php)0
-rw-r--r--data/templates/default/tag2tagadd.tpl.php (renamed from data/templates/tag2tagadd.tpl.php)0
-rw-r--r--data/templates/default/tag2tagdelete.tpl.php (renamed from data/templates/tag2tagdelete.tpl.php)0
-rw-r--r--data/templates/default/tag2tagedit.tpl.php (renamed from data/templates/tag2tagedit.tpl.php)0
-rw-r--r--data/templates/default/tagcommondescriptionedit.tpl.php (renamed from data/templates/tagcommondescriptionedit.tpl.php)0
-rw-r--r--data/templates/default/tagdelete.tpl.php (renamed from data/templates/tagdelete.tpl.php)0
-rw-r--r--data/templates/default/tagedit.tpl.php (renamed from data/templates/tagedit.tpl.php)0
-rw-r--r--data/templates/default/tagrename.tpl.php (renamed from data/templates/tagrename.tpl.php)0
-rw-r--r--data/templates/default/tags.tpl.php (renamed from data/templates/tags.tpl.php)0
-rw-r--r--data/templates/default/toolbar.inc.php (renamed from data/templates/toolbar.inc.php)0
-rw-r--r--data/templates/default/top.inc.php (renamed from data/templates/top.inc.php)0
-rw-r--r--data/templates/default/users.tpl.php (renamed from data/templates/users.tpl.php)0
-rw-r--r--src/SemanticScuttle/Model/Template.php3
-rw-r--r--src/SemanticScuttle/Service/Template.php23
53 files changed, 33 insertions, 2 deletions
diff --git a/data/config.default.php b/data/config.default.php
index 8c47e0b..c850521 100644
--- a/data/config.default.php
+++ b/data/config.default.php
@@ -63,6 +63,15 @@ $sidebarTopMessage = '';
*/
$sidebarBottomMessage = '';
+/**
+ * The HTML theme to use. With themes, you can give your semanticscuttle
+ * installation a new look.
+ *
+ * Themes are the folders in data/templates/
+ *
+ * @var string
+ */
+$theme = 'default';
/***************************************************
diff --git a/data/templates/about.tpl.php b/data/templates/default/about.tpl.php
index 7bff98d..7bff98d 100644
--- a/data/templates/about.tpl.php
+++ b/data/templates/default/about.tpl.php
diff --git a/data/templates/admin.tpl.php b/data/templates/default/admin.tpl.php
index 50680f6..50680f6 100644
--- a/data/templates/admin.tpl.php
+++ b/data/templates/default/admin.tpl.php
diff --git a/data/templates/bookmarkcommondescriptionedit.tpl.php b/data/templates/default/bookmarkcommondescriptionedit.tpl.php
index 807c58b..807c58b 100644
--- a/data/templates/bookmarkcommondescriptionedit.tpl.php
+++ b/data/templates/default/bookmarkcommondescriptionedit.tpl.php
diff --git a/data/templates/bookmarklet.inc.php b/data/templates/default/bookmarklet.inc.php
index 9867745..9867745 100644
--- a/data/templates/bookmarklet.inc.php
+++ b/data/templates/default/bookmarklet.inc.php
diff --git a/data/templates/bookmarks-thumbnail.inc.tpl.php b/data/templates/default/bookmarks-thumbnail.inc.tpl.php
index 200b8f7..200b8f7 100644
--- a/data/templates/bookmarks-thumbnail.inc.tpl.php
+++ b/data/templates/default/bookmarks-thumbnail.inc.tpl.php
diff --git a/data/templates/bookmarks-vote-horizontal.inc.tpl.php b/data/templates/default/bookmarks-vote-horizontal.inc.tpl.php
index c4a9f8e..c4a9f8e 100644
--- a/data/templates/bookmarks-vote-horizontal.inc.tpl.php
+++ b/data/templates/default/bookmarks-vote-horizontal.inc.tpl.php
diff --git a/data/templates/bookmarks-vote.inc.tpl.php b/data/templates/default/bookmarks-vote.inc.tpl.php
index 41572d5..41572d5 100644
--- a/data/templates/bookmarks-vote.inc.tpl.php
+++ b/data/templates/default/bookmarks-vote.inc.tpl.php
diff --git a/data/templates/bookmarks.tpl.php b/data/templates/default/bookmarks.tpl.php
index 55d6a0f..55d6a0f 100644
--- a/data/templates/bookmarks.tpl.php
+++ b/data/templates/default/bookmarks.tpl.php
diff --git a/data/templates/bottom.inc.php b/data/templates/default/bottom.inc.php
index 0c966a2..0c966a2 100644
--- a/data/templates/bottom.inc.php
+++ b/data/templates/default/bottom.inc.php
diff --git a/data/templates/dojo.inc.php b/data/templates/default/dojo.inc.php
index 366dcfe..366dcfe 100644
--- a/data/templates/dojo.inc.php
+++ b/data/templates/default/dojo.inc.php
diff --git a/data/templates/dynamictags.inc.php b/data/templates/default/dynamictags.inc.php
index 8cf07c1..8cf07c1 100644
--- a/data/templates/dynamictags.inc.php
+++ b/data/templates/default/dynamictags.inc.php
diff --git a/data/templates/editbookmark.tpl.php b/data/templates/default/editbookmark.tpl.php
index 8b71230..8b71230 100644
--- a/data/templates/editbookmark.tpl.php
+++ b/data/templates/default/editbookmark.tpl.php
diff --git a/data/templates/editprofile-sslclientcerts.tpl.php b/data/templates/default/editprofile-sslclientcerts.tpl.php
index 900c193..900c193 100644
--- a/data/templates/editprofile-sslclientcerts.tpl.php
+++ b/data/templates/default/editprofile-sslclientcerts.tpl.php
diff --git a/data/templates/editprofile.tpl.php b/data/templates/default/editprofile.tpl.php
index cc74f04..cc74f04 100644
--- a/data/templates/editprofile.tpl.php
+++ b/data/templates/default/editprofile.tpl.php
diff --git a/data/templates/error.404.tpl.php b/data/templates/default/error.404.tpl.php
index fe9401d..fe9401d 100644
--- a/data/templates/error.404.tpl.php
+++ b/data/templates/default/error.404.tpl.php
diff --git a/data/templates/error.500.tpl.php b/data/templates/default/error.500.tpl.php
index 1d7f7ae..1d7f7ae 100644
--- a/data/templates/error.500.tpl.php
+++ b/data/templates/default/error.500.tpl.php
diff --git a/data/templates/importDelicious.tpl.php b/data/templates/default/importDelicious.tpl.php
index bc4d892..bc4d892 100644
--- a/data/templates/importDelicious.tpl.php
+++ b/data/templates/default/importDelicious.tpl.php
diff --git a/data/templates/importNetscape.tpl.php b/data/templates/default/importNetscape.tpl.php
index 627a5af..627a5af 100644
--- a/data/templates/importNetscape.tpl.php
+++ b/data/templates/default/importNetscape.tpl.php
diff --git a/data/templates/importStructure.tpl.php b/data/templates/default/importStructure.tpl.php
index 9c54612..9c54612 100644
--- a/data/templates/importStructure.tpl.php
+++ b/data/templates/default/importStructure.tpl.php
diff --git a/data/templates/login.tpl.php b/data/templates/default/login.tpl.php
index e67808d..e67808d 100644
--- a/data/templates/login.tpl.php
+++ b/data/templates/default/login.tpl.php
diff --git a/data/templates/password.tpl.php b/data/templates/default/password.tpl.php
index 55dbed6..55dbed6 100644
--- a/data/templates/password.tpl.php
+++ b/data/templates/default/password.tpl.php
diff --git a/data/templates/profile.tpl.php b/data/templates/default/profile.tpl.php
index 1e2003a..1e2003a 100644
--- a/data/templates/profile.tpl.php
+++ b/data/templates/default/profile.tpl.php
diff --git a/data/templates/register.tpl.php b/data/templates/default/register.tpl.php
index 62cebad..62cebad 100644
--- a/data/templates/register.tpl.php
+++ b/data/templates/default/register.tpl.php
diff --git a/data/templates/rss.tpl.php b/data/templates/default/rss.tpl.php
index e6e66f7..e6e66f7 100644
--- a/data/templates/rss.tpl.php
+++ b/data/templates/default/rss.tpl.php
diff --git a/data/templates/search.menu.php b/data/templates/default/search.menu.php
index 5a8f027..5a8f027 100644
--- a/data/templates/search.menu.php
+++ b/data/templates/default/search.menu.php
diff --git a/data/templates/sidebar.block.common.php b/data/templates/default/sidebar.block.common.php
index 951ed80..951ed80 100644
--- a/data/templates/sidebar.block.common.php
+++ b/data/templates/default/sidebar.block.common.php
diff --git a/data/templates/sidebar.block.linked.php b/data/templates/default/sidebar.block.linked.php
index 9aa3cc0..9aa3cc0 100644
--- a/data/templates/sidebar.block.linked.php
+++ b/data/templates/default/sidebar.block.linked.php
diff --git a/data/templates/sidebar.block.menu.php b/data/templates/default/sidebar.block.menu.php
index 94a9fa2..94a9fa2 100644
--- a/data/templates/sidebar.block.menu.php
+++ b/data/templates/default/sidebar.block.menu.php
diff --git a/data/templates/sidebar.block.menu2.php b/data/templates/default/sidebar.block.menu2.php
index 1c177a5..1c177a5 100644
--- a/data/templates/sidebar.block.menu2.php
+++ b/data/templates/default/sidebar.block.menu2.php
diff --git a/data/templates/sidebar.block.popular.php b/data/templates/default/sidebar.block.popular.php
index 50756c0..50756c0 100644
--- a/data/templates/sidebar.block.popular.php
+++ b/data/templates/default/sidebar.block.popular.php
diff --git a/data/templates/sidebar.block.recent.php b/data/templates/default/sidebar.block.recent.php
index 1ffeb4d..1ffeb4d 100644
--- a/data/templates/sidebar.block.recent.php
+++ b/data/templates/default/sidebar.block.recent.php
diff --git a/data/templates/sidebar.block.related.php b/data/templates/default/sidebar.block.related.php
index 60ee486..60ee486 100644
--- a/data/templates/sidebar.block.related.php
+++ b/data/templates/default/sidebar.block.related.php
diff --git a/data/templates/sidebar.block.search.php b/data/templates/default/sidebar.block.search.php
index d3cd8a5..d3cd8a5 100644
--- a/data/templates/sidebar.block.search.php
+++ b/data/templates/default/sidebar.block.search.php
diff --git a/data/templates/sidebar.block.tagactions.php b/data/templates/default/sidebar.block.tagactions.php
index 3351866..3351866 100644
--- a/data/templates/sidebar.block.tagactions.php
+++ b/data/templates/default/sidebar.block.tagactions.php
diff --git a/data/templates/sidebar.block.users.php b/data/templates/default/sidebar.block.users.php
index 58fdfb7..58fdfb7 100644
--- a/data/templates/sidebar.block.users.php
+++ b/data/templates/default/sidebar.block.users.php
diff --git a/data/templates/sidebar.block.watchlist.php b/data/templates/default/sidebar.block.watchlist.php
index 3af9c5a..3af9c5a 100644
--- a/data/templates/sidebar.block.watchlist.php
+++ b/data/templates/default/sidebar.block.watchlist.php
diff --git a/data/templates/sidebar.block.watchstatus.php b/data/templates/default/sidebar.block.watchstatus.php
index 99574aa..99574aa 100644
--- a/data/templates/sidebar.block.watchstatus.php
+++ b/data/templates/default/sidebar.block.watchstatus.php
diff --git a/data/templates/sidebar.linkedtags.inc.php b/data/templates/default/sidebar.linkedtags.inc.php
index 020d0f0..020d0f0 100644
--- a/data/templates/sidebar.linkedtags.inc.php
+++ b/data/templates/default/sidebar.linkedtags.inc.php
diff --git a/data/templates/sidebar.tpl.php b/data/templates/default/sidebar.tpl.php
index e823af5..e823af5 100644
--- a/data/templates/sidebar.tpl.php
+++ b/data/templates/default/sidebar.tpl.php
diff --git a/data/templates/tag2tagadd.tpl.php b/data/templates/default/tag2tagadd.tpl.php
index 9482007..9482007 100644
--- a/data/templates/tag2tagadd.tpl.php
+++ b/data/templates/default/tag2tagadd.tpl.php
diff --git a/data/templates/tag2tagdelete.tpl.php b/data/templates/default/tag2tagdelete.tpl.php
index 8018374..8018374 100644
--- a/data/templates/tag2tagdelete.tpl.php
+++ b/data/templates/default/tag2tagdelete.tpl.php
diff --git a/data/templates/tag2tagedit.tpl.php b/data/templates/default/tag2tagedit.tpl.php
index 4745ad2..4745ad2 100644
--- a/data/templates/tag2tagedit.tpl.php
+++ b/data/templates/default/tag2tagedit.tpl.php
diff --git a/data/templates/tagcommondescriptionedit.tpl.php b/data/templates/default/tagcommondescriptionedit.tpl.php
index f938f93..f938f93 100644
--- a/data/templates/tagcommondescriptionedit.tpl.php
+++ b/data/templates/default/tagcommondescriptionedit.tpl.php
diff --git a/data/templates/tagdelete.tpl.php b/data/templates/default/tagdelete.tpl.php
index e787ff5..e787ff5 100644
--- a/data/templates/tagdelete.tpl.php
+++ b/data/templates/default/tagdelete.tpl.php
diff --git a/data/templates/tagedit.tpl.php b/data/templates/default/tagedit.tpl.php
index 5edfbc7..5edfbc7 100644
--- a/data/templates/tagedit.tpl.php
+++ b/data/templates/default/tagedit.tpl.php
diff --git a/data/templates/tagrename.tpl.php b/data/templates/default/tagrename.tpl.php
index 894b964..894b964 100644
--- a/data/templates/tagrename.tpl.php
+++ b/data/templates/default/tagrename.tpl.php
diff --git a/data/templates/tags.tpl.php b/data/templates/default/tags.tpl.php
index d6259cc..d6259cc 100644
--- a/data/templates/tags.tpl.php
+++ b/data/templates/default/tags.tpl.php
diff --git a/data/templates/toolbar.inc.php b/data/templates/default/toolbar.inc.php
index fb6638d..fb6638d 100644
--- a/data/templates/toolbar.inc.php
+++ b/data/templates/default/toolbar.inc.php
diff --git a/data/templates/top.inc.php b/data/templates/default/top.inc.php
index bdd4b1a..bdd4b1a 100644
--- a/data/templates/top.inc.php
+++ b/data/templates/default/top.inc.php
diff --git a/data/templates/users.tpl.php b/data/templates/default/users.tpl.php
index fa92bef..fa92bef 100644
--- a/data/templates/users.tpl.php
+++ b/data/templates/default/users.tpl.php
diff --git a/src/SemanticScuttle/Model/Template.php b/src/SemanticScuttle/Model/Template.php
index ff5fbbe..234e23f 100644
--- a/src/SemanticScuttle/Model/Template.php
+++ b/src/SemanticScuttle/Model/Template.php
@@ -76,6 +76,9 @@ class SemanticScuttle_Model_Template
* Sets variables and includes the template file,
* causing it to be rendered.
*
+ * Does not take care of themes and so.
+ * The include path must be set so the correct theme is used.
+ *
* @return void
*/
public function parse()
diff --git a/src/SemanticScuttle/Service/Template.php b/src/SemanticScuttle/Service/Template.php
index efa8d28..df96344 100644
--- a/src/SemanticScuttle/Service/Template.php
+++ b/src/SemanticScuttle/Service/Template.php
@@ -38,6 +38,14 @@ class SemanticScuttle_Service_Template extends SemanticScuttle_Service
*/
protected $basedir;
+ /**
+ * The template theme to use.
+ * Set in constructor from $GLOBALS['theme']
+ *
+ * @var string
+ */
+ protected $theme;
+
/**
@@ -64,6 +72,8 @@ class SemanticScuttle_Service_Template extends SemanticScuttle_Service
protected function __construct()
{
$this->basedir = $GLOBALS['TEMPLATES_DIR'];
+ $this->theme = $GLOBALS['theme'];
+ //FIXME: verify the theme exists
}
@@ -77,16 +87,25 @@ class SemanticScuttle_Service_Template extends SemanticScuttle_Service
*
* @return SemanticScuttle_Model_Template Template object
*/
- function loadTemplate($template, $vars = null)
+ public function loadTemplate($template, $vars = null)
{
if (substr($template, -4) != '.php') {
$template .= '.php';
}
+
+ $oldIncPath = get_include_path();
+ set_include_path(
+ $this->basedir . $this->theme
+ . PATH_SEPARATOR . $this->basedir . 'default'
+ );
+
$tpl = new SemanticScuttle_Model_Template(
- $this->basedir .'/'. $template, $vars, $this
+ $template, $vars, $this
);
$tpl->parse();
+ set_include_path($oldIncPath);
+
return $tpl;
}
}