drop any double spaces since these will be displayed in the title-attribute
[squirrelmail.git] / doc / compose.txt
index 3d507353fdb67c41aca093fe5e5e9b5d5f4eaca3..4ac8fb2a64eb098010b7f55495323aca84154ffe 100644 (file)
@@ -1,18 +1,34 @@
-Using the comp_in_new function
-==============================
+Creating Links to compose.php easily
+====================================
 
-comp_in_new is the javascript function to popup a new compose window.
+makeComposeLink() PHP function helps to create links to the compose page
+easily, taking into account the user's settings, "Compose in new window" and
+"Use javascript". Here's how to use it:
+
+1) Build the last part of the URL as follows:
+   $comp_uri = 'src/compose.php?mailbox='.$mailboxbox.'&send_to='.urlencode($usermail);
+
+2) The display part of the link can be anything you like (such the name of the user):
+   $disp = 'The user's name';
+
+3) Print it:
+   echo makeComposeLink($comp_uri, $disp);
 
-the function needs two arguments:
-1) compose new message (true or false)
-2) url with arguments to the compose window.
+makeComposeLink() has been available since SquirrelMail 1.4.2.
 
-if argument 1 is true then argument 2 should be ""
 
 
+Using the comp_in_new javascript function
+=========================================
+
+comp_in_new is the javascript function to popup a new compose window.
+
+the function needs one argument:
+1) url with arguments to the compose window.
+
 example 1:
-<a href="javascript:void(0)" onclick="comp_in_new(true,"")> 
+<a href="javascript:void(0)" onclick="comp_in_new("")>
 
 example 2:
-<a href="javascript:void(0)" onclick="comp_in_new(false,"../../src/compose.php?argument1=true&amp;argument2=test")> 
+<a href="javascript:void(0)" onclick="comp_in_new("../../src/compose.php?argument1=true&amp;argument2=test")>