From b7d33e35186d47dcd3609e1ef97cdb011c6f82f6 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Tue, 28 Aug 2012 06:59:29 -0400
Subject: [PATCH] Added template object 'frame'

---
 CHANGELOG                             |    1 +
 program/include/rcube_output_html.php |   29 +++++++++++++++++++++++++++++
 2 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index 8e9dcb3..028eb19 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,7 @@
 CHANGELOG Roundcube Webmail
 ===========================
 
+- Added template object 'frame'
 - Fix identity selection on reply (#1488101)
 - Add option to enable HTML editor on forwarding (#1488517)
 - Add option to not include original message on reply, rename option top_posting to reply_mode (#1485149)
diff --git a/program/include/rcube_output_html.php b/program/include/rcube_output_html.php
index 00378d7..9600021 100644
--- a/program/include/rcube_output_html.php
+++ b/program/include/rcube_output_html.php
@@ -698,6 +698,11 @@
                 }
                 break;
 
+            // frame
+            case 'frame':
+                return $this->frame($attrib);
+                break;
+
             // show a label
             case 'label':
                 if ($attrib['name'] || $attrib['command']) {
@@ -1275,6 +1280,30 @@
     }
 
 
+    /**
+     * Returns iframe object, registers some related env variables
+     *
+     * @param array $attrib HTML attributes
+     *
+     * @return string IFRAME element
+     */
+    public function frame($attrib)
+    {
+        if (!$attrib['id']) {
+            $attrib['id'] = 'rcmframe';
+        }
+
+        if (!$attrib['name']) {
+            $attrib['name'] = $attrib['id'];
+        }
+
+        $this->set_env('contentframe', $attrib['name']);
+        $this->set_env('blankpage', $attrib['src'] ? $this->abs_url($attrib['src']) : 'program/resources/blank.gif');
+
+        return html::iframe($attrib);
+    }
+
+
     /*  ************* common functions delivering gui objects **************  */
 
 

--
Gitblit v1.9.1