[prev in list] [next in list] [prev in thread] [next in thread] 

List:       squirrelmail-cvs
Subject:    [SM-CVS] CVS: squirrelmail/functions mailbox_display.php,1.414,1.415
From:       Tomas Kuliavas <tokul () users ! sourceforge ! net>
Date:       2004-09-29 18:03:31
Message-ID: E1CCinb-0006Ec-Cm () sc8-pr-cvs1 ! sourceforge ! net
[Download RAW message or body]

Update of /cvsroot/squirrelmail/squirrelmail/functions
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23028

Modified Files:
	mailbox_display.php 
Log Message:
fixed toggle all link for browsers without JS support. older implementation 
used $mailbox variable and created longer url after each click. it still need 
fixes for message moving and maybe for search.


Index: mailbox_display.php
===================================================================
RCS file: /cvsroot/squirrelmail/squirrelmail/functions/mailbox_display.php,v
retrieving revision 1.414
retrieving revision 1.415
diff -u -w -r1.414 -r1.415
--- mailbox_display.php	8 Sep 2004 03:28:33 -0000	1.414
+++ mailbox_display.php	29 Sep 2004 18:03:21 -0000	1.415
@@ -1442,22 +1442,50 @@
 //                . <a href="javascript:void(0)" onClick="' . $func_name . '();">' . \
_("Toggle All")  //                . "</a>\n";
     } else {
+        $result .= "<a href=\"$PHP_SELF";
+        // FIXME: why strpos() is used to detect presense of the symbol in the \
string. +        // Function returns boolean value only when symbol is not found
         if (strpos($PHP_SELF, "?")) {
-            $result .= "<a href=\"$PHP_SELF&amp;mailbox=" . \
                urlencode($aMailbox['NAME'])
-                    .  \
"&amp;startMessage=$aMailbox[PAGEOFFSET]&amp;srt=$aMailbox[SORT]&amp;checkall="; +    \
$prefix = '&amp;';  } else {
-            $result .= "<a href=\"$PHP_SELF?mailbox=" . urlencode($mailbox)
-                    .  \
"&amp;startMessage=$aMailbox[PAGEOFFSET]&amp;srt=$aMailbox[SORT]&amp;checkall="; +    \
$prefix = '?';  }
+
+        // If variables are part of GET request, they are present in $PHP_SELF
+        // maybe other functions can be used instead of sqgetGlobalVar (like \
preg_match) +        if (! sqgetGlobalVar('mailbox',$tmp,SQ_GET)) {
+            $result .= $prefix . 'mailbox=' . urlencode($aMailbox['NAME']);
+            $prefix = '&amp;';
+        }
+        if (! sqgetGlobalVar('startMessage',$tmp,SQ_GET)) {
+            $result .= $prefix . 'startMessage=' . $aMailbox['PAGEOFFSET'];
+            $prefix = '&amp;';
+        }
+        if (! sqgetGlobalVar('str',$tmp,SQ_GET)) {
+            $result .= $prefix . 'str=' . $aMailbox['SORT'];
+            $prefix = '&amp;';
+        }
+
         if (isset($checkall) && $checkall == '1') {
-            $result .= '0';
+            $checkall_val = '0';
+        } else {
+            $checkall_val = '1';
+        }
+        if (! sqgetGlobalVar('checkall',$tmp,SQ_GET) ) {
+            $result .= $prefix . 'checkall=' . $checkall_val;
+            $prefix = '&amp;';
         } else {
-            $result .= '1';
+            // checkall is already present in php_self. replace it
+            $result = \
preg_replace("/checkall=(\d)/","checkall=$checkall_val",$result);  }
 
-        if (isset($aMailbox['SEARCH']) && $aMailbox['SEARCH'][0]) {
-            $result .= '&amp;where=' . urlencode($aMailbox['SEARCH'][0])
-                    .  '&amp;what=' .  urlencode($aMailbox['SEARCH'][1]);
+        // FIXME: I suspect that search pages use different variables in 1.5.1cvs 
+        // and these variables are present in $PHP_SELF.
+        if (isset($aMailbox['SEARCH']) && isset($aMailbox['SEARCH'][0]) && ! \
sqgetGlobalVar('where',$tmp,SQ_GET)) { +            $result .= '&amp;where=' . \
urlencode($aMailbox['SEARCH'][0]); +            if (isset($aMailbox['SEARCH'][1]) && \
! sqgetGlobalVar('what',$tmp,SQ_GET)) { +                $result .= '&amp;what=' .  \
urlencode($aMailbox['SEARCH'][1]); +		    }
         }
         $result .= "\">";
         $result .= _("All");



-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
--
squirrelmail-cvs mailing list
List Address: squirrelmail-cvs@lists.sourceforge.net
List Info: https://lists.sourceforge.net/lists/listinfo/squirrelmail-cvs
http://squirrelmail.org/cvs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic