[ Index ]
 

Code source de PRADO 3.0.6

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

title

Body

[fermer]

/framework/Web/UI/WebControls/ -> TInlineFrame.php (source)

   1  <?php
   2  /**
   3   * TInlineFrame class file.
   4   *
   5   * @author Jason Ragsdale <jrags@jasrags.net>
   6   * @author Harry Pottash <hpottash@gmail.com>
   7   * @link http://www.pradosoft.com/
   8   * @copyright Copyright &copy; 2005 PradoSoft
   9   * @license http://www.pradosoft.com/license/
  10   * @version $Id: TInlineFrame.php 1397 2006-09-07 07:55:53Z wei $
  11   * @package System.Web.UI.WebControls
  12   */
  13  
  14  /**
  15   * TInlineFrame class
  16   *
  17   * TInlineFrame displays an inline frame (iframe) on a Web page.
  18   * The location of the frame content is specified by {@link setFrameUrl FrameUrl}.
  19   * The frame's alignment is specified by {@link setAlign Align}.
  20   * The {@link setMarginWidth MarginWidth} and {@link setMarginHeight MarginHeight}
  21   * properties define the number of pixels to use as the left/right margins and
  22   * top/bottom margins, respectively, within the inline frame.
  23   * The {@link setScrollBars ScrollBars} property specifies whether scrollbars are
  24   * provided for the inline frame. And {@link setDescriptionUrl DescriptionUrl}
  25   * gives the URI of a long description of the frame's contents.
  26   *
  27   * Original Prado v2 IFrame Author Information
  28   * @author Jason Ragsdale <jrags@jasrags.net>
  29   * @author Harry Pottash <hpottash@gmail.com>
  30   * @version $Id: TInlineFrame.php 1397 2006-09-07 07:55:53Z wei $
  31   * @package System.Web.UI.WebControls
  32   * @since 3.0
  33   */
  34  class TInlineFrame extends TWebControl
  35  {
  36      /**
  37       * @return string tag name of the iframe.
  38       */
  39  	protected function getTagName()
  40      {
  41          return 'iframe';
  42      }
  43  
  44      /**
  45       * @return TInlineFrameAlign alignment of the iframe. Defaults to TInlineFrameAlign::NotSet.
  46       */
  47  	public function getAlign()
  48      {
  49          return $this->getViewState('Align',TInlineFrameAlign::NotSet);
  50      }
  51  
  52      /**
  53       * @param TInlineFrameAlign alignment of the iframe.
  54       */
  55  	public function setAlign($value)
  56      {
  57          $this->setViewState('Align',TPropertyValue::ensureEnum($value,'TInlineFrameAlign'),TInlineFrameAlign::NotSet);
  58      }
  59  
  60      /**
  61       * @return string the URL to long description
  62       */
  63  	public function getDescriptionUrl()
  64      {
  65          return $this->getViewState('DescriptionUrl','');
  66      }
  67  
  68      /**
  69       * @param string the URL to the long description of the image.
  70       */
  71  	public function setDescriptionUrl($value)
  72      {
  73          $this->setViewState('DescriptionUrl',$value,'');
  74      }
  75  
  76      /**
  77       * @return boolean whether there should be a visual separator between the frames. Defaults to true.
  78       */
  79  	public function getShowBorder()
  80      {
  81          return $this->getViewState('ShowBorder',true);
  82      }
  83  
  84      /**
  85       * @param boolean whether there should be a visual separator between the frames.
  86       */
  87  	public function setShowBorder($value)
  88      {
  89          $this->setViewState('ShowBorder',TPropertyValue::ensureBoolean($value),true);
  90      }
  91  
  92      /**
  93       * @return string URL that this iframe will load content from. Defaults to ''.
  94       */
  95  	public function getFrameUrl()
  96      {
  97          return $this->getViewState('FrameUrl','');
  98      }
  99  
 100      /**
 101       * @param string URL that this iframe will load content from.
 102       */
 103  	public function setFrameUrl($value)
 104      {
 105          $this->setViewState('FrameUrl',$value,'');
 106      }
 107  
 108      /**
 109       * @return TInlineFrameScrollBars the visibility and position of scroll bars in an iframe. Defaults to TInlineFrameScrollBars::Auto.
 110       */
 111  	public function getScrollBars()
 112      {
 113          return $this->getViewState('ScrollBars',TInlineFrameScrollBars::Auto);
 114      }
 115  
 116      /**
 117       * @param TInlineFrameScrollBars the visibility and position of scroll bars in an iframe.
 118       */
 119  	public function setScrollBars($value)
 120      {
 121          $this->setViewState('ScrollBars',TPropertyValue::ensureEnum($value,'TInlineFrameScrollBars'),TInlineFrameScrollBars::Auto);
 122      }
 123  
 124      /**
 125       * @return integer the amount of space, in pixels, that should be left between
 126       * the frame's contents and the left and right margins. Defaults to -1, meaning not set.
 127       */
 128  	public function getMarginWidth()
 129      {
 130          return $this->getViewState('MarginWidth',-1);
 131      }
 132  
 133      /**
 134       * @param integer the amount of space, in pixels, that should be left between
 135       * the frame's contents and the left and right margins.
 136       */
 137  	public function setMarginWidth($value)
 138      {
 139          if(($value=TPropertyValue::ensureInteger($value))<0)
 140              $value=-1;
 141          $this->setViewState('MarginWidth',$value,-1);
 142      }
 143  
 144      /**
 145       * @return integer the amount of space, in pixels, that should be left between
 146       * the frame's contents and the top and bottom margins. Defaults to -1, meaning not set.
 147       */
 148  	public function getMarginHeight()
 149      {
 150          return $this->getViewState('MarginHeight',-1);
 151      }
 152  
 153      /**
 154       * @param integer the amount of space, in pixels, that should be left between
 155       * the frame's contents and the top and bottom margins.
 156       */
 157  	public function setMarginHeight($value)
 158      {
 159          if(($value=TPropertyValue::ensureInteger($value))<0)
 160              $value=-1;
 161          $this->setViewState('MarginHeight',$value,-1);
 162      }
 163  
 164      /**
 165       * Adds attribute name-value pairs to renderer.
 166       * This overrides the parent implementation with additional button specific attributes.
 167       * @param THtmlWriter the writer used for the rendering purpose
 168       */
 169  	protected function addAttributesToRender($writer)
 170      {
 171          if($this->getID()!=='')
 172              $writer->addAttribute('name',$this->getUniqueID());
 173  
 174          if(($src=$this->getFrameUrl())!=='')
 175              $writer->addAttribute('src',$src);
 176  
 177          if(($align=strtolower($this->getAlign()))!=='notset')
 178              $writer->addAttribute('align',$align);
 179  
 180          $scrollBars=$this->getScrollBars();
 181          if($scrollBars===TInlineFrameScrollBars::None)
 182              $writer->addAttribute('scrolling','no');
 183          else if($scrollBars===TInlineFrameScrollBars::Both)
 184              $writer->addAttribute('scrolling','yes');
 185  
 186          if (!$this->getShowBorder())
 187              $writer->addAttribute('frameborder','0');
 188  
 189          if(($longdesc=$this->getDescriptionUrl())!=='')
 190              $writer->addAttribute('longdesc',$longdesc);
 191  
 192          if(($marginheight=$this->getMarginHeight())!==-1)
 193              $writer->addAttribute('marginheight',$marginheight);
 194  
 195          if(($marginwidth=$this->getMarginWidth())!==-1)
 196              $writer->addAttribute('marginwidth',$marginwidth);
 197  
 198          parent::addAttributesToRender($writer);
 199      }
 200  }
 201  
 202  /**
 203   * TInlineFrameAlign class.
 204   * TInlineFrameAlign defines the enumerable type for the possible alignments
 205   * that the content in a {@link TInlineFrame} could be.
 206   *
 207   * The following enumerable values are defined:
 208   * - NotSet: the alignment is not specified.
 209   * - Left: left aligned
 210   * - Right: right aligned
 211   * - Top: top aligned
 212   * - Middle: middle aligned
 213   * - Bottom: bottom aligned
 214   *
 215   * @author Qiang Xue <qiang.xue@gmail.com>
 216   * @version $Id: TInlineFrame.php 1397 2006-09-07 07:55:53Z wei $
 217   * @package System.Web.UI.WebControls
 218   * @since 3.0.4
 219   */
 220  class TInlineFrameAlign extends TEnumerable
 221  {
 222      const NotSet='NotSet';
 223      const Left='Left';
 224      const Right='Right';
 225      const Top='Top';
 226      const Middle='Middle';
 227      const Bottom='Bottom';
 228  }
 229  
 230  /**
 231   * TInlineFrameScrollBars class.
 232   * TInlineFrameScrollBars defines the enumerable type for the possible scroll bar mode
 233   * that a {@link TInlineFrame} control could use.
 234   *
 235   * The following enumerable values are defined:
 236   * - None: no scroll bars.
 237   * - Auto: scroll bars automatically appeared when needed.
 238   * - Both: show both horizontal and vertical scroll bars all the time.
 239   *
 240   * @author Qiang Xue <qiang.xue@gmail.com>
 241   * @version $Id: TInlineFrame.php 1397 2006-09-07 07:55:53Z wei $
 242   * @package System.Web.UI.WebControls
 243   * @since 3.0.4
 244   */
 245  class TInlineFrameScrollBars extends TEnumerable
 246  {
 247      const None='None';
 248      const Auto='Auto';
 249      const Both='Both';
 250  }
 251  ?>


Généré le : Sun Feb 25 21:07:04 2007 par Balluche grâce à PHPXref 0.7