From 52851464e0267795ffd688e3c769d9161011dba8 Mon Sep 17 00:00:00 2001 From: alecpl <alec@alec.pl> Date: Thu, 02 Oct 2008 13:48:29 -0400 Subject: [PATCH] - Fix race conditions when changing mailbox (set some env variables only when needed - no action or action==list) --- program/include/html.php | 31 +++++++++++++++++++++++++++++-- 1 files changed, 29 insertions(+), 2 deletions(-) diff --git a/program/include/html.php b/program/include/html.php index 50689f2..9268aca 100644 --- a/program/include/html.php +++ b/program/include/html.php @@ -33,7 +33,7 @@ protected $content; public static $common_attrib = array('id','class','style','title','align'); - public static $containers = array('div','span','p','h1','h2','h3','form','textarea','table','tr','th','td','style'); + public static $containers = array('iframe','div','span','p','h1','h2','h3','form','textarea','table','tr','th','td','style'); public static $lc_tags = true; /** @@ -178,6 +178,21 @@ $attr = array('for' => $attr); } return self::tag('label', $attr, $cont, array_merge(self::$common_attrib, array('for'))); + } + + /** + * Derrived method to create <iframe></iframe> + * + * @param mixed Hash array with tag attributes or string with frame source (src) + * @return string HTML code + * @see html::tag() + */ + public static function iframe($attr = null, $cont = null) + { + if (is_string($attr)) { + $attr = array('src' => $attr); + } + return self::tag('iframe', $attr, $cont, array_merge(self::$common_attrib, array('src','name','width','height','border','frameborder'))); } /** @@ -576,7 +591,7 @@ public function add_header($attr, $cont) { if (is_string($attr)) - $attr = array('class' => $attr); + $attr = array('class' => $attr); $cell = new stdClass; $cell->attrib = $attr; @@ -598,6 +613,18 @@ $this->rows[$this->rowindex]->cells = array(); } + /** + * Set current row attrib + * + * @param array Row attributes + */ + public function set_row_attribs($attr = array()) + { + if (is_string($attr)) + $attr = array('class' => $attr); + + $this->rows[$this->rowindex]->attrib = $attr; + } /** * Build HTML output of the table data -- Gitblit v1.9.1