Source for file html.php
Documentation is available at html.php
* The idea is to inlcude here some functions to make easier
* the right to left implementation by "functionize" some
* @copyright 1999-2020 The SquirrelMail Project Team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id: html.php 14840 2020-01-07 07:42:38Z pdontthink $
* NOTE! If $val is non-empty, a closing tag will be added after $val
* Otherwise, NO closing tag is provided!
* @param string $tag Tag to output
* @param string $val Value between tags
* @param string $align Alignment (left, center, etc)
* @param string $bgcolor Back color in hexadecimal
* @param string $xtra Extra options
* @return string HTML ready for output
function html_tag( $tag, // Tag to output
$val =
'', // Value between tags
$align =
'', // Alignment
$bgcolor =
'', // Back color
$xtra =
'' ) { // Extra options
if ( isset
( $languages[$squirrelmail_language]['DIR']) ) {
$dir =
$languages[$squirrelmail_language]['DIR'];
$bgc =
" bgcolor=\"$bgcolor\"";
$alg =
" align=\"$rgt\"";
$alg =
" align=\"$lft\"";
$alg =
" align=\"$align\"";
$ret .=
">$val</$tag>\n";
* This function is used to add, modify or delete GET variables in a URL.
* It is especially useful when $url = $PHP_SELF
* Set $val to NULL to remove $var from $url.
* To ensure compatibility with older versions, use $val='0' to set $var to 0.
* @param string $url url that must be modified
* @param string $var GET variable name
* @param string $val variable value (CANNOT be an array)
* @param boolean $link controls sanitizing of ampersand in urls (since 1.3.2)
* @param boolean $treat_as_array When TRUE, if $var is an array (it occurs one
* or more times with square brackets after it,
* e.g. "var[1]"), the whole array will be removed
* (when $val is NULL) or the given value will be
* added to the next array slot (@since 1.4.23/1.5.2)
* @return string $url modified url
function set_url_var($url, $var, $val=
null, $link=
true, $treat_as_array=
false) {
if (strpos($url, '?') ===
false) {
list
($uri, $params) =
explode('?', $url, 2);
foreach ($params as $p) {
$newpar[$p[0]] =
(isset
($p[1]) ?
$p[1] :
'');
if ($treat_as_array &&
preg_match('/(.*)\[(\d+)]$/', $p[0], $matches)) {
if (!isset
($array_names[$matches[1]])) $array_names[$matches[1]] =
array();
$array_names[$matches[1]][$matches[2]] =
$p[1];
if ($treat_as_array &&
!empty($array_names[$var])) {
foreach ($array_names[$var] as $key =>
$ignore)
unset
($newpar[$var .
'[' .
$key .
']']);
if ($treat_as_array &&
!empty($array_names[$var])) {
foreach ($array_names[$var] as $key =>
$ignore)
if ($key >=
$max_key) $max_key =
$key +
1;
$newpar[$var .
'[' .
$max_key .
']'] =
$val;
foreach ($newpar as $name =>
$value) {
/* Temporary test function to proces template vars with formatting.
* I use it for viewing the message_header (view_header.php) with
$frm_last =
count($format_ar) -
1;
if (isset
($format_ar[0])) echo
$format_ar[0];
foreach ($var as $a_el) {
if (isset
($format_ar[$i])) {
if (isset
($format_ar[$frm_last]) &&
$frm_last>
$i ) {
echo
$format_ar[$frm_last];
Documentation generated on Mon, 13 Jan 2020 04:24:41 +0100 by phpDocumentor 1.4.3