projects
/
squirrelmail.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed fuzzy header and incorrectly reported string format.
[squirrelmail.git]
/
functions
/
html.php
diff --git
a/functions/html.php
b/functions/html.php
index 62bcafcf13899962058621378416d1afee2ed26d..3a6c4142e06f133885a064c6868adceab922e867 100644
(file)
--- a/
functions/html.php
+++ b/
functions/html.php
@@
-3,7
+3,7
@@
/**
* html.php
*
/**
* html.php
*
- * Copyright (c) 1999-200
2
The SquirrelMail Project Team
+ * Copyright (c) 1999-200
3
The SquirrelMail Project Team
* Licensed under the GNU GPL. For full terms see the file COPYING.
*
* The idea is to inlcude here some functions to make easier
* Licensed under the GNU GPL. For full terms see the file COPYING.
*
* The idea is to inlcude here some functions to make easier
@@
-14,7
+14,7
@@
*/
function html_tag( $tag, // Tag to output
*/
function html_tag( $tag, // Tag to output
- $val = '', // Value between tags
(if empty only start tag is issued)
+ $val = '', // Value between tags
$align = '', // Alignment
$bgcolor = '', // Back color
$xtra = '' ) { // Extra options
$align = '', // Alignment
$bgcolor = '', // Back color
$xtra = '' ) { // Extra options
@@
-23,10
+23,10
@@
$align = strtolower( $align );
$bgc = '';
$align = strtolower( $align );
$bgc = '';
- $tag = strto
upp
er( $tag );
+ $tag = strto
low
er( $tag );
if ( isset( $languages[$squirrelmail_language]['DIR']) ) {
if ( isset( $languages[$squirrelmail_language]['DIR']) ) {
- $dir = $languages[$squirrelmail_language]['DIR'];
+
$dir = $languages[$squirrelmail_language]['DIR'];
} else {
$dir = 'ltr';
}
} else {
$dir = 'ltr';
}
@@
-40,7
+40,7
@@
}
if ( $bgcolor <> '' ) {
}
if ( $bgcolor <> '' ) {
- $bgc = "
BGCOLOR
=\"$bgcolor\"";
+ $bgc = "
bgcolor
=\"$bgcolor\"";
}
switch ( $align ) {
}
switch ( $align ) {
@@
-48,38
+48,39
@@
$alg = '';
break;
case 'right':
$alg = '';
break;
case 'right':
- $alg = "
ALIGN
=\"$rgt\"";
+ $alg = "
align
=\"$rgt\"";
break;
case 'left':
break;
case 'left':
- $alg = "
ALIGN
=\"$lft\"";
+ $alg = "
align
=\"$lft\"";
break;
default:
break;
default:
- $alg = "
ALIGN
=\"$align\"";
+ $alg = "
align
=\"$align\"";
break;
}
$ret = "<$tag";
if ( $dir <> 'ltr' ) {
break;
}
$ret = "<$tag";
if ( $dir <> 'ltr' ) {
- $ret .= "
DIR
=\"$dir\"";
+ $ret .= "
dir
=\"$dir\"";
}
}
- $ret .=
"$bgc$alg"
;
+ $ret .=
$bgc . $alg
;
if ( $xtra <> '' ) {
$ret .= " $xtra";
}
if ( $xtra <> '' ) {
$ret .= " $xtra";
}
- $ret .= '>';
if ( $val <> '' ) {
if ( $val <> '' ) {
- $ret .= "$val</$tag>";
- }
+ $ret .= ">$val</$tag>";
+ } else {
+ $ret .= '>';
+ }
return( $ret );
}
/* handy function to set url vars */
/* especially usefull when $url = $PHP_SELF */
return( $ret );
}
/* handy function to set url vars */
/* especially usefull when $url = $PHP_SELF */
- function set_url_var($url, $var, $val=0) {
+ function set_url_var($url, $var, $val=0
, $link=true
) {
$k = '';
$ret = '';
$pat_a = array (
$k = '';
$ret = '';
$pat_a = array (
@@
-88,7
+89,7
@@
'/.+(\\?'.$var.')=(.*)$/AU', /* at front and only var */
'/.+(\\&'.$var.')=(.*)$/AU' /* at the end */
);
'/.+(\\?'.$var.')=(.*)$/AU', /* at front and only var */
'/.+(\\&'.$var.')=(.*)$/AU' /* at the end */
);
-
//
preg_replace('/&/','&',$url);
+
preg_replace('/&/','&',$url);
switch (true) {
case (preg_match($pat_a[0],$url,$regs)):
$k = $regs[1];
switch (true) {
case (preg_match($pat_a[0],$url,$regs)):
$k = $regs[1];
@@
-120,7
+121,9
@@
if ($k) {
if ($val) {
$rpl = "$k=$val";
if ($k) {
if ($val) {
$rpl = "$k=$val";
-// $rpl = preg_replace('/&/','&',$rpl);
+ if ($link) {
+ $rpl = preg_replace('/&/','&',$rpl);
+ }
} else {
$rpl = '';
}
} else {
$rpl = '';
}