From 74c72b5cab5e097ee610feca7d57e25fba11d626 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Mon, 23 May 2011 18:16:41 +0200 Subject: check if the charset parameter really exists --- www/ajaxGetTitle.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'www') 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")) { -- cgit v1.2.3 From 5ba53394fcda4ae9cfa9af52b37fb67517deeb5a Mon Sep 17 00:00:00 2001 From: Christian Weiske <cweiske@cweiske.de> Date: Wed, 25 May 2011 19:43:36 +0200 Subject: implement request #1989987: theme support. merge themes branch with --squash --- build.xml | 13 +- data/config.default.php | 9 + data/templates/about.tpl.php | 34 -- data/templates/admin.tpl.php | 35 -- .../bookmarkcommondescriptionedit.tpl.php | 58 -- data/templates/bookmarklet.inc.php | 117 ---- data/templates/bookmarks-thumbnail.inc.tpl.php | 18 - .../bookmarks-vote-horizontal.inc.tpl.php | 50 -- data/templates/bookmarks-vote.inc.tpl.php | 44 -- data/templates/bookmarks.tpl.php | 443 -------------- data/templates/bottom.inc.php | 34 -- data/templates/default/about.tpl.php | 34 ++ data/templates/default/admin.tpl.php | 35 ++ .../default/bookmarkcommondescriptionedit.tpl.php | 58 ++ data/templates/default/bookmarklet.inc.php | 117 ++++ .../default/bookmarks-thumbnail.inc.tpl.php | 18 + .../default/bookmarks-vote-horizontal.inc.tpl.php | 50 ++ data/templates/default/bookmarks-vote.inc.tpl.php | 44 ++ data/templates/default/bookmarks.tpl.php | 454 ++++++++++++++ data/templates/default/bottom.inc.php | 34 ++ data/templates/default/dojo.inc.php | 35 ++ data/templates/default/dynamictags.inc.php | 148 +++++ data/templates/default/editbookmark.tpl.php | 221 +++++++ .../default/editprofile-sslclientcerts.tpl.php | 60 ++ data/templates/default/editprofile.tpl.php | 73 +++ data/templates/default/error.404.tpl.php | 9 + data/templates/default/error.500.tpl.php | 9 + data/templates/default/importDelicious.tpl.php | 42 ++ data/templates/default/importNetscape.tpl.php | 50 ++ data/templates/default/importStructure.tpl.php | 42 ++ data/templates/default/login.tpl.php | 41 ++ data/templates/default/password.tpl.php | 26 + data/templates/default/profile.tpl.php | 74 +++ data/templates/default/register.tpl.php | 49 ++ data/templates/default/rss.tpl.php | 26 + data/templates/default/search.menu.php | 57 ++ data/templates/default/sidebar.block.common.php | 28 + data/templates/default/sidebar.block.linked.php | 66 +++ data/templates/default/sidebar.block.menu.php | 80 +++ data/templates/default/sidebar.block.menu2.php | 71 +++ data/templates/default/sidebar.block.popular.php | 44 ++ data/templates/default/sidebar.block.recent.php | 39 ++ data/templates/default/sidebar.block.related.php | 40 ++ data/templates/default/sidebar.block.search.php | 51 ++ .../templates/default/sidebar.block.tagactions.php | 35 ++ data/templates/default/sidebar.block.users.php | 34 ++ data/templates/default/sidebar.block.watchlist.php | 60 ++ .../default/sidebar.block.watchstatus.php | 28 + data/templates/default/sidebar.linkedtags.inc.php | 84 +++ data/templates/default/sidebar.tpl.php | 19 + data/templates/default/tag2tagadd.tpl.php | 57 ++ data/templates/default/tag2tagdelete.tpl.php | 49 ++ data/templates/default/tag2tagedit.tpl.php | 73 +++ .../default/tagcommondescriptionedit.tpl.php | 48 ++ data/templates/default/tagdelete.tpl.php | 20 + data/templates/default/tagedit.tpl.php | 33 ++ data/templates/default/tagrename.tpl.php | 41 ++ data/templates/default/tags.tpl.php | 31 + data/templates/default/toolbar.inc.php | 37 ++ data/templates/default/top.inc.php | 66 +++ data/templates/default/users.tpl.php | 33 ++ data/templates/dojo.inc.php | 35 -- data/templates/dynamictags.inc.php | 148 ----- data/templates/editbookmark.tpl.php | 221 ------- data/templates/editprofile-sslclientcerts.tpl.php | 60 -- data/templates/editprofile.tpl.php | 73 --- data/templates/error.404.tpl.php | 9 - data/templates/error.500.tpl.php | 9 - data/templates/importDelicious.tpl.php | 42 -- data/templates/importNetscape.tpl.php | 50 -- data/templates/importStructure.tpl.php | 42 -- data/templates/login.tpl.php | 41 -- data/templates/password.tpl.php | 26 - data/templates/profile.tpl.php | 74 --- data/templates/register.tpl.php | 49 -- data/templates/rss.tpl.php | 26 - data/templates/search.menu.php | 57 -- data/templates/sidebar.block.common.php | 28 - data/templates/sidebar.block.linked.php | 66 --- data/templates/sidebar.block.menu.php | 80 --- data/templates/sidebar.block.menu2.php | 71 --- data/templates/sidebar.block.popular.php | 44 -- data/templates/sidebar.block.recent.php | 39 -- data/templates/sidebar.block.related.php | 40 -- data/templates/sidebar.block.search.php | 51 -- data/templates/sidebar.block.tagactions.php | 35 -- data/templates/sidebar.block.users.php | 34 -- data/templates/sidebar.block.watchlist.php | 60 -- data/templates/sidebar.block.watchstatus.php | 28 - data/templates/sidebar.linkedtags.inc.php | 84 --- data/templates/sidebar.tpl.php | 19 - data/templates/tag2tagadd.tpl.php | 57 -- data/templates/tag2tagdelete.tpl.php | 49 -- data/templates/tag2tagedit.tpl.php | 73 --- data/templates/tagcommondescriptionedit.tpl.php | 48 -- data/templates/tagdelete.tpl.php | 20 - data/templates/tagedit.tpl.php | 33 -- data/templates/tagrename.tpl.php | 41 -- data/templates/tags.tpl.php | 31 - data/templates/testdummy/top.inc.php | 66 +++ data/templates/toolbar.inc.php | 37 -- data/templates/top.inc.php | 66 --- data/templates/users.tpl.php | 33 -- 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/icon.png | Bin 771 -> 0 bytes www/images/b_edit.png | Bin 451 -> 0 bytes www/images/bg_admin.png | Bin 1212 -> 0 bytes www/images/bg_bar.png | Bin 873 -> 0 bytes www/images/bg_header.png | Bin 684 -> 0 bytes www/images/bg_sidebar.png | Bin 726 -> 0 bytes www/images/loading.gif | Bin 1582 -> 0 bytes www/images/logo.png | Bin 2973 -> 0 bytes www/images/logo_24.gif | Bin 1530 -> 0 bytes www/images/rss.gif | Bin 401 -> 0 bytes www/images/thumbs_up.orig.png | Bin 19257 -> 0 bytes www/images/vote-against-voted.png | Bin 419 -> 0 bytes www/images/vote-against.png | Bin 495 -> 0 bytes www/images/vote-for-voted.png | Bin 415 -> 0 bytes www/images/vote-for.png | Bin 625 -> 0 bytes www/jsScuttle.php | 5 +- www/scuttle.css | 657 --------------------- www/themes/default/icon.png | Bin 0 -> 771 bytes www/themes/default/images/b_edit.png | Bin 0 -> 451 bytes www/themes/default/images/bg_admin.png | Bin 0 -> 1212 bytes www/themes/default/images/bg_bar.png | Bin 0 -> 873 bytes www/themes/default/images/bg_header.png | Bin 0 -> 684 bytes www/themes/default/images/bg_sidebar.png | Bin 0 -> 726 bytes www/themes/default/images/loading.gif | Bin 0 -> 1582 bytes www/themes/default/images/logo.png | Bin 0 -> 2973 bytes www/themes/default/images/logo_24.gif | Bin 0 -> 1530 bytes www/themes/default/images/rss.gif | Bin 0 -> 401 bytes www/themes/default/images/thumbs_up.orig.png | Bin 0 -> 19257 bytes www/themes/default/images/vote-against-voted.png | Bin 0 -> 419 bytes www/themes/default/images/vote-against.png | Bin 0 -> 495 bytes www/themes/default/images/vote-for-voted.png | Bin 0 -> 415 bytes www/themes/default/images/vote-for.png | Bin 0 -> 625 bytes www/themes/default/scuttle.css | 657 +++++++++++++++++++++ www/themes/testdummy/images/logo.png | Bin 0 -> 2890 bytes www/themes/testdummy/scuttle.css | 12 + 144 files changed, 3908 insertions(+), 3629 deletions(-) delete mode 100644 data/templates/about.tpl.php delete mode 100644 data/templates/admin.tpl.php delete mode 100644 data/templates/bookmarkcommondescriptionedit.tpl.php delete mode 100644 data/templates/bookmarklet.inc.php delete mode 100644 data/templates/bookmarks-thumbnail.inc.tpl.php delete mode 100644 data/templates/bookmarks-vote-horizontal.inc.tpl.php delete mode 100644 data/templates/bookmarks-vote.inc.tpl.php delete mode 100644 data/templates/bookmarks.tpl.php delete mode 100644 data/templates/bottom.inc.php create mode 100644 data/templates/default/about.tpl.php create mode 100644 data/templates/default/admin.tpl.php create mode 100644 data/templates/default/bookmarkcommondescriptionedit.tpl.php create mode 100644 data/templates/default/bookmarklet.inc.php create mode 100644 data/templates/default/bookmarks-thumbnail.inc.tpl.php create mode 100644 data/templates/default/bookmarks-vote-horizontal.inc.tpl.php create mode 100644 data/templates/default/bookmarks-vote.inc.tpl.php create mode 100644 data/templates/default/bookmarks.tpl.php create mode 100644 data/templates/default/bottom.inc.php create mode 100644 data/templates/default/dojo.inc.php create mode 100644 data/templates/default/dynamictags.inc.php create mode 100644 data/templates/default/editbookmark.tpl.php create mode 100644 data/templates/default/editprofile-sslclientcerts.tpl.php create mode 100644 data/templates/default/editprofile.tpl.php create mode 100644 data/templates/default/error.404.tpl.php create mode 100644 data/templates/default/error.500.tpl.php create mode 100644 data/templates/default/importDelicious.tpl.php create mode 100644 data/templates/default/importNetscape.tpl.php create mode 100644 data/templates/default/importStructure.tpl.php create mode 100644 data/templates/default/login.tpl.php create mode 100644 data/templates/default/password.tpl.php create mode 100644 data/templates/default/profile.tpl.php create mode 100644 data/templates/default/register.tpl.php create mode 100644 data/templates/default/rss.tpl.php create mode 100644 data/templates/default/search.menu.php create mode 100644 data/templates/default/sidebar.block.common.php create mode 100644 data/templates/default/sidebar.block.linked.php create mode 100644 data/templates/default/sidebar.block.menu.php create mode 100644 data/templates/default/sidebar.block.menu2.php create mode 100644 data/templates/default/sidebar.block.popular.php create mode 100644 data/templates/default/sidebar.block.recent.php create mode 100644 data/templates/default/sidebar.block.related.php create mode 100644 data/templates/default/sidebar.block.search.php create mode 100644 data/templates/default/sidebar.block.tagactions.php create mode 100644 data/templates/default/sidebar.block.users.php create mode 100644 data/templates/default/sidebar.block.watchlist.php create mode 100644 data/templates/default/sidebar.block.watchstatus.php create mode 100644 data/templates/default/sidebar.linkedtags.inc.php create mode 100644 data/templates/default/sidebar.tpl.php create mode 100644 data/templates/default/tag2tagadd.tpl.php create mode 100644 data/templates/default/tag2tagdelete.tpl.php create mode 100644 data/templates/default/tag2tagedit.tpl.php create mode 100644 data/templates/default/tagcommondescriptionedit.tpl.php create mode 100644 data/templates/default/tagdelete.tpl.php create mode 100644 data/templates/default/tagedit.tpl.php create mode 100644 data/templates/default/tagrename.tpl.php create mode 100644 data/templates/default/tags.tpl.php create mode 100644 data/templates/default/toolbar.inc.php create mode 100644 data/templates/default/top.inc.php create mode 100644 data/templates/default/users.tpl.php delete mode 100644 data/templates/dojo.inc.php delete mode 100644 data/templates/dynamictags.inc.php delete mode 100644 data/templates/editbookmark.tpl.php delete mode 100644 data/templates/editprofile-sslclientcerts.tpl.php delete mode 100644 data/templates/editprofile.tpl.php delete mode 100644 data/templates/error.404.tpl.php delete mode 100644 data/templates/error.500.tpl.php delete mode 100644 data/templates/importDelicious.tpl.php delete mode 100644 data/templates/importNetscape.tpl.php delete mode 100644 data/templates/importStructure.tpl.php delete mode 100644 data/templates/login.tpl.php delete mode 100644 data/templates/password.tpl.php delete mode 100644 data/templates/profile.tpl.php delete mode 100644 data/templates/register.tpl.php delete mode 100644 data/templates/rss.tpl.php delete mode 100644 data/templates/search.menu.php delete mode 100644 data/templates/sidebar.block.common.php delete mode 100644 data/templates/sidebar.block.linked.php delete mode 100644 data/templates/sidebar.block.menu.php delete mode 100644 data/templates/sidebar.block.menu2.php delete mode 100644 data/templates/sidebar.block.popular.php delete mode 100644 data/templates/sidebar.block.recent.php delete mode 100644 data/templates/sidebar.block.related.php delete mode 100644 data/templates/sidebar.block.search.php delete mode 100644 data/templates/sidebar.block.tagactions.php delete mode 100644 data/templates/sidebar.block.users.php delete mode 100644 data/templates/sidebar.block.watchlist.php delete mode 100644 data/templates/sidebar.block.watchstatus.php delete mode 100644 data/templates/sidebar.linkedtags.inc.php delete mode 100644 data/templates/sidebar.tpl.php delete mode 100644 data/templates/tag2tagadd.tpl.php delete mode 100644 data/templates/tag2tagdelete.tpl.php delete mode 100644 data/templates/tag2tagedit.tpl.php delete mode 100644 data/templates/tagcommondescriptionedit.tpl.php delete mode 100644 data/templates/tagdelete.tpl.php delete mode 100644 data/templates/tagedit.tpl.php delete mode 100644 data/templates/tagrename.tpl.php delete mode 100644 data/templates/tags.tpl.php create mode 100644 data/templates/testdummy/top.inc.php delete mode 100644 data/templates/toolbar.inc.php delete mode 100644 data/templates/top.inc.php delete mode 100644 data/templates/users.tpl.php create mode 100644 doc/themes.rst create mode 100644 src/SemanticScuttle/Model/Theme.php delete mode 100644 www/icon.png delete mode 100644 www/images/b_edit.png delete mode 100644 www/images/bg_admin.png delete mode 100644 www/images/bg_bar.png delete mode 100644 www/images/bg_header.png delete mode 100644 www/images/bg_sidebar.png delete mode 100644 www/images/loading.gif delete mode 100644 www/images/logo.png delete mode 100644 www/images/logo_24.gif delete mode 100644 www/images/rss.gif delete mode 100644 www/images/thumbs_up.orig.png delete mode 100644 www/images/vote-against-voted.png delete mode 100644 www/images/vote-against.png delete mode 100644 www/images/vote-for-voted.png delete mode 100644 www/images/vote-for.png delete mode 100644 www/scuttle.css create mode 100644 www/themes/default/icon.png create mode 100644 www/themes/default/images/b_edit.png create mode 100644 www/themes/default/images/bg_admin.png create mode 100644 www/themes/default/images/bg_bar.png create mode 100644 www/themes/default/images/bg_header.png create mode 100644 www/themes/default/images/bg_sidebar.png create mode 100644 www/themes/default/images/loading.gif create mode 100644 www/themes/default/images/logo.png create mode 100644 www/themes/default/images/logo_24.gif create mode 100644 www/themes/default/images/rss.gif create mode 100644 www/themes/default/images/thumbs_up.orig.png create mode 100644 www/themes/default/images/vote-against-voted.png create mode 100644 www/themes/default/images/vote-against.png create mode 100644 www/themes/default/images/vote-for-voted.png create mode 100644 www/themes/default/images/vote-for.png create mode 100644 www/themes/default/scuttle.css create mode 100644 www/themes/testdummy/images/logo.png create mode 100644 www/themes/testdummy/scuttle.css (limited to 'www') 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/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/about.tpl.php deleted file mode 100644 index 7bff98d..0000000 --- a/data/templates/about.tpl.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php -$this->includeTemplate($GLOBALS['top_include']); -?> - -<ul> -<li><?php echo T_('<strong>Store</strong> all your favourite links in one place, accessible from anywhere.'); ?></li> -<li><?php echo T_('<strong>Share</strong> your bookmarks with everyone, with friends on your watchlist or just keep them private.') ;?></li> -<li><?php echo T_('<strong>Tag</strong> your bookmarks with as many labels as you want, instead of wrestling with folders.'); ?></li> -<li><?php echo sprintf('<strong><a href="'.createURL('register').'">'.T_('Register now').'</a> </strong>'.T_(' to start using %s!'), $GLOBALS['sitename']); ?></li> -</ul> - -<h3><?php echo T_('Geek Stuff'); ?></h3> -<ul> -<li><a href="http://sourceforge.net/projects/semanticscuttle/">Semantic Scuttle</a> <?php echo T_('is licensed under the ');?> <a href="http://www.gnu.org/copyleft/gpl.html"><acronym title="GNU\'s Not Unix">GNU</acronym> General Public License</a> (<?php echo T_('you can freely host it on your own web server.'); ?>)</li> -<li><?php echo sprintf(T_('%1$s supports most of the <a href="http://del.icio.us/doc/api">del.icio.us <abbr title="Application Programming Interface">API</abbr></a>. Almost all of the neat tools made for that system can be modified to work with %1$s instead. 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.'), $GLOBALS['sitename']); ?></li> - - - -<?php if(!is_null($currentUser) && $currentUser->isAdmin()): ?> -<li>SemanticScuttle v0.97.0</li> -<?php endif ?> -</ul> - -<h3><?php echo T_('Tips'); ?></h3> -<ul> -<li><?php echo T_('Add search plugin into your browser:'); ?> <a href="#" onclick="window.external.AddSearchProvider('<?php echo ROOT?>api/opensearch.php');">opensearch</a></li> -<li><?php echo T_('The secret tag "system:unfiled" allows you to find bookmarks without tags.'); ?></li> -<li><?php echo T_('The secret tag "system:imported" allows you to find imported bookmarks.'); ?></li> -</ul> - - -<?php -$this->includeTemplate($GLOBALS['bottom_include']); -?> diff --git a/data/templates/admin.tpl.php b/data/templates/admin.tpl.php deleted file mode 100644 index 50680f6..0000000 --- a/data/templates/admin.tpl.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php - -$this->includeTemplate($GLOBALS['top_include']); - -echo '<h3>'.T_('Users management').'</h3>'; - -echo '<ol id="bookmarks">'; - -foreach($users as $user) { - echo '<li class="xfolkentry">'."\n"; - - echo '<div class="link">'; - echo '<a href="'.createURL('profile', $user->getUsername()).'">'.$user->getUsername().'</a>'; - echo ' - <span title="'. T_('Public/Shared/Private') .'">'. $user->getNbBookmarks('public') .' / '. $user->getNbBookmarks('shared') .' / '. $user->getNbBookmarks('private') .' '. T_('bookmark(s)') .'</span>'; - echo '</div>'; - - if($user->getUsername() != $currentUser->getUsername()) { - echo '<div class="meta">'; - echo '<a href="'.createURL('admin','delete/'.$user->getUsername()).'" onclick="return confirm(\''.T_('Are you sure?').'\');">'.T_('Delete').'</a>'; - echo '</div>'; - } - - echo '</li>'."\n"; -} -echo '</ol>'; -?> -<h3><?php echo T_('Other actions')?></h3> -<p> -<a href="<?php echo createURL('admin','checkUrl/') ?>"> <?php echo T_('Check all URLs (May take some time)') ?></a> -</p> -<?php -$this->includeTemplate('sidebar.tpl'); -$this->includeTemplate($GLOBALS['bottom_include']); - -?> diff --git a/data/templates/bookmarkcommondescriptionedit.tpl.php b/data/templates/bookmarkcommondescriptionedit.tpl.php deleted file mode 100644 index 807c58b..0000000 --- a/data/templates/bookmarkcommondescriptionedit.tpl.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php - -$this->includeTemplate($GLOBALS['top_include']); - -list ($url, $hash) = explode('/', $_SERVER['PATH_INFO']); - - -?> -<script type="text/javascript"> -window.onload = function() { - document.getElementById("title").focus(); -} -</script> - -<form action="<?php echo $formaction; ?>" method="post"> -<table title="<?php echo T_('Collaborative description: these fields can be viewed and modified by every users') ?>"> -<tr> - <th align="left"><?php echo T_('Title'); ?></th> - <td><input type="text" id="title" name="title" size="75" maxlength="255" value="<?php echo $description['cdTitle']; ?>" onkeypress="this.style.backgroundImage = 'none';" /></td> - <td></td> -</tr> -<tr> - <th align="left"><?php echo T_('Description'); ?></th> - <td><textarea name="description" cols="75" rows="10"><?php echo $description['cdDescription']; ?></textarea></td> -</tr> -<tr> - <td></td> - <td> - <?php - if(strlen($description['cdDatetime'])>0) { - echo T_('Last modification:').' '.$description['cdDatetime'].', '; - $lastUser = $userservice->getUser($description['uId']); - echo '<a href="'.createURL('profile', $lastUser['username']).'">' - . SemanticScuttle_Model_UserArray::getName($lastUser) . '</a>'; - } - ?> - </td> - <td></td> -</tr> -<tr> - <td></td> - <td> - <input type="submit" name="confirm" value="<?php echo T_('Update'); ?>" /> - <input type="submit" name="cancel" value="<?php echo T_('Cancel'); ?>" /> - </td> - <td></td> -</tr> -</table> - -<?php if (isset($referrer)): ?> -<div><input type="hidden" name="referrer" value="<?php echo $referrer; ?>" /></div> -<?php endif; ?> -<div><input type="hidden" name="hash" value="<?php echo $hash; ?>" /></div> -</form> - -<?php -$this->includeTemplate($GLOBALS['bottom_include']); -?> diff --git a/data/templates/bookmarklet.inc.php b/data/templates/bookmarklet.inc.php deleted file mode 100644 index 9867745..0000000 --- a/data/templates/bookmarklet.inc.php +++ /dev/null @@ -1,117 +0,0 @@ -<h3><?php echo T_('Bookmarklet'); ?></h3> -<p id="bookmarklet"></p> -<script type="text/javascript"> -//<![CDATA[ -var browser = navigator.appName; -jQuery(function($) { -if (browser == "Opera") { - $('#bookmarklet').append( - <?php echo json_encode( - sprintf( - T_("Click one of the following bookmarklets to add a button you can click whenever you want to add the page you are on to %s") . ':', - $GLOBALS['sitename'] - ) - ); ?> - ); -} else { - $('#bookmarklet').append( - <?php echo json_encode( - sprintf( - T_("Drag one of the following bookmarklets to your browser's bookmarks and click it whenever you want to add the page you are on to %s") . ':', - $GLOBALS['sitename'] - ) - ); - ?> - ); -} -}); -//]]> -</script> -<script type="text/javascript"> -//<![CDATA[ -var selection = ''; -if (window.getSelection) { - selection = 'window.getSelection()'; -} else if (document.getSelection) { - selection = 'document.getSelection()'; -} else if (document.selection) { - selection = 'document.selection.createRange().text'; -} -if (browser == "Opera") { - $('#bookmarklet').append( - '<ul>' - + '<li>' - + '<a class="bookmarklet" href="' - + '<?php -$popupLink = 'javascript:' - . "location.href='" - . createURL('bookmarks', $GLOBALS['user']) - . '?action=add' - . "&address='+encodeURIComponent(document.location.href)+'" - . "&title='+encodeURIComponent(document.title)+'" - . "&description='+encodeURIComponent(SELECTION)" - . ";"; -$link = 'opera:/button/' - //Opera command - . 'Go to page' - //command parameter 1 - . ',"' . rawurlencode($popupLink) . '"' - //command parameter 2 - . ',' - //button title - . ',"Post to ' . fixOperaButtonName($GLOBALS['sitename']) . '"' - //button icon name - . ',"Scuttle"'; -echo jsEscTitle(htmlspecialchars($link)); -?>'.replace('SELECTION', selection) - + '"><?php echo jsEscTitle(sprintf(T_('Post to %s'), $GLOBALS['sitename'])); ?></a>' - + '</li>' - + '<li>' - + '<a class="bookmarklet" href="' - + '<?php -$popupLink = 'javascript:' - . 'open(' - . "'" . createURL('bookmarks', $GLOBALS['user']) - . '?action=add' - . '&popup=1' - . "&address='+encodeURIComponent(document.location.href)+'" - . "&title='+encodeURIComponent(document.title)+'" - . "&description='+encodeURIComponent(SELECTION)" - . "," - . "'" . htmlspecialchars(jsEscTitle($GLOBALS['sitename'])) . "'," - . "'modal=1,status=0,scrollbars=1,toolbar=0,resizable=1,width=790,height=465" - . ",left='+(screen.width-790)/2+',top='+(screen.height-425)/2" - . ");void 0"; -$link = 'opera:/button/' - . 'Go to page' - . ',"' . rawurlencode($popupLink) . '"' - . ',' - . ',"Post to ' . fixOperaButtonName($GLOBALS['sitename']) . ' (Pop-up)"' - . ',"Scuttle"'; -echo jsEscTitle(htmlspecialchars($link)); -?>'.replace('SELECTION', selection) - + '"><?php echo jsEscTitle(sprintf(T_('Post to %s (Pop-up)'), $GLOBALS['sitename'])); ?></a>' - + '</li>' - + '</ul>' - ); -} else { - $('#bookmarklet').append( - '<ul>' - + '<li><a class="bookmarklet" href="javascript:x=document;a=encodeURIComponent(x.location.href);t=encodeURIComponent(x.title);d=encodeURIComponent('+selection+');location.href=\'<?php echo createURL('bookmarks', $GLOBALS['user']); ?>?action=add&address=\'+a+\'&title=\'+t+\'&description=\'+d;void 0;"><?php echo jsEscTitle(sprintf(T_('Post to %s'), $GLOBALS['sitename'])); ?><\/a><\/li>' - + '<li>' - + '<a class="bookmarklet" href="' - + 'javascript:x=document;' - + 'a=encodeURIComponent(x.location.href);' - + 't=encodeURIComponent(x.title);' - + 'd=encodeURIComponent('+selection+');' - + 'open(' - + '\'<?php echo createURL('bookmarks', $GLOBALS['user']); ?>?action=add&popup=1&address=\'+a+\'&title=\'+t+\'&description=\'+d,\'<?php echo htmlspecialchars(jsEscTitleDouble($GLOBALS['sitename'])); ?>\',\'modal=1,status=0,scrollbars=1,toolbar=0,resizable=1,width=790,height=465,left=\'+(screen.width-790)/2+\',top=\'+(screen.height-425)/2' - + ');void 0;">' - + '<?php echo jsEscTitle(sprintf(T_('Post to %s (Pop-up)'), $GLOBALS['sitename'])); ?>' - + '</a>' - + '</li>' - + '</ul>' - ); -} -//]]> -</script> diff --git a/data/templates/bookmarks-thumbnail.inc.tpl.php b/data/templates/bookmarks-thumbnail.inc.tpl.php deleted file mode 100644 index 200b8f7..0000000 --- a/data/templates/bookmarks-thumbnail.inc.tpl.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php -/** - * Bookmark thumbnail image - * Shows the website thumbnail for the bookmark. - * - * Expects a $row variable with bookmark data. - */ -if (!$GLOBALS['enableWebsiteThumbnails']) { - return; -} - -$thumbnailHash = md5( - $address . $GLOBALS['thumbnailsUserId'] . $GLOBALS['thumbnailsKey'] -); -//echo '<a href="'. $address .'"'. $rel .' ><img class="thumbnail" src="http://www.artviper.net/screenshots/screener.php?url='.$address.'&w=120&sdx=1280&userID='.$GLOBALS['thumbnailsUserId'].'&hash='.$thumbnailHash.'" />'; -echo '<img class="thumbnail" onclick="window.location.href=\''.$address.'\'" src="http://www.artviper.net/screenshots/screener.php?url='.$address.'&w=120&sdx=1280&userID='.$GLOBALS['thumbnailsUserId'].'&hash='.$thumbnailHash.'" />'; - -?> \ No newline at end of file diff --git a/data/templates/bookmarks-vote-horizontal.inc.tpl.php b/data/templates/bookmarks-vote-horizontal.inc.tpl.php deleted file mode 100644 index c4a9f8e..0000000 --- a/data/templates/bookmarks-vote-horizontal.inc.tpl.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php -/** - * Bookmark voting badge. - * Shows the number of votes and buttons to vote for or - * against a bookmark. - * Expects a $row variable with bookmark data - */ -if (!$GLOBALS['enableVoting'] || $GLOBALS['votingMode'] != 2) { - return; -} -if (!isset($row['hasVoted'])) { - $classes = 'vote-horiz vote-horiz-inactive'; -} else if (isset($row['vote'])) { - $classes = 'vote-horiz ' - . ($row['vote'] == 1 - ? 'vote-horiz-for' - : 'vote-horiz-against' - ); -} else { - $classes = 'vote-horiz'; -} -echo '<div class="' . $classes . '" id="bmv-' . $row['bId'] . '">'; -echo sprintf( - T_('Voting <span class="voting">%d</span>'), $row['bVoting'] -) . ' '; - -if (isset($row['hasVoted'])) { - if ($row['vote'] != 1) { - echo '<a class="vote-for" rel="nofollow" href="' - . createVoteURL(true, $row['bId']) . '"' - . ' onclick="javascript:vote(' . $row['bId'] . ',1); return false;"' - . '>' . T_('Vote for') . '</a> '; - } else { - echo '<span class="vote-for-inactive">' - . T_('Vote for') . '</span> '; - } - - - if ($row['vote'] != -1) { - echo '<a class="vote-against" rel="nofollow" href="' - . createVoteURL(false, $row['bId']) . '"' - . ' onclick="vote(' . $row['bId'] . ',-1); return false;"' - . '>' . T_('Vote against') . '</a>'; - } else { - echo '<span class="vote-against-inactive">' - . T_('Vote against') . '</span>'; - } -} -echo '</div>'; -?> \ No newline at end of file diff --git a/data/templates/bookmarks-vote.inc.tpl.php b/data/templates/bookmarks-vote.inc.tpl.php deleted file mode 100644 index 41572d5..0000000 --- a/data/templates/bookmarks-vote.inc.tpl.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php -/** - * Bookmark voting badge. - * Shows the number of votes and buttons to vote for or - * against a bookmark. - * Expects a $row variable with bookmark data - */ -if (!$GLOBALS['enableVoting'] || $GLOBALS['votingMode'] != 1) { - return; -} -if (isset($row['hasVoted']) && !$row['hasVoted']) { - $classes = 'vote-badge vote-badge-inactive'; -} else if (isset($row['vote'])) { - $classes = 'vote-badge ' - . ($row['vote'] == 1 - ? 'vote-badge-for' - : 'vote-badge-against' - ); -} else { - $classes = 'vote-badge'; -} -echo '<span class="' . $classes . '" id="bmv-' . $row['bId'] . '">'; - -if (isset($row['hasVoted']) && $row['vote'] != 1) { - echo '<a class="vote-for" rel="nofollow" href="' - . createVoteURL(true, $row['bId']) . '"' - . ' onclick="javascript:vote(' . $row['bId'] . ',1); return false;"' - . '>+</a>'; -} else { - echo '<span class="vote-for vote-for-inactive">+</span>'; -} - -echo '<span class="voting">' . $row['bVoting'] . '</span>'; - -if (isset($row['hasVoted']) && $row['vote'] != -1) { - echo '<a class="vote-against" rel="nofollow" href="' - . createVoteURL(false, $row['bId']) . '"' - . ' onclick="vote(' . $row['bId'] . ',-1); return false;"' - . '>-</a>'; -} else { - echo '<span class="vote-against vote-against-inactive">-</span>'; -} -echo '</span>'; -?> \ No newline at end of file diff --git a/data/templates/bookmarks.tpl.php b/data/templates/bookmarks.tpl.php deleted file mode 100644 index 55d6a0f..0000000 --- a/data/templates/bookmarks.tpl.php +++ /dev/null @@ -1,443 +0,0 @@ -<?php -/** - * Show a list of bookmarks. - * - * SemanticScuttle - your social bookmark manager. - * - * PHP version 5. - * - * @category Bookmarking - * @package SemanticScuttle - * @subcategory Templates - * @author Benjamin Huynh-Kim-Bang <mensonge@users.sourceforge.net> - * @author Christian Weiske <cweiske@cweiske.de> - * @author Eric Dane <ericdane@users.sourceforge.net> - * @license GPL http://www.gnu.org/licenses/gpl.html - * @link http://sourceforge.net/projects/semanticscuttle - */ - -/* Service creation: only useful services are created */ -$bookmarkservice = SemanticScuttle_Service_Factory::get('Bookmark'); -$tagservice = SemanticScuttle_Service_Factory::get('Tag'); -$cdservice = SemanticScuttle_Service_Factory::get('CommonDescription'); - - -$pageName = isset($pageName) ? $pageName : ''; -$user = isset($user) ? $user : ''; -$currenttag = isset($currenttag) ? $currenttag : ''; - - -$this->includeTemplate($GLOBALS['top_include']); - -include('search.menu.php'); -?> - -<?php if($pageName == PAGE_INDEX && $GLOBALS['welcomeMessage']):?> -<p id="welcome"><?php echo $GLOBALS['welcomeMessage'];?></p> -<?php endif?> - - -<?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 ?>images/logo_24.gif" width="12px"/> <?php echo T_('Bookmarks on this page are managed by an admin user.'); ?><img src="<?php echo ROOT ?>images/logo_24.gif" width="12px"/> -</div> -<?php endif?> - - -<?php -// common tag description -if(($currenttag!= '' && $GLOBALS['enableCommonTagDescription']) -|| (isset($hash) && $GLOBALS['enableCommonBookmarkDescription'])):?> - - -<p class="commondescription"><?php -$cDescription = ''; -if($currenttag!= '' && $cdservice->getLastTagDescription($currenttag)) { - $cDescription = $cdservice->getLastTagDescription($currenttag); - echo nl2br(filter($cDescription['cdDescription'])); -} elseif(isset($hash) && $cdservice->getLastBookmarkDescription($hash)) { - $cDescription = $cdservice->getLastBookmarkDescription($hash); - echo nl2br(filter($cDescription['cdTitle'])). "<br/>"; - echo nl2br(filter($cDescription['cdDescription'])). "<br/>"; -} - -//common tag description edit -if ($userservice->isLoggedOn()) { - if ($currenttag != '' - && ($GLOBALS['enableCommonTagDescriptionEditedByAll'] - || $currentUser->isAdmin() - ) - ) { - 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.'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>)'; - } -} -?></p> -<?php endif ?> - - -<?php -/* personal tag description */ -if($currenttag!= '' && $user!='') { - $userObject = $userservice->getUserByUsername($user); - if($tagservice->getDescription($currenttag, $userObject['uId'])) { ?> - -<p class="commondescription"><?php -$pDescription = $tagservice->getDescription($currenttag, $userObject['uId']); -echo nl2br(filter($pDescription['tDescription'])); - -//personal tag description edit -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.'images/b_edit.png" /></a>'; - } -} -?></p> - -<?php - } -} -?> - -<?php if (count($bookmarks) > 0) { ?> -<script type="text/javascript"> -window.onload = playerLoad; -</script> - -<p id="sort"><?php echo $total.' '.T_("bookmark(s)"); ?> - <?php echo T_("Sort by:"); ?> - <?php -$titleArrow = ''; -$dateArrow = ''; -$votingArrow = ''; -$dateSort = 'date_desc'; -$titleSort = 'title_asc'; -$votingSort = 'voting_desc'; - -switch(getSortOrder()) { -case 'date_asc': - $dateArrow = ' ↑'; - $dateSort = 'date_desc'; - break; - -case 'title_asc': - $titleArrow = ' ↑'; - $titleSort = 'title_desc'; - break; - -case 'title_desc': - $titleArrow = ' ↓'; - $titleSort = 'title_asc'; - break; - -case 'voting_asc': - $votingArrow = ' ↑'; - $votingSort = 'voting_desc'; - break; - -case 'voting_desc': - $votingArrow = ' ↓'; - $votingSort = 'voting_asc'; - break; - -case 'date_desc': -default: - $dateArrow = ' ↓'; - $dateSort = 'date_asc'; - break; -} -?> - <a href="?sort=<?php echo $dateSort ?>"><?php echo T_("Date").$dateArrow; ?></a> - <span>/</span> - <a href="?sort=<?php echo $titleSort ?>"><?php echo T_("Title").$titleArrow; ?></a> - <span>/</span> -<?php if ($GLOBALS['enableVoting']) { ?> - <a href="?sort=<?php echo $votingSort ?>"><?php echo T_("Voting").$votingArrow; ?></a> - <span>/</span> -<?php } ?> - -<?php -if ($currenttag!= '') { - if ($user!= '') { - echo ' - '; - echo '<a href="'. createURL('tags', $currenttag) .'">'; - echo T_('Bookmarks from other users for this tag').'</a>'; - //echo T_(' for these tags'); - } else if ($userservice->isLoggedOn()){ - echo ' - '; - echo '<a href="'. createURL('bookmarks', $currentUser->getUsername().'/'.$currenttag) .'">'; - echo T_('Only your bookmarks for this tag').'</a>'; - //echo T_(' for these tags'); - } -} -?></p> - -<?php - // PAGINATION - - // Ordering - $sortOrder = ''; - if (GET_SORT != '') { - $sortOrder = 'sort=' . getSortOrder(); - } - - $sortAmp = (($sortOrder) ? '&'. $sortOrder : ''); - $sortQue = (($sortOrder) ? '?'. $sortOrder : ''); - - // Previous - $perpage = getPerPageCount($currentUser); - if (!$page || $page < 2) { - $page = 1; - $start = 0; - $bfirst = '<span class="disable">'. T_('First') .'</span>'; - $bprev = '<span class="disable">'. T_('Previous') .'</span>'; - } else { - $prev = $page - 1; - $prev = 'page='. $prev; - $start = ($page - 1) * $perpage; - $bfirst= '<a href="'. sprintf($nav_url, $user, $currenttag, '') . $sortQue .'">'. T_('First') .'</a>'; - $bprev = '<a href="'. sprintf($nav_url, $user, $currenttag, '?') . $prev . $sortAmp .'">'. T_('Previous') .'</a>'; - } - - // Next - $next = $page + 1; - $totalpages = ceil($total / $perpage); - if (count($bookmarks) < $perpage || $perpage * $page == $total) { - $bnext = '<span class="disable">'. T_('Next') .'</span>'; - $blast = '<span class="disable">'. T_('Last') ."</span>\n"; - } else { - $bnext = '<a href="'. sprintf($nav_url, $user, $currenttag, '?page=') . $next . $sortAmp .'">'. T_('Next') .'</a>'; - $blast = '<a href="'. sprintf($nav_url, $user, $currenttag, '?page=') . $totalpages . $sortAmp .'">'. T_('Last') ."</a>\n"; - } - - // RSS - $brss = ''; - $size = count($rsschannels); - for ($i = 0; $i < $size; $i++) { - $brss = '<a style="background:#FFFFFF" href="'. htmlspecialchars($rsschannels[$i][1]) . '"' - . ' title="' . htmlspecialchars($rsschannels[$i][0]) . '">' - . '<img src="' . ROOT . 'images/rss.gif" width="16" height="16" alt="' . htmlspecialchars($rsschannels[$i][0]) .'"/>' - . '</a>'; - } - - $pagesBanner = '<p class="paging">'. $bfirst .'<span> / </span>'. $bprev .'<span> / </span>'. $bnext .'<span> / </span>'. $blast .'<span> / </span>'. sprintf(T_('Page %d of %d'), $page, $totalpages) ." ". $brss ." </p>\n"; - - if (getPerPageCount($currentUser) > 10) { - echo $pagesBanner; // display a page banner if too many bookmarks to manage - } - - -?> - - - -<ol<?php echo ($start > 0 ? ' start="'. ++$start .'"' : ''); ?> id="bookmarks"> -<?php - $addresses = array(); - foreach ($bookmarks as $key => &$row) { - $addresses[$row['bId']] = $row['bAddress']; - } - $otherCounts = $bookmarkservice->countOthers($addresses); - if ($userservice->isLoggedOn()) { - $existence = $bookmarkservice->bookmarksExist( - $addresses, $currentUser->getId() - ); - } - - if ($userservice->isLoggedOn()) { - $watchedNames = $userservice->getWatchNames( - $currentUser->getId(), true - ); - } else { - $watchedNames = null; - } - - foreach ($bookmarks as $key => &$row) { - switch ($row['bStatus']) { - case 0: - $access = ''; - break; - case 1: - $access = ' shared'; - break; - case 2: - $access = ' private'; - break; - } - - $cats = ''; - $tagsForCopy = ''; - $tags = $row['tags']; - foreach ($tags as $tkey => &$tag) { - $tagcaturl = sprintf( - $cat_url, - filter($row['username'], 'url'), - filter($tag, 'url') - ); - $cats .= sprintf( - '<a href="%s" rel="tag">%s</a>, ', - $tagcaturl, filter($tag) - ); - $tagsForCopy .= $tag . ','; - } - $cats = substr($cats, 0, -2); - if ($cats != '') { - $cats = T_('Tags:') . ' ' . $cats; - } - - // Edit and delete links - $edit = ''; - if ($bookmarkservice->editAllowed($row)) { - $edit = ' - <a href="' . createURL('edit', $row['bId']) . '">' - . T_('Edit') - . '</a>' - . ' <a href="#" onclick="deleteBookmark(this, '. $row['bId'] .'); return false;">' - . T_('Delete') - .'</a>'; - } - - // Last update - $update = ' <small title="'. T_('Last update') .'">('. date($GLOBALS['shortdate'], strtotime($row['bModified'])). ') </small>'; - - // User attribution - $copy = ' ' . T_('by') . ' '; - if ($userservice->isLoggedOn() - && $currentUser->getUsername() == $row['username'] - ) { - $copy .= T_('you'); - } else { - $copy .= '<a href="' . createURL('bookmarks', $row['username']) . '">' - . SemanticScuttle_Model_UserArray::getName($row) - . '</a>'; - } - - // others - if (!isset($hash)) { - $others = $otherCounts[$row['bAddress']]; - $ostart = '<a href="' . createURL('history', $row['bHash']) . '">'; - $oend = '</a>'; - switch ($others) { - case 0: - break; - case 1: - $copy .= sprintf(T_(' and %s1 other%s'), $ostart, $oend); - break; - default: - $copy .= sprintf(T_(' and %2$s%1$s others%3$s'), $others, $ostart, $oend); - } - } - - // Copy link - if ($userservice->isLoggedOn() - && ($currentUser->getId() != $row['uId']) - && !$existence[$row['bAddress']] - ) { - $copy .= ' - <a href="' - . createURL( - 'bookmarks', - $currentUser->getUsername() - . '?action=add&copyOf=' . $row['bId']) - . '" title="'.T_('Copy this bookmark to YOUR bookmarks.').'">' - . T_('Copy') - . '</a>'; - } - - // Nofollow option - $rel = ''; - if ($GLOBALS['nofollow']) { - $rel = ' rel="nofollow"'; - } - - $address = filter($row['bAddress']); - $oaddress = $address; - // Redirection option - if ($GLOBALS['useredir']) { - $address = $GLOBALS['url_redir'] . $address; - } - - // Admin specific design - if ($userservice->isAdmin($row['username']) && $GLOBALS['enableAdminColors']) { - $adminBgClass = ' class="adminBackground"'; - $adminStar = ' <img src="'. ROOT .'images/logo_24.gif" width="12px" title="'. T_('This bookmark is certified by an admin user.') .'" />'; - } else { - $adminBgClass = ''; - $adminStar = ''; - } - - // Private Note (just visible by the owner and his/her contacts) - if ($watchedNames !== null - && ($currentUser->getId() == $row['uId'] - || in_array($row['username'], $watchedNames) - ) - ) { - $privateNoteField = $row['bPrivateNote']; - } else { - $privateNoteField = ''; - } - - if ($GLOBALS['enableVoting'] && $GLOBALS['hideBelowVoting'] !== null - && $row['bVoting'] < $GLOBALS['hideBelowVoting'] - ) { - $access .= ' below-threshold'; - } - - // Output - echo ' <li class="xfolkentry'. $access .'">'."\n"; - include 'bookmarks-thumbnail.inc.tpl.php'; - include 'bookmarks-vote.inc.tpl.php'; - - echo ' <div' . $adminBgClass . '>' . "\n"; - - echo ' <div class="link">' - . '<a href="'. htmlspecialchars($address) .'"'. $rel .' class="taggedlink">' - . filter($row['bTitle']) - . '</a>' . $adminStar . "</div>\n"; - if ($row['bDescription'] == '') { - $bkDescription = $GLOBALS['blankDescription']; - } else { - // Improve description display (anchors, links, ...) - $bkDescription = preg_replace('|\[\/.*?\]|', '', filter($row['bDescription'])); // remove final anchor - $bkDescription = preg_replace('|\[(.*?)\]|', ' <span class="anchorBookmark">$1</span> » ', $bkDescription); // highlight starting anchor - $bkDescription = preg_replace('@((http|https|ftp)://.*?)( |\r|$)@', '<a href="$1" rel="nofollow">$1</a>$3', $bkDescription); // make url clickable - - } - echo ' <div class="description">'. nl2br($bkDescription) ."</div>\n"; - echo ' <div class="address">' . shortenString($oaddress) . "</div>\n"; - - echo ' <div class="meta">' - . $cats . "\n" - . $copy . "\n" - . $edit . "\n" - . $update . "\n" - . " </div>\n"; - echo $privateNoteField != '' - ? ' <div class="privateNote" title="'. T_('Private Note on this bookmark') .'">'.$privateNoteField."</div>\n" - : ''; - echo ' '; - include 'bookmarks-vote-horizontal.inc.tpl.php'; - echo " </div>\n"; - - echo " </li>\n"; - } - ?> - -</ol> - - <?php - if(getPerPageCount($currentUser)>7) { - echo '<p class="backToTop"><a href="#header" title="'.T_('Come back to the top of this page.').'">'.T_('Top of the page').'</a></p>'; - } - echo $pagesBanner; // display previous and next links pages + RSS link - - -} else { - echo '<p class="error">'.T_('No bookmarks available').'</p>'; -} -$this->includeTemplate('sidebar.tpl'); -$this->includeTemplate($GLOBALS['bottom_include']); -?> diff --git a/data/templates/bottom.inc.php b/data/templates/bottom.inc.php deleted file mode 100644 index 0c966a2..0000000 --- a/data/templates/bottom.inc.php +++ /dev/null @@ -1,34 +0,0 @@ -<!--following code is generated by templates/bottom.inc.php--> -<div id="bottom"> -<?php echo $GLOBALS['footerMessage'].' ';?> -<?php -echo '<a href="'.createURL('about').'">'.T_('About').'</a>'; -echo ' - '; -echo T_("Propulsed by "); -echo " <a href=\"https://sourceforge.net/projects/semanticscuttle/\">SemanticScuttle</a>"; - -if($GLOBALS['enableWebsiteThumbnails']) { - // Licence to the thumbnails provider (OBLIGATORY IF YOU USE ARTVIPER SERVICE) - echo ' (Thumbnails by <script type="text/ecmascript" src="http://www.artviper.net/link.js"></script>)'; -} -?> - -</div> - - -<?php if(isset($GLOBALS['googleAnalyticsCode']) && $GLOBALS['googleAnalyticsCode']!= ''):?> - -<script type="text/javascript"> -var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); -document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); -</script> -<script type="text/javascript"> -try { -var pageTracker = _gat._getTracker("<?php echo $GLOBALS['googleAnalyticsCode']?>"); -pageTracker._trackPageview(); -} catch(err) {}</script> - -<?php endif;?> - -</body> -</html> diff --git a/data/templates/default/about.tpl.php b/data/templates/default/about.tpl.php new file mode 100644 index 0000000..7bff98d --- /dev/null +++ b/data/templates/default/about.tpl.php @@ -0,0 +1,34 @@ +<?php +$this->includeTemplate($GLOBALS['top_include']); +?> + +<ul> +<li><?php echo T_('<strong>Store</strong> all your favourite links in one place, accessible from anywhere.'); ?></li> +<li><?php echo T_('<strong>Share</strong> your bookmarks with everyone, with friends on your watchlist or just keep them private.') ;?></li> +<li><?php echo T_('<strong>Tag</strong> your bookmarks with as many labels as you want, instead of wrestling with folders.'); ?></li> +<li><?php echo sprintf('<strong><a href="'.createURL('register').'">'.T_('Register now').'</a> </strong>'.T_(' to start using %s!'), $GLOBALS['sitename']); ?></li> +</ul> + +<h3><?php echo T_('Geek Stuff'); ?></h3> +<ul> +<li><a href="http://sourceforge.net/projects/semanticscuttle/">Semantic Scuttle</a> <?php echo T_('is licensed under the ');?> <a href="http://www.gnu.org/copyleft/gpl.html"><acronym title="GNU\'s Not Unix">GNU</acronym> General Public License</a> (<?php echo T_('you can freely host it on your own web server.'); ?>)</li> +<li><?php echo sprintf(T_('%1$s supports most of the <a href="http://del.icio.us/doc/api">del.icio.us <abbr title="Application Programming Interface">API</abbr></a>. Almost all of the neat tools made for that system can be modified to work with %1$s instead. 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.'), $GLOBALS['sitename']); ?></li> + + + +<?php if(!is_null($currentUser) && $currentUser->isAdmin()): ?> +<li>SemanticScuttle v0.97.0</li> +<?php endif ?> +</ul> + +<h3><?php echo T_('Tips'); ?></h3> +<ul> +<li><?php echo T_('Add search plugin into your browser:'); ?> <a href="#" onclick="window.external.AddSearchProvider('<?php echo ROOT?>api/opensearch.php');">opensearch</a></li> +<li><?php echo T_('The secret tag "system:unfiled" allows you to find bookmarks without tags.'); ?></li> +<li><?php echo T_('The secret tag "system:imported" allows you to find imported bookmarks.'); ?></li> +</ul> + + +<?php +$this->includeTemplate($GLOBALS['bottom_include']); +?> diff --git a/data/templates/default/admin.tpl.php b/data/templates/default/admin.tpl.php new file mode 100644 index 0000000..50680f6 --- /dev/null +++ b/data/templates/default/admin.tpl.php @@ -0,0 +1,35 @@ +<?php + +$this->includeTemplate($GLOBALS['top_include']); + +echo '<h3>'.T_('Users management').'</h3>'; + +echo '<ol id="bookmarks">'; + +foreach($users as $user) { + echo '<li class="xfolkentry">'."\n"; + + echo '<div class="link">'; + echo '<a href="'.createURL('profile', $user->getUsername()).'">'.$user->getUsername().'</a>'; + echo ' - <span title="'. T_('Public/Shared/Private') .'">'. $user->getNbBookmarks('public') .' / '. $user->getNbBookmarks('shared') .' / '. $user->getNbBookmarks('private') .' '. T_('bookmark(s)') .'</span>'; + echo '</div>'; + + if($user->getUsername() != $currentUser->getUsername()) { + echo '<div class="meta">'; + echo '<a href="'.createURL('admin','delete/'.$user->getUsername()).'" onclick="return confirm(\''.T_('Are you sure?').'\');">'.T_('Delete').'</a>'; + echo '</div>'; + } + + echo '</li>'."\n"; +} +echo '</ol>'; +?> +<h3><?php echo T_('Other actions')?></h3> +<p> +<a href="<?php echo createURL('admin','checkUrl/') ?>"> <?php echo T_('Check all URLs (May take some time)') ?></a> +</p> +<?php +$this->includeTemplate('sidebar.tpl'); +$this->includeTemplate($GLOBALS['bottom_include']); + +?> diff --git a/data/templates/default/bookmarkcommondescriptionedit.tpl.php b/data/templates/default/bookmarkcommondescriptionedit.tpl.php new file mode 100644 index 0000000..807c58b --- /dev/null +++ b/data/templates/default/bookmarkcommondescriptionedit.tpl.php @@ -0,0 +1,58 @@ +<?php + +$this->includeTemplate($GLOBALS['top_include']); + +list ($url, $hash) = explode('/', $_SERVER['PATH_INFO']); + + +?> +<script type="text/javascript"> +window.onload = function() { + document.getElementById("title").focus(); +} +</script> + +<form action="<?php echo $formaction; ?>" method="post"> +<table title="<?php echo T_('Collaborative description: these fields can be viewed and modified by every users') ?>"> +<tr> + <th align="left"><?php echo T_('Title'); ?></th> + <td><input type="text" id="title" name="title" size="75" maxlength="255" value="<?php echo $description['cdTitle']; ?>" onkeypress="this.style.backgroundImage = 'none';" /></td> + <td></td> +</tr> +<tr> + <th align="left"><?php echo T_('Description'); ?></th> + <td><textarea name="description" cols="75" rows="10"><?php echo $description['cdDescription']; ?></textarea></td> +</tr> +<tr> + <td></td> + <td> + <?php + if(strlen($description['cdDatetime'])>0) { + echo T_('Last modification:').' '.$description['cdDatetime'].', '; + $lastUser = $userservice->getUser($description['uId']); + echo '<a href="'.createURL('profile', $lastUser['username']).'">' + . SemanticScuttle_Model_UserArray::getName($lastUser) . '</a>'; + } + ?> + </td> + <td></td> +</tr> +<tr> + <td></td> + <td> + <input type="submit" name="confirm" value="<?php echo T_('Update'); ?>" /> + <input type="submit" name="cancel" value="<?php echo T_('Cancel'); ?>" /> + </td> + <td></td> +</tr> +</table> + +<?php if (isset($referrer)): ?> +<div><input type="hidden" name="referrer" value="<?php echo $referrer; ?>" /></div> +<?php endif; ?> +<div><input type="hidden" name="hash" value="<?php echo $hash; ?>" /></div> +</form> + +<?php +$this->includeTemplate($GLOBALS['bottom_include']); +?> diff --git a/data/templates/default/bookmarklet.inc.php b/data/templates/default/bookmarklet.inc.php new file mode 100644 index 0000000..9867745 --- /dev/null +++ b/data/templates/default/bookmarklet.inc.php @@ -0,0 +1,117 @@ +<h3><?php echo T_('Bookmarklet'); ?></h3> +<p id="bookmarklet"></p> +<script type="text/javascript"> +//<![CDATA[ +var browser = navigator.appName; +jQuery(function($) { +if (browser == "Opera") { + $('#bookmarklet').append( + <?php echo json_encode( + sprintf( + T_("Click one of the following bookmarklets to add a button you can click whenever you want to add the page you are on to %s") . ':', + $GLOBALS['sitename'] + ) + ); ?> + ); +} else { + $('#bookmarklet').append( + <?php echo json_encode( + sprintf( + T_("Drag one of the following bookmarklets to your browser's bookmarks and click it whenever you want to add the page you are on to %s") . ':', + $GLOBALS['sitename'] + ) + ); + ?> + ); +} +}); +//]]> +</script> +<script type="text/javascript"> +//<![CDATA[ +var selection = ''; +if (window.getSelection) { + selection = 'window.getSelection()'; +} else if (document.getSelection) { + selection = 'document.getSelection()'; +} else if (document.selection) { + selection = 'document.selection.createRange().text'; +} +if (browser == "Opera") { + $('#bookmarklet').append( + '<ul>' + + '<li>' + + '<a class="bookmarklet" href="' + + '<?php +$popupLink = 'javascript:' + . "location.href='" + . createURL('bookmarks', $GLOBALS['user']) + . '?action=add' + . "&address='+encodeURIComponent(document.location.href)+'" + . "&title='+encodeURIComponent(document.title)+'" + . "&description='+encodeURIComponent(SELECTION)" + . ";"; +$link = 'opera:/button/' + //Opera command + . 'Go to page' + //command parameter 1 + . ',"' . rawurlencode($popupLink) . '"' + //command parameter 2 + . ',' + //button title + . ',"Post to ' . fixOperaButtonName($GLOBALS['sitename']) . '"' + //button icon name + . ',"Scuttle"'; +echo jsEscTitle(htmlspecialchars($link)); +?>'.replace('SELECTION', selection) + + '"><?php echo jsEscTitle(sprintf(T_('Post to %s'), $GLOBALS['sitename'])); ?></a>' + + '</li>' + + '<li>' + + '<a class="bookmarklet" href="' + + '<?php +$popupLink = 'javascript:' + . 'open(' + . "'" . createURL('bookmarks', $GLOBALS['user']) + . '?action=add' + . '&popup=1' + . "&address='+encodeURIComponent(document.location.href)+'" + . "&title='+encodeURIComponent(document.title)+'" + . "&description='+encodeURIComponent(SELECTION)" + . "," + . "'" . htmlspecialchars(jsEscTitle($GLOBALS['sitename'])) . "'," + . "'modal=1,status=0,scrollbars=1,toolbar=0,resizable=1,width=790,height=465" + . ",left='+(screen.width-790)/2+',top='+(screen.height-425)/2" + . ");void 0"; +$link = 'opera:/button/' + . 'Go to page' + . ',"' . rawurlencode($popupLink) . '"' + . ',' + . ',"Post to ' . fixOperaButtonName($GLOBALS['sitename']) . ' (Pop-up)"' + . ',"Scuttle"'; +echo jsEscTitle(htmlspecialchars($link)); +?>'.replace('SELECTION', selection) + + '"><?php echo jsEscTitle(sprintf(T_('Post to %s (Pop-up)'), $GLOBALS['sitename'])); ?></a>' + + '</li>' + + '</ul>' + ); +} else { + $('#bookmarklet').append( + '<ul>' + + '<li><a class="bookmarklet" href="javascript:x=document;a=encodeURIComponent(x.location.href);t=encodeURIComponent(x.title);d=encodeURIComponent('+selection+');location.href=\'<?php echo createURL('bookmarks', $GLOBALS['user']); ?>?action=add&address=\'+a+\'&title=\'+t+\'&description=\'+d;void 0;"><?php echo jsEscTitle(sprintf(T_('Post to %s'), $GLOBALS['sitename'])); ?><\/a><\/li>' + + '<li>' + + '<a class="bookmarklet" href="' + + 'javascript:x=document;' + + 'a=encodeURIComponent(x.location.href);' + + 't=encodeURIComponent(x.title);' + + 'd=encodeURIComponent('+selection+');' + + 'open(' + + '\'<?php echo createURL('bookmarks', $GLOBALS['user']); ?>?action=add&popup=1&address=\'+a+\'&title=\'+t+\'&description=\'+d,\'<?php echo htmlspecialchars(jsEscTitleDouble($GLOBALS['sitename'])); ?>\',\'modal=1,status=0,scrollbars=1,toolbar=0,resizable=1,width=790,height=465,left=\'+(screen.width-790)/2+\',top=\'+(screen.height-425)/2' + + ');void 0;">' + + '<?php echo jsEscTitle(sprintf(T_('Post to %s (Pop-up)'), $GLOBALS['sitename'])); ?>' + + '</a>' + + '</li>' + + '</ul>' + ); +} +//]]> +</script> diff --git a/data/templates/default/bookmarks-thumbnail.inc.tpl.php b/data/templates/default/bookmarks-thumbnail.inc.tpl.php new file mode 100644 index 0000000..200b8f7 --- /dev/null +++ b/data/templates/default/bookmarks-thumbnail.inc.tpl.php @@ -0,0 +1,18 @@ +<?php +/** + * Bookmark thumbnail image + * Shows the website thumbnail for the bookmark. + * + * Expects a $row variable with bookmark data. + */ +if (!$GLOBALS['enableWebsiteThumbnails']) { + return; +} + +$thumbnailHash = md5( + $address . $GLOBALS['thumbnailsUserId'] . $GLOBALS['thumbnailsKey'] +); +//echo '<a href="'. $address .'"'. $rel .' ><img class="thumbnail" src="http://www.artviper.net/screenshots/screener.php?url='.$address.'&w=120&sdx=1280&userID='.$GLOBALS['thumbnailsUserId'].'&hash='.$thumbnailHash.'" />'; +echo '<img class="thumbnail" onclick="window.location.href=\''.$address.'\'" src="http://www.artviper.net/screenshots/screener.php?url='.$address.'&w=120&sdx=1280&userID='.$GLOBALS['thumbnailsUserId'].'&hash='.$thumbnailHash.'" />'; + +?> \ No newline at end of file diff --git a/data/templates/default/bookmarks-vote-horizontal.inc.tpl.php b/data/templates/default/bookmarks-vote-horizontal.inc.tpl.php new file mode 100644 index 0000000..c4a9f8e --- /dev/null +++ b/data/templates/default/bookmarks-vote-horizontal.inc.tpl.php @@ -0,0 +1,50 @@ +<?php +/** + * Bookmark voting badge. + * Shows the number of votes and buttons to vote for or + * against a bookmark. + * Expects a $row variable with bookmark data + */ +if (!$GLOBALS['enableVoting'] || $GLOBALS['votingMode'] != 2) { + return; +} +if (!isset($row['hasVoted'])) { + $classes = 'vote-horiz vote-horiz-inactive'; +} else if (isset($row['vote'])) { + $classes = 'vote-horiz ' + . ($row['vote'] == 1 + ? 'vote-horiz-for' + : 'vote-horiz-against' + ); +} else { + $classes = 'vote-horiz'; +} +echo '<div class="' . $classes . '" id="bmv-' . $row['bId'] . '">'; +echo sprintf( + T_('Voting <span class="voting">%d</span>'), $row['bVoting'] +) . ' '; + +if (isset($row['hasVoted'])) { + if ($row['vote'] != 1) { + echo '<a class="vote-for" rel="nofollow" href="' + . createVoteURL(true, $row['bId']) . '"' + . ' onclick="javascript:vote(' . $row['bId'] . ',1); return false;"' + . '>' . T_('Vote for') . '</a> '; + } else { + echo '<span class="vote-for-inactive">' + . T_('Vote for') . '</span> '; + } + + + if ($row['vote'] != -1) { + echo '<a class="vote-against" rel="nofollow" href="' + . createVoteURL(false, $row['bId']) . '"' + . ' onclick="vote(' . $row['bId'] . ',-1); return false;"' + . '>' . T_('Vote against') . '</a>'; + } else { + echo '<span class="vote-against-inactive">' + . T_('Vote against') . '</span>'; + } +} +echo '</div>'; +?> \ No newline at end of file diff --git a/data/templates/default/bookmarks-vote.inc.tpl.php b/data/templates/default/bookmarks-vote.inc.tpl.php new file mode 100644 index 0000000..41572d5 --- /dev/null +++ b/data/templates/default/bookmarks-vote.inc.tpl.php @@ -0,0 +1,44 @@ +<?php +/** + * Bookmark voting badge. + * Shows the number of votes and buttons to vote for or + * against a bookmark. + * Expects a $row variable with bookmark data + */ +if (!$GLOBALS['enableVoting'] || $GLOBALS['votingMode'] != 1) { + return; +} +if (isset($row['hasVoted']) && !$row['hasVoted']) { + $classes = 'vote-badge vote-badge-inactive'; +} else if (isset($row['vote'])) { + $classes = 'vote-badge ' + . ($row['vote'] == 1 + ? 'vote-badge-for' + : 'vote-badge-against' + ); +} else { + $classes = 'vote-badge'; +} +echo '<span class="' . $classes . '" id="bmv-' . $row['bId'] . '">'; + +if (isset($row['hasVoted']) && $row['vote'] != 1) { + echo '<a class="vote-for" rel="nofollow" href="' + . createVoteURL(true, $row['bId']) . '"' + . ' onclick="javascript:vote(' . $row['bId'] . ',1); return false;"' + . '>+</a>'; +} else { + echo '<span class="vote-for vote-for-inactive">+</span>'; +} + +echo '<span class="voting">' . $row['bVoting'] . '</span>'; + +if (isset($row['hasVoted']) && $row['vote'] != -1) { + echo '<a class="vote-against" rel="nofollow" href="' + . createVoteURL(false, $row['bId']) . '"' + . ' onclick="vote(' . $row['bId'] . ',-1); return false;"' + . '>-</a>'; +} else { + echo '<span class="vote-against vote-against-inactive">-</span>'; +} +echo '</span>'; +?> \ No newline at end of file diff --git a/data/templates/default/bookmarks.tpl.php b/data/templates/default/bookmarks.tpl.php new file mode 100644 index 0000000..91d50bf --- /dev/null +++ b/data/templates/default/bookmarks.tpl.php @@ -0,0 +1,454 @@ +<?php +/** + * Show a list of bookmarks. + * + * SemanticScuttle - your social bookmark manager. + * + * PHP version 5. + * + * @category Bookmarking + * @package SemanticScuttle + * @subcategory Templates + * @author Benjamin Huynh-Kim-Bang <mensonge@users.sourceforge.net> + * @author Christian Weiske <cweiske@cweiske.de> + * @author Eric Dane <ericdane@users.sourceforge.net> + * @license GPL http://www.gnu.org/licenses/gpl.html + * @link http://sourceforge.net/projects/semanticscuttle + */ + +/* Service creation: only useful services are created */ +$bookmarkservice = SemanticScuttle_Service_Factory::get('Bookmark'); +$tagservice = SemanticScuttle_Service_Factory::get('Tag'); +$cdservice = SemanticScuttle_Service_Factory::get('CommonDescription'); + + +$pageName = isset($pageName) ? $pageName : ''; +$user = isset($user) ? $user : ''; +$currenttag = isset($currenttag) ? $currenttag : ''; + + +$this->includeTemplate($GLOBALS['top_include']); + +include('search.menu.php'); +?> + +<?php if($pageName == PAGE_INDEX && $GLOBALS['welcomeMessage']):?> +<p id="welcome"><?php echo $GLOBALS['welcomeMessage'];?></p> +<?php endif?> + + +<?php if($GLOBALS['enableAdminColors']!=false && isset($userid) && $userservice->isAdmin($userid) && $pageName != PAGE_WATCHLIST) : ?> +<div style="width:70%;text-align:center;"> + <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?> + + +<?php +// common tag description +if(($currenttag!= '' && $GLOBALS['enableCommonTagDescription']) +|| (isset($hash) && $GLOBALS['enableCommonBookmarkDescription'])):?> + + +<p class="commondescription"><?php +$cDescription = ''; +if($currenttag!= '' && $cdservice->getLastTagDescription($currenttag)) { + $cDescription = $cdservice->getLastTagDescription($currenttag); + echo nl2br(filter($cDescription['cdDescription'])); +} elseif(isset($hash) && $cdservice->getLastBookmarkDescription($hash)) { + $cDescription = $cdservice->getLastBookmarkDescription($hash); + echo nl2br(filter($cDescription['cdTitle'])). "<br/>"; + echo nl2br(filter($cDescription['cdDescription'])). "<br/>"; +} + +//common tag description edit +if ($userservice->isLoggedOn()) { + if ($currenttag != '' + && ($GLOBALS['enableCommonTagDescriptionEditedByAll'] + || $currentUser->isAdmin() + ) + ) { + 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="' . $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>)'; + } +} +?></p> +<?php endif ?> + + +<?php +/* personal tag description */ +if($currenttag!= '' && $user!='') { + $userObject = $userservice->getUserByUsername($user); + if($tagservice->getDescription($currenttag, $userObject['uId'])) { ?> + +<p class="commondescription"><?php +$pDescription = $tagservice->getDescription($currenttag, $userObject['uId']); +echo nl2br(filter($pDescription['tDescription'])); + +//personal tag description edit +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="' . $theme->resource('images/b_edit.png') . '" /></a>'; + } +} +?></p> + +<?php + } +} +?> + +<?php if (count($bookmarks) > 0) { ?> +<script type="text/javascript"> +window.onload = playerLoad; +</script> + +<p id="sort"><?php echo $total.' '.T_("bookmark(s)"); ?> - <?php echo T_("Sort by:"); ?> + <?php +$titleArrow = ''; +$dateArrow = ''; +$votingArrow = ''; +$dateSort = 'date_desc'; +$titleSort = 'title_asc'; +$votingSort = 'voting_desc'; + +switch(getSortOrder()) { +case 'date_asc': + $dateArrow = ' ↑'; + $dateSort = 'date_desc'; + break; + +case 'title_asc': + $titleArrow = ' ↑'; + $titleSort = 'title_desc'; + break; + +case 'title_desc': + $titleArrow = ' ↓'; + $titleSort = 'title_asc'; + break; + +case 'voting_asc': + $votingArrow = ' ↑'; + $votingSort = 'voting_desc'; + break; + +case 'voting_desc': + $votingArrow = ' ↓'; + $votingSort = 'voting_asc'; + break; + +case 'date_desc': +default: + $dateArrow = ' ↓'; + $dateSort = 'date_asc'; + break; +} +?> + <a href="?sort=<?php echo $dateSort ?>"><?php echo T_("Date").$dateArrow; ?></a> + <span>/</span> + <a href="?sort=<?php echo $titleSort ?>"><?php echo T_("Title").$titleArrow; ?></a> + <span>/</span> +<?php if ($GLOBALS['enableVoting']) { ?> + <a href="?sort=<?php echo $votingSort ?>"><?php echo T_("Voting").$votingArrow; ?></a> + <span>/</span> +<?php } ?> + +<?php +if ($currenttag!= '') { + if ($user!= '') { + echo ' - '; + echo '<a href="'. createURL('tags', $currenttag) .'">'; + echo T_('Bookmarks from other users for this tag').'</a>'; + //echo T_(' for these tags'); + } else if ($userservice->isLoggedOn()){ + echo ' - '; + echo '<a href="'. createURL('bookmarks', $currentUser->getUsername().'/'.$currenttag) .'">'; + echo T_('Only your bookmarks for this tag').'</a>'; + //echo T_(' for these tags'); + } +} +?></p> + +<?php + // PAGINATION + + // Ordering + $sortOrder = ''; + if (GET_SORT != '') { + $sortOrder = 'sort=' . getSortOrder(); + } + + $sortAmp = (($sortOrder) ? '&'. $sortOrder : ''); + $sortQue = (($sortOrder) ? '?'. $sortOrder : ''); + + // Previous + $perpage = getPerPageCount($currentUser); + if (!$page || $page < 2) { + $page = 1; + $start = 0; + $bfirst = '<span class="disable">'. T_('First') .'</span>'; + $bprev = '<span class="disable">'. T_('Previous') .'</span>'; + } else { + $prev = $page - 1; + $prev = 'page='. $prev; + $start = ($page - 1) * $perpage; + $bfirst= '<a href="'. sprintf($nav_url, $user, $currenttag, '') . $sortQue .'">'. T_('First') .'</a>'; + $bprev = '<a href="'. sprintf($nav_url, $user, $currenttag, '?') . $prev . $sortAmp .'">'. T_('Previous') .'</a>'; + } + + // Next + $next = $page + 1; + $totalpages = ceil($total / $perpage); + if (count($bookmarks) < $perpage || $perpage * $page == $total) { + $bnext = '<span class="disable">'. T_('Next') .'</span>'; + $blast = '<span class="disable">'. T_('Last') ."</span>\n"; + } else { + $bnext = '<a href="'. sprintf($nav_url, $user, $currenttag, '?page=') . $next . $sortAmp .'">'. T_('Next') .'</a>'; + $blast = '<a href="'. sprintf($nav_url, $user, $currenttag, '?page=') . $totalpages . $sortAmp .'">'. T_('Last') ."</a>\n"; + } + + // RSS + $brss = ''; + $size = count($rsschannels); + for ($i = 0; $i < $size; $i++) { + $brss = '<a style="background:#FFFFFF"' + . ' href="'. htmlspecialchars($rsschannels[$i][1]) . '"' + . ' title="' . htmlspecialchars($rsschannels[$i][0]) . '">' + . '<img src="' . $theme->resource('images/rss.gif') . '"' + . ' width="16" height="16"' + . ' alt="' . htmlspecialchars($rsschannels[$i][0]) .'"/>' + . '</a>'; + } + + $pagesBanner = '<p class="paging">'. $bfirst .'<span> / </span>'. $bprev .'<span> / </span>'. $bnext .'<span> / </span>'. $blast .'<span> / </span>'. sprintf(T_('Page %d of %d'), $page, $totalpages) ." ". $brss ." </p>\n"; + + if (getPerPageCount($currentUser) > 10) { + echo $pagesBanner; // display a page banner if too many bookmarks to manage + } + + +?> + + + +<ol<?php echo ($start > 0 ? ' start="'. ++$start .'"' : ''); ?> id="bookmarks"> +<?php + $addresses = array(); + foreach ($bookmarks as $key => &$row) { + $addresses[$row['bId']] = $row['bAddress']; + } + $otherCounts = $bookmarkservice->countOthers($addresses); + if ($userservice->isLoggedOn()) { + $existence = $bookmarkservice->bookmarksExist( + $addresses, $currentUser->getId() + ); + } + + if ($userservice->isLoggedOn()) { + $watchedNames = $userservice->getWatchNames( + $currentUser->getId(), true + ); + } else { + $watchedNames = null; + } + + foreach ($bookmarks as $key => &$row) { + switch ($row['bStatus']) { + case 0: + $access = ''; + break; + case 1: + $access = ' shared'; + break; + case 2: + $access = ' private'; + break; + } + + $cats = ''; + $tagsForCopy = ''; + $tags = $row['tags']; + foreach ($tags as $tkey => &$tag) { + $tagcaturl = sprintf( + $cat_url, + filter($row['username'], 'url'), + filter($tag, 'url') + ); + $cats .= sprintf( + '<a href="%s" rel="tag">%s</a>, ', + $tagcaturl, filter($tag) + ); + $tagsForCopy .= $tag . ','; + } + $cats = substr($cats, 0, -2); + if ($cats != '') { + $cats = T_('Tags:') . ' ' . $cats; + } + + // Edit and delete links + $edit = ''; + if ($bookmarkservice->editAllowed($row)) { + $edit = ' - <a href="' . createURL('edit', $row['bId']) . '">' + . T_('Edit') + . '</a>' + . ' <a href="#" onclick="deleteBookmark(this, '. $row['bId'] .'); return false;">' + . T_('Delete') + .'</a>'; + } + + // Last update + $update = ' <small title="'. T_('Last update') .'">('. date($GLOBALS['shortdate'], strtotime($row['bModified'])). ') </small>'; + + // User attribution + $copy = ' ' . T_('by') . ' '; + if ($userservice->isLoggedOn() + && $currentUser->getUsername() == $row['username'] + ) { + $copy .= T_('you'); + } else { + $copy .= '<a href="' . createURL('bookmarks', $row['username']) . '">' + . SemanticScuttle_Model_UserArray::getName($row) + . '</a>'; + } + + // others + if (!isset($hash)) { + $others = $otherCounts[$row['bAddress']]; + $ostart = '<a href="' . createURL('history', $row['bHash']) . '">'; + $oend = '</a>'; + switch ($others) { + case 0: + break; + case 1: + $copy .= sprintf(T_(' and %s1 other%s'), $ostart, $oend); + break; + default: + $copy .= sprintf(T_(' and %2$s%1$s others%3$s'), $others, $ostart, $oend); + } + } + + // Copy link + if ($userservice->isLoggedOn() + && ($currentUser->getId() != $row['uId']) + && !$existence[$row['bAddress']] + ) { + $copy .= ' - <a href="' + . createURL( + 'bookmarks', + $currentUser->getUsername() + . '?action=add&copyOf=' . $row['bId']) + . '" title="'.T_('Copy this bookmark to YOUR bookmarks.').'">' + . T_('Copy') + . '</a>'; + } + + // Nofollow option + $rel = ''; + if ($GLOBALS['nofollow']) { + $rel = ' rel="nofollow"'; + } + + $address = filter($row['bAddress']); + $oaddress = $address; + // Redirection option + if ($GLOBALS['useredir']) { + $address = $GLOBALS['url_redir'] . $address; + } + + // Admin specific design + if ($userservice->isAdmin($row['username']) + && $GLOBALS['enableAdminColors'] + ) { + $adminBgClass = ' class="adminBackground"'; + $adminStar = ' <img' + . ' src="' . $theme->resource('images/logo_24.gif') . '"' + . ' width="12px"' + . ' title="' . T_('This bookmark is certified by an admin user.') . '"' + . '/>'; + } else { + $adminBgClass = ''; + $adminStar = ''; + } + + // Private Note (just visible by the owner and his/her contacts) + if ($watchedNames !== null + && ($currentUser->getId() == $row['uId'] + || in_array($row['username'], $watchedNames) + ) + ) { + $privateNoteField = $row['bPrivateNote']; + } else { + $privateNoteField = ''; + } + + if ($GLOBALS['enableVoting'] && $GLOBALS['hideBelowVoting'] !== null + && $row['bVoting'] < $GLOBALS['hideBelowVoting'] + ) { + $access .= ' below-threshold'; + } + + // Output + echo ' <li class="xfolkentry'. $access .'">'."\n"; + include 'bookmarks-thumbnail.inc.tpl.php'; + include 'bookmarks-vote.inc.tpl.php'; + + echo ' <div' . $adminBgClass . '>' . "\n"; + + echo ' <div class="link">' + . '<a href="'. htmlspecialchars($address) .'"'. $rel .' class="taggedlink">' + . filter($row['bTitle']) + . '</a>' . $adminStar . "</div>\n"; + if ($row['bDescription'] == '') { + $bkDescription = $GLOBALS['blankDescription']; + } else { + // Improve description display (anchors, links, ...) + $bkDescription = preg_replace('|\[\/.*?\]|', '', filter($row['bDescription'])); // remove final anchor + $bkDescription = preg_replace('|\[(.*?)\]|', ' <span class="anchorBookmark">$1</span> » ', $bkDescription); // highlight starting anchor + $bkDescription = preg_replace('@((http|https|ftp)://.*?)( |\r|$)@', '<a href="$1" rel="nofollow">$1</a>$3', $bkDescription); // make url clickable + + } + echo ' <div class="description">'. nl2br($bkDescription) ."</div>\n"; + echo ' <div class="address">' . shortenString($oaddress) . "</div>\n"; + + echo ' <div class="meta">' + . $cats . "\n" + . $copy . "\n" + . $edit . "\n" + . $update . "\n" + . " </div>\n"; + echo $privateNoteField != '' + ? ' <div class="privateNote" title="'. T_('Private Note on this bookmark') .'">'.$privateNoteField."</div>\n" + : ''; + echo ' '; + include 'bookmarks-vote-horizontal.inc.tpl.php'; + echo " </div>\n"; + + echo " </li>\n"; + } + ?> + +</ol> + + <?php + if(getPerPageCount($currentUser)>7) { + echo '<p class="backToTop"><a href="#header" title="'.T_('Come back to the top of this page.').'">'.T_('Top of the page').'</a></p>'; + } + echo $pagesBanner; // display previous and next links pages + RSS link + + +} else { + echo '<p class="error">'.T_('No bookmarks available').'</p>'; +} +$this->includeTemplate('sidebar.tpl'); +$this->includeTemplate($GLOBALS['bottom_include']); +?> diff --git a/data/templates/default/bottom.inc.php b/data/templates/default/bottom.inc.php new file mode 100644 index 0000000..0c966a2 --- /dev/null +++ b/data/templates/default/bottom.inc.php @@ -0,0 +1,34 @@ +<!--following code is generated by templates/bottom.inc.php--> +<div id="bottom"> +<?php echo $GLOBALS['footerMessage'].' ';?> +<?php +echo '<a href="'.createURL('about').'">'.T_('About').'</a>'; +echo ' - '; +echo T_("Propulsed by "); +echo " <a href=\"https://sourceforge.net/projects/semanticscuttle/\">SemanticScuttle</a>"; + +if($GLOBALS['enableWebsiteThumbnails']) { + // Licence to the thumbnails provider (OBLIGATORY IF YOU USE ARTVIPER SERVICE) + echo ' (Thumbnails by <script type="text/ecmascript" src="http://www.artviper.net/link.js"></script>)'; +} +?> + +</div> + + +<?php if(isset($GLOBALS['googleAnalyticsCode']) && $GLOBALS['googleAnalyticsCode']!= ''):?> + +<script type="text/javascript"> +var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); +document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); +</script> +<script type="text/javascript"> +try { +var pageTracker = _gat._getTracker("<?php echo $GLOBALS['googleAnalyticsCode']?>"); +pageTracker._trackPageview(); +} catch(err) {}</script> + +<?php endif;?> + +</body> +</html> diff --git a/data/templates/default/dojo.inc.php b/data/templates/default/dojo.inc.php new file mode 100644 index 0000000..366dcfe --- /dev/null +++ b/data/templates/default/dojo.inc.php @@ -0,0 +1,35 @@ +<?php +/*************************************************************************** + Copyright (C) 2005 - 2006 Scuttle project + http://sourceforge.net/projects/scuttle/ + http://scuttle.org/ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + ***************************************************************************/ + +?> + +<?php if (isset($loadjs)) :?> +<script type="text/javascript" + src="http://ajax.googleapis.com/ajax/libs/dojo/1.2/dojo/dojo.xd.js" + djConfig="parseOnLoad:true, isDebug:<?php echo DEBUG_MODE?'true':'false' ?>, usePlainJson:true, baseUrl: '<?php echo ROOT ?>', modulePaths: {'js': 'js'}"></script> + +<script type="text/javascript"> +dojo.require("dojo.parser"); +dojo.require("dojo.data.ItemFileReadStore"); +dojo.require("js.MultiComboBox"); // DOJO module adapted for SemanticScuttle +dojo.require("dijit.Tree"); +</script> +<?php endif ?> \ No newline at end of file diff --git a/data/templates/default/dynamictags.inc.php b/data/templates/default/dynamictags.inc.php new file mode 100644 index 0000000..8cf07c1 --- /dev/null +++ b/data/templates/default/dynamictags.inc.php @@ -0,0 +1,148 @@ +<?php +/*************************************************************************** + Copyright (C) 2005 - 2006 Scuttle project + http://sourceforge.net/projects/scuttle/ + http://scuttle.org/ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + ***************************************************************************/ + +/* Service creation: only useful services are created */ +$b2tservice = SemanticScuttle_Service_Factory :: get('Bookmark2Tag'); + +$logged_on_userid = $userservice->getCurrentUserId(); + +//tags from current user +$userPopularTags =& $b2tservice->getPopularTags($logged_on_userid, 25, $logged_on_userid); +$userPopularTagsCloud =& $b2tservice->tagCloud($userPopularTags, 5, 90, 175); +$userPopularTagsCount = count($userPopularTags); + +//tags from all users +$allPopularTags =& $b2tservice->getPopularTags(null, 5, $logged_on_userid); +$allPopularTagsCloud =& $b2tservice->tagCloud($allPopularTags, 5, 90, 175); +$allPopularTagsCount = count($allPopularTags); + + +// function printing the cloud +function writeTagsProposition($tagsCloud, $title) +{ + static $id = 0; + ++$id; + + echo <<<JS + $('.edit-tagclouds') + .append( +'<div class="collapsible" id="edit-tagcloud-$id">' ++ ' <h3>$title</h3>' ++ ' <p class="popularTags tags"></p>' ++ '</div>'); +JS; + + $taglist = ''; + foreach (array_keys($tagsCloud) as $key) { + $row = $tagsCloud[$key]; + $entries = T_ngettext('bookmark', 'bookmarks', $row['bCount']); + $taglist .= '<span' + . ' title="'. $row['bCount'] . ' ' . $entries . '"' + . ' style="font-size:' . $row['size'] . '"' + . ' onclick="addTag(this)">' + . filter($row['tag']) + . '</span> '; + } + echo '$(\'#edit-tagcloud-' . $id . ' p\').append(' + . json_encode($taglist) + . ");\n"; +} + + +if ($allPopularTagsCount > 0 || $userPopularTagsCount > 0 ) { ?> +<script type="text/javascript"> +//<![CDATA[ +Array.prototype.contains = function (ele) { + for (var i = 0; i < this.length; i++) { + if (this[i] == ele) { + return true; + } + } + return false; +}; + +Array.prototype.remove = function (ele) { + var arr = new Array(); + var count = 0; + for (var i = 0; i < this.length; i++) { + if (this[i] != ele) { + arr[count] = this[i]; + count++; + } + } + return arr; +}; + +function addonload(addition) { + //var existing = window.onload; + window.onload = function () { + //existing(); + addition(); + } +} + +jQuery(function($) { +<?php +if ($userPopularTagsCount > 0) { + writeTagsProposition($userPopularTagsCloud, T_('Popular Tags')); +} +if ($allPopularTagsCount > 0) { + writeTagsProposition($allPopularTagsCloud, T_('Popular Tags From All Users')); +} +?> + var taglist = $('#tags'); + var tags = taglist.val().split(', '); + + var populartags = $('.edit-tagclouds span'); + + for (var i = 0; i < populartags.length; i++) { + if (tags.contains(populartags[i].innerHTML)) { + populartags[i].className = 'selected'; + } + } +}); + +function addTag(ele) { + var thisTag = ele.innerHTML; + var taglist = document.getElementById('tags'); + var tags = taglist.value.split(', '); + + // If tag is already listed, remove it + if (tags.contains(thisTag)) { + tags = tags.remove(thisTag); + ele.className = 'unselected'; + + // Otherwise add it + } else { + tags.splice(0, 0, thisTag); + ele.className = 'selected'; + } + + taglist.value = tags.join(', '); + + document.getElementById('tags').focus(); +} +//]]> +</script> +<div class="edit-tagclouds"></div> +<?php +} +?> diff --git a/data/templates/default/editbookmark.tpl.php b/data/templates/default/editbookmark.tpl.php new file mode 100644 index 0000000..8b71230 --- /dev/null +++ b/data/templates/default/editbookmark.tpl.php @@ -0,0 +1,221 @@ +<?php +$this->includeTemplate($GLOBALS['top_include']); + +$accessPublic = ''; +$accessShared = ''; +$accessPrivate = ''; +switch ($row['bStatus']) { + case 0 : + $accessPublic = ' selected="selected"'; + break; + case 1 : + $accessShared = ' selected="selected"'; + break; + case 2 : + $accessPrivate = ' selected="selected"'; + break; +} + +function jsEscTitle($title) +{ + return addcslashes($title, "'"); +} +function jsEscTitleDouble($title) +{ + return addcslashes(addcslashes($title, "'"), "'\\"); +} +function fixOperaButtonName($name) { + //yes, opera has problems with double quotes in button names + return str_replace('"', "''", $name); +} + +if (is_array($row['tags'])) { + $row['tags'] = implode(', ', $row['tags']); +} + +$ajaxUrl = ROOT . 'ajax/' + . ( + ($GLOBALS['adminsAreAdvisedTagsFromOtherAdmins'] && $currentUser->isAdmin()) + ? 'getadmintags' + : 'getcontacttags' + ) . '.php'; +?> +<form action="<?php echo $formaction; ?>" method="post"> +<table> +<tr> + <th align="left"><?php echo T_('Address'); ?></th> + <td><input type="text" id="address" name="address" size="75" maxlength="65535" value="<?php echo filter($row['bAddress'], 'xml'); ?>" onblur="useAddress(this)" /></td> + <td>← <?php echo T_('Required'); ?></td> +</tr> +<tr> + <th align="left"><?php echo T_('Title'); ?></th> + <td><input type="text" id="titleField" name="title" size="75" maxlength="255" value="<?php echo filter($row['bTitle'], 'xml'); ?>" onkeypress="this.style.backgroundImage = 'none';" /></td> + <td>← <?php echo T_('Required'); ?></td> +</tr> +<tr> + <th align="left"> + <?php echo T_('Description'); ?> + <a onclick="var nz = document.getElementById('privateNoteZone'); nz.style.display='';this.style.display='none';"><?php echo T_("Add Note"); ?></a> + </th> + <td><textarea name="description" id="description" rows="5" cols="63" ><?php echo filter($row['bDescription'], 'xml'); ?></textarea></td> + <td>← <?php echo T_('You can use anchors to delimite attributes. for example: [publisher]blah[/publisher] '); ?> + <?php if(count($GLOBALS['descriptionAnchors'])>0): ?> + <br /><br /> + <?php echo T_('Suggested anchors: '); ?> + <?php foreach($GLOBALS['descriptionAnchors'] as $anchorName => $anchorValue): ?> + <?php if(is_numeric($anchorName)) { + $anchorName = $anchorValue; + $anchorValue = '['.$anchorValue.']'.'[/'.$anchorValue.']'; + } ?> + <span class="anchor" title="<?php echo $anchorValue ?>" onclick="addAnchor('<?php echo $anchorValue ?>', 'description')"><?php echo $anchorName ?></span> + <?php endforeach; ?> + <?php endif; ?> + </td> +</tr> +<tr id="privateNoteZone" <?php if(strlen($row['bPrivateNote'])==0):?>style="display:none"<?php endif; ?>> + <th align="left"><?php echo T_('Private Note'); ?></th> + <td><textarea name="privateNote" id="privateNote" rows="1" cols="63" ><?php echo filter($row['bPrivateNote'], 'xml'); ?></textarea></td> + <td>← <?php echo T_('Just visible by you and your contacts.'); ?> + </td> +</tr> +<tr> + <th align="left"><?php echo T_('Tags'); ?></th> + <td class="scuttletheme"> + <input type="text" id="tags" name="tags" size="75" value="<?php echo filter($row['tags'], 'xml'); ?>"/> + </td> + <td>← <?php echo T_('Comma-separated'); ?></td> +</tr> +<tr> + <th></th> + <td align="right"><small><?php echo htmlspecialchars(T_('Note: use ">" to include one tag in another. e.g.: europe>france>paris'))?></small></td> +</tr> +<tr> + <th></th> + <td align="right"><small><?php echo T_('Note: use "=" to make synonym two tags. e.g.: france=frenchcountry')?></small></td> +</tr> +<tr> + <th align="left"><?php echo T_('Privacy'); ?></th> + <td> + <select name="status"> + <option value="0"<?php echo $accessPublic ?>><?php echo T_('Public'); ?></option> + <option value="1"<?php echo $accessShared ?>><?php echo T_('Shared with Watch List'); ?></option> + <option value="2"<?php echo $accessPrivate ?>><?php echo T_('Private'); ?></option> + </select> + </td> + <td></td> +</tr> +<tr> + <td></td> + <td> + <input type="submit" name="submitted" value="<?php echo $btnsubmit; ?>" /> + <input type="button" name="cancel" value="<?php echo T_('Cancel') ?>" onclick="<?php echo $popup?'window.close();':'javascript: history.go(-1)'; ?>" /> + <?php + if (isset($showdelete) && $showdelete) { + ?> + <input type="submit" name="delete" value="<?php echo T_('Delete Bookmark'); ?>" /> + <?php + } + if (isset($showdelete) && $showdelete) { + echo ' (<a href="'.createURL('bookmarkcommondescriptionedit', $row['bHash']).'">'; + echo T_('edit common description').'</a>)'; + } + + if ($popup) { + ?> + <input type="hidden" name="popup" value="1" /> + <?php + } elseif (isset($referrer)) { + ?> + <input type="hidden" name="referrer" value="<?php echo $referrer; ?>" /> + <?php + } + ?> + </td> + <td></td> + </tr> + </table> +</form> + +<link href="<?php echo ROOT ?>js/jquery-ui-1.8.11/themes/base/jquery.ui.all.css" rel="stylesheet" type="text/css"/> + +<script type="text/javascript" src="<?php echo ROOT ?>js/jquery-ui-1.8.11/jquery.ui.core.js"></script> +<script type="text/javascript" src="<?php echo ROOT ?>js/jquery-ui-1.8.11/jquery.ui.widget.js"></script> +<script type="text/javascript" src="<?php echo ROOT ?>js/jquery-ui-1.8.11/jquery.ui.position.js"></script> +<script type="text/javascript" src="<?php echo ROOT ?>js/jquery-ui-1.8.11/jquery.ui.autocomplete.js"></script> +<script type="text/javascript"> +//<![CDATA[ +jQuery(document).ready(function() { + function split(val) + { + return val.split(/[,=><]\s*/); + } + + function extractLast(term) + { + return split(term).pop(); + } + //var availableTags = ["c++", "java", "php", "coldfusion", "javascript", "asp", "ruby"]; + + jQuery("input#tags").autocomplete({ + autoFocus: true, + minLength: 1, + + source: function(request, response) { + // delegate back to autocomplete, but extract the last term + var term = extractLast(request.term); + if (term.length < this.options.minLength) { + return; + } + response( + /* + $.ui.autocomplete.filter( + availableTags, extractLast(request.term) + ) + */ + $.getJSON( + "<?php echo $ajaxUrl; ?>", + { beginsWith: term }, + response + ) + ); + }, + + focus: function() { + // prevent value inserted on focus + return false; + }, + select: function(event, ui) { + var terms = split(this.value); + // remove the current input + terms.pop(); + // add the selected item + terms.push(ui.item.value); + // add placeholder to get the comma-and-space at the end + terms.push(""); + this.value = terms.join(", "); + return false; + } + }); +}); +//]]> +</script> + +<?php +// Dynamic tag selection +$this->includeTemplate('dynamictags.inc'); + +// Bookmarklets and import links +if (empty($_REQUEST['popup']) && (!isset($showdelete) || !$showdelete)) { + +$this->includeTemplate('bookmarklet.inc.php'); +?> +<h3><?php echo T_('Import'); ?></h3> +<ul> + <li><a href="<?php echo createURL('importNetscape'); ?>"><?php echo T_('Import bookmarks from bookmark file'); ?></a> (<?php echo T_('Internet Explorer, Mozilla Firefox and Netscape'); ?>)</li> + <li><a href="<?php echo createURL('import'); ?>"><?php echo T_('Import bookmarks from del.icio.us'); ?></a></li> +</ul> + +<?php +} +$this->includeTemplate($GLOBALS['bottom_include']); +?> diff --git a/data/templates/default/editprofile-sslclientcerts.tpl.php b/data/templates/default/editprofile-sslclientcerts.tpl.php new file mode 100644 index 0000000..900c193 --- /dev/null +++ b/data/templates/default/editprofile-sslclientcerts.tpl.php @@ -0,0 +1,60 @@ +<?php +/** + * User's own profile page: SSL client certificate settings + * + * @param array $sslClientCerts Array of SSL client certificate objects + * @param string $formaction URL where to send the forms to + * @param SemanticScuttle_Model_User_SslClientCert + * $currentCert Current SSL client certificate (may be null) + */ +?> +<h3><?php echo T_('SSL client certificates'); ?></h3> +<?php if (count($sslClientCerts)) { ?> +<table> + <thead> + <tr> + <th>Options</th> + <th><?php echo T_('Serial'); ?></th> + <th><?php echo T_('Name'); ?></th> + <th><?php echo T_('Email'); ?></th> + <th><?php echo T_('Issuer'); ?></th> + </tr> + </thead> + <tbody> + <?php foreach($sslClientCerts as $cert) { ?> + <tr <?php if ($cert->isCurrent()) { echo 'class="ssl-current"'; } ?>> + <td> + <form method="post" action="<?php echo $formaction; ?>"> + <input type="hidden" name="certId" value="<?php echo $cert->id; ?>"/> + <button type="submit" name="action" value="deleteClientCert"> + <?php echo T_('delete'); ?> + </button> + </form> + </td> + <td><?php echo htmlspecialchars($cert->sslSerial); ?></td> + <td><?php echo htmlspecialchars($cert->sslName); ?></td> + <td><?php echo htmlspecialchars($cert->sslEmail); ?></td> + <td><?php echo htmlspecialchars($cert->sslClientIssuerDn); ?></td> + </tr> + <?php } ?> + </tbody> +</table> +<?php } else { ?> + <p><?php echo T_('No certificates registered'); ?></p> +<?php } ?> + +<?php if ($currentCert) { ?> + <?php if ($currentCert->isRegistered($sslClientCerts)) { ?> + <p><?php echo T_('Your current certificate is already registered with your account.'); ?></p> + <?php } else { ?> + <p> + <form method="post" action="<?php echo $formaction; ?>"> + <button type="submit" name="action" value="registerCurrentCert"> + <?php echo T_('Register current certificate to automatically login.'); ?> + </button> + </form> + </p> + <?php } ?> +<?php } else { ?> + <p><?php echo T_('Your browser does not provide a certificate.'); ?></p> +<?php } ?> diff --git a/data/templates/default/editprofile.tpl.php b/data/templates/default/editprofile.tpl.php new file mode 100644 index 0000000..cc74f04 --- /dev/null +++ b/data/templates/default/editprofile.tpl.php @@ -0,0 +1,73 @@ +<?php +$this->includeTemplate($GLOBALS['top_include']); +?> + +<form action="<?php echo $formaction; ?>" method="post"> +<input type="hidden" name="token" value="<?php echo $token; ?>"/> + +<h3><?php echo T_('Account Details'); ?></h3> + +<table class="profile"> +<tr> + <th align="left"><?php echo T_('Username'); ?></th> + <td><?php echo $user; ?></td> + <td></td> +</tr> +<tr> + <th align="left"><?php echo T_('New Password'); ?></th> + <td><input type="password" name="pPass" size="20" /></td> + <td></td> +</tr> +<tr> + <th align="left"><?php echo T_('Confirm Password'); ?></th> + <td><input type="password" name="pPassConf" size="20" /></td> + <td></td> +</tr> +<tr> + <th align="left"><?php echo T_('E-mail'); ?></th> + <td><input type="text" name="pMail" size="75" value="<?php echo filter($objectUser->getEmail(), 'xml'); ?>" /></td> + <td>← <?php echo T_('Required'); ?></td> +</tr> +</table> + +<h3><?php echo T_('Personal Details'); ?></h3> + +<table class="profile"> +<tr> + <th align="left"><?php echo T_('Name'); ?></th> + <td><input type="text" name="pName" size="75" value="<?php echo filter($objectUser->getName(), 'xml'); ?>" /></td> +</tr> +<tr> + <th align="left"><?php echo T_('Homepage'); ?></th> + <td><input type="text" name="pPage" size="75" value="<?php echo filter($objectUser->getHomepage()); ?>" /></td> +</tr> +<tr> + <th align="left"><?php echo T_('Description'); ?></th> + <td><textarea name="pDesc" cols="75" rows="10"><?php echo $objectUser->getContent(); ?></textarea></td> +</tr> +<tr> + <th></th> + <td><input type="submit" name="submitted" value="<?php echo T_('Save Changes'); ?>" /></td> +</tr> +</table> + +<?php include 'editprofile-sslclientcerts.tpl.php'; ?> +<h3><?php echo T_('Actions'); ?></h3> +<table class="profile"> +<tr> + <th align="left"><?php echo T_('Export bookmarks'); ?></th> + <td> + <a href="../api/export_html.php"><?php echo T_('HTML file (for browsers)')?></a> / + <a href="../api/posts_all.php"><?php echo T_('XML file (like del.icio.us)')?></a> / + <a href="../api/export_csv.php"><?php echo T_('CSV file (for spreadsheet tools)')?></a> + </td> +</tr> +<tr><th> </th><td> </td></tr> +<tr><th> </th><td> </td></tr> +</table> + +</form> + +<?php +$this->includeTemplate($GLOBALS['bottom_include']); +?> diff --git a/data/templates/default/error.404.tpl.php b/data/templates/default/error.404.tpl.php new file mode 100644 index 0000000..fe9401d --- /dev/null +++ b/data/templates/default/error.404.tpl.php @@ -0,0 +1,9 @@ +<?php +header('HTTP/1.x 404 Not Found'); +$this->includeTemplate($GLOBALS['top_include']); +if (!$error) { + echo '<h1>'. T_('Not Found') .'</h1>'; + echo '<p>'. T_('The requested URL was not found on this server') .'</p>'; +} +$this->includeTemplate($GLOBALS['bottom_include']); +?> \ No newline at end of file diff --git a/data/templates/default/error.500.tpl.php b/data/templates/default/error.500.tpl.php new file mode 100644 index 0000000..1d7f7ae --- /dev/null +++ b/data/templates/default/error.500.tpl.php @@ -0,0 +1,9 @@ +<?php +header('HTTP/1.x 500 Server error'); +$this->includeTemplate($GLOBALS['top_include']); +if (!$error) { + echo '<h1>'. T_('General server error') .'</h1>'; + echo '<p>'. T_('The requested URL could not be processed') .'</p>'; +} +$this->includeTemplate($GLOBALS['bottom_include']); +?> diff --git a/data/templates/default/importDelicious.tpl.php b/data/templates/default/importDelicious.tpl.php new file mode 100644 index 0000000..bc4d892 --- /dev/null +++ b/data/templates/default/importDelicious.tpl.php @@ -0,0 +1,42 @@ +<?php +$this->includeTemplate($GLOBALS['top_include']); +?> + +<form id="import" enctype="multipart/form-data" action="<?php echo $formaction; ?>" method="post"> +<table> +<tr valign="top"> + <th align="left"><?php echo T_('File'); ?></th> + <td> + <input type="hidden" name="MAX_FILE_SIZE" value="1024000" /> + <input type="file" name="userfile" size="50" /> + </td> +</tr> +<tr valign="top"> + <th align="left"><?php echo T_('Privacy'); ?></th> + <td> + <select name="status"> + <option value="0"><?php echo T_('Public'); ?></option> + <option value="1"><?php echo T_('Shared with Watchlist'); ?></option> + <option value="2"><?php echo T_('Private'); ?></option> + </select> + </td> +</tr> +<tr> + <td /> + <td><input type="submit" value="<?php echo T_('Import'); ?>" /></td> +</tr> +</table> +</form> + +<h3><?php echo T_('Instructions'); ?></h3> +<ol> + <li><?php echo T_('Log in to the <a href="http://del.icio.us/api/posts/all">export page at del.icio.us</a>'); ?>.</li> + <li><?php echo T_('Save the resulting <abbr title="Extensible Markup Language">XML</abbr> file to your computer'); ?>.</li> + <li><?php echo T_('Click <kbd>Browse...</kbd> to find this file on your computer. The maximum size the file can be is 1MB'); ?>.</li> + <li><?php echo T_('Select the default privacy setting for your imported bookmarks'); ?>.</li> + <li><?php echo T_('Click <kbd>Import</kbd> to start importing the bookmarks; it may take a minute'); ?>.</li> +</ol> + +<?php +$this->includeTemplate($GLOBALS['bottom_include']); +?> \ No newline at end of file diff --git a/data/templates/default/importNetscape.tpl.php b/data/templates/default/importNetscape.tpl.php new file mode 100644 index 0000000..627a5af --- /dev/null +++ b/data/templates/default/importNetscape.tpl.php @@ -0,0 +1,50 @@ +<?php +$this->includeTemplate($GLOBALS['top_include']); +?> + +<div id="bookmarks"> + <form id="import" enctype="multipart/form-data" action="<?php echo $formaction; ?>" method="post"> + <table> + <tr valign="top"> + <th align="left"><?php echo T_('File'); ?></th> + <td> + <input type="hidden" name="MAX_FILE_SIZE" value="1024000" /> + <input type="file" name="userfile" size="50" /> + </td> + </tr> + <tr valign="top"> + <th align="left"><?php echo T_('Privacy'); ?></th> + <td> + <select name="status"> + <option value="0"><?php echo T_('Public'); ?></option> + <option value="1"><?php echo T_('Shared with Watchlist'); ?></option> + <option value="2"><?php echo T_('Private'); ?></option> + </select> + </td> + </tr> + <tr> + <td /> + <td><input type="submit" value="<?php echo T_('Import'); ?>" /></td> + </tr> + </table> + </form> + + <h3><?php echo T_('Instructions'); ?></h3> + <ol> + <li> + <p><?php echo T_('Export your bookmarks from your browser to a file'); ?>:</p> + <ul> + <li><?php echo T_('Internet Explorer: <kbd>File > Import and Export... > Export Favorites'); ?></kbd></li> + <li><?php echo T_('Mozilla Firefox: <kbd>Bookmarks > Manage Bookmarks... > File > Export...'); ?></kbd></li> + <li><?php echo T_('Netscape: <kbd>Bookmarks > Manage Bookmarks... > Tools > Export...'); ?></kbd></li> + </ul> + </li> + <li><?php echo T_('Click <kbd>Browse...</kbd> to find the saved bookmark file on your computer. The maximum size the file can be is 1MB'); ?>.</li> + <li><?php echo T_('Select the default privacy setting for your imported bookmarks'); ?>.</li> + <li><?php echo T_('Click <kbd>Import</kbd> to start importing the bookmarks; it may take a minute'); ?>.</li> + </ol> +</div> + +<?php +$this->includeTemplate($GLOBALS['bottom_include']); +?> \ No newline at end of file diff --git a/data/templates/default/importStructure.tpl.php b/data/templates/default/importStructure.tpl.php new file mode 100644 index 0000000..9c54612 --- /dev/null +++ b/data/templates/default/importStructure.tpl.php @@ -0,0 +1,42 @@ +<?php +$this->includeTemplate($GLOBALS['top_include']); +?> + +<div id="bookmarks"> +<form id="import" enctype="multipart/form-data" + action="<?php echo $formaction; ?>" method="post"> +<table> + <tr valign="top"> + <th align="left"><?php echo T_('File'); ?></th> + <td><input type="hidden" name="MAX_FILE_SIZE" value="1024000" /> <input + type="file" name="userfile" size="50" /></td> + </tr> + <tr> + <td /> + <td><input type="submit" value="<?php echo T_('Import'); ?>" /></td> + </tr> +</table> +</form> + +<h3><?php echo T_('Instructions'); ?></h3> +<ol> + <li> + <p><?php echo T_('Create your structure into a simple text file and following this model:');?></p> + <ul> + <li>firstTagOfLevel1</li> + <li>    firstTagOfLevel2 <i>(the line starts with two spaces)</i></li> + <li>    secondTagOfLevel2</li> + <li>    thirdTagOfLevel2</li> + <li>secondTagOfLevel1</li> + <li>    fourthTagOfLevel2 <i>(included into secondTagOfLevel1)</i></li> + </ul> + </li> + <li> + <p><?php echo T_('Then import the file. The tags and their relations will be added to your profile.'); ?></p> + </li> +</ol> +</div> + +<?php +$this->includeTemplate($GLOBALS['bottom_include']); +?> \ No newline at end of file diff --git a/data/templates/default/login.tpl.php b/data/templates/default/login.tpl.php new file mode 100644 index 0000000..e67808d --- /dev/null +++ b/data/templates/default/login.tpl.php @@ -0,0 +1,41 @@ +<?php +$this->includeTemplate($GLOBALS['top_include']); +?> + +<script type="text/javascript"> +window.onload = function() { + document.getElementById("username").focus(); +} +</script> + +<?php +if (!$userservice->isSessionStable()) { + echo '<p class="error">'.T_('Please activate cookies').'</p>'; +} +?> + +<form action="<?php echo $formaction; ?>" method="post"> + <div><input type="hidden" name="query" value="<?php echo $querystring; ?>" /></div> + <table> + <tr> + <th align="left"><label for="username"><?php echo T_('Username'); ?></label></th> + <td><input type="text" id="username" name="username" size="20" /></td> + <td></td> + </tr> + <tr> + <th align="left"><label for="password"><?php echo T_('Password'); ?></label></th> + <td><input type="password" id="password" name="password" size="20" /></td> + <td><input type="checkbox" name="keeppass" id="keeppass" value="yes" /> <label for="keeppass"><?php echo T_("Don't ask for my password for 2 weeks"); ?>.</label></td> + </tr> + <tr> + <td></td> + <td><input type="submit" name="submitted" value="<?php echo T_('Log In'); ?>" /></td> + <td></td> + </tr> + </table> + <p>» <a href="<?php echo ROOT ?>password.php"><?php echo T_('Forgotten your password?') ?></a></p> +</form> + +<?php +$this->includeTemplate($GLOBALS['bottom_include']); +?> \ No newline at end of file diff --git a/data/templates/default/password.tpl.php b/data/templates/default/password.tpl.php new file mode 100644 index 0000000..55dbed6 --- /dev/null +++ b/data/templates/default/password.tpl.php @@ -0,0 +1,26 @@ +<?php +$this->includeTemplate($GLOBALS['top_include']); +?> + +<p><?php echo sprintf(T_('If you have forgotten your password, %s can generate a new one. Enter the username and e-mail address of your account into the form below and we will e-mail your new password to you.'), $GLOBALS['sitename']); ?></p> + +<form action="<?php echo $formaction; ?>" method="post"> + <table> + <tr> + <th align="left"><label for="username"><?php echo T_('Username'); ?></label></th> + <td><input type="text" id="username" name="username" size="20" class="required" /></td> + </tr> + <tr> + <th align="left"><label for="email"><?php echo T_('E-mail'); ?></label></th> + <td><input type="text" id="email" name="email" size="40" class="required" /></td> + </tr> + <tr> + <td></td> + <td><input type="submit" name="submitted" value="<?php echo T_('Generate Password'); ?>" /></td> + </tr> + </table> +</form> + +<?php +$this->includeTemplate($GLOBALS['bottom_include']); +?> \ No newline at end of file diff --git a/data/templates/default/profile.tpl.php b/data/templates/default/profile.tpl.php new file mode 100644 index 0000000..1e2003a --- /dev/null +++ b/data/templates/default/profile.tpl.php @@ -0,0 +1,74 @@ +<?php +$this->includeTemplate($GLOBALS['top_include']); +?> + +<dl id="profile"> +<dt><?php echo T_('Username'); ?></dt> + <dd><?php echo $user; ?></dd> +<?php +if ($userservice->isLoggedOn() && $currentUser->isAdmin()) { +?> +<dt><?php echo T_('Email'); ?></dt> + <dd><?php echo filter($objectUser->getEmail()) ?></dd> +<?php +} +if ($objectUser->getName() != "") { +?> +<dt><?php echo T_('Name'); ?></dt> + <dd><?php echo filter($objectUser->getName()); ?></dd> +<?php +} +if ($objectUser->getHomepage() != "") { +?> +<dt><?php echo T_('Homepage'); ?></dt> + <dd><a href="<?php echo filter($objectUser->getHomepage()); ?>"><?php echo filter($objectUser->getHomepage()); ?></a></dd> +<?php +} +?> +<dt><?php echo T_('Member Since'); ?></dt> + <dd><?php echo date($GLOBALS['longdate'], strtotime($objectUser->getDatetime())); ?></dd> +<?php +if ($objectUser->getContent() != "") { +?> +<dt><?php echo T_('Description'); ?></dt> + <dd><?php echo $objectUser->getContent(); ?></dd> +<?php +} +$watching = $userservice->getWatchNames($userid); +if ($watching) { +?> + <dt><?php echo T_('Watching'); ?></dt> + <dd> + <?php + $list = ''; + foreach($watching as $watchuser) { + $list .= '<a href="'. createURL('bookmarks', $watchuser) .'">'. $watchuser .'</a>, '; + } + echo substr($list, 0, -2); + ?> + </dd> +<?php +} +$watchnames = $userservice->getWatchNames($userid, true); +if ($watchnames) { +?> + <dt><?php echo T_('Watched By'); ?></dt> + <dd> + <?php + $list = ''; + foreach($watchnames as $watchuser) { + $list .= '<a href="'. createURL('bookmarks', $watchuser) .'">'. $watchuser .'</a>, '; + } + echo substr($list, 0, -2); + ?> + </dd> +<?php +} +?> +<dt><?php echo T_('Bookmarks'); ?></dt> + <dd><a href="<?php echo createURL('bookmarks', $user) ?>"><?php echo T_('Go to bookmarks')?> >></a></dd> +</dl> + +<?php +$this->includeTemplate($GLOBALS['bottom_include']); +?> diff --git a/data/templates/default/register.tpl.php b/data/templates/default/register.tpl.php new file mode 100644 index 0000000..62cebad --- /dev/null +++ b/data/templates/default/register.tpl.php @@ -0,0 +1,49 @@ +<?php +$this->includeTemplate($GLOBALS['top_include']); +?> + +<script type="text/javascript"> +window.onload = function() { + document.getElementById("username").focus(); +} +</script> + +<p><?php echo sprintf(T_('Sign up here to create a free %s account. All the information requested below is required'), $GLOBALS['sitename']); ?>.</p> + +<form action="<?php echo $formaction; ?>" method="post"> +<table> +<tr> + <th align="left"><label for="username"><?php echo T_('Username'); ?></label></th> + <td><input type="text" id="username" name="username" size="20" class="required" onkeyup="isAvailable(this, '')" /> </td> + <td id="availability"><?php echo '←'.T_(' at least 5 characters, alphanumeric (no spaces, no dots or other special ones)') ?></td> +</tr> +<tr> + <th align="left"><label for="password"><?php echo T_('Password'); ?></label></th> + <td><input type="password" id="password" name="password" size="20" class="required" /></td> + <td></td> +</tr> +<tr> + <th align="left"><label for="email"><?php echo T_('E-mail'); ?></label></th> + <td><input type="text" id="email" name="email" size="40" class="required" value="<?php echo htmlspecialchars(POST_MAIL); ?>" /></td> + <td><?php echo '←'.T_(' to send you your password if you forget it')?></td> +</tr> + +<?php if(strlen($antispamQuestion)>0) {?> +<tr> + <th align="left"><label for="antispamAnswer"><?php echo T_('Antispam question'); ?></label></th> + <td><input type="text" id="antispamAnswer" name="antispamAnswer" size="40" class="required" value="<?php echo $antispamQuestion; ?>" onfocus="if (this.value == '<?php echo $antispamQuestion; ?>') this.value = '';" onblur="if (this.value == '') this.value = '<?php echo $antispamQuestion; ?>';"/></td> + <td></td> +</tr> +<?php } ?> + +<tr> + <td></td> + <td><input type="submit" name="submitted" value="<?php echo T_('Register'); ?>" /></td> + <td></td> +</tr> +</table> +</form> + +<?php +$this->includeTemplate($GLOBALS['bottom_include']); +?> diff --git a/data/templates/default/rss.tpl.php b/data/templates/default/rss.tpl.php new file mode 100644 index 0000000..e6e66f7 --- /dev/null +++ b/data/templates/default/rss.tpl.php @@ -0,0 +1,26 @@ +<?php +echo '<' . '?xml version="1.0" encoding="utf-8" ?' . ">\n"; +?> +<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"> +<channel> + <title><?php echo htmlspecialchars($feedtitle); ?> + + + + + 60 + + + + <?php echo htmlspecialchars($bookmark['title']); ?> + + + + + + + + + + + \ No newline at end of file diff --git a/data/templates/default/search.menu.php b/data/templates/default/search.menu.php new file mode 100644 index 0000000..5a8f027 --- /dev/null +++ b/data/templates/default/search.menu.php @@ -0,0 +1,57 @@ + + + + diff --git a/data/templates/default/sidebar.block.common.php b/data/templates/default/sidebar.block.common.php new file mode 100644 index 0000000..951ed80 --- /dev/null +++ b/data/templates/default/sidebar.block.common.php @@ -0,0 +1,28 @@ +getRelatedTagsByHash($hash); +$commonTags =& $b2tservice->tagCloud($commonTags, 5, 90, 225, 'alphabet_asc'); + +if ($commonTags && count($commonTags) > 0) { + ?> + +

+
+

'. filter($row['tag']) .' '; +} +echo $contents ."\n"; +?>

+
+ + diff --git a/data/templates/default/sidebar.block.linked.php b/data/templates/default/sidebar.block.linked.php new file mode 100644 index 0000000..9aa3cc0 --- /dev/null +++ b/data/templates/default/sidebar.block.linked.php @@ -0,0 +1,66 @@ +getCurrentUserId(); +$editingMode = $logged_on_userid !== false; +?> +

+ \ No newline at end of file diff --git a/data/templates/default/sidebar.block.menu.php b/data/templates/default/sidebar.block.menu.php new file mode 100644 index 0000000..94a9fa2 --- /dev/null +++ b/data/templates/default/sidebar.block.menu.php @@ -0,0 +1,80 @@ +getCurrentUserId(); +if ($logged_on_userid === false) { + $logged_on_userid = NULL; +} + +// editing mode +if(($logged_on_userid != null) && ($userid === $logged_on_userid)) { + $editingMode = true; +} else { + $editingMode = false; +} + +if(!isset($user) || $user == '') { + $cat_url = createURL('tags', '%2$s'); +} + +$menuTags = $tag2tagservice->getMenuTags($userid); +if (sizeof($menuTags) > 0 || ($userid != 0 && $userid === $logged_on_userid)) { +?> + +

+'.T_('Menu Tags').' '; + //} +?> +

+ + + + + diff --git a/data/templates/default/sidebar.block.menu2.php b/data/templates/default/sidebar.block.menu2.php new file mode 100644 index 0000000..1c177a5 --- /dev/null +++ b/data/templates/default/sidebar.block.menu2.php @@ -0,0 +1,71 @@ +getCurrentUserId(); +if ($logged_on_userid === false) { + $logged_on_userid = NULL; +} + + +$cat_url = createURL('tags', '%s'); +$menu2Tags = $GLOBALS['menu2Tags']; + +if (count($menu2Tags) > 0) { +?> + +

+ + +
> + +
+ + diff --git a/data/templates/default/sidebar.block.popular.php b/data/templates/default/sidebar.block.popular.php new file mode 100644 index 0000000..50756c0 --- /dev/null +++ b/data/templates/default/sidebar.block.popular.php @@ -0,0 +1,44 @@ +getCurrentUserId(); +if ($logged_on_userid === false) { + $logged_on_userid = NULL; +} +$popularTags =& $b2tservice->getPopularTags($userid, $popCount, $logged_on_userid); +$popularTags =& $b2tservice->tagCloud($popularTags, 5, 90, 225, 'alphabet_asc'); + +if ($popularTags && count($popularTags) > 0) { +?> + +

+ + + diff --git a/data/templates/default/sidebar.block.recent.php b/data/templates/default/sidebar.block.recent.php new file mode 100644 index 0000000..1ffeb4d --- /dev/null +++ b/data/templates/default/sidebar.block.recent.php @@ -0,0 +1,39 @@ +getCurrentUserId(); +if ($logged_on_userid === false) { + $logged_on_userid = NULL; +} +$recentTags = $b2tservice->getPopularTags($userid, $popCount, $logged_on_userid, $GLOBALS['defaultRecentDays']); +$recentTags =& $b2tservice->tagCloud($recentTags, 5, 90, 225, 'alphabet_asc'); + +if ($recentTags && count($recentTags) > 0) { +?> + +

+
+ '; + + if(!isset($user) || $user == '') { + $user = ''; + $cat_url = createURL('tags', '%2$s'); + } + + foreach ($recentTags as $row) { + $entries = T_ngettext('bookmark', 'bookmarks', $row['bCount']); + $contents .= ' '; + } + echo $contents ."

\n"; + ?> +

+
+ + diff --git a/data/templates/default/sidebar.block.related.php b/data/templates/default/sidebar.block.related.php new file mode 100644 index 0000000..60ee486 --- /dev/null +++ b/data/templates/default/sidebar.block.related.php @@ -0,0 +1,40 @@ +getCurrentUserId(); +if ($logged_on_userid === false) { + $logged_on_userid = NULL; +} + +if(!isset($userid)) { + $userid = NULL; +} + +if(isset($user) && strlen($user)==0) { + $cat_url = createURL('tags', '%2$s'); +} +if ($currenttag) { + $relatedTags = $b2tservice->getRelatedTags($currenttag, $userid, $logged_on_userid); + if (sizeof($relatedTags) > 0) { +?> + +

+ + + diff --git a/data/templates/default/sidebar.block.search.php b/data/templates/default/sidebar.block.search.php new file mode 100644 index 0000000..d3cd8a5 --- /dev/null +++ b/data/templates/default/sidebar.block.search.php @@ -0,0 +1,51 @@ + + * @author Christian Weiske + * @author Eric Dane + * @license GPL http://www.gnu.org/licenses/gpl.html + * @link http://sourceforge.net/projects/semanticscuttle + */ +/* Service creation: only useful services are created */ +$searchhistoryservice = SemanticScuttle_Service_Factory::get('SearchHistory'); + +$lastSearches = $searchhistoryservice->getAllSearches( + 'all', NULL, 3, NULL, true, false +); + +if ($lastSearches && count($lastSearches) > 0) { +?> + +

+
+ +' . "\n"; +} +//echo ''; +?> + +
'; + echo ''; + echo htmlspecialchars($row['shTerms']); + echo ''; + echo ' (' . $row['shNbResults'] . ')'; + echo '
...
+
+ diff --git a/data/templates/default/sidebar.block.tagactions.php b/data/templates/default/sidebar.block.tagactions.php new file mode 100644 index 0000000..3351866 --- /dev/null +++ b/data/templates/default/sidebar.block.tagactions.php @@ -0,0 +1,35 @@ +isLoggedOn()) { + + if ($currentUser->getUsername() == $user) { + $tags = explode('+', $currenttag); + $renametext = T_ngettext('Rename Tag', 'Rename Tags', count($tags)); + $renamelink = createURL('tagrename', $currenttag); + $deletelink = createURL('tagdelete', $currenttag); + $tagdesclink = createURL('tagedit', $currenttag); + $commondesclink = createURL('tagcommondescriptionedit', $currenttag); + $addtag2taglinklink = createURL('tag2tagadd', $currenttag); +?> + +

+
+
    +
  • + +
  • + +
  • + isAdmin() )): ?> +
  • + +
  • +
+
+ + diff --git a/data/templates/default/sidebar.block.users.php b/data/templates/default/sidebar.block.users.php new file mode 100644 index 0000000..58fdfb7 --- /dev/null +++ b/data/templates/default/sidebar.block.users.php @@ -0,0 +1,34 @@ +getCurrentUserId(); +if ($logged_on_userid === false) { + $logged_on_userid = NULL; +} +$lastUsers = $userservice->getUsers(3); + +if ($lastUsers && count($lastUsers) > 0) { +?> + +

+
+ +'; +} +//echo ''; +?> + +
'; + echo ''; + echo SemanticScuttle_Model_UserArray::getName($row); + echo ''; + echo ' ('.T_('bookmarks').')'; + echo '
...
+

+
+ diff --git a/data/templates/default/sidebar.block.watchlist.php b/data/templates/default/sidebar.block.watchlist.php new file mode 100644 index 0000000..3af9c5a --- /dev/null +++ b/data/templates/default/sidebar.block.watchlist.php @@ -0,0 +1,60 @@ +getWatchNames($userid); +$watchedBy = $userservice->getWatchNames($userid, true); + + +$closeContacts = array(); // people in my contacts list and who I am also in the contacts list +foreach($watching as $watchuser) { + if(in_array($watchuser, $watchedBy)) { + $closeContacts[] = $watchuser; + } +} + +?> + +0):?> +

+
+
    + +
  • + +
+
+ + + +

+
+
    + isLoggedOn() && $currentUser->getUsername() == $user): ?> +
  • +
    + +
    +
  • + + + +
  • + isLoggedOn() && $currentUser->getUsername() == $user): ?> + - x +
  • + + + +
+
+ +

+
+
    + +
  • + +
+ +
diff --git a/data/templates/default/sidebar.block.watchstatus.php b/data/templates/default/sidebar.block.watchstatus.php new file mode 100644 index 0000000..99574aa --- /dev/null +++ b/data/templates/default/sidebar.block.watchstatus.php @@ -0,0 +1,28 @@ +isLoggedOn()) { + + if ($currentUser->getUsername() != $user) { + $result = $userservice->getWatchStatus($userid, $userservice->getCurrentUserId()); + if ($result) { + $linkText = T_('Remove from Watchlist'); + } else { + $linkText = T_('Add to Watchlist'); + } + $linkAddress = createURL('watch', $user); +?> + +

+
+
    +
  • +
+
+ + \ No newline at end of file diff --git a/data/templates/default/sidebar.linkedtags.inc.php b/data/templates/default/sidebar.linkedtags.inc.php new file mode 100644 index 0000000..020d0f0 --- /dev/null +++ b/data/templates/default/sidebar.linkedtags.inc.php @@ -0,0 +1,84 @@ + '', 'stoplist' => $stopList); + } + + $tag2tagservice =SemanticScuttle_Service_Factory::get('Tag2Tag'); + $tagstatservice =SemanticScuttle_Service_Factory::get('TagStat'); + + // link '>' + if($level>1) { + if($editingMode) { + $link = '> '; + } else { + $link = '> '; + } + } else { + $link = ''; + } + + $output = ''; + $output.= ''; + $output.= ''; + $output.= ''; + $output.= $level == 1?'':''; + $output.= str_repeat(' ', $level*2) .$link.''; + $output.= $level == 1?'':''; + //$output.= ' - '. $tagstatservice->getMaxDepth($tag, $linkType, $uId); + + $synonymTags = $tag2tagservice->getAllLinkedTags($tag, '=', $uId); + $synonymTags = is_array($synonymTags)?$synonymTags:array($synonymTags); + sort($synonymTags); + $synonymList = ''; + foreach($synonymTags as $synonymTag) { + //$output.= ", ".$synonymTag; + $synonymList.= $synonymTag.' '; + } + if(count($synonymTags)>0) { + $output.= ', '.$synonymTags[0]; + } + if(count($synonymTags)>1) { + $output.= ', etc'; + } + + /*if($editingMode) { + $output.= ' ('; + $output.= '+'; + if(1) { + $output.= ' - '; + $output.= '-'; + } + $output.= ')'; + }*/ + $output.= ''; + $output.= ''; + + $tags = array($tag); + $tags = array_merge($tags, $synonymTags); + foreach($tags as $tag) { + + if(!in_array($tag, $stopList)) { + $linkedTags = $tag2tagservice->getLinkedTags($tag, '>', $uId); + $precedentTag = $tag; + $stopList[] = $tag; + foreach($linkedTags as $linkedTag) { + $displayLinkedTags = displayLinkedTags($linkedTag, $linkType, $uId, $cat_url, $user, $editingMode, $precedentTag, $level + 1, $stopList); + $output.= $displayLinkedTags['output']; + } + if(isset($displayLinkedTags) && is_array($displayLinkedTags['stopList'])) { + $stopList = array_merge($stopList, $displayLinkedTags['stopList']); + $stopList = array_unique($stopList); + } + } + + } + return array('output' => $output, 'stopList' => $stopList); +} + +?> diff --git a/data/templates/default/sidebar.tpl.php b/data/templates/default/sidebar.tpl.php new file mode 100644 index 0000000..e823af5 --- /dev/null +++ b/data/templates/default/sidebar.tpl.php @@ -0,0 +1,19 @@ +isAdmin($userid)): ?> +'); -JS; - - $taglist = ''; - foreach (array_keys($tagsCloud) as $key) { - $row = $tagsCloud[$key]; - $entries = T_ngettext('bookmark', 'bookmarks', $row['bCount']); - $taglist .= '' - . filter($row['tag']) - . ' '; - } - echo '$(\'#edit-tagcloud-' . $id . ' p\').append(' - . json_encode($taglist) - . ");\n"; -} - - -if ($allPopularTagsCount > 0 || $userPopularTagsCount > 0 ) { ?> - -
- diff --git a/data/templates/editbookmark.tpl.php b/data/templates/editbookmark.tpl.php deleted file mode 100644 index 8b71230..0000000 --- a/data/templates/editbookmark.tpl.php +++ /dev/null @@ -1,221 +0,0 @@ -includeTemplate($GLOBALS['top_include']); - -$accessPublic = ''; -$accessShared = ''; -$accessPrivate = ''; -switch ($row['bStatus']) { - case 0 : - $accessPublic = ' selected="selected"'; - break; - case 1 : - $accessShared = ' selected="selected"'; - break; - case 2 : - $accessPrivate = ' selected="selected"'; - break; -} - -function jsEscTitle($title) -{ - return addcslashes($title, "'"); -} -function jsEscTitleDouble($title) -{ - return addcslashes(addcslashes($title, "'"), "'\\"); -} -function fixOperaButtonName($name) { - //yes, opera has problems with double quotes in button names - return str_replace('"', "''", $name); -} - -if (is_array($row['tags'])) { - $row['tags'] = implode(', ', $row['tags']); -} - -$ajaxUrl = ROOT . 'ajax/' - . ( - ($GLOBALS['adminsAreAdvisedTagsFromOtherAdmins'] && $currentUser->isAdmin()) - ? 'getadmintags' - : 'getcontacttags' - ) . '.php'; -?> -
- - - - - - - - - - - - - - - - -style="display:none"> - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - 0): ?> -

- - $anchorValue): ?> - - - - -
-
- -
" to include one tag in another. e.g.: europe>france>paris'))?>
- -
- - - - - '; - echo T_('edit common description').')'; - } - - if ($popup) { - ?> - - - - -
-
- - - - - - - - - -includeTemplate('dynamictags.inc'); - -// Bookmarklets and import links -if (empty($_REQUEST['popup']) && (!isset($showdelete) || !$showdelete)) { - -$this->includeTemplate('bookmarklet.inc.php'); -?> -

-
    -
  • ()
  • -
  • -
- -includeTemplate($GLOBALS['bottom_include']); -?> diff --git a/data/templates/editprofile-sslclientcerts.tpl.php b/data/templates/editprofile-sslclientcerts.tpl.php deleted file mode 100644 index 900c193..0000000 --- a/data/templates/editprofile-sslclientcerts.tpl.php +++ /dev/null @@ -1,60 +0,0 @@ - -

- - - - - - - - - - - - - - isCurrent()) { echo 'class="ssl-current"'; } ?>> - - - - - - - - -
Options
-
- - -
-
sslSerial); ?>sslName); ?>sslEmail); ?>sslClientIssuerDn); ?>
- -

- - - - isRegistered($sslClientCerts)) { ?> -

- -

-

- -
-

- - -

- diff --git a/data/templates/editprofile.tpl.php b/data/templates/editprofile.tpl.php deleted file mode 100644 index cc74f04..0000000 --- a/data/templates/editprofile.tpl.php +++ /dev/null @@ -1,73 +0,0 @@ -includeTemplate($GLOBALS['top_include']); -?> - -
- - -

- - - - - - - - - - - - - - - - - - - - - - -
- -

- - - - - - - - - - - - - - - - - - -
- - -

- - - - - - - -
- / - / - -
- -
- -includeTemplate($GLOBALS['bottom_include']); -?> diff --git a/data/templates/error.404.tpl.php b/data/templates/error.404.tpl.php deleted file mode 100644 index fe9401d..0000000 --- a/data/templates/error.404.tpl.php +++ /dev/null @@ -1,9 +0,0 @@ -includeTemplate($GLOBALS['top_include']); -if (!$error) { - echo '

'. T_('Not Found') .'

'; - echo '

'. T_('The requested URL was not found on this server') .'

'; -} -$this->includeTemplate($GLOBALS['bottom_include']); -?> \ No newline at end of file diff --git a/data/templates/error.500.tpl.php b/data/templates/error.500.tpl.php deleted file mode 100644 index 1d7f7ae..0000000 --- a/data/templates/error.500.tpl.php +++ /dev/null @@ -1,9 +0,0 @@ -includeTemplate($GLOBALS['top_include']); -if (!$error) { - echo '

'. T_('General server error') .'

'; - echo '

'. T_('The requested URL could not be processed') .'

'; -} -$this->includeTemplate($GLOBALS['bottom_include']); -?> diff --git a/data/templates/importDelicious.tpl.php b/data/templates/importDelicious.tpl.php deleted file mode 100644 index bc4d892..0000000 --- a/data/templates/importDelicious.tpl.php +++ /dev/null @@ -1,42 +0,0 @@ -includeTemplate($GLOBALS['top_include']); -?> - -
- - - - - - - - - - - - -
- - -
- -
-
-
- -

-
    -
  1. export page at del.icio.us'); ?>.
  2. -
  3. XML file to your computer'); ?>.
  4. -
  5. Browse... to find this file on your computer. The maximum size the file can be is 1MB'); ?>.
  6. -
  7. .
  8. -
  9. Import to start importing the bookmarks; it may take a minute'); ?>.
  10. -
- -includeTemplate($GLOBALS['bottom_include']); -?> \ No newline at end of file diff --git a/data/templates/importNetscape.tpl.php b/data/templates/importNetscape.tpl.php deleted file mode 100644 index 627a5af..0000000 --- a/data/templates/importNetscape.tpl.php +++ /dev/null @@ -1,50 +0,0 @@ -includeTemplate($GLOBALS['top_include']); -?> - -
-
- - - - - - - - - - - - -
- - -
- -
-
-
- -

-
    -
  1. -

    :

    -
      -
    • File > Import and Export... > Export Favorites'); ?>
    • -
    • Bookmarks > Manage Bookmarks... > File > Export...'); ?>
    • -
    • Bookmarks > Manage Bookmarks... > Tools > Export...'); ?>
    • -
    -
  2. -
  3. Browse... to find the saved bookmark file on your computer. The maximum size the file can be is 1MB'); ?>.
  4. -
  5. .
  6. -
  7. Import to start importing the bookmarks; it may take a minute'); ?>.
  8. -
-
- -includeTemplate($GLOBALS['bottom_include']); -?> \ No newline at end of file diff --git a/data/templates/importStructure.tpl.php b/data/templates/importStructure.tpl.php deleted file mode 100644 index 9c54612..0000000 --- a/data/templates/importStructure.tpl.php +++ /dev/null @@ -1,42 +0,0 @@ -includeTemplate($GLOBALS['top_include']); -?> - -
-
- - - - - - - - -
-
-
- -

-
    -
  1. -

    -
      -
    • firstTagOfLevel1
    • -
    •     firstTagOfLevel2 (the line starts with two spaces)
    • -
    •     secondTagOfLevel2
    • -
    •     thirdTagOfLevel2
    • -
    • secondTagOfLevel1
    • -
    •     fourthTagOfLevel2 (included into secondTagOfLevel1)
    • -
    -
  2. -
  3. -

    -
  4. -
-
- -includeTemplate($GLOBALS['bottom_include']); -?> \ No newline at end of file diff --git a/data/templates/login.tpl.php b/data/templates/login.tpl.php deleted file mode 100644 index e67808d..0000000 --- a/data/templates/login.tpl.php +++ /dev/null @@ -1,41 +0,0 @@ -includeTemplate($GLOBALS['top_include']); -?> - - - -isSessionStable()) { - echo '

'.T_('Please activate cookies').'

'; -} -?> - -
-
- - - - - - - - - - - - - - - - -
-

»

-
- -includeTemplate($GLOBALS['bottom_include']); -?> \ No newline at end of file diff --git a/data/templates/password.tpl.php b/data/templates/password.tpl.php deleted file mode 100644 index 55dbed6..0000000 --- a/data/templates/password.tpl.php +++ /dev/null @@ -1,26 +0,0 @@ -includeTemplate($GLOBALS['top_include']); -?> - -

- -
- - - - - - - - - - - - - -
-
- -includeTemplate($GLOBALS['bottom_include']); -?> \ No newline at end of file diff --git a/data/templates/profile.tpl.php b/data/templates/profile.tpl.php deleted file mode 100644 index 1e2003a..0000000 --- a/data/templates/profile.tpl.php +++ /dev/null @@ -1,74 +0,0 @@ -includeTemplate($GLOBALS['top_include']); -?> - -
-
-
-isLoggedOn() && $currentUser->isAdmin()) { -?> -
-
getEmail()) ?>
-getName() != "") { -?> -
-
getName()); ?>
-getHomepage() != "") { -?> -
-
getHomepage()); ?>
- -
-
getDatetime())); ?>
-getContent() != "") { -?> -
-
getContent(); ?>
-getWatchNames($userid); -if ($watching) { -?> -
-
- '. $watchuser .', '; - } - echo substr($list, 0, -2); - ?> -
-getWatchNames($userid, true); -if ($watchnames) { -?> -
-
- '. $watchuser .', '; - } - echo substr($list, 0, -2); - ?> -
- -
-
>>
-
- -includeTemplate($GLOBALS['bottom_include']); -?> diff --git a/data/templates/register.tpl.php b/data/templates/register.tpl.php deleted file mode 100644 index 62cebad..0000000 --- a/data/templates/register.tpl.php +++ /dev/null @@ -1,49 +0,0 @@ -includeTemplate($GLOBALS['top_include']); -?> - - - -

.

- -
- - - - - - - - - - - - - - - - - -0) {?> - - - - - - - - - - - - -
-
- -includeTemplate($GLOBALS['bottom_include']); -?> diff --git a/data/templates/rss.tpl.php b/data/templates/rss.tpl.php deleted file mode 100644 index e6e66f7..0000000 --- a/data/templates/rss.tpl.php +++ /dev/null @@ -1,26 +0,0 @@ -\n"; -?> - - - <?php echo htmlspecialchars($feedtitle); ?> - - - - - 60 - - - - <?php echo htmlspecialchars($bookmark['title']); ?> - - - - - - - - - - - \ No newline at end of file diff --git a/data/templates/search.menu.php b/data/templates/search.menu.php deleted file mode 100644 index 5a8f027..0000000 --- a/data/templates/search.menu.php +++ /dev/null @@ -1,57 +0,0 @@ - - - - diff --git a/data/templates/sidebar.block.common.php b/data/templates/sidebar.block.common.php deleted file mode 100644 index 951ed80..0000000 --- a/data/templates/sidebar.block.common.php +++ /dev/null @@ -1,28 +0,0 @@ -getRelatedTagsByHash($hash); -$commonTags =& $b2tservice->tagCloud($commonTags, 5, 90, 225, 'alphabet_asc'); - -if ($commonTags && count($commonTags) > 0) { - ?> - -

-
-

'. filter($row['tag']) .' '; -} -echo $contents ."\n"; -?>

-
- - diff --git a/data/templates/sidebar.block.linked.php b/data/templates/sidebar.block.linked.php deleted file mode 100644 index 9aa3cc0..0000000 --- a/data/templates/sidebar.block.linked.php +++ /dev/null @@ -1,66 +0,0 @@ -getCurrentUserId(); -$editingMode = $logged_on_userid !== false; -?> -

- \ No newline at end of file diff --git a/data/templates/sidebar.block.menu.php b/data/templates/sidebar.block.menu.php deleted file mode 100644 index 94a9fa2..0000000 --- a/data/templates/sidebar.block.menu.php +++ /dev/null @@ -1,80 +0,0 @@ -getCurrentUserId(); -if ($logged_on_userid === false) { - $logged_on_userid = NULL; -} - -// editing mode -if(($logged_on_userid != null) && ($userid === $logged_on_userid)) { - $editingMode = true; -} else { - $editingMode = false; -} - -if(!isset($user) || $user == '') { - $cat_url = createURL('tags', '%2$s'); -} - -$menuTags = $tag2tagservice->getMenuTags($userid); -if (sizeof($menuTags) > 0 || ($userid != 0 && $userid === $logged_on_userid)) { -?> - -

-'.T_('Menu Tags').' '; - //} -?> -

- - - - - diff --git a/data/templates/sidebar.block.menu2.php b/data/templates/sidebar.block.menu2.php deleted file mode 100644 index 1c177a5..0000000 --- a/data/templates/sidebar.block.menu2.php +++ /dev/null @@ -1,71 +0,0 @@ -getCurrentUserId(); -if ($logged_on_userid === false) { - $logged_on_userid = NULL; -} - - -$cat_url = createURL('tags', '%s'); -$menu2Tags = $GLOBALS['menu2Tags']; - -if (count($menu2Tags) > 0) { -?> - -

- - -
> -
    -' - . sprintf( - '%s', - sprintf($cat_url, $menu2Tag), - $menu2Tag - ) - . '' . "\n"; -} -?> -
-
- - diff --git a/data/templates/sidebar.block.popular.php b/data/templates/sidebar.block.popular.php deleted file mode 100644 index 50756c0..0000000 --- a/data/templates/sidebar.block.popular.php +++ /dev/null @@ -1,44 +0,0 @@ -getCurrentUserId(); -if ($logged_on_userid === false) { - $logged_on_userid = NULL; -} -$popularTags =& $b2tservice->getPopularTags($userid, $popCount, $logged_on_userid); -$popularTags =& $b2tservice->tagCloud($popularTags, 5, 90, 225, 'alphabet_asc'); - -if ($popularTags && count($popularTags) > 0) { -?> - -

- - - diff --git a/data/templates/sidebar.block.recent.php b/data/templates/sidebar.block.recent.php deleted file mode 100644 index 1ffeb4d..0000000 --- a/data/templates/sidebar.block.recent.php +++ /dev/null @@ -1,39 +0,0 @@ -getCurrentUserId(); -if ($logged_on_userid === false) { - $logged_on_userid = NULL; -} -$recentTags = $b2tservice->getPopularTags($userid, $popCount, $logged_on_userid, $GLOBALS['defaultRecentDays']); -$recentTags =& $b2tservice->tagCloud($recentTags, 5, 90, 225, 'alphabet_asc'); - -if ($recentTags && count($recentTags) > 0) { -?> - -

-
- '; - - if(!isset($user) || $user == '') { - $user = ''; - $cat_url = createURL('tags', '%2$s'); - } - - foreach ($recentTags as $row) { - $entries = T_ngettext('bookmark', 'bookmarks', $row['bCount']); - $contents .= ' '; - } - echo $contents ."

\n"; - ?> -

-
- - diff --git a/data/templates/sidebar.block.related.php b/data/templates/sidebar.block.related.php deleted file mode 100644 index 60ee486..0000000 --- a/data/templates/sidebar.block.related.php +++ /dev/null @@ -1,40 +0,0 @@ -getCurrentUserId(); -if ($logged_on_userid === false) { - $logged_on_userid = NULL; -} - -if(!isset($userid)) { - $userid = NULL; -} - -if(isset($user) && strlen($user)==0) { - $cat_url = createURL('tags', '%2$s'); -} -if ($currenttag) { - $relatedTags = $b2tservice->getRelatedTags($currenttag, $userid, $logged_on_userid); - if (sizeof($relatedTags) > 0) { -?> - -

- - - diff --git a/data/templates/sidebar.block.search.php b/data/templates/sidebar.block.search.php deleted file mode 100644 index d3cd8a5..0000000 --- a/data/templates/sidebar.block.search.php +++ /dev/null @@ -1,51 +0,0 @@ - - * @author Christian Weiske - * @author Eric Dane - * @license GPL http://www.gnu.org/licenses/gpl.html - * @link http://sourceforge.net/projects/semanticscuttle - */ -/* Service creation: only useful services are created */ -$searchhistoryservice = SemanticScuttle_Service_Factory::get('SearchHistory'); - -$lastSearches = $searchhistoryservice->getAllSearches( - 'all', NULL, 3, NULL, true, false -); - -if ($lastSearches && count($lastSearches) > 0) { -?> - -

-
- -' . "\n"; -} -//echo ''; -?> - -
'; - echo ''; - echo htmlspecialchars($row['shTerms']); - echo ''; - echo ' (' . $row['shNbResults'] . ')'; - echo '
...
-
- diff --git a/data/templates/sidebar.block.tagactions.php b/data/templates/sidebar.block.tagactions.php deleted file mode 100644 index 3351866..0000000 --- a/data/templates/sidebar.block.tagactions.php +++ /dev/null @@ -1,35 +0,0 @@ -isLoggedOn()) { - - if ($currentUser->getUsername() == $user) { - $tags = explode('+', $currenttag); - $renametext = T_ngettext('Rename Tag', 'Rename Tags', count($tags)); - $renamelink = createURL('tagrename', $currenttag); - $deletelink = createURL('tagdelete', $currenttag); - $tagdesclink = createURL('tagedit', $currenttag); - $commondesclink = createURL('tagcommondescriptionedit', $currenttag); - $addtag2taglinklink = createURL('tag2tagadd', $currenttag); -?> - -

-
-
    -
  • - -
  • - -
  • - isAdmin() )): ?> -
  • - -
  • -
-
- - diff --git a/data/templates/sidebar.block.users.php b/data/templates/sidebar.block.users.php deleted file mode 100644 index 58fdfb7..0000000 --- a/data/templates/sidebar.block.users.php +++ /dev/null @@ -1,34 +0,0 @@ -getCurrentUserId(); -if ($logged_on_userid === false) { - $logged_on_userid = NULL; -} -$lastUsers = $userservice->getUsers(3); - -if ($lastUsers && count($lastUsers) > 0) { -?> - -

-
- -'; -} -//echo ''; -?> - -
'; - echo ''; - echo SemanticScuttle_Model_UserArray::getName($row); - echo ''; - echo ' ('.T_('bookmarks').')'; - echo '
...
-

-
- diff --git a/data/templates/sidebar.block.watchlist.php b/data/templates/sidebar.block.watchlist.php deleted file mode 100644 index 3af9c5a..0000000 --- a/data/templates/sidebar.block.watchlist.php +++ /dev/null @@ -1,60 +0,0 @@ -getWatchNames($userid); -$watchedBy = $userservice->getWatchNames($userid, true); - - -$closeContacts = array(); // people in my contacts list and who I am also in the contacts list -foreach($watching as $watchuser) { - if(in_array($watchuser, $watchedBy)) { - $closeContacts[] = $watchuser; - } -} - -?> - -0):?> -

-
-
    - -
  • - -
-
- - - -

-
-
    - isLoggedOn() && $currentUser->getUsername() == $user): ?> -
  • -
    - -
    -
  • - - - -
  • - isLoggedOn() && $currentUser->getUsername() == $user): ?> - - x -
  • - - - -
-
- -

-
-
    - -
  • - -
- -
diff --git a/data/templates/sidebar.block.watchstatus.php b/data/templates/sidebar.block.watchstatus.php deleted file mode 100644 index 99574aa..0000000 --- a/data/templates/sidebar.block.watchstatus.php +++ /dev/null @@ -1,28 +0,0 @@ -isLoggedOn()) { - - if ($currentUser->getUsername() != $user) { - $result = $userservice->getWatchStatus($userid, $userservice->getCurrentUserId()); - if ($result) { - $linkText = T_('Remove from Watchlist'); - } else { - $linkText = T_('Add to Watchlist'); - } - $linkAddress = createURL('watch', $user); -?> - -

-
-
    -
  • -
-
- - \ No newline at end of file diff --git a/data/templates/sidebar.linkedtags.inc.php b/data/templates/sidebar.linkedtags.inc.php deleted file mode 100644 index 020d0f0..0000000 --- a/data/templates/sidebar.linkedtags.inc.php +++ /dev/null @@ -1,84 +0,0 @@ - '', 'stoplist' => $stopList); - } - - $tag2tagservice =SemanticScuttle_Service_Factory::get('Tag2Tag'); - $tagstatservice =SemanticScuttle_Service_Factory::get('TagStat'); - - // link '>' - if($level>1) { - if($editingMode) { - $link = '> '; - } else { - $link = '> '; - } - } else { - $link = ''; - } - - $output = ''; - $output.= ''; - $output.= ''; - $output.= ''; - $output.= $level == 1?'':''; - $output.= str_repeat(' ', $level*2) .$link.''; - $output.= $level == 1?'':''; - //$output.= ' - '. $tagstatservice->getMaxDepth($tag, $linkType, $uId); - - $synonymTags = $tag2tagservice->getAllLinkedTags($tag, '=', $uId); - $synonymTags = is_array($synonymTags)?$synonymTags:array($synonymTags); - sort($synonymTags); - $synonymList = ''; - foreach($synonymTags as $synonymTag) { - //$output.= ", ".$synonymTag; - $synonymList.= $synonymTag.' '; - } - if(count($synonymTags)>0) { - $output.= ', '.$synonymTags[0]; - } - if(count($synonymTags)>1) { - $output.= ', etc'; - } - - /*if($editingMode) { - $output.= ' ('; - $output.= '+'; - if(1) { - $output.= ' - '; - $output.= '-'; - } - $output.= ')'; - }*/ - $output.= ''; - $output.= ''; - - $tags = array($tag); - $tags = array_merge($tags, $synonymTags); - foreach($tags as $tag) { - - if(!in_array($tag, $stopList)) { - $linkedTags = $tag2tagservice->getLinkedTags($tag, '>', $uId); - $precedentTag = $tag; - $stopList[] = $tag; - foreach($linkedTags as $linkedTag) { - $displayLinkedTags = displayLinkedTags($linkedTag, $linkType, $uId, $cat_url, $user, $editingMode, $precedentTag, $level + 1, $stopList); - $output.= $displayLinkedTags['output']; - } - if(isset($displayLinkedTags) && is_array($displayLinkedTags['stopList'])) { - $stopList = array_merge($stopList, $displayLinkedTags['stopList']); - $stopList = array_unique($stopList); - } - } - - } - return array('output' => $output, 'stopList' => $stopList); -} - -?> diff --git a/data/templates/sidebar.tpl.php b/data/templates/sidebar.tpl.php deleted file mode 100644 index e823af5..0000000 --- a/data/templates/sidebar.tpl.php +++ /dev/null @@ -1,19 +0,0 @@ -isAdmin($userid)): ?> -