]> gitweb.fluxo.info Git - semanticscuttle.git/commitdiff
Interface fix: improve referer behaviour (going back to a page)
authormensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>
Wed, 4 Feb 2009 14:00:16 +0000 (14:00 +0000)
committermensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>
Wed, 4 Feb 2009 14:00:16 +0000 (14:00 +0000)
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@248 b3834d28-1941-0410-a4f8-b48e95affb8f

bookmarks.php
services/bookmarkservice.php
templates/editbookmark.tpl.php

index ee3f96b64d7b29aac02f0f221d5926200729bf1b..26bc55ffa1e14e9960e626723a1f29de1e1a9864 100644 (file)
@@ -41,6 +41,7 @@ isset($_POST['description']) ? define('POST_DESCRIPTION', $_POST['description'])
 isset($_POST['privateNote']) ? define('POST_PRIVATENOTE', $_POST['privateNote']): define('POST_PRIVATENOTE', '');
 isset($_POST['status']) ? define('POST_STATUS', $_POST['status']): define('POST_STATUS', '');
 isset($_POST['tags']) ? define('POST_TAGS', $_POST['tags']): define('POST_TAGS', '');
+isset($_POST['referrer']) ? define('POST_REFERRER', $_POST['referrer']): define('POST_REFERRER', '');
 
 isset($_GET['popup']) ? define('GET_POPUP', $_GET['popup']): define('GET_POPUP', '');
 isset($_POST['popup']) ? define('POST_POPUP', $_POST['popup']): define('POST_POPUP', '');
@@ -148,7 +149,10 @@ if ($userservice->isLoggedOn() && POST_SUBMITTED != '') {
                                        if ($GLOBALS['useredir']) {
                                                $address = $GLOBALS['url_redir'] . $address;
                                        }
-                                       //header('Location: '. $address); // not useful
+                                       
+                                       if(POST_REFERRER != '') {
+                                               header('Location: '. POST_REFERRER);
+                                       }die('pr'.POST_REFERRER);
                                }
                        } else {
                                $tplVars['error'] = T_('There was an error saving your bookmark. Please try again or contact the administrator.');
@@ -194,6 +198,7 @@ if ($templatename == 'editbookmark.tpl') {
                        );
                }
                $title = T_('Add a Bookmark');
+               $tplVars['referrer'] = $_SERVER['HTTP_REFERER'];
                $tplVars['pagetitle'] = $title;
                $tplVars['subtitle'] = $title;
                $tplVars['btnsubmit'] = T_('Add Bookmark');
@@ -262,6 +267,7 @@ if ($templatename == 'editbookmark.tpl') {
 $tplVars['summarizeLinkedTags'] = true;
 $tplVars['pageName'] = PAGE_BOOKMARKS;
 
+
 $templateservice->loadTemplate($templatename, $tplVars);
 
 if ($usecache && $endcache) {
index 1d72bc8fdf5be7f7d9f3a5d1c5398c92719a2c59..5a0137e2ca566e676cacbef063c69f9e62723ce0 100644 (file)
@@ -107,7 +107,11 @@ class BookmarkService {
                if (!($dbresult = & $this->db->sql_query($sql))) {
                        message_die(GENERAL_ERROR, 'Could not get vars', '', __LINE__, __FILE__, $sql, $this->db);
                }
-               $ouput = ($this->db->sql_fetchfield(0, 0) > 0); 
+               if($this->db->sql_fetchfield(0, 0) > 0) {
+                       $output = true; 
+               } else {
+                       $output = false;
+               }
                $this->db->sql_freeresult($dbresult);
                return $output;
        }
index b3514f34d853eff897f1300cc3fc8ae02e5a95f4..d6f21151b355857d74dbf3f331f06f5005ecbd71 100644 (file)
@@ -95,6 +95,7 @@ $this->includeTemplate("dojo.inc");
     <td></td>
     <td>
         <input type="submit" name="submitted" value="<?php echo $btnsubmit; ?>" />
+        <input type="button" name="cancel" value="<?php echo T_('Cancel') ?>" onclick="javascript: history.go(-1)" />
         <?php
         if (isset($showdelete) && $showdelete) {
         ?>