Merged changes form main trunk since 2.1RC
[fa-stable.git] / includes / ui / ui_input.inc
index a85f41a8f3af6285c8a1bf35280fe1887b3532c6..0a6adae119c6040809b68e5383a0b5078aa465ca 100644 (file)
@@ -486,22 +486,38 @@ function text_row_ex($label, $name, $size, $max=null, $title=null, $value=null,
 //-----------------------------------------------------------------------------------
 function email_row($label, $name, $value, $size, $max, $title=null, $params="", $post_label="")
 {
-       text_row("<a href='Mailto:".$_POST[$name]."'>$label</a>", $name, $value, $size, $max, $title, $params, $post_label);
+       if (get_post($name)) 
+               $label = "<a href='Mailto:".$_POST[$name]."'>$label</a>";
+       text_row($label, $name, $value, $size, $max, $title, $params, $post_label);
 }
 
 function email_row_ex($label, $name, $size, $max=null, $title=null, $value=null, $params=null, $post_label=null)
 {
-       text_row_ex("<a href='Mailto:".$_POST[$name]."'>$label</a>", $name, $size, $max, $title, $value, $params, $post_label);
+       if (get_post($name)) 
+               $label = "<a href='Mailto:".$_POST[$name]."'>$label</a>";
+       text_row_ex($label, $name, $size, $max, $title, $value, $params, $post_label);
 }
 
 function link_row($label, $name, $value, $size, $max, $title=null, $params="", $post_label="")
 {
-       text_row("<a href='".$_POST[$name]."' target='_blank'>$label</a>", $name, $value, $size, $max, $title, $params, $post_label);
+       $val = get_post($name);
+       if ($val) {
+               if (strpos($val,'http://')===false)
+                       $val = 'http://'.$val;
+               $label = "<a href='$val' target='_blank'>$label</a>";
+       }
+       text_row($label, $name, $value, $size, $max, $title, $params, $post_label);
 }
 
 function link_row_ex($label, $name, $size, $max=null, $title=null, $value=null, $params=null, $post_label=null)
 {
-       text_row_ex("<a href='".$_POST[$name]."' target='_blank'>$label</a>", $name, $size, $max, $title, $value, $params, $post_label);
+       $val = get_post($name);
+       if ($val) {
+               if (strpos($val,'http://')===false)
+                       $val = 'http://'.$val;
+               $label = "<a href='$val' target='_blank'>$label</a>";
+       }
+       text_row_ex($label, $name, $size, $max, $title, $value, $params, $post_label);
 }
 
 //-----------------------------------------------------------------------------------