]> gitweb.fluxo.info Git - semanticscuttle.git/commitdiff
Interface fix: allows to remove a tag from selection in subtitle bar thanks to a *
authormensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>
Thu, 18 Dec 2008 22:11:03 +0000 (22:11 +0000)
committermensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>
Thu, 18 Dec 2008 22:11:03 +0000 (22:11 +0000)
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@207 b3834d28-1941-0410-a4f8-b48e95affb8f

bookmarks.php
functions.inc.php
scuttle.css
tags.php

index 3a948efd5d0493c11b55c80f3e932a663ecc44c2..f8d73dee1b870e99521c93b136f772501b128f2b 100644 (file)
@@ -100,7 +100,15 @@ if ($user) {
 }
 if ($cat) {
        $catTitle = ': '. str_replace('+', ' + ', $cat);
-       $pagetitle .= $catTitle;
+       
+       $catTitleWithUrls = ': ';       
+       $titleTags = explode('+', filter($cat));        
+       for($i = 0; $i<count($titleTags);$i++) {
+               $catTitleWithUrls.= $titleTags[$i].'<a href="'.createUrl('bookmarks', $user.'/'.aggregateTags($titleTags, '+', $titleTags[$i])).'" title="'.T_('Remove the tag from the selection').'">*</a> + ';
+       }
+       $catTitleWithUrls = substr($catTitleWithUrls, 0, strlen($catTitleWithUrls) - strlen(' + '));
+
+       $pagetitle .= $catTitleWithUrls;
 }
 $pagetitle = substr($pagetitle, 2);
 
@@ -237,12 +245,17 @@ if ($templatename == 'editbookmark.tpl') {
        $tplVars['cat_url'] = createURL('bookmarks', '%s/%s');
        $tplVars['nav_url'] = createURL('bookmarks', '%s/%s%s');
        if ($userservice->isLoggedOn() && $user == $currentUsername) {
-               $title = T_('My Bookmarks') . filter($catTitle);
+               //$title = T_('My Bookmarks') . $catTitleWithUrls;
+               $tplVars['pagetitle'] = T_('My Bookmarks') . $catTitle;
+               $tplVars['subtitle'] =  T_('My Bookmarks') . $catTitleWithUrls;
        } else {
-               $title = filter($pagetitle);
+               //$title = $pagetitle;
+               //$tplVars['pagetitle'] = $pagetitle;
+               $tplVars['pagetitle'] = '';
+               $tplVars['subtitle'] = $pagetitle;
        }
-       $tplVars['pagetitle'] = $title;
-       $tplVars['subtitle'] = $title;
+       //$tplVars['pagetitle'] = $title;
+       //$tplVars['subtitle'] = $title;
 }
 
 $tplVars['summarizeLinkedTags'] = true;
index 4dd73f31721a08b204a2540b93e729d87058ef61..3ee0e9b363da5c5da7f589cdfdf98b98a95501c0 100644 (file)
@@ -115,6 +115,20 @@ function checkUrl($url, $checkOnline = true) {
        }
 }
 
+/* Returns a concatenated String
+ * including all the tags from the array $arrayTags (excepted of the $exceptedTag)
+ * separated by the $separator.
+ * */
+function aggregateTags($arrayTags, $separator = ' + ', $exceptedTag = '') {
+       $output = '';
+
+       for($i = 0; $i<count($arrayTags); $i++) {
+               if($arrayTags[$i] != $exceptedTag) {
+                       $output.= $arrayTags[$i] . $separator;
+               }
+       }
+       return substr($output, 0, strlen($output) - strlen($separator) );
+}
 
 function message_die($msg_code, $msg_text = '', $msg_title = '', $err_line = '', $err_file = '', $sql = '', $db = NULL) {
        if(defined('HAS_DIED'))
index 271416a2934e5637148fcd680561a4d13b452a16..9dfc0a4592464eaf248abe2ab3591b80eea3977a 100644 (file)
@@ -152,6 +152,9 @@ h2 {
     padding: 0.5em 1em;
     text-transform: lowercase;
 }
+h2 a, h2 a:hover {
+       color: #DDD;
+}
 
 /* NAVIGATION */
 
index bee3092b11da68243896438fdd0018881ea66103..358501cfe4fef193e3525612245d523d9d1252cf 100644 (file)
--- a/tags.php
+++ b/tags.php
@@ -39,10 +39,17 @@ list($url, $cat) = explode('/', $_SERVER['PATH_INFO']);
 if (!$cat) {
        header('Location: '. createURL('populartags'));
        exit;
-} else {
-       $cattitle = str_replace('+', ' + ', $cat);
 }
-$pagetitle = T_('Tags') .': '. $cattitle;
+
+$titleTags = explode('+', filter($cat));
+$pagetitle = T_('Tags') .': ';
+for($i = 0; $i<count($titleTags);$i++) {
+       $pagetitle.= $titleTags[$i].'<a href="'.createUrl('tags', aggregateTags($titleTags, '+', $titleTags[$i])).'" title="'.T_('Remove the tag from the selection').'">*</a> + ';
+}
+$pagetitle = substr($pagetitle, 0, strlen($pagetitle) - strlen(' + ')); 
+
+
+//$cattitle = str_replace('+', ' + ', $cat);
 
 if ($usecache) {
        // Generate hash for caching on
@@ -57,7 +64,8 @@ if ($usecache) {
 }
 
 // Header variables
-$tplVars['pagetitle'] = $pagetitle;
+//$tplVars['pagetitle'] = $pagetitle;
+$tplVars['pagetitle'] = '';
 $tplVars['loadjs'] = true;
 $tplVars['rsschannels'] = array(
 array(filter($sitename .': '. $pagetitle), createURL('rss', 'all/'. filter($cat, 'url')).'?sort='.getSortOrder())
@@ -78,7 +86,7 @@ $tplVars['start'] = $start;
 $tplVars['popCount'] = 25;
 $tplVars['currenttag'] = $cat;
 $tplVars['sidebar_blocks'] = array('linked', 'related', 'popular');
-$tplVars['subtitle'] = filter($pagetitle);
+$tplVars['subtitle'] = $pagetitle;
 $tplVars['bookmarkCount'] = $start + 1;
 $bookmarks =& $bookmarkservice->getBookmarks($start, $perpage, NULL, $cat, NULL, getSortOrder());
 $tplVars['total'] = $bookmarks['total'];
@@ -92,4 +100,5 @@ if ($usecache) {
        // Cache output if existing copy has expired
        $cacheservice->End($hash);
 }
+
 ?>