From df984f26669e0e3bfd6ede23e5bddfae8fd695ea Mon Sep 17 00:00:00 2001 From: mensonge Date: Tue, 25 Nov 2008 16:58:56 +0000 Subject: Interface fix: add an hyperlink from bookmark edition page to collaborative edition of the same bookmark git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@175 b3834d28-1941-0410-a4f8-b48e95affb8f --- bookmarkcommondescriptionedit.php | 9 ++++++++- services/bookmarkservice.php | 4 ++++ templates/bookmarkcommondescriptionedit.tpl.php | 2 +- templates/bookmarks.tpl.php | 4 ---- templates/editbookmark.tpl.php | 5 +++++ 5 files changed, 18 insertions(+), 6 deletions(-) diff --git a/bookmarkcommondescriptionedit.php b/bookmarkcommondescriptionedit.php index 1ac316e..ec7aee2 100644 --- a/bookmarkcommondescriptionedit.php +++ b/bookmarkcommondescriptionedit.php @@ -33,8 +33,15 @@ isset($_POST['cancel']) ? define('POST_CANCEL', $_POST['cancel']): define('POST_ isset($_POST['hash']) ? define('POST_HASH', $_POST['hash']): define('POST_HASH', ''); isset($_POST['title']) ? define('POST_TITLE', $_POST['title']): define('POST_TITLE', ''); isset($_POST['description']) ? define('POST_DESCRIPTION', $_POST['description']): define('POST_DESCRIPTION', ''); -isset($_POST['referrer']) ? define('POST_REFERRER', $_POST['referrer']): define('POST_REFERRER', ''); +// prevent cycle between personal and common edit page +if(!isset($_POST['referrer'])) { + define('POST_REFERRER', ''); +} elseif(strpos($_POST['referrer'], ROOT.'edit.php') == 0) { + define('POST_REFERRER', createUrl('history', POST_HASH)); +} else { + define('POST_REFERRER', $_POST['referrer']); +} list ($url, $hash) = explode('/', $_SERVER['PATH_INFO']); diff --git a/services/bookmarkservice.php b/services/bookmarkservice.php index 73cdf84..4c3cbca 100644 --- a/services/bookmarkservice.php +++ b/services/bookmarkservice.php @@ -66,6 +66,10 @@ class BookmarkService { function getBookmarkByHash($hash) { return $this->_getbookmark('bHash', $hash, true); } + + function countBookmarks($uId) { + + } function editAllowed($bookmark) { if (!is_numeric($bookmark) && (!is_array($bookmark) || !is_numeric($bookmark['bId']))) diff --git a/templates/bookmarkcommondescriptionedit.tpl.php b/templates/bookmarkcommondescriptionedit.tpl.php index 053ee30..ac3f540 100644 --- a/templates/bookmarkcommondescriptionedit.tpl.php +++ b/templates/bookmarkcommondescriptionedit.tpl.php @@ -15,7 +15,7 @@ window.onload = function() {
- +
diff --git a/templates/bookmarks.tpl.php b/templates/bookmarks.tpl.php index ce34634..7ab54ab 100644 --- a/templates/bookmarks.tpl.php +++ b/templates/bookmarks.tpl.php @@ -6,10 +6,6 @@ $bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService'); $tagservice =& ServiceFactory::getServiceInstance('TagService'); $cdservice =& ServiceFactory::getServiceInstance('CommonDescriptionService'); -//$logged_on_userid = $userservice->getCurrentUserId(); -//$currentUser = $userservice->getCurrentUser(); -//$currentUsername = $currentUser[$userservice->getFieldName('username')]; - // Momentary useful to go to object code $currentObjectUser = $userservice->getCurrentObjectUser(); diff --git a/templates/editbookmark.tpl.php b/templates/editbookmark.tpl.php index b112455..4f97dac 100644 --- a/templates/editbookmark.tpl.php +++ b/templates/editbookmark.tpl.php @@ -76,6 +76,11 @@ switch ($row['bStatus']) { '; + echo T_('edit common description').')'; + } + if ($popup) { ?> -- cgit v1.2.3-54-g00ecf