From a11432db93dbfdb0dbc78e1dd384663439799559 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Mon, 23 May 2011 06:53:31 +0200 Subject: [PATCH 01/38] first try to implement theming support, which currently does not work at all --- data/config.default.php | 9 ++++++++ data/templates/{ => default}/about.tpl.php | 0 data/templates/{ => default}/admin.tpl.php | 0 .../bookmarkcommondescriptionedit.tpl.php | 0 .../{ => default}/bookmarklet.inc.php | 0 .../bookmarks-thumbnail.inc.tpl.php | 0 .../bookmarks-vote-horizontal.inc.tpl.php | 0 .../{ => default}/bookmarks-vote.inc.tpl.php | 0 .../templates/{ => default}/bookmarks.tpl.php | 0 data/templates/{ => default}/bottom.inc.php | 0 data/templates/{ => default}/dojo.inc.php | 0 .../{ => default}/dynamictags.inc.php | 0 .../{ => default}/editbookmark.tpl.php | 0 .../editprofile-sslclientcerts.tpl.php | 0 .../{ => default}/editprofile.tpl.php | 0 .../templates/{ => default}/error.404.tpl.php | 0 .../templates/{ => default}/error.500.tpl.php | 0 .../{ => default}/importDelicious.tpl.php | 0 .../{ => default}/importNetscape.tpl.php | 0 .../{ => default}/importStructure.tpl.php | 0 data/templates/{ => default}/login.tpl.php | 0 data/templates/{ => default}/password.tpl.php | 0 data/templates/{ => default}/profile.tpl.php | 0 data/templates/{ => default}/register.tpl.php | 0 data/templates/{ => default}/rss.tpl.php | 0 data/templates/{ => default}/search.menu.php | 0 .../{ => default}/sidebar.block.common.php | 0 .../{ => default}/sidebar.block.linked.php | 0 .../{ => default}/sidebar.block.menu.php | 0 .../{ => default}/sidebar.block.menu2.php | 0 .../{ => default}/sidebar.block.popular.php | 0 .../{ => default}/sidebar.block.recent.php | 0 .../{ => default}/sidebar.block.related.php | 0 .../{ => default}/sidebar.block.search.php | 0 .../sidebar.block.tagactions.php | 0 .../{ => default}/sidebar.block.users.php | 0 .../{ => default}/sidebar.block.watchlist.php | 0 .../sidebar.block.watchstatus.php | 0 .../{ => default}/sidebar.linkedtags.inc.php | 0 data/templates/{ => default}/sidebar.tpl.php | 0 .../{ => default}/tag2tagadd.tpl.php | 0 .../{ => default}/tag2tagdelete.tpl.php | 0 .../{ => default}/tag2tagedit.tpl.php | 0 .../tagcommondescriptionedit.tpl.php | 0 .../templates/{ => default}/tagdelete.tpl.php | 0 data/templates/{ => default}/tagedit.tpl.php | 0 .../templates/{ => default}/tagrename.tpl.php | 0 data/templates/{ => default}/tags.tpl.php | 0 data/templates/{ => default}/toolbar.inc.php | 0 data/templates/{ => default}/top.inc.php | 0 data/templates/{ => default}/users.tpl.php | 0 src/SemanticScuttle/Model/Template.php | 3 +++ src/SemanticScuttle/Service/Template.php | 23 +++++++++++++++++-- 53 files changed, 33 insertions(+), 2 deletions(-) rename data/templates/{ => default}/about.tpl.php (100%) rename data/templates/{ => default}/admin.tpl.php (100%) rename data/templates/{ => default}/bookmarkcommondescriptionedit.tpl.php (100%) rename data/templates/{ => default}/bookmarklet.inc.php (100%) rename data/templates/{ => default}/bookmarks-thumbnail.inc.tpl.php (100%) rename data/templates/{ => default}/bookmarks-vote-horizontal.inc.tpl.php (100%) rename data/templates/{ => default}/bookmarks-vote.inc.tpl.php (100%) rename data/templates/{ => default}/bookmarks.tpl.php (100%) rename data/templates/{ => default}/bottom.inc.php (100%) rename data/templates/{ => default}/dojo.inc.php (100%) rename data/templates/{ => default}/dynamictags.inc.php (100%) rename data/templates/{ => default}/editbookmark.tpl.php (100%) rename data/templates/{ => default}/editprofile-sslclientcerts.tpl.php (100%) rename data/templates/{ => default}/editprofile.tpl.php (100%) rename data/templates/{ => default}/error.404.tpl.php (100%) rename data/templates/{ => default}/error.500.tpl.php (100%) rename data/templates/{ => default}/importDelicious.tpl.php (100%) rename data/templates/{ => default}/importNetscape.tpl.php (100%) rename data/templates/{ => default}/importStructure.tpl.php (100%) rename data/templates/{ => default}/login.tpl.php (100%) rename data/templates/{ => default}/password.tpl.php (100%) rename data/templates/{ => default}/profile.tpl.php (100%) rename data/templates/{ => default}/register.tpl.php (100%) rename data/templates/{ => default}/rss.tpl.php (100%) rename data/templates/{ => default}/search.menu.php (100%) rename data/templates/{ => default}/sidebar.block.common.php (100%) rename data/templates/{ => default}/sidebar.block.linked.php (100%) rename data/templates/{ => default}/sidebar.block.menu.php (100%) rename data/templates/{ => default}/sidebar.block.menu2.php (100%) rename data/templates/{ => default}/sidebar.block.popular.php (100%) rename data/templates/{ => default}/sidebar.block.recent.php (100%) rename data/templates/{ => default}/sidebar.block.related.php (100%) rename data/templates/{ => default}/sidebar.block.search.php (100%) rename data/templates/{ => default}/sidebar.block.tagactions.php (100%) rename data/templates/{ => default}/sidebar.block.users.php (100%) rename data/templates/{ => default}/sidebar.block.watchlist.php (100%) rename data/templates/{ => default}/sidebar.block.watchstatus.php (100%) rename data/templates/{ => default}/sidebar.linkedtags.inc.php (100%) rename data/templates/{ => default}/sidebar.tpl.php (100%) rename data/templates/{ => default}/tag2tagadd.tpl.php (100%) rename data/templates/{ => default}/tag2tagdelete.tpl.php (100%) rename data/templates/{ => default}/tag2tagedit.tpl.php (100%) rename data/templates/{ => default}/tagcommondescriptionedit.tpl.php (100%) rename data/templates/{ => default}/tagdelete.tpl.php (100%) rename data/templates/{ => default}/tagedit.tpl.php (100%) rename data/templates/{ => default}/tagrename.tpl.php (100%) rename data/templates/{ => default}/tags.tpl.php (100%) rename data/templates/{ => default}/toolbar.inc.php (100%) rename data/templates/{ => default}/top.inc.php (100%) rename data/templates/{ => default}/users.tpl.php (100%) 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 similarity index 100% rename from data/templates/about.tpl.php rename to data/templates/default/about.tpl.php diff --git a/data/templates/admin.tpl.php b/data/templates/default/admin.tpl.php similarity index 100% rename from data/templates/admin.tpl.php rename to data/templates/default/admin.tpl.php diff --git a/data/templates/bookmarkcommondescriptionedit.tpl.php b/data/templates/default/bookmarkcommondescriptionedit.tpl.php similarity index 100% rename from data/templates/bookmarkcommondescriptionedit.tpl.php rename to data/templates/default/bookmarkcommondescriptionedit.tpl.php diff --git a/data/templates/bookmarklet.inc.php b/data/templates/default/bookmarklet.inc.php similarity index 100% rename from data/templates/bookmarklet.inc.php rename to 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 similarity index 100% rename from data/templates/bookmarks-thumbnail.inc.tpl.php rename to 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 similarity index 100% rename from data/templates/bookmarks-vote-horizontal.inc.tpl.php rename to 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 similarity index 100% rename from data/templates/bookmarks-vote.inc.tpl.php rename to data/templates/default/bookmarks-vote.inc.tpl.php diff --git a/data/templates/bookmarks.tpl.php b/data/templates/default/bookmarks.tpl.php similarity index 100% rename from data/templates/bookmarks.tpl.php rename to data/templates/default/bookmarks.tpl.php diff --git a/data/templates/bottom.inc.php b/data/templates/default/bottom.inc.php similarity index 100% rename from data/templates/bottom.inc.php rename to data/templates/default/bottom.inc.php diff --git a/data/templates/dojo.inc.php b/data/templates/default/dojo.inc.php similarity index 100% rename from data/templates/dojo.inc.php rename to data/templates/default/dojo.inc.php diff --git a/data/templates/dynamictags.inc.php b/data/templates/default/dynamictags.inc.php similarity index 100% rename from data/templates/dynamictags.inc.php rename to data/templates/default/dynamictags.inc.php diff --git a/data/templates/editbookmark.tpl.php b/data/templates/default/editbookmark.tpl.php similarity index 100% rename from data/templates/editbookmark.tpl.php rename to data/templates/default/editbookmark.tpl.php diff --git a/data/templates/editprofile-sslclientcerts.tpl.php b/data/templates/default/editprofile-sslclientcerts.tpl.php similarity index 100% rename from data/templates/editprofile-sslclientcerts.tpl.php rename to data/templates/default/editprofile-sslclientcerts.tpl.php diff --git a/data/templates/editprofile.tpl.php b/data/templates/default/editprofile.tpl.php similarity index 100% rename from data/templates/editprofile.tpl.php rename to data/templates/default/editprofile.tpl.php diff --git a/data/templates/error.404.tpl.php b/data/templates/default/error.404.tpl.php similarity index 100% rename from data/templates/error.404.tpl.php rename to data/templates/default/error.404.tpl.php diff --git a/data/templates/error.500.tpl.php b/data/templates/default/error.500.tpl.php similarity index 100% rename from data/templates/error.500.tpl.php rename to data/templates/default/error.500.tpl.php diff --git a/data/templates/importDelicious.tpl.php b/data/templates/default/importDelicious.tpl.php similarity index 100% rename from data/templates/importDelicious.tpl.php rename to data/templates/default/importDelicious.tpl.php diff --git a/data/templates/importNetscape.tpl.php b/data/templates/default/importNetscape.tpl.php similarity index 100% rename from data/templates/importNetscape.tpl.php rename to data/templates/default/importNetscape.tpl.php diff --git a/data/templates/importStructure.tpl.php b/data/templates/default/importStructure.tpl.php similarity index 100% rename from data/templates/importStructure.tpl.php rename to data/templates/default/importStructure.tpl.php diff --git a/data/templates/login.tpl.php b/data/templates/default/login.tpl.php similarity index 100% rename from data/templates/login.tpl.php rename to data/templates/default/login.tpl.php diff --git a/data/templates/password.tpl.php b/data/templates/default/password.tpl.php similarity index 100% rename from data/templates/password.tpl.php rename to data/templates/default/password.tpl.php diff --git a/data/templates/profile.tpl.php b/data/templates/default/profile.tpl.php similarity index 100% rename from data/templates/profile.tpl.php rename to data/templates/default/profile.tpl.php diff --git a/data/templates/register.tpl.php b/data/templates/default/register.tpl.php similarity index 100% rename from data/templates/register.tpl.php rename to data/templates/default/register.tpl.php diff --git a/data/templates/rss.tpl.php b/data/templates/default/rss.tpl.php similarity index 100% rename from data/templates/rss.tpl.php rename to data/templates/default/rss.tpl.php diff --git a/data/templates/search.menu.php b/data/templates/default/search.menu.php similarity index 100% rename from data/templates/search.menu.php rename to data/templates/default/search.menu.php diff --git a/data/templates/sidebar.block.common.php b/data/templates/default/sidebar.block.common.php similarity index 100% rename from data/templates/sidebar.block.common.php rename to data/templates/default/sidebar.block.common.php diff --git a/data/templates/sidebar.block.linked.php b/data/templates/default/sidebar.block.linked.php similarity index 100% rename from data/templates/sidebar.block.linked.php rename to data/templates/default/sidebar.block.linked.php diff --git a/data/templates/sidebar.block.menu.php b/data/templates/default/sidebar.block.menu.php similarity index 100% rename from data/templates/sidebar.block.menu.php rename to data/templates/default/sidebar.block.menu.php diff --git a/data/templates/sidebar.block.menu2.php b/data/templates/default/sidebar.block.menu2.php similarity index 100% rename from data/templates/sidebar.block.menu2.php rename to data/templates/default/sidebar.block.menu2.php diff --git a/data/templates/sidebar.block.popular.php b/data/templates/default/sidebar.block.popular.php similarity index 100% rename from data/templates/sidebar.block.popular.php rename to data/templates/default/sidebar.block.popular.php diff --git a/data/templates/sidebar.block.recent.php b/data/templates/default/sidebar.block.recent.php similarity index 100% rename from data/templates/sidebar.block.recent.php rename to data/templates/default/sidebar.block.recent.php diff --git a/data/templates/sidebar.block.related.php b/data/templates/default/sidebar.block.related.php similarity index 100% rename from data/templates/sidebar.block.related.php rename to data/templates/default/sidebar.block.related.php diff --git a/data/templates/sidebar.block.search.php b/data/templates/default/sidebar.block.search.php similarity index 100% rename from data/templates/sidebar.block.search.php rename to data/templates/default/sidebar.block.search.php diff --git a/data/templates/sidebar.block.tagactions.php b/data/templates/default/sidebar.block.tagactions.php similarity index 100% rename from data/templates/sidebar.block.tagactions.php rename to data/templates/default/sidebar.block.tagactions.php diff --git a/data/templates/sidebar.block.users.php b/data/templates/default/sidebar.block.users.php similarity index 100% rename from data/templates/sidebar.block.users.php rename to data/templates/default/sidebar.block.users.php diff --git a/data/templates/sidebar.block.watchlist.php b/data/templates/default/sidebar.block.watchlist.php similarity index 100% rename from data/templates/sidebar.block.watchlist.php rename to data/templates/default/sidebar.block.watchlist.php diff --git a/data/templates/sidebar.block.watchstatus.php b/data/templates/default/sidebar.block.watchstatus.php similarity index 100% rename from data/templates/sidebar.block.watchstatus.php rename to data/templates/default/sidebar.block.watchstatus.php diff --git a/data/templates/sidebar.linkedtags.inc.php b/data/templates/default/sidebar.linkedtags.inc.php similarity index 100% rename from data/templates/sidebar.linkedtags.inc.php rename to data/templates/default/sidebar.linkedtags.inc.php diff --git a/data/templates/sidebar.tpl.php b/data/templates/default/sidebar.tpl.php similarity index 100% rename from data/templates/sidebar.tpl.php rename to data/templates/default/sidebar.tpl.php diff --git a/data/templates/tag2tagadd.tpl.php b/data/templates/default/tag2tagadd.tpl.php similarity index 100% rename from data/templates/tag2tagadd.tpl.php rename to data/templates/default/tag2tagadd.tpl.php diff --git a/data/templates/tag2tagdelete.tpl.php b/data/templates/default/tag2tagdelete.tpl.php similarity index 100% rename from data/templates/tag2tagdelete.tpl.php rename to data/templates/default/tag2tagdelete.tpl.php diff --git a/data/templates/tag2tagedit.tpl.php b/data/templates/default/tag2tagedit.tpl.php similarity index 100% rename from data/templates/tag2tagedit.tpl.php rename to data/templates/default/tag2tagedit.tpl.php diff --git a/data/templates/tagcommondescriptionedit.tpl.php b/data/templates/default/tagcommondescriptionedit.tpl.php similarity index 100% rename from data/templates/tagcommondescriptionedit.tpl.php rename to data/templates/default/tagcommondescriptionedit.tpl.php diff --git a/data/templates/tagdelete.tpl.php b/data/templates/default/tagdelete.tpl.php similarity index 100% rename from data/templates/tagdelete.tpl.php rename to data/templates/default/tagdelete.tpl.php diff --git a/data/templates/tagedit.tpl.php b/data/templates/default/tagedit.tpl.php similarity index 100% rename from data/templates/tagedit.tpl.php rename to data/templates/default/tagedit.tpl.php diff --git a/data/templates/tagrename.tpl.php b/data/templates/default/tagrename.tpl.php similarity index 100% rename from data/templates/tagrename.tpl.php rename to data/templates/default/tagrename.tpl.php diff --git a/data/templates/tags.tpl.php b/data/templates/default/tags.tpl.php similarity index 100% rename from data/templates/tags.tpl.php rename to data/templates/default/tags.tpl.php diff --git a/data/templates/toolbar.inc.php b/data/templates/default/toolbar.inc.php similarity index 100% rename from data/templates/toolbar.inc.php rename to data/templates/default/toolbar.inc.php diff --git a/data/templates/top.inc.php b/data/templates/default/top.inc.php similarity index 100% rename from data/templates/top.inc.php rename to data/templates/default/top.inc.php diff --git a/data/templates/users.tpl.php b/data/templates/default/users.tpl.php similarity index 100% rename from data/templates/users.tpl.php rename to 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; } } From 581eca06d61d3cf9213f80b7540072cf2098f0f6 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Mon, 23 May 2011 06:56:46 +0200 Subject: [PATCH 02/38] make themes work --- src/SemanticScuttle/Service/Template.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/SemanticScuttle/Service/Template.php b/src/SemanticScuttle/Service/Template.php index df96344..2a683d6 100644 --- a/src/SemanticScuttle/Service/Template.php +++ b/src/SemanticScuttle/Service/Template.php @@ -97,6 +97,8 @@ class SemanticScuttle_Service_Template extends SemanticScuttle_Service set_include_path( $this->basedir . $this->theme . PATH_SEPARATOR . $this->basedir . 'default' + //needed since services are instantiated in templates + . PATH_SEPARATOR . $oldIncPath ); $tpl = new SemanticScuttle_Model_Template( From 2d2e7f97e43ec97884a032213952aed2deb6616d Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Mon, 23 May 2011 07:35:36 +0200 Subject: [PATCH 03/38] first themes docs --- doc/themes.rst | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 doc/themes.rst diff --git a/doc/themes.rst b/doc/themes.rst new file mode 100644 index 0000000..72a4c8d --- /dev/null +++ b/doc/themes.rst @@ -0,0 +1,32 @@ +====================== +SemanticScuttle Themes +====================== +SemanticScuttle may be changed visually by supplying custom "themes" that +modify the visual appearance. + + +Changing the current theme +========================== +In ``data/config.php``, set your theme like this: + + $theme = 'darkmood'; + + +Changeable files +================ + +CSS file +-------- +FIXME, missing at the moment + + +Template files +-------------- +The templates of the default file are located in + + data/templates/default/ + +You may put your theme template files into + + data/templates/$themename/ + From 3e3c070b31df956daf7dbe47a510733b22d2ceef Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Mon, 23 May 2011 18:10:51 +0200 Subject: [PATCH 04/38] move image and css files to theme folder --- data/templates/default/bookmarks.tpl.php | 10 +++++----- data/templates/default/top.inc.php | 4 ++-- www/jsScuttle.php | 4 ++-- www/{ => themes/default}/icon.png | Bin www/{ => themes/default}/images/b_edit.png | Bin www/{ => themes/default}/images/bg_admin.png | Bin www/{ => themes/default}/images/bg_bar.png | Bin www/{ => themes/default}/images/bg_header.png | Bin www/{ => themes/default}/images/bg_sidebar.png | Bin www/{ => themes/default}/images/loading.gif | Bin www/{ => themes/default}/images/logo.png | Bin www/{ => themes/default}/images/logo_24.gif | Bin www/{ => themes/default}/images/rss.gif | Bin www/{ => themes/default}/images/thumbs_up.orig.png | Bin .../default}/images/vote-against-voted.png | Bin www/{ => themes/default}/images/vote-against.png | Bin www/{ => themes/default}/images/vote-for-voted.png | Bin www/{ => themes/default}/images/vote-for.png | Bin www/{ => themes/default}/scuttle.css | 0 19 files changed, 9 insertions(+), 9 deletions(-) rename www/{ => themes/default}/icon.png (100%) rename www/{ => themes/default}/images/b_edit.png (100%) rename www/{ => themes/default}/images/bg_admin.png (100%) rename www/{ => themes/default}/images/bg_bar.png (100%) rename www/{ => themes/default}/images/bg_header.png (100%) rename www/{ => themes/default}/images/bg_sidebar.png (100%) rename www/{ => themes/default}/images/loading.gif (100%) rename www/{ => themes/default}/images/logo.png (100%) rename www/{ => themes/default}/images/logo_24.gif (100%) rename www/{ => themes/default}/images/rss.gif (100%) rename www/{ => themes/default}/images/thumbs_up.orig.png (100%) rename www/{ => themes/default}/images/vote-against-voted.png (100%) rename www/{ => themes/default}/images/vote-against.png (100%) rename www/{ => themes/default}/images/vote-for-voted.png (100%) rename www/{ => themes/default}/images/vote-for.png (100%) rename www/{ => themes/default}/scuttle.css (100%) diff --git a/data/templates/default/bookmarks.tpl.php b/data/templates/default/bookmarks.tpl.php index 55d6a0f..93bcf53 100644 --- a/data/templates/default/bookmarks.tpl.php +++ b/data/templates/default/bookmarks.tpl.php @@ -39,7 +39,7 @@ include('search.menu.php'); isAdmin($userid) && $pageName != PAGE_WATCHLIST) : ?>
- +
@@ -70,7 +70,7 @@ if ($userservice->isLoggedOn()) { ) { echo ' '; echo !is_array($cDescription) || strlen($cDescription['cdDescription'])==0?T_('Edit the common description of this tag'):''; - echo ' '; + echo ' '; } else if (isset($hash)) { echo ' ('; echo T_('Edit the common description of this bookmark').')'; @@ -95,7 +95,7 @@ if($userservice->isLoggedOn()) { if($currenttag!= '') { echo ' '; echo strlen($pDescription['tDescription'])==0?T_('Edit your personal description of this tag'):''; - echo ' '; + echo ' '; } } ?>

@@ -221,7 +221,7 @@ if ($currenttag!= '') { for ($i = 0; $i < $size; $i++) { $brss = '' - . '' . htmlspecialchars($rsschannels[$i][0]) .'' + . '' . htmlspecialchars($rsschannels[$i][0]) .'' . ''; } @@ -363,7 +363,7 @@ if ($currenttag!= '') { // Admin specific design if ($userservice->isAdmin($row['username']) && $GLOBALS['enableAdminColors']) { $adminBgClass = ' class="adminBackground"'; - $adminStar = ' '; + $adminStar = ' '; } else { $adminBgClass = ''; $adminStar = ''; diff --git a/data/templates/default/top.inc.php b/data/templates/default/top.inc.php index bdd4b1a..6ad2df2 100644 --- a/data/templates/default/top.inc.php +++ b/data/templates/default/top.inc.php @@ -4,8 +4,8 @@ <?php echo filter($GLOBALS['sitename'] .(isset($pagetitle) ? ' » ' . $pagetitle : '')); ?> - - + + images/loading.gif)'; + usernameField.style.backgroundImage = 'url(/images/loading.gif)'; if (response != '') { usernameField.style.backgroundImage = 'none'; if (response == 'true') { @@ -92,7 +92,7 @@ function useAddress(ele) { function getTitle(input, response){ var title = document.getElementById('titleField'); if (title.value == '') { - title.style.backgroundImage = 'url(images/loading.gif)'; + title.style.backgroundImage = 'url(/images/loading.gif)'; if (response != null) { title.style.backgroundImage = 'none'; title.value = response; diff --git a/www/icon.png b/www/themes/default/icon.png similarity index 100% rename from www/icon.png rename to www/themes/default/icon.png diff --git a/www/images/b_edit.png b/www/themes/default/images/b_edit.png similarity index 100% rename from www/images/b_edit.png rename to www/themes/default/images/b_edit.png diff --git a/www/images/bg_admin.png b/www/themes/default/images/bg_admin.png similarity index 100% rename from www/images/bg_admin.png rename to www/themes/default/images/bg_admin.png diff --git a/www/images/bg_bar.png b/www/themes/default/images/bg_bar.png similarity index 100% rename from www/images/bg_bar.png rename to www/themes/default/images/bg_bar.png diff --git a/www/images/bg_header.png b/www/themes/default/images/bg_header.png similarity index 100% rename from www/images/bg_header.png rename to www/themes/default/images/bg_header.png diff --git a/www/images/bg_sidebar.png b/www/themes/default/images/bg_sidebar.png similarity index 100% rename from www/images/bg_sidebar.png rename to www/themes/default/images/bg_sidebar.png diff --git a/www/images/loading.gif b/www/themes/default/images/loading.gif similarity index 100% rename from www/images/loading.gif rename to www/themes/default/images/loading.gif diff --git a/www/images/logo.png b/www/themes/default/images/logo.png similarity index 100% rename from www/images/logo.png rename to www/themes/default/images/logo.png diff --git a/www/images/logo_24.gif b/www/themes/default/images/logo_24.gif similarity index 100% rename from www/images/logo_24.gif rename to www/themes/default/images/logo_24.gif diff --git a/www/images/rss.gif b/www/themes/default/images/rss.gif similarity index 100% rename from www/images/rss.gif rename to www/themes/default/images/rss.gif diff --git a/www/images/thumbs_up.orig.png b/www/themes/default/images/thumbs_up.orig.png similarity index 100% rename from www/images/thumbs_up.orig.png rename to www/themes/default/images/thumbs_up.orig.png diff --git a/www/images/vote-against-voted.png b/www/themes/default/images/vote-against-voted.png similarity index 100% rename from www/images/vote-against-voted.png rename to www/themes/default/images/vote-against-voted.png diff --git a/www/images/vote-against.png b/www/themes/default/images/vote-against.png similarity index 100% rename from www/images/vote-against.png rename to www/themes/default/images/vote-against.png diff --git a/www/images/vote-for-voted.png b/www/themes/default/images/vote-for-voted.png similarity index 100% rename from www/images/vote-for-voted.png rename to www/themes/default/images/vote-for-voted.png diff --git a/www/images/vote-for.png b/www/themes/default/images/vote-for.png similarity index 100% rename from www/images/vote-for.png rename to www/themes/default/images/vote-for.png diff --git a/www/scuttle.css b/www/themes/default/scuttle.css similarity index 100% rename from www/scuttle.css rename to www/themes/default/scuttle.css From 554a358539e2705d4394701778de9dffa8b6a815 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Mon, 23 May 2011 18:13:40 +0200 Subject: [PATCH 05/38] updates theme documentation --- doc/themes.rst | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/doc/themes.rst b/doc/themes.rst index 72a4c8d..7c40ef2 100644 --- a/doc/themes.rst +++ b/doc/themes.rst @@ -7,26 +7,33 @@ modify the visual appearance. Changing the current theme ========================== -In ``data/config.php``, set your theme like this: +In ``data/config.php``, set your theme like this: :: $theme = 'darkmood'; -Changeable files -================ +Creating your own theme +======================= -CSS file --------- -FIXME, missing at the moment +CSS and image files +------------------- +Since both file types need to be accessible via the web server directly, +they are located in the ``www/`` folder: :: + + www/themes/$themename/ + +The main CSS file that automatically gets included is :: + + www/themes/$themename/scuttle.css Template files -------------- -The templates of the default file are located in +The templates of the default file are located in :: data/templates/default/ -You may put your theme template files into +You may put your theme template files into :: data/templates/$themename/ From 74c72b5cab5e097ee610feca7d57e25fba11d626 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Mon, 23 May 2011 18:16:41 +0200 Subject: [PATCH 06/38] check if the charset parameter really exists --- www/ajaxGetTitle.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/www/ajaxGetTitle.php b/www/ajaxGetTitle.php index b4f44ca..8e5d92c 100644 --- a/www/ajaxGetTitle.php +++ b/www/ajaxGetTitle.php @@ -38,9 +38,12 @@ function getTitle($url) { preg_match_all('/(.*)<\/title>/si', $html, $matches); $title = $matches[1][0]; + $encoding = 'utf-8'; // Get encoding from charset attribute preg_match_all('/<meta.*charset=([^;"]*)">/i', $html, $matches); - $encoding = strtoupper($matches[1][0]); + if (isset($matches[1][0])) { + $encoding = strtoupper($matches[1][0]); + } // Convert to UTF-8 from the original encoding if (function_exists("mb_convert_encoding")) { From 07656f6724d536de2c2eb234e0368959660093bd Mon Sep 17 00:00:00 2001 From: Christian Weiske <cweiske@cweiske.de> Date: Tue, 24 May 2011 06:54:38 +0200 Subject: [PATCH 07/38] make changelog fully rST-parsable. that was easy! --- doc/ChangeLog | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 3c4e939..8fa208c 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -68,11 +68,13 @@ your SemanticScuttle installations! - Fix several SQL injection possibilities - Fix E_NOTICE when calling alltags.php without any parameter - Implement part of request #2928950: + - User adjustable entry count: rss.php?count=20 - Fix HTTP content type header for RSS - Add config option to allow sorting by bookmark creation date instead of modification date -- Implement request #2833793: Export to avahi config files + + - Implement request #2833793: Export to avahi config files - we support zeroconf networking! - Implement request #2934868: Do not display full redirection URL Patch by fnorder@users.sourceforge.net @@ -181,7 +183,7 @@ your SemanticScuttle installations! - Major Refactoring: add a tag cache improving query processing (knowledge inference on tag relations) [DB modified] - Interface fix: allows to remove a tag from the selection into - subtitle bar thanks to a *. + subtitle bar thanks to a \*. - New Feature: authorizes anchors with brackets into descriptions of bookmark. For example: "[city]Paris[/city]". This text between anchors will be highlighted when the @@ -219,6 +221,7 @@ your SemanticScuttle installations! 0.90 - 2008-06-05 ----------------- The main improvements of this new version are: + - menu tags (tags which are included into the "menu" tag and thus which appear on the main page) - connexion with Google Custom Search Engine which allows to @@ -227,6 +230,7 @@ The main improvements of this new version are: All the changes: + - New feature: add Google Custom Search Engine into gsearch/ folder and looking into all bookmarks [Config modified] - Interface design: antispam question is hidden when @@ -279,6 +283,7 @@ The main change of this release is the possibility to preview websites through thumbnails (thanks to artviper.net). All the changes: + - Interface design: display SemanticScuttle version number on "about" page - Bug fix: allow clean urls thanks to .htaccess @@ -298,6 +303,7 @@ All the changes: 0.87 - 2008-02-14 ----------------- This new version brings two major features to SemanticScuttle: + 1) You can now create a synonym link between tags. For example, by linking the tags "monument" and "monuments", you can find resources tagged with the first one when you navigate @@ -310,6 +316,7 @@ This new version brings two major features to SemanticScuttle: ones (more difficult but more powerful). All the changes: + - Interface design: allow to access to users' bookmarks from last user sidebox. (Currently, we can just access to their profiles). - Interface design: hide multiple URLs repeated into history page @@ -335,9 +342,11 @@ All the changes: ----------------- - New feature: Add stats (nb children, nb descendants, depth, nb update) to structured tags + - Allow to visualize structured tags according to stats - Add admin page to update stats from the existing structured tags in the database + - Translation: improve French translation (add missing translations, transform "labels" into "tags") - New feature: List all users in a users page and users block on From e01c813101f2811879acfe808c4573b924f7b666 Mon Sep 17 00:00:00 2001 From: Christian Weiske <cweiske@cweiske.de> Date: Tue, 24 May 2011 18:21:54 +0200 Subject: [PATCH 08/38] introduce theme model and use it in jsscuttle. rest will follow --- build.xml | 13 ++-- src/SemanticScuttle/Model/Theme.php | 97 ++++++++++++++++++++++++ src/SemanticScuttle/Service/Template.php | 12 ++- src/SemanticScuttle/header.php | 3 + www/jsScuttle.php | 5 +- 5 files changed, 118 insertions(+), 12 deletions(-) create mode 100644 src/SemanticScuttle/Model/Theme.php diff --git a/build.xml b/build.xml index 9773a63..7b3896b 100644 --- a/build.xml +++ b/build.xml @@ -121,18 +121,19 @@ <replacement path="src/SemanticScuttle/header.php" - type="pear-config" - from="@data_dir@" to="data_dir" + type="pear-config" from="@data_dir@" to="data_dir" + /> + <replacement + path="src/SemanticScuttle/header.php" + type="pear-config" from="@www_dir@" to="www_dir" /> <replacement path="www/www-header.php" - type="pear-config" - from="@data_dir@" to="data_dir" + type="pear-config" from="@data_dir@" to="data_dir" /> <replacement path="tests/prepare.php" - type="pear-config" - from="@data_dir@" to="data_dir" + type="pear-config" from="@data_dir@" to="data_dir" /> <changelog version="0.97" date="2010-06-09" license="GPL"> diff --git a/src/SemanticScuttle/Model/Theme.php b/src/SemanticScuttle/Model/Theme.php new file mode 100644 index 0000000..a2f4973 --- /dev/null +++ b/src/SemanticScuttle/Model/Theme.php @@ -0,0 +1,97 @@ +<?php +/** + * SemanticScuttle - your social bookmark manager. + * + * PHP version 5. + * + * @category Bookmarking + * @package SemanticScuttle + * @author Christian Weiske <cweiske@cweiske.de> + * @license AGPL v3 or later http://www.gnu.org/licenses/agpl.html + * @link http://sourceforge.net/projects/semanticscuttle + */ + +/** + * A theme, the visual representation of SemanticScuttle. + * + * @category Bookmarking + * @package SemanticScuttle + * @author Christian Weiske <cweiske@cweiske.de> + * @license AGPL v3 or later http://www.gnu.org/licenses/agpl.html + * @link http://sourceforge.net/projects/semanticscuttle + */ +class SemanticScuttle_Model_Theme +{ + /** + * Theme name. Also the path part of template and resource files + * + * @var string + */ + protected $name = null; + + /** + * Local path to the www themes directory. + * Needs to have a trailing slash. + * + * @var string + */ + protected $wwwThemeDir = null; + + + + /** + * Create a new theme instance. + * + * @param string $name Theme name "data/templates/(*)/" + */ + public function __construct($name = 'default') + { + $this->name = $name; + $this->wwwThemeDir = $GLOBALS['wwwdir'] . '/themes/'; + //TODO: implement theme hierarchies with parent fallback + } + + + + /** + * Returns the URL path to a resource file (www/themes/$name/$file). + * Automatically falls back to the parent theme if the file does not exist + * in the theme. + * + * Must always be used when adding i.e. images to the output. + * + * @param string $file File name to find the path for + * + * @return string Full path + */ + public function resource($file) + { + $themeFile = $this->wwwThemeDir . $this->name . '/' . $file; + if (file_exists($themeFile)) { + return ROOT . 'themes/' . $this->name . '/' . $file; + } + + $defaultFile = $this->wwwThemeDir . 'default/' . $file; + if (file_exists($defaultFile)) { + return ROOT . 'themes/default/' . $file; + } + + //file does not exist. fall back to the theme file + // to guide the theme author a bit. + // TODO: logging. in admin mode, there should be a message + return ROOT . 'themes/' . $this->name . '/' . $file; + } + + + + /** + * Returns the theme name. + * + * @return string Theme name + */ + public function getName() + { + return $this->name; + } +} +?> \ No newline at end of file diff --git a/src/SemanticScuttle/Service/Template.php b/src/SemanticScuttle/Service/Template.php index 2a683d6..b5d4cfa 100644 --- a/src/SemanticScuttle/Service/Template.php +++ b/src/SemanticScuttle/Service/Template.php @@ -14,6 +14,7 @@ */ require_once 'SemanticScuttle/Model/Template.php'; +require_once 'SemanticScuttle/Model/Theme.php'; /** * SemanticScuttle template service. @@ -40,9 +41,9 @@ class SemanticScuttle_Service_Template extends SemanticScuttle_Service /** * The template theme to use. - * Set in constructor from $GLOBALS['theme'] + * Set in constructor based on $GLOBALS['theme'] * - * @var string + * @var SemanticScuttle_Model_Theme */ protected $theme; @@ -72,7 +73,7 @@ class SemanticScuttle_Service_Template extends SemanticScuttle_Service protected function __construct() { $this->basedir = $GLOBALS['TEMPLATES_DIR']; - $this->theme = $GLOBALS['theme']; + $this->theme = new SemanticScuttle_Model_Theme($GLOBALS['theme']); //FIXME: verify the theme exists } @@ -84,6 +85,8 @@ class SemanticScuttle_Service_Template extends SemanticScuttle_Service * @param string $template Template filename relative * to template dir * @param array $vars Array of template variables. + * The current theme object will be added + * automatically with name "theme". * * @return SemanticScuttle_Model_Template Template object */ @@ -95,12 +98,13 @@ class SemanticScuttle_Service_Template extends SemanticScuttle_Service $oldIncPath = get_include_path(); set_include_path( - $this->basedir . $this->theme + $this->basedir . $this->theme->getName() . PATH_SEPARATOR . $this->basedir . 'default' //needed since services are instantiated in templates . PATH_SEPARATOR . $oldIncPath ); + $vars['theme'] = $this->theme; $tpl = new SemanticScuttle_Model_Template( $template, $vars, $this ); diff --git a/src/SemanticScuttle/header.php b/src/SemanticScuttle/header.php index 098e5c3..6c0d4df 100644 --- a/src/SemanticScuttle/header.php +++ b/src/SemanticScuttle/header.php @@ -18,9 +18,12 @@ if ('@data_dir@' == '@' . 'data_dir@') { //non pear-install $datadir = dirname(__FILE__) . '/../../data/'; + $wwwdir = dirname(__FILE__) . '/../../www/'; } else { //pear installation; files are in include path $datadir = '@data_dir@/SemanticScuttle/'; + //FIXME: when you have multiple installations, the www_dir will be wrong + $wwwdir = '@www_dir@/SemanticScuttle/'; } if (!file_exists($datadir . '/config.php')) { diff --git a/www/jsScuttle.php b/www/jsScuttle.php index 4f9d3b7..5e5f31b 100644 --- a/www/jsScuttle.php +++ b/www/jsScuttle.php @@ -3,6 +3,7 @@ $GLOBALS['saveInLastUrl'] = false; $httpContentType = 'text/javascript'; require_once 'www-header.php'; require_once 'SemanticScuttle/functions.php'; +$theme = new SemanticScuttle_Model_Theme($GLOBALS['theme']); $player_root = ROOT .'includes/player/'; ?> @@ -62,7 +63,7 @@ function isAvailable(input, response){ username = username.trim(); var availability = document.getElementById("availability"); if (username != '') { - usernameField.style.backgroundImage = 'url(<?php echo ROOT . 'themes/' . $GLOBALS['theme']; ?>/images/loading.gif)'; + usernameField.style.backgroundImage = 'url(<?php echo $theme->resource('images/loading.gif'); ?>)'; if (response != '') { usernameField.style.backgroundImage = 'none'; if (response == 'true') { @@ -92,7 +93,7 @@ function useAddress(ele) { function getTitle(input, response){ var title = document.getElementById('titleField'); if (title.value == '') { - title.style.backgroundImage = 'url(<?php echo ROOT . 'themes/' . $GLOBALS['theme']; ?>/images/loading.gif)'; + title.style.backgroundImage = 'url(<?php echo $theme->resource('images/loading.gif');?>)'; if (response != null) { title.style.backgroundImage = 'none'; title.value = response; From 1c180e28ffe223c8cdff7e9bb7ec237cded48ef4 Mon Sep 17 00:00:00 2001 From: Christian Weiske <cweiske@cweiske.de> Date: Wed, 25 May 2011 06:55:16 +0200 Subject: [PATCH 09/38] use theme->resource() method to get paths to themable filse --- data/templates/default/bookmarks.tpl.php | 25 +++++++++++++++++------- data/templates/default/top.inc.php | 4 ++-- src/SemanticScuttle/Model/Theme.php | 2 +- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/data/templates/default/bookmarks.tpl.php b/data/templates/default/bookmarks.tpl.php index 93bcf53..91d50bf 100644 --- a/data/templates/default/bookmarks.tpl.php +++ b/data/templates/default/bookmarks.tpl.php @@ -39,7 +39,9 @@ include('search.menu.php'); <?php if($GLOBALS['enableAdminColors']!=false && isset($userid) && $userservice->isAdmin($userid) && $pageName != PAGE_WATCHLIST) : ?> <div style="width:70%;text-align:center;"> -<img src="<?php echo ROOT . 'themes/' . $GLOBALS['theme']; ?>/images/logo_24.gif" width="12px"/> <?php echo T_('Bookmarks on this page are managed by an admin user.'); ?><img src="<?php echo ROOT . 'themes/' . $GLOBALS['theme']; ?>/images/logo_24.gif" width="12px"/> + <img src="<?php $theme->resource('images/logo_24.gif'); ?>" width="12px"/> + <?php echo T_('Bookmarks on this page are managed by an admin user.'); ?> + <img src="<?php $theme->resource('images/logo_24.gif'); ?>" width="12px"/> </div> <?php endif?> @@ -70,7 +72,7 @@ if ($userservice->isLoggedOn()) { ) { echo ' <a href="'. createURL('tagcommondescriptionedit', $currenttag).'" title="'.T_('Edit the common description of this tag').'">'; echo !is_array($cDescription) || strlen($cDescription['cdDescription'])==0?T_('Edit the common description of this tag'):''; - echo ' <img src="'.ROOT . 'themes/' . $GLOBALS['theme'] . '/images/b_edit.png" /></a>'; + echo ' <img src="' . $theme->resource('images/b_edit.png') . '" /></a>'; } else if (isset($hash)) { echo ' (<a href="'.createURL('bookmarkcommondescriptionedit', $hash).'" title="'.T_('Edit the common description of this bookmark').'">'; echo T_('Edit the common description of this bookmark').'</a>)'; @@ -95,7 +97,7 @@ if($userservice->isLoggedOn()) { if($currenttag!= '') { echo ' <a href="'. createURL('tagedit', $currenttag).'" title="'.T_('Edit your personal description of this tag').'" >'; echo strlen($pDescription['tDescription'])==0?T_('Edit your personal description of this tag'):''; - echo ' <img src="' . ROOT . 'themes/' . $GLOBALS['theme'] . '/images/b_edit.png" /></a>'; + echo ' <img src="' . $theme->resource('images/b_edit.png') . '" /></a>'; } } ?></p> @@ -219,9 +221,12 @@ if ($currenttag!= '') { $brss = ''; $size = count($rsschannels); for ($i = 0; $i < $size; $i++) { - $brss = '<a style="background:#FFFFFF" href="'. htmlspecialchars($rsschannels[$i][1]) . '"' + $brss = '<a style="background:#FFFFFF"' + . ' href="'. htmlspecialchars($rsschannels[$i][1]) . '"' . ' title="' . htmlspecialchars($rsschannels[$i][0]) . '">' - . '<img src="' . ROOT . 'themes/' . $GLOBALS['theme'] . '/images/rss.gif" width="16" height="16" alt="' . htmlspecialchars($rsschannels[$i][0]) .'"/>' + . '<img src="' . $theme->resource('images/rss.gif') . '"' + . ' width="16" height="16"' + . ' alt="' . htmlspecialchars($rsschannels[$i][0]) .'"/>' . '</a>'; } @@ -361,9 +366,15 @@ if ($currenttag!= '') { } // Admin specific design - if ($userservice->isAdmin($row['username']) && $GLOBALS['enableAdminColors']) { + if ($userservice->isAdmin($row['username']) + && $GLOBALS['enableAdminColors'] + ) { $adminBgClass = ' class="adminBackground"'; - $adminStar = ' <img src="' . ROOT . 'themes/' . $GLOBALS['theme'] . '/images/logo_24.gif" width="12px" title="'. T_('This bookmark is certified by an admin user.') .'" />'; + $adminStar = ' <img' + . ' src="' . $theme->resource('images/logo_24.gif') . '"' + . ' width="12px"' + . ' title="' . T_('This bookmark is certified by an admin user.') . '"' + . '/>'; } else { $adminBgClass = ''; $adminStar = ''; diff --git a/data/templates/default/top.inc.php b/data/templates/default/top.inc.php index 6ad2df2..9eed6ff 100644 --- a/data/templates/default/top.inc.php +++ b/data/templates/default/top.inc.php @@ -4,8 +4,8 @@ <head> <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" /> <title><?php echo filter($GLOBALS['sitename'] .(isset($pagetitle) ? ' » ' . $pagetitle : '')); ?> - - + + Date: Wed, 25 May 2011 06:57:55 +0200 Subject: [PATCH 10/38] make tag and common tag description pages valid html --- data/templates/tagcommondescriptionedit.tpl.php | 1 - data/templates/tagedit.tpl.php | 1 - 2 files changed, 2 deletions(-) diff --git a/data/templates/tagcommondescriptionedit.tpl.php b/data/templates/tagcommondescriptionedit.tpl.php index f938f93..207cfd2 100644 --- a/data/templates/tagcommondescriptionedit.tpl.php +++ b/data/templates/tagcommondescriptionedit.tpl.php @@ -36,7 +36,6 @@ window.onload = function() { -

diff --git a/data/templates/tagedit.tpl.php b/data/templates/tagedit.tpl.php index 5edfbc7..860c933 100644 --- a/data/templates/tagedit.tpl.php +++ b/data/templates/tagedit.tpl.php @@ -21,7 +21,6 @@ window.onload = function() { -

From eb3ae40f35c2ca64c5cd5c2def905b914afc8acf Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Wed, 25 May 2011 17:00:30 +0200 Subject: [PATCH 11/38] sample theme for demonstration purposes --- www/themes/testdummy/images/logo.png | Bin 0 -> 2890 bytes www/themes/testdummy/scuttle.css | 12 ++++++++++++ 2 files changed, 12 insertions(+) create mode 100644 www/themes/testdummy/images/logo.png create mode 100644 www/themes/testdummy/scuttle.css diff --git a/www/themes/testdummy/images/logo.png b/www/themes/testdummy/images/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..4a8f8bae36399e501555dbaa2fa55e379ca778d0 GIT binary patch literal 2890 zcmV-Q3$^r#P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2ipZ1 z4mu?@@Ae%401C=UL_t(&-p!g>Y+ToQ$A9N;vydE;!{H`MmTX0_QM;-$2?9@J6;7Ha zK$-$Ukyk@O7No6_r#=L5Q3OR(1l6uf_gC<}cF!*D@v$<~$QMro zpSb^legMYC9EP(N$)v&LWPI>qG4db#BmHJCLGe~ekCH`DddaBdrqK`FDl^MrkPU1S&ROD zi~a$Vz=yyG&yzNh@d*d5;okewD5dhi7w!ZLd>Q!A}00Dd31Un!H!V2WhY;6oqIkjYpW9mipsDtti4XNFQJ0~Ri~SY7cbm0Xre zHAI3f;HSWgz%=mc^vtQP+a^%R7bk&_1HT8H0*=K7GYp4B!o)Nch5-+p>}P5!(FPj> zkI5(%&Qo2se)C*|W-~x3MYZa)zUEP@`Don&aDf@%g(w;P-|3lC?ydw1`Ql07a}nqV zI#s5W8NC!rDH4%njvh;r9kDT#+P>)yM7pgK_^`6ps5U z0H^~m0nY(XP0yUFwx9LT2VUv}o&x@`rh>W7fv{2WsZ@N*>kUML4dAiqnNv^41pX2Dqwc$%$)p(_ za~K=9862|Or@WJ=CQGHN03V#5IrXXqd@5cz zJUqbh6DdZb(7)4&J&ZDwT@D{kvQ(-n;FG|s2C&#BkhK^ab9#dBCKA75cjl;J@fBT*n&o`)T2E2W>j@It-xeI^1pp?oPzz?-}FGo{3^UDqD_29OG z%8o&-gNTT*885YaJj|ulE+(@nuvI;Zxp}dddn_wM2QH8Cr*E0YV!2+ zhO%=2j+5qh9vLE$G;kb)blSkORXauYqKMmQ25rDSJy_SJH!W_-d#$c`oPV><`kF_* zUZ>Ig^)qMBpMD~m+OhzyEj@KX8P1 z`)sxJzAnA?V(%qwkg>F4BBCMCP_O&Uo~uPJwvOkO&%A!&OW*C-e%$~Nk;dDLPyTnM z`tsj{W_8siku)fmJuF*cnjzTO6`E%Fx9e&Wj=|w0369;9q<_FXFnQJM0cT#RQr!rs z)oKK~wRmCv@xKspEl z$kD{EUTi5U+tJj}=yw;elc5HP?MBFw35%Ga@uV47$Kee_N|8st>%=}!F zrIJgf;@>2RIOp#?Sw9Lm$4{gf9I|f9dwHJl$}g&{t@<>ZO+>^itvvg9Y2}$;cPxEd zM3!z!r$wXzym|Kg=l<67%KtZeZk6)7PwBebPL(_F!A=)AHvibT&5@&to1*MqMBbdO zv%Iv0@3#;M^m^sRzq)emTd#FYF9Y*E>j4p2)4Dk~d+D*S1-f^Ev@Nvnw)90e0TJ@=J1Pt`wAQES@ouk#^ zir307{A-uTd0j+W-D`T@G!YS{)Ehv0=8$bGv<}1jek9ZRey6D18B^lnMU~j|e*0d8wr4*Jqn2q$$Z4)Tui#Cw8Y!#W+xC!_>1s_{PG@%7V00YzP%kHOdwU-5k z0cG3j!1UgI>YWy~EF+q4V4A5M;Ji};192B24nTWJrnVU-fXhoBuB*vpEQYfd!^1YQ zC8dY^wK^oKu+j%cpc`;E__)V&{n{4wdVto@YzDL~34QxU1(ZtA*JtDTn#IK}`ua?c z+?8Z(%;|F3H>9etQsGC+>P{bSg+OvA?U&bmmP#%gm9S@1tNE<1cmzQc5pi8_<>$4= z8^wC#;==IYM+&Lru}5mPzT>r;fn_CWHZuVmHn@vOlw0Nua#>F39z5e8XRBLA{@dnqI{{1cB2X{^V z$;pwSk9}5T^xHcBuwfx&HP-GzJ7yL%8V+s0Igf=9RzM$LKlI}wKZ>`f54<# zZBefWtgVJUOA!&@ugp~Iul;y_;cs3Ff?Cg$TDbPa*@bIQoXrk>bbM<3(LYF~j()P$ zvPVPdBxtov48xDSkjC>XbNj)#XM4SnFMdTt{y}vJRBLy+*}D9b#pP#yvRZz=w99fg zDnL>|X1m@UW!;dfw>o#_8;`A(|7!_2yIU@_uipob-}Tkc zr_=9ySnF1Gvv%&n)y40h5Bml?XAQtAa9uW{24-UCZzH}LzmKy-3bz+u1!YLT{=cB+zY`FAd* o3}7U(OeXR?W#BCl*|k~w|K~OWG#aDKxBvhE07*qoM6N<$f*Z1#g#Z8m literal 0 HcmV?d00001 diff --git a/www/themes/testdummy/scuttle.css b/www/themes/testdummy/scuttle.css new file mode 100644 index 0000000..c62cd19 --- /dev/null +++ b/www/themes/testdummy/scuttle.css @@ -0,0 +1,12 @@ +@import url(../default/scuttle.css); + +body { + background-color: #FEA; +} + +html > body h1 { + background: url('images/logo.png') no-repeat 10px; +} +div#header { + background: #FEA; +} From a96c038b0940f3df66f4d1772e963642c9908722 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Wed, 25 May 2011 17:07:18 +0200 Subject: [PATCH 12/38] update changelog --- doc/ChangeLog | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index 8fa208c..3a2bb41 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,6 +1,9 @@ ChangeLog for SemantiScuttle ============================ +- Implement request #FIXME: Theming support + + 0.98.0 - 2011-XX-XX ------------------- - Switch to jQuery and drop dojo From 49fa996cd7be1b0f7e3b43dc7c622c2f6a901e76 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Wed, 25 May 2011 17:12:59 +0200 Subject: [PATCH 13/38] more information on custom theme creation --- doc/themes.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc/themes.rst b/doc/themes.rst index 7c40ef2..007388f 100644 --- a/doc/themes.rst +++ b/doc/themes.rst @@ -11,9 +11,14 @@ In ``data/config.php``, set your theme like this: :: $theme = 'darkmood'; +The available themes are the folders in ``www/themes/``. +By default, SemanticScuttle ships only one usable theme ("default") and one +to demonstrate how to create your own theme ("testdummy"). + Creating your own theme ======================= +Have a look at the "testdummy" theme in ``www/themes/testdummy/``. CSS and image files ------------------- @@ -26,6 +31,10 @@ The main CSS file that automatically gets included is :: www/themes/$themename/scuttle.css +Several template files in SemanticScuttle include image files. If they do not +exist in your theme, the default ones are used automatically. +Note that this is not true for images that are specified in the CSS files. + Template files -------------- From 42632fff234b2a9f4f70983874d1c37a2d939c43 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Wed, 25 May 2011 17:15:41 +0200 Subject: [PATCH 14/38] show how to modify a template --- data/templates/testdummy/top.inc.php | 66 ++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 data/templates/testdummy/top.inc.php diff --git a/data/templates/testdummy/top.inc.php b/data/templates/testdummy/top.inc.php new file mode 100644 index 0000000..7b0874c --- /dev/null +++ b/data/templates/testdummy/top.inc.php @@ -0,0 +1,66 @@ + + + + + + <?php echo filter($GLOBALS['sitename'] .(isset($pagetitle) ? ' » ' . $pagetitle : '')); ?> + + + +'; + } +} +?> + + + + + + + + + + + + + + + + + + + +'. $subtitle ."\n"; +} +if(DEBUG_MODE) { + echo '

'. T_('Admins, your installation is in "Debug Mode" ($debugMode = true). To go in "Normal Mode" and hide debugging messages, change $debugMode to false into config.php.') ."

\n"; +} +if (isset($error) && $error!='') { + echo '

'. $error ."

\n"; +} +if (isset($msg) && $msg!='') { + echo '

'. $msg ."

\n"; +} +if (isset($tipMsg) && $tipMsg!='') { + echo '

'. $tipMsg ."

\n"; +} +?> From 11341abac95478b6fbfce645dbc1e6ecf1220a6a Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Wed, 25 May 2011 19:24:03 +0200 Subject: [PATCH 15/38] name proper feature request for theming --- doc/ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 3a2bb41..ade19af 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,7 +1,7 @@ ChangeLog for SemantiScuttle ============================ -- Implement request #FIXME: Theming support +- Implement request #1989987: Theming support 0.98.0 - 2011-XX-XX From 3e7808a8fda15fa04b696bb4b3ff7fb4854b8d7c Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Wed, 25 May 2011 19:24:21 +0200 Subject: [PATCH 16/38] mention skins --- doc/themes.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/themes.rst b/doc/themes.rst index 007388f..6f34a36 100644 --- a/doc/themes.rst +++ b/doc/themes.rst @@ -1,8 +1,8 @@ ====================== SemanticScuttle Themes ====================== -SemanticScuttle may be changed visually by supplying custom "themes" that -modify the visual appearance. +SemanticScuttle may be changed visually by supplying custom "themes" (skins) +that modify the visual appearance. Changing the current theme From 5ba53394fcda4ae9cfa9af52b37fb67517deeb5a Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Wed, 25 May 2011 19:43:36 +0200 Subject: [PATCH 17/38] implement request #1989987: theme support. merge themes branch with --squash --- build.xml | 13 +-- data/config.default.php | 9 ++ data/templates/{ => default}/about.tpl.php | 0 data/templates/{ => default}/admin.tpl.php | 0 .../bookmarkcommondescriptionedit.tpl.php | 0 .../{ => default}/bookmarklet.inc.php | 0 .../bookmarks-thumbnail.inc.tpl.php | 0 .../bookmarks-vote-horizontal.inc.tpl.php | 0 .../{ => default}/bookmarks-vote.inc.tpl.php | 0 .../templates/{ => default}/bookmarks.tpl.php | 25 +++-- data/templates/{ => default}/bottom.inc.php | 0 data/templates/{ => default}/dojo.inc.php | 0 .../{ => default}/dynamictags.inc.php | 0 .../{ => default}/editbookmark.tpl.php | 0 .../editprofile-sslclientcerts.tpl.php | 0 .../{ => default}/editprofile.tpl.php | 0 .../templates/{ => default}/error.404.tpl.php | 0 .../templates/{ => default}/error.500.tpl.php | 0 .../{ => default}/importDelicious.tpl.php | 0 .../{ => default}/importNetscape.tpl.php | 0 .../{ => default}/importStructure.tpl.php | 0 data/templates/{ => default}/login.tpl.php | 0 data/templates/{ => default}/password.tpl.php | 0 data/templates/{ => default}/profile.tpl.php | 0 data/templates/{ => default}/register.tpl.php | 0 data/templates/{ => default}/rss.tpl.php | 0 data/templates/{ => default}/search.menu.php | 0 .../{ => default}/sidebar.block.common.php | 0 .../{ => default}/sidebar.block.linked.php | 0 .../{ => default}/sidebar.block.menu.php | 0 .../{ => default}/sidebar.block.menu2.php | 0 .../{ => default}/sidebar.block.popular.php | 0 .../{ => default}/sidebar.block.recent.php | 0 .../{ => default}/sidebar.block.related.php | 0 .../{ => default}/sidebar.block.search.php | 0 .../sidebar.block.tagactions.php | 0 .../{ => default}/sidebar.block.users.php | 0 .../{ => default}/sidebar.block.watchlist.php | 0 .../sidebar.block.watchstatus.php | 0 .../{ => default}/sidebar.linkedtags.inc.php | 0 data/templates/{ => default}/sidebar.tpl.php | 0 .../{ => default}/tag2tagadd.tpl.php | 0 .../{ => default}/tag2tagdelete.tpl.php | 0 .../{ => default}/tag2tagedit.tpl.php | 0 .../tagcommondescriptionedit.tpl.php | 0 .../templates/{ => default}/tagdelete.tpl.php | 0 data/templates/{ => default}/tagedit.tpl.php | 0 .../templates/{ => default}/tagrename.tpl.php | 0 data/templates/{ => default}/tags.tpl.php | 0 data/templates/{ => default}/toolbar.inc.php | 0 data/templates/{ => default}/top.inc.php | 4 +- data/templates/{ => default}/users.tpl.php | 0 data/templates/testdummy/top.inc.php | 66 ++++++++++++ doc/ChangeLog | 3 + doc/themes.rst | 48 +++++++++ src/SemanticScuttle/Model/Template.php | 3 + src/SemanticScuttle/Model/Theme.php | 97 ++++++++++++++++++ src/SemanticScuttle/Service/Template.php | 29 +++++- src/SemanticScuttle/header.php | 3 + www/jsScuttle.php | 5 +- www/{ => themes/default}/icon.png | Bin www/{ => themes/default}/images/b_edit.png | Bin www/{ => themes/default}/images/bg_admin.png | Bin www/{ => themes/default}/images/bg_bar.png | Bin www/{ => themes/default}/images/bg_header.png | Bin .../default}/images/bg_sidebar.png | Bin www/{ => themes/default}/images/loading.gif | Bin www/{ => themes/default}/images/logo.png | Bin www/{ => themes/default}/images/logo_24.gif | Bin www/{ => themes/default}/images/rss.gif | Bin .../default}/images/thumbs_up.orig.png | Bin .../default}/images/vote-against-voted.png | Bin .../default}/images/vote-against.png | Bin .../default}/images/vote-for-voted.png | Bin www/{ => themes/default}/images/vote-for.png | Bin www/{ => themes/default}/scuttle.css | 0 www/themes/testdummy/images/logo.png | Bin 0 -> 2890 bytes www/themes/testdummy/scuttle.css | 12 +++ 78 files changed, 298 insertions(+), 19 deletions(-) rename data/templates/{ => default}/about.tpl.php (100%) rename data/templates/{ => default}/admin.tpl.php (100%) rename data/templates/{ => default}/bookmarkcommondescriptionedit.tpl.php (100%) rename data/templates/{ => default}/bookmarklet.inc.php (100%) rename data/templates/{ => default}/bookmarks-thumbnail.inc.tpl.php (100%) rename data/templates/{ => default}/bookmarks-vote-horizontal.inc.tpl.php (100%) rename data/templates/{ => default}/bookmarks-vote.inc.tpl.php (100%) rename data/templates/{ => default}/bookmarks.tpl.php (92%) rename data/templates/{ => default}/bottom.inc.php (100%) rename data/templates/{ => default}/dojo.inc.php (100%) rename data/templates/{ => default}/dynamictags.inc.php (100%) rename data/templates/{ => default}/editbookmark.tpl.php (100%) rename data/templates/{ => default}/editprofile-sslclientcerts.tpl.php (100%) rename data/templates/{ => default}/editprofile.tpl.php (100%) rename data/templates/{ => default}/error.404.tpl.php (100%) rename data/templates/{ => default}/error.500.tpl.php (100%) rename data/templates/{ => default}/importDelicious.tpl.php (100%) rename data/templates/{ => default}/importNetscape.tpl.php (100%) rename data/templates/{ => default}/importStructure.tpl.php (100%) rename data/templates/{ => default}/login.tpl.php (100%) rename data/templates/{ => default}/password.tpl.php (100%) rename data/templates/{ => default}/profile.tpl.php (100%) rename data/templates/{ => default}/register.tpl.php (100%) rename data/templates/{ => default}/rss.tpl.php (100%) rename data/templates/{ => default}/search.menu.php (100%) rename data/templates/{ => default}/sidebar.block.common.php (100%) rename data/templates/{ => default}/sidebar.block.linked.php (100%) rename data/templates/{ => default}/sidebar.block.menu.php (100%) rename data/templates/{ => default}/sidebar.block.menu2.php (100%) rename data/templates/{ => default}/sidebar.block.popular.php (100%) rename data/templates/{ => default}/sidebar.block.recent.php (100%) rename data/templates/{ => default}/sidebar.block.related.php (100%) rename data/templates/{ => default}/sidebar.block.search.php (100%) rename data/templates/{ => default}/sidebar.block.tagactions.php (100%) rename data/templates/{ => default}/sidebar.block.users.php (100%) rename data/templates/{ => default}/sidebar.block.watchlist.php (100%) rename data/templates/{ => default}/sidebar.block.watchstatus.php (100%) rename data/templates/{ => default}/sidebar.linkedtags.inc.php (100%) rename data/templates/{ => default}/sidebar.tpl.php (100%) rename data/templates/{ => default}/tag2tagadd.tpl.php (100%) rename data/templates/{ => default}/tag2tagdelete.tpl.php (100%) rename data/templates/{ => default}/tag2tagedit.tpl.php (100%) rename data/templates/{ => default}/tagcommondescriptionedit.tpl.php (100%) rename data/templates/{ => default}/tagdelete.tpl.php (100%) rename data/templates/{ => default}/tagedit.tpl.php (100%) rename data/templates/{ => default}/tagrename.tpl.php (100%) rename data/templates/{ => default}/tags.tpl.php (100%) rename data/templates/{ => default}/toolbar.inc.php (100%) rename data/templates/{ => default}/top.inc.php (92%) rename data/templates/{ => default}/users.tpl.php (100%) create mode 100644 data/templates/testdummy/top.inc.php create mode 100644 doc/themes.rst create mode 100644 src/SemanticScuttle/Model/Theme.php rename www/{ => themes/default}/icon.png (100%) rename www/{ => themes/default}/images/b_edit.png (100%) rename www/{ => themes/default}/images/bg_admin.png (100%) rename www/{ => themes/default}/images/bg_bar.png (100%) rename www/{ => themes/default}/images/bg_header.png (100%) rename www/{ => themes/default}/images/bg_sidebar.png (100%) rename www/{ => themes/default}/images/loading.gif (100%) rename www/{ => themes/default}/images/logo.png (100%) rename www/{ => themes/default}/images/logo_24.gif (100%) rename www/{ => themes/default}/images/rss.gif (100%) rename www/{ => themes/default}/images/thumbs_up.orig.png (100%) rename www/{ => themes/default}/images/vote-against-voted.png (100%) rename www/{ => themes/default}/images/vote-against.png (100%) rename www/{ => themes/default}/images/vote-for-voted.png (100%) rename www/{ => themes/default}/images/vote-for.png (100%) rename www/{ => themes/default}/scuttle.css (100%) create mode 100644 www/themes/testdummy/images/logo.png create mode 100644 www/themes/testdummy/scuttle.css diff --git a/build.xml b/build.xml index 9773a63..7b3896b 100644 --- a/build.xml +++ b/build.xml @@ -121,18 +121,19 @@ + 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 similarity index 100% rename from data/templates/about.tpl.php rename to data/templates/default/about.tpl.php diff --git a/data/templates/admin.tpl.php b/data/templates/default/admin.tpl.php similarity index 100% rename from data/templates/admin.tpl.php rename to data/templates/default/admin.tpl.php diff --git a/data/templates/bookmarkcommondescriptionedit.tpl.php b/data/templates/default/bookmarkcommondescriptionedit.tpl.php similarity index 100% rename from data/templates/bookmarkcommondescriptionedit.tpl.php rename to data/templates/default/bookmarkcommondescriptionedit.tpl.php diff --git a/data/templates/bookmarklet.inc.php b/data/templates/default/bookmarklet.inc.php similarity index 100% rename from data/templates/bookmarklet.inc.php rename to 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 similarity index 100% rename from data/templates/bookmarks-thumbnail.inc.tpl.php rename to 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 similarity index 100% rename from data/templates/bookmarks-vote-horizontal.inc.tpl.php rename to 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 similarity index 100% rename from data/templates/bookmarks-vote.inc.tpl.php rename to data/templates/default/bookmarks-vote.inc.tpl.php diff --git a/data/templates/bookmarks.tpl.php b/data/templates/default/bookmarks.tpl.php similarity index 92% rename from data/templates/bookmarks.tpl.php rename to data/templates/default/bookmarks.tpl.php index 55d6a0f..91d50bf 100644 --- a/data/templates/bookmarks.tpl.php +++ b/data/templates/default/bookmarks.tpl.php @@ -39,7 +39,9 @@ include('search.menu.php'); isAdmin($userid) && $pageName != PAGE_WATCHLIST) : ?>
- + + +
@@ -70,7 +72,7 @@ if ($userservice->isLoggedOn()) { ) { echo ' '; echo !is_array($cDescription) || strlen($cDescription['cdDescription'])==0?T_('Edit the common description of this tag'):''; - echo ' '; + echo ' '; } else if (isset($hash)) { echo ' ('; echo T_('Edit the common description of this bookmark').')'; @@ -95,7 +97,7 @@ if($userservice->isLoggedOn()) { if($currenttag!= '') { echo ' '; echo strlen($pDescription['tDescription'])==0?T_('Edit your personal description of this tag'):''; - echo ' '; + echo ' '; } } ?>

@@ -219,9 +221,12 @@ if ($currenttag!= '') { $brss = ''; $size = count($rsschannels); for ($i = 0; $i < $size; $i++) { - $brss = '' - . '' . htmlspecialchars($rsschannels[$i][0]) .'' + . '' . htmlspecialchars($rsschannels[$i][0]) .'' . ''; } @@ -361,9 +366,15 @@ if ($currenttag!= '') { } // Admin specific design - if ($userservice->isAdmin($row['username']) && $GLOBALS['enableAdminColors']) { + if ($userservice->isAdmin($row['username']) + && $GLOBALS['enableAdminColors'] + ) { $adminBgClass = ' class="adminBackground"'; - $adminStar = ' '; + $adminStar = ' '; } else { $adminBgClass = ''; $adminStar = ''; diff --git a/data/templates/bottom.inc.php b/data/templates/default/bottom.inc.php similarity index 100% rename from data/templates/bottom.inc.php rename to data/templates/default/bottom.inc.php diff --git a/data/templates/dojo.inc.php b/data/templates/default/dojo.inc.php similarity index 100% rename from data/templates/dojo.inc.php rename to data/templates/default/dojo.inc.php diff --git a/data/templates/dynamictags.inc.php b/data/templates/default/dynamictags.inc.php similarity index 100% rename from data/templates/dynamictags.inc.php rename to data/templates/default/dynamictags.inc.php diff --git a/data/templates/editbookmark.tpl.php b/data/templates/default/editbookmark.tpl.php similarity index 100% rename from data/templates/editbookmark.tpl.php rename to data/templates/default/editbookmark.tpl.php diff --git a/data/templates/editprofile-sslclientcerts.tpl.php b/data/templates/default/editprofile-sslclientcerts.tpl.php similarity index 100% rename from data/templates/editprofile-sslclientcerts.tpl.php rename to data/templates/default/editprofile-sslclientcerts.tpl.php diff --git a/data/templates/editprofile.tpl.php b/data/templates/default/editprofile.tpl.php similarity index 100% rename from data/templates/editprofile.tpl.php rename to data/templates/default/editprofile.tpl.php diff --git a/data/templates/error.404.tpl.php b/data/templates/default/error.404.tpl.php similarity index 100% rename from data/templates/error.404.tpl.php rename to data/templates/default/error.404.tpl.php diff --git a/data/templates/error.500.tpl.php b/data/templates/default/error.500.tpl.php similarity index 100% rename from data/templates/error.500.tpl.php rename to data/templates/default/error.500.tpl.php diff --git a/data/templates/importDelicious.tpl.php b/data/templates/default/importDelicious.tpl.php similarity index 100% rename from data/templates/importDelicious.tpl.php rename to data/templates/default/importDelicious.tpl.php diff --git a/data/templates/importNetscape.tpl.php b/data/templates/default/importNetscape.tpl.php similarity index 100% rename from data/templates/importNetscape.tpl.php rename to data/templates/default/importNetscape.tpl.php diff --git a/data/templates/importStructure.tpl.php b/data/templates/default/importStructure.tpl.php similarity index 100% rename from data/templates/importStructure.tpl.php rename to data/templates/default/importStructure.tpl.php diff --git a/data/templates/login.tpl.php b/data/templates/default/login.tpl.php similarity index 100% rename from data/templates/login.tpl.php rename to data/templates/default/login.tpl.php diff --git a/data/templates/password.tpl.php b/data/templates/default/password.tpl.php similarity index 100% rename from data/templates/password.tpl.php rename to data/templates/default/password.tpl.php diff --git a/data/templates/profile.tpl.php b/data/templates/default/profile.tpl.php similarity index 100% rename from data/templates/profile.tpl.php rename to data/templates/default/profile.tpl.php diff --git a/data/templates/register.tpl.php b/data/templates/default/register.tpl.php similarity index 100% rename from data/templates/register.tpl.php rename to data/templates/default/register.tpl.php diff --git a/data/templates/rss.tpl.php b/data/templates/default/rss.tpl.php similarity index 100% rename from data/templates/rss.tpl.php rename to data/templates/default/rss.tpl.php diff --git a/data/templates/search.menu.php b/data/templates/default/search.menu.php similarity index 100% rename from data/templates/search.menu.php rename to data/templates/default/search.menu.php diff --git a/data/templates/sidebar.block.common.php b/data/templates/default/sidebar.block.common.php similarity index 100% rename from data/templates/sidebar.block.common.php rename to data/templates/default/sidebar.block.common.php diff --git a/data/templates/sidebar.block.linked.php b/data/templates/default/sidebar.block.linked.php similarity index 100% rename from data/templates/sidebar.block.linked.php rename to data/templates/default/sidebar.block.linked.php diff --git a/data/templates/sidebar.block.menu.php b/data/templates/default/sidebar.block.menu.php similarity index 100% rename from data/templates/sidebar.block.menu.php rename to data/templates/default/sidebar.block.menu.php diff --git a/data/templates/sidebar.block.menu2.php b/data/templates/default/sidebar.block.menu2.php similarity index 100% rename from data/templates/sidebar.block.menu2.php rename to data/templates/default/sidebar.block.menu2.php diff --git a/data/templates/sidebar.block.popular.php b/data/templates/default/sidebar.block.popular.php similarity index 100% rename from data/templates/sidebar.block.popular.php rename to data/templates/default/sidebar.block.popular.php diff --git a/data/templates/sidebar.block.recent.php b/data/templates/default/sidebar.block.recent.php similarity index 100% rename from data/templates/sidebar.block.recent.php rename to data/templates/default/sidebar.block.recent.php diff --git a/data/templates/sidebar.block.related.php b/data/templates/default/sidebar.block.related.php similarity index 100% rename from data/templates/sidebar.block.related.php rename to data/templates/default/sidebar.block.related.php diff --git a/data/templates/sidebar.block.search.php b/data/templates/default/sidebar.block.search.php similarity index 100% rename from data/templates/sidebar.block.search.php rename to data/templates/default/sidebar.block.search.php diff --git a/data/templates/sidebar.block.tagactions.php b/data/templates/default/sidebar.block.tagactions.php similarity index 100% rename from data/templates/sidebar.block.tagactions.php rename to data/templates/default/sidebar.block.tagactions.php diff --git a/data/templates/sidebar.block.users.php b/data/templates/default/sidebar.block.users.php similarity index 100% rename from data/templates/sidebar.block.users.php rename to data/templates/default/sidebar.block.users.php diff --git a/data/templates/sidebar.block.watchlist.php b/data/templates/default/sidebar.block.watchlist.php similarity index 100% rename from data/templates/sidebar.block.watchlist.php rename to data/templates/default/sidebar.block.watchlist.php diff --git a/data/templates/sidebar.block.watchstatus.php b/data/templates/default/sidebar.block.watchstatus.php similarity index 100% rename from data/templates/sidebar.block.watchstatus.php rename to data/templates/default/sidebar.block.watchstatus.php diff --git a/data/templates/sidebar.linkedtags.inc.php b/data/templates/default/sidebar.linkedtags.inc.php similarity index 100% rename from data/templates/sidebar.linkedtags.inc.php rename to data/templates/default/sidebar.linkedtags.inc.php diff --git a/data/templates/sidebar.tpl.php b/data/templates/default/sidebar.tpl.php similarity index 100% rename from data/templates/sidebar.tpl.php rename to data/templates/default/sidebar.tpl.php diff --git a/data/templates/tag2tagadd.tpl.php b/data/templates/default/tag2tagadd.tpl.php similarity index 100% rename from data/templates/tag2tagadd.tpl.php rename to data/templates/default/tag2tagadd.tpl.php diff --git a/data/templates/tag2tagdelete.tpl.php b/data/templates/default/tag2tagdelete.tpl.php similarity index 100% rename from data/templates/tag2tagdelete.tpl.php rename to data/templates/default/tag2tagdelete.tpl.php diff --git a/data/templates/tag2tagedit.tpl.php b/data/templates/default/tag2tagedit.tpl.php similarity index 100% rename from data/templates/tag2tagedit.tpl.php rename to data/templates/default/tag2tagedit.tpl.php diff --git a/data/templates/tagcommondescriptionedit.tpl.php b/data/templates/default/tagcommondescriptionedit.tpl.php similarity index 100% rename from data/templates/tagcommondescriptionedit.tpl.php rename to data/templates/default/tagcommondescriptionedit.tpl.php diff --git a/data/templates/tagdelete.tpl.php b/data/templates/default/tagdelete.tpl.php similarity index 100% rename from data/templates/tagdelete.tpl.php rename to data/templates/default/tagdelete.tpl.php diff --git a/data/templates/tagedit.tpl.php b/data/templates/default/tagedit.tpl.php similarity index 100% rename from data/templates/tagedit.tpl.php rename to data/templates/default/tagedit.tpl.php diff --git a/data/templates/tagrename.tpl.php b/data/templates/default/tagrename.tpl.php similarity index 100% rename from data/templates/tagrename.tpl.php rename to data/templates/default/tagrename.tpl.php diff --git a/data/templates/tags.tpl.php b/data/templates/default/tags.tpl.php similarity index 100% rename from data/templates/tags.tpl.php rename to data/templates/default/tags.tpl.php diff --git a/data/templates/toolbar.inc.php b/data/templates/default/toolbar.inc.php similarity index 100% rename from data/templates/toolbar.inc.php rename to data/templates/default/toolbar.inc.php diff --git a/data/templates/top.inc.php b/data/templates/default/top.inc.php similarity index 92% rename from data/templates/top.inc.php rename to data/templates/default/top.inc.php index bdd4b1a..9eed6ff 100644 --- a/data/templates/top.inc.php +++ b/data/templates/default/top.inc.php @@ -4,8 +4,8 @@ <?php echo filter($GLOBALS['sitename'] .(isset($pagetitle) ? ' » ' . $pagetitle : '')); ?> - - + + + + + + + <?php echo filter($GLOBALS['sitename'] .(isset($pagetitle) ? ' » ' . $pagetitle : '')); ?> + + + +'; + } +} +?> + + + + + + + + + + + + + + + + + + + +'. $subtitle ."\n"; +} +if(DEBUG_MODE) { + echo '

'. T_('Admins, your installation is in "Debug Mode" ($debugMode = true). To go in "Normal Mode" and hide debugging messages, change $debugMode to false into config.php.') ."

\n"; +} +if (isset($error) && $error!='') { + echo '

'. $error ."

\n"; +} +if (isset($msg) && $msg!='') { + echo '

'. $msg ."

\n"; +} +if (isset($tipMsg) && $tipMsg!='') { + echo '

'. $tipMsg ."

\n"; +} +?> diff --git a/doc/ChangeLog b/doc/ChangeLog index 8fa208c..ade19af 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,6 +1,9 @@ ChangeLog for SemantiScuttle ============================ +- Implement request #1989987: Theming support + + 0.98.0 - 2011-XX-XX ------------------- - Switch to jQuery and drop dojo diff --git a/doc/themes.rst b/doc/themes.rst new file mode 100644 index 0000000..6f34a36 --- /dev/null +++ b/doc/themes.rst @@ -0,0 +1,48 @@ +====================== +SemanticScuttle Themes +====================== +SemanticScuttle may be changed visually by supplying custom "themes" (skins) +that modify the visual appearance. + + +Changing the current theme +========================== +In ``data/config.php``, set your theme like this: :: + + $theme = 'darkmood'; + +The available themes are the folders in ``www/themes/``. +By default, SemanticScuttle ships only one usable theme ("default") and one +to demonstrate how to create your own theme ("testdummy"). + + +Creating your own theme +======================= +Have a look at the "testdummy" theme in ``www/themes/testdummy/``. + +CSS and image files +------------------- +Since both file types need to be accessible via the web server directly, +they are located in the ``www/`` folder: :: + + www/themes/$themename/ + +The main CSS file that automatically gets included is :: + + www/themes/$themename/scuttle.css + +Several template files in SemanticScuttle include image files. If they do not +exist in your theme, the default ones are used automatically. +Note that this is not true for images that are specified in the CSS files. + + +Template files +-------------- +The templates of the default file are located in :: + + data/templates/default/ + +You may put your theme template files into :: + + data/templates/$themename/ + 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/Model/Theme.php b/src/SemanticScuttle/Model/Theme.php new file mode 100644 index 0000000..65861b8 --- /dev/null +++ b/src/SemanticScuttle/Model/Theme.php @@ -0,0 +1,97 @@ + + * @license AGPL v3 or later http://www.gnu.org/licenses/agpl.html + * @link http://sourceforge.net/projects/semanticscuttle + */ + +/** + * A theme, the visual representation of SemanticScuttle. + * + * @category Bookmarking + * @package SemanticScuttle + * @author Christian Weiske + * @license AGPL v3 or later http://www.gnu.org/licenses/agpl.html + * @link http://sourceforge.net/projects/semanticscuttle + */ +class SemanticScuttle_Model_Theme +{ + /** + * Theme name. Also the path part of template and resource files + * + * @var string + */ + protected $name = null; + + /** + * Local path to the www themes directory. + * Needs to have a trailing slash. + * + * @var string + */ + protected $wwwThemeDir = null; + + + + /** + * Create a new theme instance. + * + * @param string $name Theme name "data/templates/(*)/" + */ + public function __construct($name = 'default') + { + $this->name = $name; + $this->wwwThemeDir = $GLOBALS['wwwdir'] . '/themes/'; + //TODO: implement theme hierarchies with parent fallback + } + + + + /** + * Returns the URL path to a resource file (www/themes/$name/$file). + * Automatically falls back to the parent theme if the file does not exist + * in the theme. + * + * Must always be used when adding i.e. images to the output. + * + * @param string $file File name to find the path for, i.e. "scuttle.css". + * + * @return string Full path + */ + public function resource($file) + { + $themeFile = $this->wwwThemeDir . $this->name . '/' . $file; + if (file_exists($themeFile)) { + return ROOT . 'themes/' . $this->name . '/' . $file; + } + + $defaultFile = $this->wwwThemeDir . 'default/' . $file; + if (file_exists($defaultFile)) { + return ROOT . 'themes/default/' . $file; + } + + //file does not exist. fall back to the theme file + // to guide the theme author a bit. + // TODO: logging. in admin mode, there should be a message + return ROOT . 'themes/' . $this->name . '/' . $file; + } + + + + /** + * Returns the theme name. + * + * @return string Theme name + */ + public function getName() + { + return $this->name; + } +} +?> \ No newline at end of file diff --git a/src/SemanticScuttle/Service/Template.php b/src/SemanticScuttle/Service/Template.php index efa8d28..b5d4cfa 100644 --- a/src/SemanticScuttle/Service/Template.php +++ b/src/SemanticScuttle/Service/Template.php @@ -14,6 +14,7 @@ */ require_once 'SemanticScuttle/Model/Template.php'; +require_once 'SemanticScuttle/Model/Theme.php'; /** * SemanticScuttle template service. @@ -38,6 +39,14 @@ class SemanticScuttle_Service_Template extends SemanticScuttle_Service */ protected $basedir; + /** + * The template theme to use. + * Set in constructor based on $GLOBALS['theme'] + * + * @var SemanticScuttle_Model_Theme + */ + protected $theme; + /** @@ -64,6 +73,8 @@ class SemanticScuttle_Service_Template extends SemanticScuttle_Service protected function __construct() { $this->basedir = $GLOBALS['TEMPLATES_DIR']; + $this->theme = new SemanticScuttle_Model_Theme($GLOBALS['theme']); + //FIXME: verify the theme exists } @@ -74,19 +85,33 @@ class SemanticScuttle_Service_Template extends SemanticScuttle_Service * @param string $template Template filename relative * to template dir * @param array $vars Array of template variables. + * The current theme object will be added + * automatically with name "theme". * * @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->getName() + . PATH_SEPARATOR . $this->basedir . 'default' + //needed since services are instantiated in templates + . PATH_SEPARATOR . $oldIncPath + ); + + $vars['theme'] = $this->theme; $tpl = new SemanticScuttle_Model_Template( - $this->basedir .'/'. $template, $vars, $this + $template, $vars, $this ); $tpl->parse(); + set_include_path($oldIncPath); + return $tpl; } } diff --git a/src/SemanticScuttle/header.php b/src/SemanticScuttle/header.php index 098e5c3..6c0d4df 100644 --- a/src/SemanticScuttle/header.php +++ b/src/SemanticScuttle/header.php @@ -18,9 +18,12 @@ if ('@data_dir@' == '@' . 'data_dir@') { //non pear-install $datadir = dirname(__FILE__) . '/../../data/'; + $wwwdir = dirname(__FILE__) . '/../../www/'; } else { //pear installation; files are in include path $datadir = '@data_dir@/SemanticScuttle/'; + //FIXME: when you have multiple installations, the www_dir will be wrong + $wwwdir = '@www_dir@/SemanticScuttle/'; } if (!file_exists($datadir . '/config.php')) { diff --git a/www/jsScuttle.php b/www/jsScuttle.php index c166755..5e5f31b 100644 --- a/www/jsScuttle.php +++ b/www/jsScuttle.php @@ -3,6 +3,7 @@ $GLOBALS['saveInLastUrl'] = false; $httpContentType = 'text/javascript'; require_once 'www-header.php'; require_once 'SemanticScuttle/functions.php'; +$theme = new SemanticScuttle_Model_Theme($GLOBALS['theme']); $player_root = ROOT .'includes/player/'; ?> @@ -62,7 +63,7 @@ function isAvailable(input, response){ username = username.trim(); var availability = document.getElementById("availability"); if (username != '') { - usernameField.style.backgroundImage = 'url(images/loading.gif)'; + usernameField.style.backgroundImage = 'url(resource('images/loading.gif'); ?>)'; if (response != '') { usernameField.style.backgroundImage = 'none'; if (response == 'true') { @@ -92,7 +93,7 @@ function useAddress(ele) { function getTitle(input, response){ var title = document.getElementById('titleField'); if (title.value == '') { - title.style.backgroundImage = 'url(images/loading.gif)'; + title.style.backgroundImage = 'url(resource('images/loading.gif');?>)'; if (response != null) { title.style.backgroundImage = 'none'; title.value = response; diff --git a/www/icon.png b/www/themes/default/icon.png similarity index 100% rename from www/icon.png rename to www/themes/default/icon.png diff --git a/www/images/b_edit.png b/www/themes/default/images/b_edit.png similarity index 100% rename from www/images/b_edit.png rename to www/themes/default/images/b_edit.png diff --git a/www/images/bg_admin.png b/www/themes/default/images/bg_admin.png similarity index 100% rename from www/images/bg_admin.png rename to www/themes/default/images/bg_admin.png diff --git a/www/images/bg_bar.png b/www/themes/default/images/bg_bar.png similarity index 100% rename from www/images/bg_bar.png rename to www/themes/default/images/bg_bar.png diff --git a/www/images/bg_header.png b/www/themes/default/images/bg_header.png similarity index 100% rename from www/images/bg_header.png rename to www/themes/default/images/bg_header.png diff --git a/www/images/bg_sidebar.png b/www/themes/default/images/bg_sidebar.png similarity index 100% rename from www/images/bg_sidebar.png rename to www/themes/default/images/bg_sidebar.png diff --git a/www/images/loading.gif b/www/themes/default/images/loading.gif similarity index 100% rename from www/images/loading.gif rename to www/themes/default/images/loading.gif diff --git a/www/images/logo.png b/www/themes/default/images/logo.png similarity index 100% rename from www/images/logo.png rename to www/themes/default/images/logo.png diff --git a/www/images/logo_24.gif b/www/themes/default/images/logo_24.gif similarity index 100% rename from www/images/logo_24.gif rename to www/themes/default/images/logo_24.gif diff --git a/www/images/rss.gif b/www/themes/default/images/rss.gif similarity index 100% rename from www/images/rss.gif rename to www/themes/default/images/rss.gif diff --git a/www/images/thumbs_up.orig.png b/www/themes/default/images/thumbs_up.orig.png similarity index 100% rename from www/images/thumbs_up.orig.png rename to www/themes/default/images/thumbs_up.orig.png diff --git a/www/images/vote-against-voted.png b/www/themes/default/images/vote-against-voted.png similarity index 100% rename from www/images/vote-against-voted.png rename to www/themes/default/images/vote-against-voted.png diff --git a/www/images/vote-against.png b/www/themes/default/images/vote-against.png similarity index 100% rename from www/images/vote-against.png rename to www/themes/default/images/vote-against.png diff --git a/www/images/vote-for-voted.png b/www/themes/default/images/vote-for-voted.png similarity index 100% rename from www/images/vote-for-voted.png rename to www/themes/default/images/vote-for-voted.png diff --git a/www/images/vote-for.png b/www/themes/default/images/vote-for.png similarity index 100% rename from www/images/vote-for.png rename to www/themes/default/images/vote-for.png diff --git a/www/scuttle.css b/www/themes/default/scuttle.css similarity index 100% rename from www/scuttle.css rename to www/themes/default/scuttle.css diff --git a/www/themes/testdummy/images/logo.png b/www/themes/testdummy/images/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..4a8f8bae36399e501555dbaa2fa55e379ca778d0 GIT binary patch literal 2890 zcmV-Q3$^r#P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2ipZ1 z4mu?@@Ae%401C=UL_t(&-p!g>Y+ToQ$A9N;vydE;!{H`MmTX0_QM;-$2?9@J6;7Ha zK$-$Ukyk@O7No6_r#=L5Q3OR(1l6uf_gC<}cF!*D@v$<~$QMro zpSb^legMYC9EP(N$)v&LWPI>qG4db#BmHJCLGe~ekCH`DddaBdrqK`FDl^MrkPU1S&ROD zi~a$Vz=yyG&yzNh@d*d5;okewD5dhi7w!ZLd>Q!A}00Dd31Un!H!V2WhY;6oqIkjYpW9mipsDtti4XNFQJ0~Ri~SY7cbm0Xre zHAI3f;HSWgz%=mc^vtQP+a^%R7bk&_1HT8H0*=K7GYp4B!o)Nch5-+p>}P5!(FPj> zkI5(%&Qo2se)C*|W-~x3MYZa)zUEP@`Don&aDf@%g(w;P-|3lC?ydw1`Ql07a}nqV zI#s5W8NC!rDH4%njvh;r9kDT#+P>)yM7pgK_^`6ps5U z0H^~m0nY(XP0yUFwx9LT2VUv}o&x@`rh>W7fv{2WsZ@N*>kUML4dAiqnNv^41pX2Dqwc$%$)p(_ za~K=9862|Or@WJ=CQGHN03V#5IrXXqd@5cz zJUqbh6DdZb(7)4&J&ZDwT@D{kvQ(-n;FG|s2C&#BkhK^ab9#dBCKA75cjl;J@fBT*n&o`)T2E2W>j@It-xeI^1pp?oPzz?-}FGo{3^UDqD_29OG z%8o&-gNTT*885YaJj|ulE+(@nuvI;Zxp}dddn_wM2QH8Cr*E0YV!2+ zhO%=2j+5qh9vLE$G;kb)blSkORXauYqKMmQ25rDSJy_SJH!W_-d#$c`oPV><`kF_* zUZ>Ig^)qMBpMD~m+OhzyEj@KX8P1 z`)sxJzAnA?V(%qwkg>F4BBCMCP_O&Uo~uPJwvOkO&%A!&OW*C-e%$~Nk;dDLPyTnM z`tsj{W_8siku)fmJuF*cnjzTO6`E%Fx9e&Wj=|w0369;9q<_FXFnQJM0cT#RQr!rs z)oKK~wRmCv@xKspEl z$kD{EUTi5U+tJj}=yw;elc5HP?MBFw35%Ga@uV47$Kee_N|8st>%=}!F zrIJgf;@>2RIOp#?Sw9Lm$4{gf9I|f9dwHJl$}g&{t@<>ZO+>^itvvg9Y2}$;cPxEd zM3!z!r$wXzym|Kg=l<67%KtZeZk6)7PwBebPL(_F!A=)AHvibT&5@&to1*MqMBbdO zv%Iv0@3#;M^m^sRzq)emTd#FYF9Y*E>j4p2)4Dk~d+D*S1-f^Ev@Nvnw)90e0TJ@=J1Pt`wAQES@ouk#^ zir307{A-uTd0j+W-D`T@G!YS{)Ehv0=8$bGv<}1jek9ZRey6D18B^lnMU~j|e*0d8wr4*Jqn2q$$Z4)Tui#Cw8Y!#W+xC!_>1s_{PG@%7V00YzP%kHOdwU-5k z0cG3j!1UgI>YWy~EF+q4V4A5M;Ji};192B24nTWJrnVU-fXhoBuB*vpEQYfd!^1YQ zC8dY^wK^oKu+j%cpc`;E__)V&{n{4wdVto@YzDL~34QxU1(ZtA*JtDTn#IK}`ua?c z+?8Z(%;|F3H>9etQsGC+>P{bSg+OvA?U&bmmP#%gm9S@1tNE<1cmzQc5pi8_<>$4= z8^wC#;==IYM+&Lru}5mPzT>r;fn_CWHZuVmHn@vOlw0Nua#>F39z5e8XRBLA{@dnqI{{1cB2X{^V z$;pwSk9}5T^xHcBuwfx&HP-GzJ7yL%8V+s0Igf=9RzM$LKlI}wKZ>`f54<# zZBefWtgVJUOA!&@ugp~Iul;y_;cs3Ff?Cg$TDbPa*@bIQoXrk>bbM<3(LYF~j()P$ zvPVPdBxtov48xDSkjC>XbNj)#XM4SnFMdTt{y}vJRBLy+*}D9b#pP#yvRZz=w99fg zDnL>|X1m@UW!;dfw>o#_8;`A(|7!_2yIU@_uipob-}Tkc zr_=9ySnF1Gvv%&n)y40h5Bml?XAQtAa9uW{24-UCZzH}LzmKy-3bz+u1!YLT{=cB+zY`FAd* o3}7U(OeXR?W#BCl*|k~w|K~OWG#aDKxBvhE07*qoM6N<$f*Z1#g#Z8m literal 0 HcmV?d00001 diff --git a/www/themes/testdummy/scuttle.css b/www/themes/testdummy/scuttle.css new file mode 100644 index 0000000..c62cd19 --- /dev/null +++ b/www/themes/testdummy/scuttle.css @@ -0,0 +1,12 @@ +@import url(../default/scuttle.css); + +body { + background-color: #FEA; +} + +html > body h1 { + background: url('images/logo.png') no-repeat 10px; +} +div#header { + background: #FEA; +} From b279ded75769818ae78ca11654ecef935d6cb956 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Wed, 25 May 2011 19:51:16 +0200 Subject: [PATCH 18/38] move themes to 0.98 --- doc/ChangeLog | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index ade19af..0730b7f 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,8 +1,6 @@ ChangeLog for SemantiScuttle ============================ -- Implement request #1989987: Theming support - 0.98.0 - 2011-XX-XX ------------------- @@ -11,6 +9,7 @@ ChangeLog for SemantiScuttle - Fix bug in getTagsForBookmarks() that fetched all tags - Fix bug #3097187: Using opensearch with two tags does not work in Firefox - Fix bug #3251877: French translation JavaScript Bug when editing bookmarks +- Implement request #1989987: Theming support - Implement request #3054906: Show user's full name instead of nickname - Implement patch #3059829: update FR_CA translation - Show error message on mysqli connection errors From 18989f97f1c4299f447b011c28961ca5c8310c13 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Thu, 26 May 2011 08:20:04 +0200 Subject: [PATCH 19/38] documentation index --- doc/developers/{TODO => TODO.rst} | 0 doc/developers/{api => api.rst} | 0 doc/developers/{debugging => debugging.rst} | 0 doc/developers/{doc-TODO => doc-TODO.rst} | 0 ...se-new-version => release-new-version.rst} | 0 doc/developers/{rules => rules.rst} | 0 ...ning-unit-tests => running-unit-tests.rst} | 0 .../{translation => translation.rst} | 0 doc/index.rst | 43 +++++++++++++++++++ 9 files changed, 43 insertions(+) rename doc/developers/{TODO => TODO.rst} (100%) rename doc/developers/{api => api.rst} (100%) rename doc/developers/{debugging => debugging.rst} (100%) rename doc/developers/{doc-TODO => doc-TODO.rst} (100%) rename doc/developers/{release-new-version => release-new-version.rst} (100%) rename doc/developers/{rules => rules.rst} (100%) rename doc/developers/{running-unit-tests => running-unit-tests.rst} (100%) rename doc/developers/{translation => translation.rst} (100%) create mode 100644 doc/index.rst diff --git a/doc/developers/TODO b/doc/developers/TODO.rst similarity index 100% rename from doc/developers/TODO rename to doc/developers/TODO.rst diff --git a/doc/developers/api b/doc/developers/api.rst similarity index 100% rename from doc/developers/api rename to doc/developers/api.rst diff --git a/doc/developers/debugging b/doc/developers/debugging.rst similarity index 100% rename from doc/developers/debugging rename to doc/developers/debugging.rst diff --git a/doc/developers/doc-TODO b/doc/developers/doc-TODO.rst similarity index 100% rename from doc/developers/doc-TODO rename to doc/developers/doc-TODO.rst diff --git a/doc/developers/release-new-version b/doc/developers/release-new-version.rst similarity index 100% rename from doc/developers/release-new-version rename to doc/developers/release-new-version.rst diff --git a/doc/developers/rules b/doc/developers/rules.rst similarity index 100% rename from doc/developers/rules rename to doc/developers/rules.rst diff --git a/doc/developers/running-unit-tests b/doc/developers/running-unit-tests.rst similarity index 100% rename from doc/developers/running-unit-tests rename to doc/developers/running-unit-tests.rst diff --git a/doc/developers/translation b/doc/developers/translation.rst similarity index 100% rename from doc/developers/translation rename to doc/developers/translation.rst diff --git a/doc/index.rst b/doc/index.rst new file mode 100644 index 0000000..fc75aa6 --- /dev/null +++ b/doc/index.rst @@ -0,0 +1,43 @@ +============================= +SemanticScuttle documentation +============================= + + +First reads +=========== +- README_ +- `installation guide`_ +- `upgrade instructions`_ + +.. _README: README.html +.. _installation guide: INSTALL.html +.. _upgrade instructions: UPGRADE.html + + + +Features +======== +- `SSL Client certificates`__ +- Themes__ + +__ ssl-client-certificates.html +__ themes.html + + + +Developer documentation +======================= +- `General development rules`__ +- `Delicious API`__ +- `Debugging HowTo`__ +- `How to release a new version`__ +- `Running unit testes`__ +- `How to translate SemanticScuttle`__ + +__ rules.html +__ api.html +__ debugging.html +__ release-new-version.html +__ running-unit-tests.html +__ translation.html + From 7820014667f04d5d0a9c2f6913b3d3fb261f1b07 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Thu, 26 May 2011 18:03:46 +0200 Subject: [PATCH 20/38] task to generate docs from rst files. does not fully work yet --- build.xml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/build.xml b/build.xml index 7b3896b..cd80c06 100644 --- a/build.xml +++ b/build.xml @@ -41,7 +41,6 @@ Test your zip with: unzip -l SemanticScuttle-0.95.0.zip --> - @@ -209,6 +208,23 @@ + + + + + + + + + + + + + + + + + @@ -315,6 +331,9 @@ + + + From 189449c0d73a88ae87569cb9427fcd7dc6142c62 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Thu, 26 May 2011 18:17:26 +0200 Subject: [PATCH 21/38] doc building works now --- build.xml | 10 +++++++++- doc/index.rst | 12 ++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/build.xml b/build.xml index cd80c06..a51bdbb 100644 --- a/build.xml +++ b/build.xml @@ -214,13 +214,20 @@ + - + + + + + + + @@ -334,6 +341,7 @@ + diff --git a/doc/index.rst b/doc/index.rst index fc75aa6..a260642 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -34,10 +34,10 @@ Developer documentation - `Running unit testes`__ - `How to translate SemanticScuttle`__ -__ rules.html -__ api.html -__ debugging.html -__ release-new-version.html -__ running-unit-tests.html -__ translation.html +__ developers/rules.html +__ developers/api.html +__ developers/debugging.html +__ developers/release-new-version.html +__ developers/running-unit-tests.html +__ developers/translation.html From b56d604e7eedc1c748e90da4f3a1948b052e20cb Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Thu, 26 May 2011 18:19:35 +0200 Subject: [PATCH 22/38] let the doc build fail if rst2html finds errors --- build.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build.xml b/build.xml index a51bdbb..0289c38 100644 --- a/build.xml +++ b/build.xml @@ -227,7 +227,10 @@ - + From a396759f22ff06689e25d92d4faaaf0835bf8bc8 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Thu, 26 May 2011 21:05:59 +0200 Subject: [PATCH 23/38] build doc files only if source files are newer than rendered files --- build.xml | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/build.xml b/build.xml index 0289c38..f6731fe 100644 --- a/build.xml +++ b/build.xml @@ -219,18 +219,30 @@ - + + - + - - + + + + + + + + + + + From bb4b6574bc63e38cb39dffab90985228f1506d90 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Thu, 26 May 2011 21:19:26 +0200 Subject: [PATCH 24/38] ignore license file when building docs --- build.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/build.xml b/build.xml index f6731fe..dbec0a6 100644 --- a/build.xml +++ b/build.xml @@ -215,6 +215,7 @@ + From 2dc582cfbb9c317fc75343acf6c023df1b07b8a2 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Thu, 26 May 2011 21:19:47 +0200 Subject: [PATCH 25/38] make INSTALL.txt file valid rST --- doc/INSTALL.txt | 50 ++++++++++++++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 19 deletions(-) diff --git a/doc/INSTALL.txt b/doc/INSTALL.txt index b2dd3b2..5afc732 100644 --- a/doc/INSTALL.txt +++ b/doc/INSTALL.txt @@ -1,51 +1,60 @@ +============================ SemanticScuttle installation ============================ Prerequisites -------------- +============= To run SemanticScuttle, you need: + - PHP5 with filter functions enabled - A web server, for example Apache Installation instructions -------------------------- +========================= 1. Create a new MySQL database -2. Import tables.sql into that database, i.e. - run - > mysql -umyusername semanticscuttle < data/tables.sql +2. Import ``data/tables.sql`` into that database, i.e. + run :: + + $ mysql -umyusername semanticscuttle < data/tables.sql + on the shell ("semanticscuttle" being the database name) -3. Copy data/config.php.dist to data/config.php and modify it as + +3. Copy ``data/config.php.dist`` to ``data/config.php`` and modify it as necessary. 4. Make the cache directory writable by your web server. - For example, run - > chmod 0777 cache + For example, run :: + + $ chmod 0777 cache + on the shell. -5. Set the www/ directory as document root in your web server, +5. Set the ``www/`` directory as document root in your web server, restart the web server. Ugly www directory in URLs --------------------------- +========================== In case point 5 of the installation instructions cannot be put into practice by you because you are not able to change the web server configuration, you are not lost! There is a way to get rid of -www/ in your URL! +``www/`` in your URL! + +Imagine following directory layout: :: -Imagine following directory layout: /home/customer123/ www/ subdomain1/ subdomain2/ subdomain3/ -Create a SemanticScuttle directory somewhere outside www if possible -and put all directories except www/ in there. Move all files and -directories from www/ into your subdomain directory. Then modify -subdomain/www-header.php to include the correct file path. +Create a SemanticScuttle directory somewhere outside ``www`` if possible +and put all directories except ``www/`` in there. Move all files and +directories from ``www/`` into your subdomain directory. Then modify +``subdomain/www-header.php`` to include the correct file path. + +The new directory layout should look that way: :: -The new directory layout should look that way: /home/customer123/ semanticscuttle/ doc/ @@ -60,8 +69,11 @@ The new directory layout should look that way: www-header.php subdomain3/ -Now open www-header.php and replace +Now open www-header.php and replace :: + require_once '../src/SemanticScuttle/header.php'; -with + +with :: + require_once '../../semanticscuttle/src/SemanticScuttle/header.php'; From 47005bb1c62960d33ba2061d6842529403331ff2 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Thu, 26 May 2011 21:21:37 +0200 Subject: [PATCH 26/38] make INSTALL.txt file valid rST --- doc/developers/translation.rst | 41 ++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/doc/developers/translation.rst b/doc/developers/translation.rst index 776b5d7..f014be2 100644 --- a/doc/developers/translation.rst +++ b/doc/developers/translation.rst @@ -1,40 +1,47 @@ +=========================== Translating SemanticScuttle =========================== SemanticScuttle uses gnu gettext for translation. It does not rely on the php extension but ships with a pure php implementation, -php-gettext[1]. +php-gettext_. Using gettext from within the code is really easy: -Enclose the string you want to translate in a "T_" function call. +Enclose the string you want to translate in a "``T_``" function call. + +For example, to translate:: + + echo "Vote for"; -For example, to translate -> echo "Vote for"; just write -> echo T_("Vote for"); + echo T_("Vote for"); + +.. _php-gettext: https://launchpad.net/php-gettext/ Translation basics ------------------- +================== We keep one base translation file, data/locales/messages.po. This file is auto-generated via xgettext from all our php source files. In case you added a new string to the code that needs translation, -update the base translation file by running -> php scripts/update-translation-base.php +update the base translation file by running :: -After that has been done, the changes to the base messages.po file + $ php scripts/update-translation-base.php + +After that has been done, the changes to the base ``messages.po`` file need to be merged into the single language translation files, -for example data/locales/de_DE/LC_MESSAGES/messages.po. +for example ``data/locales/de_DE/LC_MESSAGES/messages.po``. -Updating them from the master file is as easy as running -> php scripts/update-translation.php de_DE +Updating them from the master file is as easy as running:: + + $ php scripts/update-translation.php de_DE + +When the translation is ready, the ``.po`` file needs to be compiled +in a machine-readable ``.mo`` file. Use :: + + $ php scripts/compile-translation.php de_DE -When the translation is ready, the .po file needs to be compiled -in a machine-readable .mo file. Use -> php scripts/compile-translation.php de_DE to achieve that. - -[1] https://launchpad.net/php-gettext/ \ No newline at end of file From 324225f10b505d8c5a21614b7c88666e1c3c7e85 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Thu, 26 May 2011 21:22:43 +0200 Subject: [PATCH 27/38] make translation docs valid rST --- doc/developers/translation.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/developers/translation.rst b/doc/developers/translation.rst index f014be2..008f66e 100644 --- a/doc/developers/translation.rst +++ b/doc/developers/translation.rst @@ -13,7 +13,7 @@ For example, to translate:: echo "Vote for"; -just write +just write :: echo T_("Vote for"); @@ -22,8 +22,8 @@ just write Translation basics ================== -We keep one base translation file, data/locales/messages.po. -This file is auto-generated via xgettext from all our php source files. +We keep one base translation file, ``data/locales/messages.po``. +This file is auto-generated via ``xgettext`` from all our php source files. In case you added a new string to the code that needs translation, update the base translation file by running :: From 2ddbf1703f9b813999073cc1c915d3e647be0d55 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Thu, 26 May 2011 21:37:06 +0200 Subject: [PATCH 28/38] fix authentication docs and integrate them in index.rst --- doc/authentication.txt | 258 ++++++++++++++++++++++------------------- doc/index.rst | 2 + 2 files changed, 139 insertions(+), 121 deletions(-) diff --git a/doc/authentication.txt b/doc/authentication.txt index da49e5a..c3ccb47 100644 --- a/doc/authentication.txt +++ b/doc/authentication.txt @@ -1,3 +1,4 @@ +============================================ External authentication with SemanticScuttle ============================================ @@ -12,8 +13,8 @@ active directory server. Since version 0.96, SemanticScuttle supports user authentication against external systems. To provide a wide range of supported systems, we chose -to utilize PEAR's Authentication package [1]. -It does this by providing different "authentication containers" [2], +to utilize PEAR's `Authentication package`__. +It does this by providing different "`authentication containers`__", for example Database, IMAP, LDAP, POP3, RADIUS, SAP and SOAP. Please be aware of the fact that, after successful authentication, the user @@ -24,51 +25,58 @@ is offline - you won't, execpt you switch it off in the SemanticScuttle configuration. -[1] http://pear.php.net/package/Auth -[2] http://pear.php.net/manual/en/package.authentication.auth.intro-storage.php +__ http://pear.php.net/package/Auth +__ http://pear.php.net/manual/en/package.authentication.auth.intro-storage.php Basic configuration =================== -The default configuration file data/config.default.php has an own section +The default configuration file ``data/config.default.php`` has an own section on auth options and an explanation of the single entries. To utilize the external authentication, you need to install the -PEAR Auth package: - $ pear install auth +PEAR Auth package: :: + + $ pear install auth + If you do not have a PEAR installation available, you can try to manually install the files in the src/ directory. If you choose to do that, the -src/ directory should look similar to that: +src/ directory should look similar to that: :: - src/ - Auth.php - Auth/ - Anonymous.php - Container.php - Container/ + src/ + Auth.php + Auth/ + Anonymous.php + Container.php + Container/ + .. + SemanticScuttle/ + header.php .. - SemanticScuttle/ - header.php - .. -After that, modify your data/config.php file. The most important change -is to use - $serviceoverrides['User'] = 'SemanticScuttle_Service_AuthUser'; +After that, modify your ``data/config.php`` file. The most important change +is to use :: + + $serviceoverrides['User'] = 'SemanticScuttle_Service_AuthUser'; + which tells SemanticScuttle to switch to the special authentication service. Now that's done, you can configure the single auth options: - $authType = 'MDB2'; -selects the authentication container. - $authOptions -is an array of options specific to the authentication container. Please -consult the PEAR Auth documentation for more information. +``$authType = 'MDB2';`` + selects the authentication container. - $authDebug = true; -should be used when setup fails, since it may give important hints -where it fails. Please note that login will seem to fail with -debugging activated. Going back to the main page after that will -show that you are logged in. +``$authOptions`` + is an array of options specific to the authentication container. Please + consult the PEAR Auth documentation for more information. + +``$authDebug = true;`` + should be used when setup fails, since it may give important hints + where it fails. + + Please note that login will seem to fail with + debugging activated. Going back to the main page after that will + show that you are logged in. @@ -77,53 +85,53 @@ Authentication examples General database authentification --------------------------------- -Here you also need the PEAR MDB2 package. -The "new_link" option is important! +Here you also need the PEAR `MDB2 package`_. +The "``new_link``" option is important! -config.php settings: --8<------------------ -$serviceoverrides['User'] = 'SemanticScuttle_Service_AuthUser'; -$authType = 'MDB2'; -$authOptions = array( - 'dsn' => array( - 'phptype' => 'mysql', - 'hostspec' => 'FIXME', - 'username' => 'FIXME', - 'password' => 'FIXME', - 'database' => 'FIXME', - 'new_link' => true, - ), - 'table' => 'usersFIXME', - 'usernamecol' => 'usernameFIXME', - 'passwordcol' => 'passwordFIXME', - 'cryptType' => 'md5', -); --8<------------------ +``config.php`` settings: :: + + $serviceoverrides['User'] = 'SemanticScuttle_Service_AuthUser'; + $authType = 'MDB2'; + $authOptions = array( + 'dsn' => array( + 'phptype' => 'mysql', + 'hostspec' => 'FIXME', + 'username' => 'FIXME', + 'password' => 'FIXME', + 'database' => 'FIXME', + 'new_link' => true, + ), + 'table' => 'usersFIXME', + 'usernamecol' => 'usernameFIXME', + 'passwordcol' => 'passwordFIXME', + 'cryptType' => 'md5', + ); Mantis Bugtracker ----------------- -Here you also need the PEAR MDB2 package. +Here you also need the PEAR `MDB2 package`_. -config.php settings: --8<------------------ -$serviceoverrides['User'] = 'SemanticScuttle_Service_AuthUser'; -$authType = 'MDB2'; -$authOptions = array( - 'dsn' => array( - 'phptype' => 'mysql', - 'hostspec' => 'FIXME', - 'username' => 'FIXME', - 'password' => 'FIXME', - 'database' => 'FIXME', - 'new_link' => true, - ), - 'table' => 'mantis_user_table', - 'usernamecol' => 'username', - 'passwordcol' => 'password', - 'cryptType' => 'md5', -); --8<------------------ +``config.php`` settings: :: + + $serviceoverrides['User'] = 'SemanticScuttle_Service_AuthUser'; + $authType = 'MDB2'; + $authOptions = array( + 'dsn' => array( + 'phptype' => 'mysql', + 'hostspec' => 'FIXME', + 'username' => 'FIXME', + 'password' => 'FIXME', + 'database' => 'FIXME', + 'new_link' => true, + ), + 'table' => 'mantis_user_table', + 'usernamecol' => 'username', + 'passwordcol' => 'password', + 'cryptType' => 'md5', + ); + +.. _MDB2 package: http://pear.php.net/package/MDB2 MediaWiki @@ -132,66 +140,74 @@ Unfortunately, the password column does not contain a simple hashed password - for good reasons as described on http://www.mediawiki.org/wiki/Manual_talk:User_table#user_password_column -If you configure your mediawiki to use passwords without salt, you +If you configure your MediaWiki_ to use passwords without salt, you can make it work nevertheless: -MediaWiki LocalSettings.php: - $wgPasswordSalt = false; -- after that, users need to change/update their passwords to get them +MediaWiki ``LocalSettings.php``: :: + + $wgPasswordSalt = false; + +\- after that, users need to change/update their passwords to get them unsalted in the database. You can verify if the passwords are unhashed -if you do - SELECT CAST( user_password AS CHAR ) FROM user -on your MediaWiki database. Passwords prefixed with ":A:" can be used. +if you do :: + + SELECT CAST( user_password AS CHAR ) FROM user + +on your MediaWiki database. Passwords prefixed with "``:A:``" can be used. Another problem is that mediawiki user names begin with an uppercase letter. -You need to modify www/login.php and remove the "utf8_strtolower" function -call: - $posteduser = trim(utf8_strtolower(POST_USERNAME)); -becomes - $posteduser = trim(POST_USERNAME); +You need to modify ``www/login.php`` and remove the "``utf8_strtolower``" function +call: :: + + $posteduser = trim(utf8_strtolower(POST_USERNAME)); + +becomes :: + + $posteduser = trim(POST_USERNAME); -config.php settings: --8<------------------ -$serviceoverrides['User'] = 'SemanticScuttle_Service_AuthUser'; -$authType = 'MDB2'; -$authOptions = array( - 'dsn' => array( - 'phptype' => 'mysql', - 'hostspec' => 'FIXME', - 'username' => 'FIXME', - 'password' => 'FIXME', - 'database' => 'FIXME', - 'new_link' => true, - ), - 'table' => 'user', - 'usernamecol' => 'user_name', - 'passwordcol' => 'user_password', - 'cryptType' => 'md5_mediawiki', -); -function md5_mediawiki($password) { - return ':A:' . md5($password); -} --8<------------------ +``config.php`` settings: :: + $serviceoverrides['User'] = 'SemanticScuttle_Service_AuthUser'; + $authType = 'MDB2'; + $authOptions = array( + 'dsn' => array( + 'phptype' => 'mysql', + 'hostspec' => 'FIXME', + 'username' => 'FIXME', + 'password' => 'FIXME', + 'database' => 'FIXME', + 'new_link' => true, + ), + 'table' => 'user', + 'usernamecol' => 'user_name', + 'passwordcol' => 'user_password', + 'cryptType' => 'md5_mediawiki', + ); + function md5_mediawiki($password) { + return ':A:' . md5($password); + } + + +.. _MediaWiki: http://www.mediawiki.org/wiki/MediaWiki Active Directory / LDAP ----------------------- Here we authenticate against an active directory server. -config.php settings: --8<------------------ -$serviceoverrides['User'] = 'SemanticScuttle_Service_AuthUser'; -$authType = 'LDAP'; -$authOptions = array( - 'host' => '192.168.1.4', - 'version' => 3, - 'basedn' => 'DC=EXAMPLE,DC=ORG', - 'binddn' => 'readuser', - 'bindpw' => 'readuser', - 'userattr' => 'sAMAccountName', - 'userfilter' => '(objectClass=user)', - 'attributes' => array(''), -); -$authEmailSuffix = '@example.org'; --8<------------------ +``config.php`` settings: :: + + $serviceoverrides['User'] = 'SemanticScuttle_Service_AuthUser'; + $authType = 'LDAP'; + $authOptions = array( + 'host' => '192.168.1.4', + 'version' => 3, + 'basedn' => 'DC=EXAMPLE,DC=ORG', + 'binddn' => 'readuser', + 'bindpw' => 'readuser', + 'userattr' => 'sAMAccountName', + 'userfilter' => '(objectClass=user)', + 'attributes' => array(''), + ); + $authEmailSuffix = '@example.org'; + diff --git a/doc/index.rst b/doc/index.rst index a260642..1b8feea 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -17,9 +17,11 @@ First reads Features ======== +- `Custom user authentication`__ - `SSL Client certificates`__ - Themes__ +__ authentication.html __ ssl-client-certificates.html __ themes.html From df4c6af956dd064f6ed2a82a89b7ff5931a5c8af Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Thu, 26 May 2011 21:37:20 +0200 Subject: [PATCH 29/38] rename auth docs --- doc/{authentication.txt => authentication.rst} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename doc/{authentication.txt => authentication.rst} (100%) diff --git a/doc/authentication.txt b/doc/authentication.rst similarity index 100% rename from doc/authentication.txt rename to doc/authentication.rst From b55b3a6c670c5af99671c2d6c77cbf0d15954728 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Thu, 26 May 2011 21:39:06 +0200 Subject: [PATCH 30/38] hint about docutils --- build.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.xml b/build.xml index dbec0a6..5a2a7fc 100644 --- a/build.xml +++ b/build.xml @@ -207,7 +207,8 @@ - + From 17dcda30e78c13f1ca91c1f031ecd4d6445ef6a7 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Thu, 26 May 2011 21:44:29 +0200 Subject: [PATCH 31/38] more documentation rST fixes --- build.xml | 1 + doc/developers/debugging.rst | 30 +++++++++++++++------------ doc/developers/running-unit-tests.rst | 25 +++++++++++++--------- 3 files changed, 33 insertions(+), 23 deletions(-) diff --git a/build.xml b/build.xml index 5a2a7fc..d0637c7 100644 --- a/build.xml +++ b/build.xml @@ -217,6 +217,7 @@ + diff --git a/doc/developers/debugging.rst b/doc/developers/debugging.rst index 7f84da6..6bee309 100644 --- a/doc/developers/debugging.rst +++ b/doc/developers/debugging.rst @@ -4,17 +4,21 @@ How to debug SemanticScuttle Database queries ---------------- -In config.php, enable debugMode. -Further, add the following there: -------- -register_shutdown_function( - create_function('', <<sql_report('display'); -FNC - ) -); ------- -To see database queries in SemanticScuttle, add -> ?explain=1 + +In ``data/config.php``, enable ``debugMode``. +Further, add the following afterwards: :: + + register_shutdown_function( + create_function('', <<sql_report('display'); + FNC + ) + ); + + +To see database queries in SemanticScuttle, add :: + + ?explain=1 + to your URL. diff --git a/doc/developers/running-unit-tests.rst b/doc/developers/running-unit-tests.rst index 556055f..8b0fa0d 100644 --- a/doc/developers/running-unit-tests.rst +++ b/doc/developers/running-unit-tests.rst @@ -1,21 +1,26 @@ Running unit tests ================== -Go to the SemanticScuttle main directory and run - $ php tests/AllTests.php -or - $ phpunit tests/AllTests.php -also remember the --verbose parameter to PHPUnit. +Go to the SemanticScuttle ``tests`` directory and run ``phpunit``:: -If you want to run a specific test class only: - $ phpunit tests/BookmarksTest.php + $ cd tests + $ phpunit . -If you need to test one method only: +also remember the ``--verbose`` parameter to PHPUnit. + +If you want to run a specific test class only: :: + + $ cd tests + $ phpunit BookmarksTest.php + +If you need to test one method only: :: + + $ cd tests $ phpunit --filter BookmarkTest::testUnificationOfBookmarks tests/BookmarkTest.php Caveats ------- -Having debugging enabled and database driver "mysql4" activated -will lead to failing tests because of FOUND_ROWS() usage, which +Having debugging enabled and database driver "``mysql4``" activated +will lead to failing tests because of ``FOUND_ROWS()`` usage, which does not work nicely with database debugging. From 4e04131d2ff615c217d0b2ddceb7ecff4a4e2feb Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Thu, 26 May 2011 22:00:08 +0200 Subject: [PATCH 32/38] make readme proper rST --- doc/README.txt | 90 ++++++++++++++++++-------------------------------- 1 file changed, 33 insertions(+), 57 deletions(-) diff --git a/doc/README.txt b/doc/README.txt index 97387d2..792b0f0 100644 --- a/doc/README.txt +++ b/doc/README.txt @@ -1,4 +1,5 @@ -SemanticScuttle 0.94 +==================== +SemanticScuttle 0.98 ==================== A social bookmarking tool experimenting with new features like structured tags or collaborative descriptions of tags. @@ -9,83 +10,58 @@ Available under the GNU General Public License Installation ------------- -See INSTALL.txt +============ +See `INSTALL.txt`__ + + +__ INSTALL.html Upgrading from a previous version ---------------------------------- -See UPGRADE.txt +================================= +See `UPGRADE.txt`__ + +__ UPGRADE.html Public API ----------- -Scuttle supports most of the del.icio.us API [1]. +========== +Scuttle supports most of the `del.icio.us API`__. Almost all of the neat tools made for that system can be modified to work with your SemanticScuttle installation. If you find a tool that won't let you change the API address, ask the creator to add this setting. You never know, they might just do it. -[1] http://del.icio.us/doc/api +__ http://del.icio.us/doc/api -Translations ------------- -Scuttle is available in the following languages : - -English en-GB 100% (Default) -Chinese zh-CN 86% -Danish dk-DK 100% -Dutch nl-NL 68% -French fr-FR 100% -German de-DE 100% -Hindi hi-IN 100% -Italian it-IT 89% -Japanese ja-JP 100% -Lithuanian lt-LT 100% -Portuguese pt-BR 100% -Spanish es-ES 94% - -Translations are managed with gettext . - -To provide additional translations: -- execute of of the scripts in - for example to complete french (France) translation on a - GNU/Linux system, type - ./gettexts.sh fr_FR -- then edit the file - with poedit - (that will update ) - Links ----- -http://semanticscuttle.wiki.sourceforge.net/ - - further documentation +- `further documentation`__ +- `support and help questions`__ +- `development mailing list instructions`__ +- `suggestions`_ for SemanticScuttle +- `bug reports`_ +- `feature requests`_ +- `patches`_ -http://sourceforge.net/forum/forum.php?forum_id=759510 - - support and help questions +__ http://semanticscuttle.wiki.sourceforge.net/ +__ http://sourceforge.net/forum/forum.php?forum_id=759510 +__ https://sourceforge.net/mailarchive/forum.php?forum_name=semanticscuttle-devel +.. _suggestions: http://sourceforge.net/forum/forum.php?forum_id=759511 +.. _bug reports: http://sourceforge.net/tracker/?group_id=211356&atid=1017430 +.. _feature requests: https://sourceforge.net/tracker/?group_id=211356&atid=1017433 +.. _patches: https://sourceforge.net/tracker/?group_id=211356&atid=1017432 -https://sourceforge.net/mailarchive/forum.php?forum_name=semanticscuttle-devel - - development mailing list instructions -http://sourceforge.net/forum/forum.php?forum_id=759511 - - suggestions for SemanticScuttle - -http://sourceforge.net/tracker/?group_id=211356&atid=1017430 - - bug reports - -https://sourceforge.net/tracker/?group_id=211356&atid=1017433 - - feature requests - -https://sourceforge.net/tracker/?group_id=211356&atid=1017432 - - patches Known issues ------------- +============ Number of bookmarks always 0: "0 bookmark(s)" - This issue occurs when debug mode is enabled. - Technically, this is because the database layers DEBUG_EXTRA gets - enabled through debug mode. +--------------------------------------------- +This issue occurs when debug mode is enabled. +Technically, this is because the database layers ``DEBUG_EXTRA`` gets +enabled through debug mode. From d2e4df06c3ed2ec3b84025c89342c0d937f44ffe Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Thu, 26 May 2011 22:00:41 +0200 Subject: [PATCH 33/38] move readme.txt to rst --- doc/{README.txt => README.rst} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename doc/{README.txt => README.rst} (100%) diff --git a/doc/README.txt b/doc/README.rst similarity index 100% rename from doc/README.txt rename to doc/README.rst From fa64fb2a4984e9f1a14e02916854472ba0a4637f Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Thu, 26 May 2011 22:01:45 +0200 Subject: [PATCH 34/38] fix file name --- doc/README.rst | 2 +- doc/UPGRADE.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/README.rst b/doc/README.rst index 792b0f0..6cfe270 100644 --- a/doc/README.rst +++ b/doc/README.rst @@ -11,7 +11,7 @@ Available under the GNU General Public License Installation ============ -See `INSTALL.txt`__ +See `INSTALL.rst`__ __ INSTALL.html diff --git a/doc/UPGRADE.txt b/doc/UPGRADE.txt index 3be6654..2d4c4d2 100644 --- a/doc/UPGRADE.txt +++ b/doc/UPGRADE.txt @@ -1,3 +1,4 @@ +================================================= Upgrading SemanticScuttle from a previous version ================================================= From 628260297a181a974d369cf72f8c59c9ff155e00 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Thu, 26 May 2011 22:02:40 +0200 Subject: [PATCH 35/38] fix name --- doc/README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/README.rst b/doc/README.rst index 6cfe270..0c7befe 100644 --- a/doc/README.rst +++ b/doc/README.rst @@ -26,7 +26,7 @@ __ UPGRADE.html Public API ========== -Scuttle supports most of the `del.icio.us API`__. +SemanticScuttle supports most of the `del.icio.us API`__. Almost all of the neat tools made for that system can be modified to work with your SemanticScuttle installation. If you find a tool that won't let you change the API address, ask the creator to add From 511124934764a6a420da89038aa2c3f02234692d Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Fri, 27 May 2011 06:44:29 +0200 Subject: [PATCH 36/38] we fixed more bugs while coding --- doc/ChangeLog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index 0730b7f..596ea7a 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -9,6 +9,8 @@ ChangeLog for SemantiScuttle - Fix bug in getTagsForBookmarks() that fetched all tags - Fix bug #3097187: Using opensearch with two tags does not work in Firefox - Fix bug #3251877: French translation JavaScript Bug when editing bookmarks +- Fix bug #3168521: Title of tag-filtered RSS Feed is broken +- Fix bug #2853627: Javascript warning - Implement request #1989987: Theming support - Implement request #3054906: Show user's full name instead of nickname - Implement patch #3059829: update FR_CA translation From 2419885577b4e38b82f5b0f4fbfe8077f680d825 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Fri, 27 May 2011 06:59:33 +0200 Subject: [PATCH 37/38] make upgrade file fully rST-compatible and move SQL commands out into single schema files --- data/schema/1.sql | 20 ++++ data/schema/2.sql | 10 ++ data/schema/3.sql | 85 +++++++++++++++ data/schema/4.sql | 11 ++ data/schema/5.sql | 1 + doc/UPGRADE.txt | 262 ++++++++++++++-------------------------------- 6 files changed, 207 insertions(+), 182 deletions(-) create mode 100644 data/schema/1.sql create mode 100644 data/schema/2.sql create mode 100644 data/schema/3.sql create mode 100644 data/schema/4.sql create mode 100644 data/schema/5.sql diff --git a/data/schema/1.sql b/data/schema/1.sql new file mode 100644 index 0000000..e09a210 --- /dev/null +++ b/data/schema/1.sql @@ -0,0 +1,20 @@ +RENAME TABLE `sc_tags` TO `sc_bookmarks2tags` ; + + CREATE TABLE `sc_searchhistory` ( + `shId` int(11) NOT NULL auto_increment, + `shTerms` varchar(255) NOT NULL default '', + `shRange` varchar(32) NOT NULL default '', + `shDatetime` datetime NOT NULL default '0000-00-00 00:00:00', + `shNbResults` int(6) NOT NULL default '0', + `uId` int(11) NOT NULL default '0', + PRIMARY KEY (`shId`) + ); + + CREATE TABLE `sc_tags` ( + `tId` int(11) NOT NULL auto_increment, + `tag` varchar(32) NOT NULL default '', + `uId` int(11) NOT NULL default '0', + `tDescription` varchar(255) default NULL, + PRIMARY KEY (`tId`), + UNIQUE KEY `sc_tags_tag_uId` (`tag`, `uId`) + ); diff --git a/data/schema/2.sql b/data/schema/2.sql new file mode 100644 index 0000000..6c3bfaf --- /dev/null +++ b/data/schema/2.sql @@ -0,0 +1,10 @@ +ALTER TABLE `sc_bookmarks` CHANGE `bDescription` `bDescription` VARCHAR( 1500 ) +CREATE TABLE `sc_tagscache` ( + `tcId` int(11) NOT NULL auto_increment, + `tag1` varchar(100) NOT NULL default '', + `tag2` varchar(100) NOT NULL default '', + `relationType` varchar(32) NOT NULL default '', + `uId` int(11) NOT NULL default '0', + PRIMARY KEY (`tcId`), + UNIQUE KEY `sc_tagscache_tag1_tag2_type_uId` (`tag1`,`tag2`,`relationType`,`uId`) +); diff --git a/data/schema/3.sql b/data/schema/3.sql new file mode 100644 index 0000000..32431b9 --- /dev/null +++ b/data/schema/3.sql @@ -0,0 +1,85 @@ +/* modify and add fields */ +ALTER TABLE `sc_bookmarks` MODIFY `bAddress` varchar(1500) NOT NULL; +ALTER TABLE `sc_bookmarks` MODIFY `bDescription` TEXT default NULL; +ALTER TABLE `sc_bookmarks` ADD `bPrivateNote` TEXT NULL AFTER `bDescription` ; +ALTER TABLE `sc_tags` MODIFY `tDescription` TEXT default NULL; +ALTER TABLE `sc_commondescription` MODIFY `cdDescription` TEXT default NULL; + +/* convert to UTF-8 if your table is ISO-something (through BLOB: tips provided by MYSQL documentation)*/ +/* first need to remove index keys because of BLOB constraints*/ +ALTER TABLE `sc_tags` DROP INDEX `sc_tags_tag_uId`; +ALTER TABLE `sc_bookmarks2tags` DROP INDEX `sc_bookmarks2tags_tag_bId`; +ALTER TABLE `sc_bookmarks2tags` DROP INDEX `sc_bookmarks2tags_bId`; +ALTER TABLE `sc_tags2tags` DROP INDEX `sc_tags2tags_tag1_tag2_uId`; +ALTER TABLE `sc_commondescription` DROP INDEX `sc_commondescription_tag_datetime`; +ALTER TABLE `sc_tagscache` DROP INDEX `sc_tagscache_tag1_tag2_type_uId`; +ALTER TABLE `sc_tagsstats` DROP INDEX `sc_tagsstats_tag1_type_uId`; + +/* secondly convert through BLOB type */ +ALTER TABLE `sc_bookmarks` CHANGE `bTitle` `bTitle` BLOB; +ALTER TABLE `sc_bookmarks` CHANGE `bTitle` `bTitle` varchar(255) CHARACTER SET utf8; +ALTER TABLE `sc_bookmarks` CHANGE `bAddress` `bAddress` BLOB; +ALTER TABLE `sc_bookmarks` CHANGE `bAddress` `bAddress` varchar(1500) CHARACTER SET utf8; +ALTER TABLE `sc_bookmarks` CHANGE `bDescription` `bDescription` BLOB; +ALTER TABLE `sc_bookmarks` CHANGE `bDescription` `bDescription` text CHARACTER SET utf8; +ALTER TABLE `sc_bookmarks` CHANGE `bPrivateNote` `bPrivateNote` BLOB; +ALTER TABLE `sc_bookmarks` CHANGE `bPrivateNote` `bPrivateNote` text CHARACTER SET utf8; + +ALTER TABLE `sc_tags` CHANGE `tag` `tag` BLOB; +ALTER TABLE `sc_tags` CHANGE `tag` `tag` varchar(100) CHARACTER SET utf8; +ALTER TABLE `sc_tags` CHANGE `tDescription` `tDescription` BLOB; +ALTER TABLE `sc_tags` CHANGE `tDescription` `tDescription` text CHARACTER SET utf8; + +ALTER TABLE `sc_bookmarks2tags` CHANGE `tag` `tag` BLOB; +ALTER TABLE `sc_bookmarks2tags` CHANGE `tag` `tag` varchar(100) CHARACTER SET utf8; + +ALTER TABLE `sc_users` CHANGE `name` `name` BLOB; +ALTER TABLE `sc_users` CHANGE `name` `name` varchar(50) CHARACTER SET utf8; +ALTER TABLE `sc_users` CHANGE `uContent` `uContent` BLOB; +ALTER TABLE `sc_users` CHANGE `uContent` `uContent` text CHARACTER SET utf8; + +ALTER TABLE `sc_tags2tags` CHANGE `tag1` `tag1` BLOB; +ALTER TABLE `sc_tags2tags` CHANGE `tag1` `tag1` varchar(100) CHARACTER SET utf8; +ALTER TABLE `sc_tags2tags` CHANGE `tag2` `tag2` BLOB; +ALTER TABLE `sc_tags2tags` CHANGE `tag2` `tag2` varchar(100) CHARACTER SET utf8; + +ALTER TABLE `sc_tagsstats` CHANGE `tag1` `tag1` BLOB; +ALTER TABLE `sc_tagsstats` CHANGE `tag1` `tag1` varchar(100) CHARACTER SET utf8; + +ALTER TABLE `sc_tagscache` CHANGE `tag1` `tag1` BLOB; +ALTER TABLE `sc_tagscache` CHANGE `tag1` `tag1` varchar(100) CHARACTER SET utf8; +ALTER TABLE `sc_tagscache` CHANGE `tag2` `tag2` BLOB; +ALTER TABLE `sc_tagscache` CHANGE `tag2` `tag2` varchar(100) CHARACTER SET utf8; + +ALTER TABLE `sc_commondescription` CHANGE `tag` `tag` BLOB; +ALTER TABLE `sc_commondescription` CHANGE `tag` `tag` varchar(100) CHARACTER SET utf8; +ALTER TABLE `sc_commondescription` CHANGE `cdTitle` `cdTitle` BLOB; +ALTER TABLE `sc_commondescription` CHANGE `cdTitle` `cdTitle` varchar(255) CHARACTER SET utf8; +ALTER TABLE `sc_commondescription` CHANGE `cdDescription` `cdDescription` BLOB; +ALTER TABLE `sc_commondescription` CHANGE `cdDescription` `cdDescription` text CHARACTER SET utf8; + +ALTER TABLE `sc_searchhistory` CHANGE `shTerms` `shTerms` BLOB; +ALTER TABLE `sc_searchhistory` CHANGE `shTerms` `shTerms` varchar(255) CHARACTER SET utf8; +ALTER TABLE `sc_searchhistory` CHANGE `shRange` `shRange` BLOB; +ALTER TABLE `sc_searchhistory` CHANGE `shRange` `shRange` varchar(32) CHARACTER SET utf8; + +/* Thirdly re-add index keys */ +ALTER TABLE `sc_tags` ADD UNIQUE KEY `sc_tags_tag_uId` (`tag`, `uId`); +ALTER TABLE `sc_bookmarks2tags` ADD UNIQUE KEY `sc_bookmarks2tags_tag_bId` (`tag`,`bId`); +ALTER TABLE `sc_bookmarks2tags` ADD KEY `sc_bookmarks2tags_bId` (`bId`); +ALTER TABLE `sc_tags2tags` ADD UNIQUE KEY `sc_tags2tags_tag1_tag2_uId` (`tag1`,`tag2`,`relationType`,`uId`); +ALTER TABLE `sc_commondescription` ADD UNIQUE KEY `sc_commondescription_tag_datetime` (`tag`,`cdDatetime`); +ALTER TABLE `sc_tagscache` ADD UNIQUE KEY `sc_tagscache_tag1_tag2_type_uId` (`tag1`,`tag2`,`relationType`,`uId`); +ALTER TABLE `sc_tagsstats` ADD UNIQUE KEY `sc_tagsstats_tag1_type_uId` (`tag1`,`relationType`,`uId`); + +/* Change tables to utf-8 charset */ +ALTER TABLE `sc_bookmarks` CHARACTER SET utf8 COLLATE utf8_general_ci; +ALTER TABLE `sc_tags` CHARACTER SET utf8 COLLATE utf8_general_ci; +ALTER TABLE `sc_bookmarks2tags` CHARACTER SET utf8 COLLATE utf8_general_ci; +ALTER TABLE `sc_users` CHARACTER SET utf8 COLLATE utf8_general_ci; +ALTER TABLE `sc_watched` CHARACTER SET utf8 COLLATE utf8_general_ci; +ALTER TABLE `sc_tags2tags` CHARACTER SET utf8 COLLATE utf8_general_ci; +ALTER TABLE `sc_tagsstats` CHARACTER SET utf8 COLLATE utf8_general_ci; +ALTER TABLE `sc_tagscache` CHARACTER SET utf8 COLLATE utf8_general_ci; +ALTER TABLE `sc_commondescription` CHARACTER SET utf8 COLLATE utf8_general_ci; +ALTER TABLE `sc_searchhistory` CHARACTER SET utf8 COLLATE utf8_general_ci; diff --git a/data/schema/4.sql b/data/schema/4.sql new file mode 100644 index 0000000..022aaf0 --- /dev/null +++ b/data/schema/4.sql @@ -0,0 +1,11 @@ +ALTER TABLE `sc_bookmarks` ADD `bVoting` INT NOT NULL; +ALTER TABLE `sc_bookmarks` ADD `bVotes` INT NOT NULL; + +CREATE TABLE `sc_votes` ( + `bId` INT NOT NULL , + `uId` INT NOT NULL , + `vote` INT( 2 ) NOT NULL , + UNIQUE KEY `bid_2` (`bId`,`uId`), + KEY `bid` (`bId`), + KEY `uid` (`uId`) +) CHARACTER SET utf8 COLLATE utf8_general_ci ; diff --git a/data/schema/5.sql b/data/schema/5.sql new file mode 100644 index 0000000..d4c9afc --- /dev/null +++ b/data/schema/5.sql @@ -0,0 +1 @@ +ALTER TABLE `sc_bookmarks` ADD `bShort` VARCHAR(16) NULL DEFAULT NULL; diff --git a/doc/UPGRADE.txt b/doc/UPGRADE.txt index 2d4c4d2..0e570e5 100644 --- a/doc/UPGRADE.txt +++ b/doc/UPGRADE.txt @@ -4,261 +4,159 @@ Upgrading SemanticScuttle from a previous version From version 0.97 to 0.98 -------------------------- -Database updates: Apply data/schema/6.sql or do the following: - - CREATE TABLE `sc_version` ( - `schema_version` int(11) NOT NULL - ) DEFAULT CHARSET=utf8; - - INSERT INTO `sc_version` (`schema_version`) VALUES ('6'); +========================= +Database updates +---------------- +Apply ``data/schema/6.sql`` From version 0.96 to 0.97 -------------------------- +========================= No database changes necessary. From version 0.95 to 0.96 -------------------------- -Update your database: -- ALTER TABLE `sc_bookmarks` ADD `bShort` VARCHAR(16) NULL DEFAULT NULL; +========================= +Database updates +---------------- +Apply ``data/schema/5.sql`` -API: -The method signatures of addBookmark() and updateBookmark() -changed due to the addition of the $short parameter. +API +--- +The method signatures of ``addBookmark()`` and ``updateBookmark()`` +changed due to the addition of the ``$short`` parameter. We got complaints about the changed file structure, and people told -us that they just cannot set the document root to www/, because they -are not admins on their http server. This is a valid point, and -with 0.96.0 you can easily change it. See INSTALL.txt for more information -about moving www/. +us that they just cannot set the document root to ``www/``, because they +are not admins on their HTTP server. This is a valid point, and +with 0.96.0 you can easily change it. See `INSTALL.txt`_ for more information +about moving ``www/``. + +.. _INSTALL.txt: INSTALL.html From version 0.94 to 0.95 --------------------------- +========================= The file structure completely changed in 0.95.0 compared to previous versions. We recommend that you start with a -fresh installation, just copying over your config.php file. -Set your web server document root directory to www/. +fresh installation, just copying over your ``config.php`` file. +Set your web server document root directory to ``www/``. Yes, we kind of lost the ability to run SemanticScuttle in a subdirectory of a hostname. This functionality will be back in one of the next releases, but for now, you have to live with it. -Update your database: -- ALTER TABLE `sc_bookmarks` ADD `bVoting` INT NOT NULL; -- ALTER TABLE `sc_bookmarks` ADD `bVotes` INT NOT NULL; -- Add the new votes database table. See data/tables.sql. +Update your database +-------------------- +Apply ``data/schema/4.sql``. Currently, only MySQL can be used as database backend. All other DBMS (database management systems) have not been tested except for PostgreSQL, and SemanticScuttle fails there. -The de_AT translation has been re-added. This is because -de_AT provides a rather ugly "official German" style, -while the normal de_DE is friendlier. Choose what you like. +Translation +----------- +The ``de_AT`` translation has been re-added. This is because +``de_AT`` provides a rather ugly "official German" style, +while the normal ``de_DE`` is friendlier. Choose what you like. From version 0.93 to 0.94 -------------------------- +========================= - Nothing changed except for the default configuration file. It is recommended to start with a fresh config file, but not neccesary. Old config files still work. -- If you used translation de_AT, please switch to de_DE. - de_AT was moved to de_DE and de_AT has been removed. +- If you used translation ``de_AT``, please switch to ``de_DE``. + ``de_AT`` was moved to ``de_DE`` and ``de_AT`` has been removed. From version 0.92 to 0.93 -------------------------- +========================= - Backup your database - Make a copy from your SemanticScuttle Web directory -- Upgrade your database by following instructions ONE after ONE (order is important) : -#NOTHING TO CHANGE IN DB -- Upgrade your current configuration file (config.inc.php) with respect to config.inc.php.example -$footerMessage = ''; #HTML message appearing at the bottom of the page (just above SemanticScuttle credits) -$sidebarTopMessage = ''; #HTML message appearing at the top of the sidebar -$sidebarBottomMessage = ''; #HTML message appearing at the bottom of the sidebar -$adminsCanModifyBookmarksFromOtherUsers = true; # 'true' if admin users can edit or delete bookmarks belonging to other users. Else 'false'. -$adminsAreAdvisedTagsFromOtherAdmins = false; # 'true' if tags from other admins are proposed to each admin (in add/edit a bookmark page). Else 'false'. -$defaultPerPageForAdmins = 20; # default number of bookmarks per page for admins (-1 means no limit) +- Upgrade your current configuration file (``config.inc.php``) with respect to ``config.inc.php.example`` :: + + $footerMessage = ''; #HTML message appearing at the bottom of the page (just above SemanticScuttle credits) + $sidebarTopMessage = ''; #HTML message appearing at the top of the sidebar + $sidebarBottomMessage = ''; #HTML message appearing at the bottom of the sidebar + $adminsCanModifyBookmarksFromOtherUsers = true; # 'true' if admin users can edit or delete bookmarks belonging to other users. Else 'false'. + $adminsAreAdvisedTagsFromOtherAdmins = false; # 'true' if tags from other admins are proposed to each admin (in add/edit a bookmark page). Else 'false'. + $defaultPerPageForAdmins = 20; # default number of bookmarks per page for admins (-1 means no limit) From version 0.91 to 0.92 -------------------------- +========================= Message: this version modifies the database to UTF-8 charset. The idea is to convert the content (through BLOB type) and then to change the tables' charsets. - Backup your database - Make a copy from your SemanticScuttle Web directory -- Upgrade your database by following instructions ONE after ONE (order is important) : +- Upgrade your database by applying ``data/schema/3.sql`` +- Upgrade your current configuration file (``config.inc.php``) with respect to ``config.inc.php.example`` -/* modify and add fields */ -ALTER TABLE `sc_bookmarks` MODIFY `bAddress` varchar(1500) NOT NULL; -ALTER TABLE `sc_bookmarks` MODIFY `bDescription` TEXT default NULL; -ALTER TABLE `sc_bookmarks` ADD `bPrivateNote` TEXT NULL AFTER `bDescription` ; -ALTER TABLE `sc_tags` MODIFY `tDescription` TEXT default NULL; -ALTER TABLE `sc_commondescription` MODIFY `cdDescription` TEXT default NULL; + - Add variable :: -/* convert to UTF-8 if your table is ISO-something (through BLOB: tips provided by MYSQL documentation)*/ -/* first need to remove index keys because of BLOB constraints*/ -ALTER TABLE `sc_tags` DROP INDEX `sc_tags_tag_uId`; -ALTER TABLE `sc_bookmarks2tags` DROP INDEX `sc_bookmarks2tags_tag_bId`; -ALTER TABLE `sc_bookmarks2tags` DROP INDEX `sc_bookmarks2tags_bId`; -ALTER TABLE `sc_tags2tags` DROP INDEX `sc_tags2tags_tag1_tag2_uId`; -ALTER TABLE `sc_commondescription` DROP INDEX `sc_commondescription_tag_datetime`; -ALTER TABLE `sc_tagscache` DROP INDEX `sc_tagscache_tag1_tag2_type_uId`; -ALTER TABLE `sc_tagsstats` DROP INDEX `sc_tagsstats_tag1_type_uId`; + $descriptionAnchors = array("author", "isbn", "address"=>"[address][street][/street][city][/city][/address]"); #add a possible anchor (structured content) for bookmarks' description field -/* secondly convert through BLOB type */ -ALTER TABLE `sc_bookmarks` CHANGE `bTitle` `bTitle` BLOB; -ALTER TABLE `sc_bookmarks` CHANGE `bTitle` `bTitle` varchar(255) CHARACTER SET utf8; -ALTER TABLE `sc_bookmarks` CHANGE `bAddress` `bAddress` BLOB; -ALTER TABLE `sc_bookmarks` CHANGE `bAddress` `bAddress` varchar(1500) CHARACTER SET utf8; -ALTER TABLE `sc_bookmarks` CHANGE `bDescription` `bDescription` BLOB; -ALTER TABLE `sc_bookmarks` CHANGE `bDescription` `bDescription` text CHARACTER SET utf8; -ALTER TABLE `sc_bookmarks` CHANGE `bPrivateNote` `bPrivateNote` BLOB; -ALTER TABLE `sc_bookmarks` CHANGE `bPrivateNote` `bPrivateNote` text CHARACTER SET utf8; + - Add variable :: -ALTER TABLE `sc_tags` CHANGE `tag` `tag` BLOB; -ALTER TABLE `sc_tags` CHANGE `tag` `tag` varchar(100) CHARACTER SET utf8; -ALTER TABLE `sc_tags` CHANGE `tDescription` `tDescription` BLOB; -ALTER TABLE `sc_tags` CHANGE `tDescription` `tDescription` text CHARACTER SET utf8; + $enableCommonTagDescriptionEditedByAll = true; #true mean everybody can edit common description. Else just the admins can do it. + - Add variable :: -ALTER TABLE `sc_bookmarks2tags` CHANGE `tag` `tag` BLOB; -ALTER TABLE `sc_bookmarks2tags` CHANGE `tag` `tag` varchar(100) CHARACTER SET utf8; - -ALTER TABLE `sc_users` CHANGE `name` `name` BLOB; -ALTER TABLE `sc_users` CHANGE `name` `name` varchar(50) CHARACTER SET utf8; -ALTER TABLE `sc_users` CHANGE `uContent` `uContent` BLOB; -ALTER TABLE `sc_users` CHANGE `uContent` `uContent` text CHARACTER SET utf8; - -ALTER TABLE `sc_tags2tags` CHANGE `tag1` `tag1` BLOB; -ALTER TABLE `sc_tags2tags` CHANGE `tag1` `tag1` varchar(100) CHARACTER SET utf8; -ALTER TABLE `sc_tags2tags` CHANGE `tag2` `tag2` BLOB; -ALTER TABLE `sc_tags2tags` CHANGE `tag2` `tag2` varchar(100) CHARACTER SET utf8; - -ALTER TABLE `sc_tagsstats` CHANGE `tag1` `tag1` BLOB; -ALTER TABLE `sc_tagsstats` CHANGE `tag1` `tag1` varchar(100) CHARACTER SET utf8; - -ALTER TABLE `sc_tagscache` CHANGE `tag1` `tag1` BLOB; -ALTER TABLE `sc_tagscache` CHANGE `tag1` `tag1` varchar(100) CHARACTER SET utf8; -ALTER TABLE `sc_tagscache` CHANGE `tag2` `tag2` BLOB; -ALTER TABLE `sc_tagscache` CHANGE `tag2` `tag2` varchar(100) CHARACTER SET utf8; - -ALTER TABLE `sc_commondescription` CHANGE `tag` `tag` BLOB; -ALTER TABLE `sc_commondescription` CHANGE `tag` `tag` varchar(100) CHARACTER SET utf8; -ALTER TABLE `sc_commondescription` CHANGE `cdTitle` `cdTitle` BLOB; -ALTER TABLE `sc_commondescription` CHANGE `cdTitle` `cdTitle` varchar(255) CHARACTER SET utf8; -ALTER TABLE `sc_commondescription` CHANGE `cdDescription` `cdDescription` BLOB; -ALTER TABLE `sc_commondescription` CHANGE `cdDescription` `cdDescription` text CHARACTER SET utf8; - -ALTER TABLE `sc_searchhistory` CHANGE `shTerms` `shTerms` BLOB; -ALTER TABLE `sc_searchhistory` CHANGE `shTerms` `shTerms` varchar(255) CHARACTER SET utf8; -ALTER TABLE `sc_searchhistory` CHANGE `shRange` `shRange` BLOB; -ALTER TABLE `sc_searchhistory` CHANGE `shRange` `shRange` varchar(32) CHARACTER SET utf8; - -/* Thirdly re-add index keys */ -ALTER TABLE `sc_tags` ADD UNIQUE KEY `sc_tags_tag_uId` (`tag`, `uId`); -ALTER TABLE `sc_bookmarks2tags` ADD UNIQUE KEY `sc_bookmarks2tags_tag_bId` (`tag`,`bId`); -ALTER TABLE `sc_bookmarks2tags` ADD KEY `sc_bookmarks2tags_bId` (`bId`); -ALTER TABLE `sc_tags2tags` ADD UNIQUE KEY `sc_tags2tags_tag1_tag2_uId` (`tag1`,`tag2`,`relationType`,`uId`); -ALTER TABLE `sc_commondescription` ADD UNIQUE KEY `sc_commondescription_tag_datetime` (`tag`,`cdDatetime`); -ALTER TABLE `sc_tagscache` ADD UNIQUE KEY `sc_tagscache_tag1_tag2_type_uId` (`tag1`,`tag2`,`relationType`,`uId`); -ALTER TABLE `sc_tagsstats` ADD UNIQUE KEY `sc_tagsstats_tag1_type_uId` (`tag1`,`relationType`,`uId`); - -/* Change tables to utf-8 charset */ -ALTER TABLE `sc_bookmarks` CHARACTER SET utf8 COLLATE utf8_general_ci; -ALTER TABLE `sc_tags` CHARACTER SET utf8 COLLATE utf8_general_ci; -ALTER TABLE `sc_bookmarks2tags` CHARACTER SET utf8 COLLATE utf8_general_ci; -ALTER TABLE `sc_users` CHARACTER SET utf8 COLLATE utf8_general_ci; -ALTER TABLE `sc_watched` CHARACTER SET utf8 COLLATE utf8_general_ci; -ALTER TABLE `sc_tags2tags` CHARACTER SET utf8 COLLATE utf8_general_ci; -ALTER TABLE `sc_tagsstats` CHARACTER SET utf8 COLLATE utf8_general_ci; -ALTER TABLE `sc_tagscache` CHARACTER SET utf8 COLLATE utf8_general_ci; -ALTER TABLE `sc_commondescription` CHARACTER SET utf8 COLLATE utf8_general_ci; -ALTER TABLE `sc_searchhistory` CHARACTER SET utf8 COLLATE utf8_general_ci; - -- Upgrade your current configuration file (config.inc.php) with respect to config.inc.php.example -* Add variable : $descriptionAnchors = array("author", "isbn", "address"=>"[address][street][/street][city][/city][/address]"); #add a possible anchor (structured content) for bookmarks' description field -* Add variable : $enableCommonTagDescriptionEditedByAll = true; #true mean everybody can edit common description. Else just the admins can do it. -* Add variable : $googleAnalyticsCode = ''; #Allow GoogleAnalytics tracker https://www.google.com/analytics/ + $googleAnalyticsCode = ''; #Allow GoogleAnalytics tracker https://www.google.com/analytics/ From version 0.90 to 0.91 -------------------------- +========================= - Backup you database - Make a copy from your SemanticScuttle Web directory -- Upgrade your database by following instructions ONE after ONE (order is important) : - * ALTER TABLE `sc_bookmarks` CHANGE `bDescription` `bDescription` VARCHAR( 1500 ) - * CREATE TABLE `sc_tagscache` ( - `tcId` int(11) NOT NULL auto_increment, - `tag1` varchar(100) NOT NULL default '', - `tag2` varchar(100) NOT NULL default '', - `relationType` varchar(32) NOT NULL default '', - `uId` int(11) NOT NULL default '0', - PRIMARY KEY (`tcId`), - UNIQUE KEY `sc_tagscache_tag1_tag2_type_uId` (`tag1`,`tag2`,`relationType`,`uId`) -); -- Upgrade your current configuration file (config.inc.php) with respect to config.inc.php.example - * Delete last line : include_once('debug.inc.php'); - * Add variable: $menu2Tags = array('example', 'of', 'menu', 'tags'); - * Add variable: $debugMode = true; # if true, show debug messages +- Upgrade your database by applying ``data/schema/2.sql`` +- Upgrade your current configuration file (``config.inc.php``) with respect to ``config.inc.php.example`` + + - Delete last line :: + + include_once('debug.inc.php'); + + - Add variable:: + + $menu2Tags = array('example', 'of', 'menu', 'tags'); + + - Add variable:: + + $debugMode = true; # if true, show debug messages From version 0.89 to 0.90 -------------------------- +========================= - Backup you database - Make a copy from your SemanticScuttle Web directory - Upgrade your current configuration file (config.inc.php) with respect to config.inc.php.example -# add these lines under $enableWebsiteThumbnails = false; # enableWebsiteThumbnails {true|false}: -$thumbnailsUserId = ''; -$thumbnailsKey = ''; + add these lines under ``$enableWebsiteThumbnails = false; # enableWebsiteThumbnails {true|false}``:: + + $thumbnailsUserId = ''; + $thumbnailsKey = ''; From version 0.88 to 0.89 -------------------------- +========================= - Backup you database - Make a copy from your SemanticScuttle Web directory -- Upgrade your database by following instructions ONE after ONE (order is important) : +- Upgrade your database by applying ``data/schema/1.sql`` +- Upgrade your current configuration file (``config.inc.php``) with respect to ``config.inc.php.example`` + - add line:: -* change the table called 'sc_tags' into 'sc_bookmarks2tags' by executing the following SQL commands (after changing 'yourdatabasename' and adapting its name prefix 'sc_' to your convenience): - - RENAME TABLE `yourdatabasename`.`sc_tags` TO `yourdatabasename`.`sc_bookmarks2tags` ; - - -* add the following table (adapt its name prefix to your convenience) executing the following SQL commands: - - CREATE TABLE `sc_searchhistory` ( - `shId` int(11) NOT NULL auto_increment, - `shTerms` varchar(255) NOT NULL default '', - `shRange` varchar(32) NOT NULL default '', - `shDatetime` datetime NOT NULL default '0000-00-00 00:00:00', - `shNbResults` int(6) NOT NULL default '0', - `uId` int(11) NOT NULL default '0', - PRIMARY KEY (`shId`) - ); - - CREATE TABLE `sc_tags` ( - `tId` int(11) NOT NULL auto_increment, - `tag` varchar(32) NOT NULL default '', - `uId` int(11) NOT NULL default '0', - `tDescription` varchar(255) default NULL, - PRIMARY KEY (`tId`), - UNIQUE KEY `sc_tags_tag_uId` (`tag`, `uId`) - ); - -- Upgrade your current configuration file (config.inc.php) with respect to config.inc.php.example - # add line: $sizeSearchHistory = 10; - # add sidebar block index line: + + - add sidebar block index line:: + $index_sidebar_blocks = array('search','menu','users','popular'); - # add line: + + - add line:: $enableGoogleCustomSearch = true; From 4c8a53c5bc632302aaf8978e711eb53a03166db5 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Fri, 27 May 2011 07:01:22 +0200 Subject: [PATCH 38/38] update changelog --- doc/ChangeLog | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 596ea7a..cde9e61 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -6,22 +6,23 @@ ChangeLog for SemantiScuttle ------------------- - Switch to jQuery and drop dojo - Fix bug #3187177: Wrong URL / Export XML Bookmarks -- Fix bug in getTagsForBookmarks() that fetched all tags +- Fix bug in ``getTagsForBookmarks()`` that fetched all tags - Fix bug #3097187: Using opensearch with two tags does not work in Firefox - Fix bug #3251877: French translation JavaScript Bug when editing bookmarks - Fix bug #3168521: Title of tag-filtered RSS Feed is broken - Fix bug #2853627: Javascript warning - Implement request #1989987: Theming support - Implement request #3054906: Show user's full name instead of nickname -- Implement patch #3059829: update FR_CA translation +- Implement patch #3059829: update ``FR_CA`` translation - Show error message on mysqli connection errors - Update php-gettext library to 1.0.10 -- api/posts/add respects the "replace" parameter now +- ``api/posts/add`` respects the "replace" parameter now - Fix privacy issue when fetching tags of several users - Fix Google custom search XML - Only URLs with an allowed protocol may be added to the database -- Support HTTPS connections when $root is not configured +- Support HTTPS connections when ``$root`` is not configured - SQL schema version table to ease future database upgrades +- Documentation is written with rST (reStructuredText) now 0.97.2 - 2011-02-17