From 6d6e066f23a272719312bc6efbef907e0e9668b9 Mon Sep 17 00:00:00 2001 From: thomascube Date: Thu, 31 Jul 2008 16:40:09 +0000 Subject: Code cleanup with new html classes --- program/include/html.php | 2 +- program/include/main.inc | 119 ++++++++++----------- program/steps/settings/func.inc | 232 +++++++++++++++++----------------------- 3 files changed, 153 insertions(+), 200 deletions(-) diff --git a/program/include/html.php b/program/include/html.php index 4a79def91..236dec291 100644 --- a/program/include/html.php +++ b/program/include/html.php @@ -145,7 +145,7 @@ class html if (is_string($attr)) { $attr = array('href' => $attr); } - return self::tag('a', $attr, $cont, array_merge(self::$common_attrib, array('href','target','name','onclick','onmouseover','onmouseout'))); + return self::tag('a', $attr, $cont, array_merge(self::$common_attrib, array('href','target','name','onclick','onmouseover','onmouseout','onmousedown','onmouseup'))); } /** diff --git a/program/include/main.inc b/program/include/main.inc index 65b322f8e..c2a35c695 100644 --- a/program/include/main.inc +++ b/program/include/main.inc @@ -463,9 +463,10 @@ function get_input_value($fname, $source, $allow_html=FALSE, $charset=NULL) * Remove all non-ascii and non-word chars * except . and - */ -function asciiwords($str) +function asciiwords($str, $css_id = false) { - return preg_replace('/[^a-z0-9._-]/i', '', $str); + $allowed = 'a-z0-9\_\-' . (!$css_id ? '\.' : ''); + return preg_replace("/[^$allowed]/i", '', $str); } /** @@ -887,22 +888,11 @@ function rcmail_mailbox_list($attrib) // $mboxlist_start = rcube_timer(); $type = $attrib['type'] ? $attrib['type'] : 'ul'; - $add_attrib = $type=='select' ? array('style', 'class', 'id', 'name', 'onchange') : - array('style', 'class', 'id'); - + unset($attrib['type']); + if ($type=='ul' && !$attrib['id']) $attrib['id'] = 'rcmboxlist'; - // allow the following attributes to be added to the