[dev] HEAD: problems with "view external web page" applet

Joe Wilson joe.wilson at mindcandy.org
Fri Aug 1 19:54:29 PDT 2003


I do not have Mozilla installed so I cannot test that this works with that
browser, but it should solve the problem for both MSIE and Mozilla.  It will
also allow for the extension of this to any other browsers that have differing
behavior wrt iframes.

Joe

*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#
 *#
  *#   Joe Wilson             (917) 690-0507 (c)
   *#   884 Palmer Ave.        (914) 777-3250 (h)
    *#   Mamaroneck, NY 10543
     *#
      *#    He to whom [the mysterious] is a stranger,
       *#    who can no longer pause to wonder and stand
        *#    rapt in awe, is as good as dead: his eyes are closed.
         *#                           - Albert Einstein
          *#
           *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*


Quoting Rob <rob2 at siklos.ca>:

> Yes, I'm using the latest version of IE6.
>
> > Quoting Joe Wilson <joe.wilson at mindcandy.org>:
> >
> > > I had this same problem in development of the code.  My research seems
> to
> > > indicate that it is not possible to use a percentage in the height
> attribute
> > > of an iFrame, but only an absolute pixel value.  I suppose one
> possibility is
> > > to read the height of the containing Block and set it explicitly, but it
> is
> > > probably easier to simply leave the height out as it seems to default to
> > > 100%.
> >
> > Are both of you using IE? In Mozilla, it did *not* default to 100%, but
> putting
> > it in worked perfectly.
> >
> > -chuck
> >
> > --
> > Charles Hagenbuch, <chuck at horde.org>
> > They're just looking at a wall of meat.
> >
> > --
> > Horde developers mailing list
> > Frequently Asked Questions: http://horde.org/faq/
> > To unsubscribe, mail: dev-unsubscribe at lists.horde.org
> >
>
>
> --
> Horde developers mailing list
> Frequently Asked Questions: http://horde.org/faq/
> To unsubscribe, mail: dev-unsubscribe at lists.horde.org
>
-------------- next part --------------
Index: iframe.php
===================================================================
RCS file: /usr/local/cvs/horde/horde/lib/Block/iframe.php,v
retrieving revision 1.1
diff -u -r1.1 iframe.php
--- iframe.php	31 Jul 2003 03:29:49 -0000	1.1
+++ iframe.php	2 Aug 2003 02:35:39 -0000
@@ -2,14 +2,12 @@
 /**
  * $Horde: horde/lib/Block/iframe.php,v 1.2 2003/01/29 09:47:05 mikec Exp $
  *
- * @package Horde
+ * @package horde
  */
-class Horde_Block_iframe extends Horde_Block {
+class Horde_iframe_Block extends Horde_Block {
 
-    /**
-     * Constructor.
-     */
-    function Horde_Block_iframe($params = array())
+    /* Constructor */
+    function horde_iframe_Block($params = array())
     {
         $this->_params = $params;
         $this->_app = 'horde';
@@ -19,8 +17,8 @@
     /**
      * Does this block have any user editable parameters?
      *
-     * @return boolean  True is there are editable parameters.
-     *                  False if there are not.
+     * @return boolean  True is there are editable paramters
+     *                  False if there are not
      */
     function isEditable()
     {
@@ -34,7 +32,7 @@
      */
     function _title()
     {
-        return $this->_params['iframe'];
+        return _("URL");
     }
 
     /**
@@ -44,7 +42,15 @@
      */
     function _content()
     {
-        return '<iframe src="' . $this->_params['iframe'] . '" width="100%" height="100%" marginheight="0" scrolling="yes" frameborder="0"></iframe>';
-    }
+        require_once HORDE_BASE . '/lib/Browser.php';
+        $browser = &Browser::singleton();
 
+	if (!$browser->hasFeature('iframe'))
+	    $html = "Your browser does not support iFrames.";
+	if ($browser->getBrowser() == "msie")
+	    $html = '<iframe src="' . $this->_params['iframe'] . '" width="100%" marginheight="0" scrolling="yes" frameborder="0"></iframe>';
+	else
+            $html = '<iframe src="' . $this->_params['iframe'] . '" width="100%" height="100%" marginheight="0" scrolling="yes" frameborder="0"></iframe>';
+	return $html;
+    }
 }


More information about the dev mailing list