[ Index ]
 

Code source de Horde 3.1.3

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/lib/Block/ -> iframe.php (source)

   1  <?php
   2  
   3  $block_name = _("View an external web page");
   4  
   5  /**
   6   * $Horde: horde/lib/Block/iframe.php,v 1.18.8.4 2006/02/21 10:53:45 jan Exp $
   7   *
   8   * @package Horde_Block
   9   */
  10  class Horde_Block_Horde_iframe extends Horde_Block {
  11  
  12      var $_app = 'horde';
  13  
  14      function _params()
  15      {
  16          return array('iframe' => array('type' => 'text',
  17                                         'name' => _("URL"),
  18                                         'default' => ''),
  19                       'title'  => array('type' => 'text',
  20                                         'name' => _("Title")),
  21                       'height' => array('type' => 'int',
  22                                         'name' => _("Height")));
  23      }
  24  
  25      /**
  26       * The title to go in this block.
  27       *
  28       * @return string   The title text.
  29       */
  30      function _title()
  31      {
  32          global $registry;
  33  
  34          $title = isset($this->_params['title'])
  35              ? $this->_params['title']
  36              : $this->_params['iframe'];
  37  
  38          $html = Horde::link($this->_params['iframe']) . $title .
  39              '</a> :: <small>' .
  40              Horde::link($this->_params['iframe'], '', '', '_blank') .
  41              Horde::img('website.png', _("Open in a new window")) . ' ' .
  42              _("Open in a new window") . '</a></small>';
  43  
  44          return $html;
  45      }
  46  
  47      /**
  48       * The content to go in this block.
  49       *
  50       * @return string   The content
  51       */
  52      function _content()
  53      {
  54          global $browser;
  55  
  56          if (!$browser->hasFeature('iframes')) {
  57              return _("Your browser does not support this feature.");
  58          }
  59  
  60          if (empty($this->_params['height'])) {
  61              if ($browser->isBrowser('msie') || $browser->isBrowser('konqueror')) {
  62                  $height = '';
  63              } else {
  64                  $height = ' height="100%"';
  65              }
  66          } else {
  67              $height = ' height="' . htmlspecialchars($this->_params['height']) . '"';
  68          }
  69          return '<iframe src="' . htmlspecialchars($this->_params['iframe']) . '" width="100%"' . $height . ' marginheight="0" scrolling="auto" frameborder="0"></iframe>';
  70      }
  71  
  72  }


Généré le : Sun Feb 25 18:01:28 2007 par Balluche grâce à PHPXref 0.7