Overview

Packages

  • Horde
  • None

Classes

  • Horde_Ajax_Application
  • Horde_Api
  • Horde_Block_Account
  • Horde_Block_Account_Base
  • Horde_Block_Account_Finger
  • Horde_Block_Account_Ldap
  • Horde_Block_Account_Localhost
  • Horde_Block_Cloud
  • Horde_Block_FbStream
  • Horde_Block_Feed
  • Horde_Block_Fortune
  • Horde_Block_Google
  • Horde_Block_Iframe
  • Horde_Block_Metar
  • Horde_Block_Moon
  • Horde_Block_Sunrise
  • Horde_Block_Time
  • Horde_Block_TwitterTimeline
  • Horde_Block_Vatid
  • Horde_Block_Weather
  • Horde_LoginTasks_SystemTask_GarbageCollection
  • Horde_LoginTasks_SystemTask_Upgrade
  • Horde_LoginTasks_Task_AdminCheck
  • Horde_LoginTasks_Task_LastLogin
  • Horde_LoginTasks_Task_TosAgreement
  • Horde_Prefs_Ui
  • Overview
  • Package
  • Class
  • Tree
 1: <?php
 2: /**
 3:  * @package Horde
 4:  */
 5: class Horde_Block_Iframe extends Horde_Core_Block
 6: {
 7:     /**
 8:      */
 9:     public function __construct($app, $params = array())
10:     {
11:         parent::__construct($app, $params);
12: 
13:         $this->_name = _("View an external web page");
14:     }
15: 
16:     /**
17:      */
18:     protected function _params()
19:     {
20:         return array(
21:             'iframe' => array(
22:                 'type' => 'text',
23:                 'name' => _("URL"),
24:                 'default' => ''
25:             ),
26:             'title' => array(
27:                 'type' => 'text',
28:                 'name' => _("Title")
29:             ),
30:             'height' => array(
31:                 'type' => 'enum',
32:                 'name' => _("Height"),
33:                 'default' => '600',
34:                 'values' => array(
35:                     '480' => _("Small"),
36:                     '600' => _("Medium"),
37:                     '768' => _("Large"),
38:                     '1024' => _("Extra Large")
39:                 )
40:             )
41:         );
42:     }
43: 
44:     /**
45:      */
46:     protected function _title()
47:     {
48:         global $registry;
49: 
50:         $title = !empty($this->_params['title'])
51:             ? $this->_params['title']
52:             : $this->_params['iframe'];
53:         $url = new Horde_Url(Horde::externalUrl($this->_params['iframe']));
54: 
55:         return htmlspecialchars($title) .
56:             $url->link(array('target' => '_blank')) .
57:             Horde::img('external.png', '', array('style' => 'vertical-align:middle;padding-left:.3em')) . '</a>';
58:     }
59: 
60:     /**
61:      */
62:     protected function _content()
63:     {
64:         global $browser;
65: 
66:         if (!$browser->hasFeature('iframes')) {
67:             return _("Your browser does not support this feature.");
68:         }
69: 
70:         if (empty($this->_params['height'])) {
71:             $height = ($browser->isBrowser('msie') || $browser->isBrowser('webkit'))
72:                 ? ''
73:                 : ' height="100%"';
74:         } else {
75:             $height = ' height="' . htmlspecialchars($this->_params['height']) . '"';
76:         }
77: 
78:         return '<iframe src="' . htmlspecialchars($this->_params['iframe']) . '" width="100%"' . $height . ' marginheight="0" scrolling="auto" frameborder="0"></iframe>';
79:     }
80: 
81: }
82: 
API documentation generated by ApiGen