Interface fix: make consistent the general navigation between personal and common spaces

git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@47 b3834d28-1941-0410-a4f8-b48e95affb8f
This commit is contained in:
mensonge 2008-02-20 13:43:06 +00:00
parent 76ed2e494b
commit fd6dca8104
9 changed files with 51 additions and 8 deletions

View file

@ -73,7 +73,8 @@ if ($bookmark =& $bookmarkservice->getBookmarkByHash($hash)) {
$tplVars['hash'] = $hash; $tplVars['hash'] = $hash;
$tplVars['popCount'] = 50; $tplVars['popCount'] = 50;
$tplVars['sidebar_blocks'] = array('common'); $tplVars['sidebar_blocks'] = array('common');
$tplVars['cat_url'] = createURL('tags', '%2$s'); //$tplVars['cat_url'] = createURL('tags', '%2$s');
$tplVars['cat_url'] = createURL('bookmarks', '%1$s/%2$s');
$tplVars['nav_url'] = createURL('history', $hash .'/%3$s'); $tplVars['nav_url'] = createURL('history', $hash .'/%3$s');
$templateservice->loadTemplate('bookmarks.tpl', $tplVars); $templateservice->loadTemplate('bookmarks.tpl', $tplVars);
} else { } else {

View file

@ -75,7 +75,7 @@ $tplVars['bookmarkCount'] = $start + 1;
$bookmarks =& $bookmarkservice->getBookmarks($start, $perpage, NULL, NULL, NULL, getSortOrder(), NULL, 0, $dtend); $bookmarks =& $bookmarkservice->getBookmarks($start, $perpage, NULL, NULL, NULL, getSortOrder(), NULL, 0, $dtend);
$tplVars['total'] = $bookmarks['total']; $tplVars['total'] = $bookmarks['total'];
$tplVars['bookmarks'] =& $bookmarks['bookmarks']; $tplVars['bookmarks'] =& $bookmarks['bookmarks'];
$tplVars['cat_url'] = createURL('tags', '%2$s'); $tplVars['cat_url'] = createURL('bookmarks', '%1$s/%2$s');
$tplVars['nav_url'] = createURL('index', '%3$s'); $tplVars['nav_url'] = createURL('index', '%3$s');
$tplVars['summarizeLinkedTags'] = true; $tplVars['summarizeLinkedTags'] = true;

View file

@ -76,7 +76,7 @@ $tplVars['bookmarkCount'] = $start + 1;
$bookmarks =& $bookmarkservice->getBookmarks($start, $perpage, NULL, $cat, NULL, getSortOrder()); $bookmarks =& $bookmarkservice->getBookmarks($start, $perpage, NULL, $cat, NULL, getSortOrder());
$tplVars['total'] = $bookmarks['total']; $tplVars['total'] = $bookmarks['total'];
$tplVars['bookmarks'] =& $bookmarks['bookmarks']; $tplVars['bookmarks'] =& $bookmarks['bookmarks'];
$tplVars['cat_url'] = createURL('tags', '%2$s'); $tplVars['cat_url'] = createURL('bookmarks', '%1$s/%2$s');
$tplVars['nav_url'] = createURL('tags', '%2$s%3$s'); $tplVars['nav_url'] = createURL('tags', '%2$s%3$s');
$templateservice->loadTemplate('bookmarks.tpl', $tplVars); $templateservice->loadTemplate('bookmarks.tpl', $tplVars);

View file

@ -4,6 +4,9 @@ $bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
$cdservice =& ServiceFactory::getServiceInstance('CommonDescriptionService'); $cdservice =& ServiceFactory::getServiceInstance('CommonDescriptionService');
$logged_on_userid = $userservice->getCurrentUserId(); $logged_on_userid = $userservice->getCurrentUserId();
$currentUser = $userservice->getCurrentUser();
$currentUsername = $currentUser[$userservice->getFieldName('username')];
$this->includeTemplate($GLOBALS['top_include']); $this->includeTemplate($GLOBALS['top_include']);
include('search.inc.php'); include('search.inc.php');
@ -54,8 +57,26 @@ window.onload = playerLoad;
<?php <?php
} }
?> ?>
<?php
if(isset($currenttag)) {
if(isset($user)) {
echo ' - ';
echo '<a href="'. createURL('tags', $currenttag) .'">';
echo T_('Bookmarks from other users for these tags').'</a>';
//echo T_(' for these tags');
} else if($logged_on_userid>0){
echo ' - ';
echo '<a href="'. createURL('bookmarks', $currentUsername.'/'.$currenttag) .'">';
echo T_('Only your bookmarks for these tags').'</a>';
//echo T_(' for these tags');
}
}
?>
</p> </p>
<ol<?php echo ($start > 0 ? ' start="'. ++$start .'"' : ''); ?> id="bookmarks"> <ol<?php echo ($start > 0 ? ' start="'. ++$start .'"' : ''); ?> id="bookmarks">
<?php <?php
@ -76,8 +97,9 @@ window.onload = playerLoad;
$cats = ''; $cats = '';
$tags = $row['tags']; $tags = $row['tags'];
foreach(array_keys($tags) as $key) { foreach(array_keys($tags) as $key) {
$tag =& $tags[$key]; $tag =& $tags[$key];
$cats .= '<a href="'. sprintf($cat_url, filter($user, 'url'), filter($tag, 'url')) .'" rel="tag">'. filter($tag) .'</a>, '; $cats .= '<a href="'. sprintf($cat_url, filter($row['username'], 'url'), filter($tag, 'url')) .'" rel="tag">'. filter($tag) .'</a>, ';
} }
$cats = substr($cats, 0, -2); $cats = substr($cats, 0, -2);
if ($cats != '') { if ($cats != '') {

View file

@ -11,6 +11,11 @@ if ($commonTags && count($commonTags) > 0) {
<p class="tags"> <p class="tags">
<?php <?php
$contents = ''; $contents = '';
if(strlen($user)==0) {
$cat_url = createURL('tags', '%2$s');
}
foreach ($commonTags as $row) { foreach ($commonTags as $row) {
$entries = T_ngettext('bookmark', 'bookmarks', $row['bCount']); $entries = T_ngettext('bookmark', 'bookmarks', $row['bCount']);
$contents .= '<a href="'. sprintf($cat_url, $user, filter($row['tag'], 'url')) .'" title="'. $row['bCount'] .' '. $entries .'" rel="tag" style="font-size:'. $row['size'] .'">'. filter($row['tag']) .'</a> '; $contents .= '<a href="'. sprintf($cat_url, $user, filter($row['tag'], 'url')) .'" title="'. $row['bCount'] .' '. $entries .'" rel="tag" style="font-size:'. $row['size'] .'">'. filter($row['tag']) .'</a> ';

View file

@ -118,6 +118,10 @@ if ($currenttag) {
echo '</td></tr>'; echo '</td></tr>';
} }
if(strlen($user)==0) {
$cat_url = createURL('tags', '%2$s');
}
$stopList = array(); $stopList = array();
foreach($explodedTags as $explodedTag) { foreach($explodedTags as $explodedTag) {
if(!in_array($explodedTag, $stopList)) { if(!in_array($explodedTag, $stopList)) {

View file

@ -17,6 +17,11 @@ if ($popularTags && count($popularTags) > 0) {
<p class="tags"> <p class="tags">
<?php <?php
$contents = ''; $contents = '';
if(strlen($user)==0) {
$cat_url = createURL('tags', '%2$s');
}
foreach ($popularTags as $row) { foreach ($popularTags as $row) {
$entries = T_ngettext('bookmark', 'bookmarks', $row['bCount']); $entries = T_ngettext('bookmark', 'bookmarks', $row['bCount']);
$contents .= '<a href="'. sprintf($cat_url, $user, filter($row['tag'], 'url')) .'" title="'. $row['bCount'] .' '. $entries .'" rel="tag" style="font-size:'. $row['size'] .'">'. filter($row['tag']) .'</a> '; $contents .= '<a href="'. sprintf($cat_url, $user, filter($row['tag'], 'url')) .'" title="'. $row['bCount'] .' '. $entries .'" rel="tag" style="font-size:'. $row['size'] .'">'. filter($row['tag']) .'</a> ';

View file

@ -16,6 +16,11 @@ if ($recentTags && count($recentTags) > 0) {
<div id="recent"> <div id="recent">
<?php <?php
$contents = '<p class="tags">'; $contents = '<p class="tags">';
if(strlen($user)==0) {
$cat_url = createURL('tags', '%2$s');
}
foreach ($recentTags as $row) { foreach ($recentTags as $row) {
$entries = T_ngettext('bookmark', 'bookmarks', $row['bCount']); $entries = T_ngettext('bookmark', 'bookmarks', $row['bCount']);
$contents .= '<a href="'. sprintf($cat_url, $user, filter($row['tag'], 'url')) .'" title="'. $row['bCount'] .' '. $entries .'" rel="tag" style="font-size:'. $row['size'] .'">'. filter($row['tag']) .'</a> '; $contents .= '<a href="'. sprintf($cat_url, $user, filter($row['tag'], 'url')) .'" title="'. $row['bCount'] .' '. $entries .'" rel="tag" style="font-size:'. $row['size'] .'">'. filter($row['tag']) .'</a> ';

View file

@ -1,5 +1,6 @@
<div id="sidebar"> <div id="sidebar">
<?php <?php
$size = count($sidebar_blocks); $size = count($sidebar_blocks);
for ($i = 0; $i < $size; $i++) { for ($i = 0; $i < $size; $i++) {
$this->includeTemplate('sidebar.block.'. $sidebar_blocks[$i]); $this->includeTemplate('sidebar.block.'. $sidebar_blocks[$i]);