From b7827e6ea1619e5606011990d6b25e935b215f08 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Fri, 06 Feb 2009 04:34:02 -0500
Subject: [PATCH] - allow printing drafts

---
 program/include/html.php |   41 +++++++++++++++++++++++++++++++++++++++--
 1 files changed, 39 insertions(+), 2 deletions(-)

diff --git a/program/include/html.php b/program/include/html.php
index 73b0b33..01ad415 100644
--- a/program/include/html.php
+++ b/program/include/html.php
@@ -5,7 +5,7 @@
  | program/include/html.php                                              |
  |                                                                       |
  | This file is part of the RoundCube Webmail client                     |
- | Copyright (C) 2005-2008, RoundCube Dev, - Switzerland                 |
+ | Copyright (C) 2005-2009, RoundCube Dev, - Switzerland                 |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  | PURPOSE:                                                              |
@@ -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
@@ -642,6 +669,16 @@
         unset($this->attrib['cols'], $this->attrib['rowsonly']);
         return parent::show();
     }
+    
+    /**
+     * Count number of rows
+     *
+     * @return The number of rows
+     */
+    public function size()
+    {
+      return count($this->rows);
+    }
 }
 
 ?>

--
Gitblit v1.9.1