home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Servidores / xampp-win32-1.6.7-installer.exe / php / PEAR / HTML / QuickForm / link.php < prev    next >
Encoding:
PHP Script  |  2008-07-02  |  4.9 KB  |  201 lines

  1. <?php
  2. /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
  3.  
  4. /**
  5.  * HTML class for a link type field
  6.  * 
  7.  * PHP versions 4 and 5
  8.  *
  9.  * LICENSE: This source file is subject to version 3.01 of the PHP license
  10.  * that is available through the world-wide-web at the following URI:
  11.  * http://www.php.net/license/3_01.txt If you did not receive a copy of
  12.  * the PHP License and are unable to obtain it through the web, please
  13.  * send a note to license@php.net so we can mail you a copy immediately.
  14.  *
  15.  * @category    HTML
  16.  * @package     HTML_QuickForm
  17.  * @author      Adam Daniel <adaniel1@eesus.jnj.com>
  18.  * @author      Bertrand Mansion <bmansion@mamasam.com>
  19.  * @copyright   2001-2007 The PHP Group
  20.  * @license     http://www.php.net/license/3_01.txt PHP License 3.01
  21.  * @version     CVS: $Id: link.php,v 1.3 2007/05/29 18:34:36 avb Exp $
  22.  * @link        http://pear.php.net/package/HTML_QuickForm
  23.  */
  24.  
  25. /**
  26.  * HTML class for static data
  27.  */ 
  28. require_once 'HTML/QuickForm/static.php';
  29.  
  30. /**
  31.  * HTML class for a link type field
  32.  * 
  33.  * @category    HTML
  34.  * @package     HTML_QuickForm
  35.  * @author      Adam Daniel <adaniel1@eesus.jnj.com>
  36.  * @author      Bertrand Mansion <bmansion@mamasam.com>
  37.  * @version     Release: 3.2.10
  38.  * @since       2.0
  39.  */
  40. class HTML_QuickForm_link extends HTML_QuickForm_static
  41. {
  42.     // {{{ properties
  43.  
  44.     /**
  45.      * Link display text
  46.      * @var       string
  47.      * @since     1.0
  48.      * @access    private
  49.      */
  50.     var $_text = "";
  51.  
  52.     // }}}
  53.     // {{{ constructor
  54.     
  55.     /**
  56.      * Class constructor
  57.      * 
  58.      * @param     string    $elementLabel   (optional)Link label
  59.      * @param     string    $href           (optional)Link href
  60.      * @param     string    $text           (optional)Link display text
  61.      * @param     mixed     $attributes     (optional)Either a typical HTML attribute string 
  62.      *                                      or an associative array
  63.      * @since     1.0
  64.      * @access    public
  65.      * @return    void
  66.      * @throws    
  67.      */
  68.     function HTML_QuickForm_link($elementName=null, $elementLabel=null, $href=null, $text=null, $attributes=null)
  69.     {
  70.         HTML_QuickForm_element::HTML_QuickForm_element($elementName, $elementLabel, $attributes);
  71.         $this->_persistantFreeze = false;
  72.         $this->_type = 'link';
  73.         $this->setHref($href);
  74.         $this->_text = $text;
  75.     } //end constructor
  76.     
  77.     // }}}
  78.     // {{{ setName()
  79.  
  80.     /**
  81.      * Sets the input field name
  82.      * 
  83.      * @param     string    $name   Input field name attribute
  84.      * @since     1.0
  85.      * @access    public
  86.      * @return    void
  87.      * @throws    
  88.      */
  89.     function setName($name)
  90.     {
  91.         $this->updateAttributes(array('name'=>$name));
  92.     } //end func setName
  93.     
  94.     // }}}
  95.     // {{{ getName()
  96.  
  97.     /**
  98.      * Returns the element name
  99.      * 
  100.      * @since     1.0
  101.      * @access    public
  102.      * @return    string
  103.      * @throws    
  104.      */
  105.     function getName()
  106.     {
  107.         return $this->getAttribute('name');
  108.     } //end func getName
  109.  
  110.     // }}}
  111.     // {{{ setValue()
  112.  
  113.     /**
  114.      * Sets value for textarea element
  115.      * 
  116.      * @param     string    $value  Value for password element
  117.      * @since     1.0
  118.      * @access    public
  119.      * @return    void
  120.      * @throws    
  121.      */
  122.     function setValue($value)
  123.     {
  124.         return;
  125.     } //end func setValue
  126.     
  127.     // }}}
  128.     // {{{ getValue()
  129.  
  130.     /**
  131.      * Returns the value of the form element
  132.      *
  133.      * @since     1.0
  134.      * @access    public
  135.      * @return    void
  136.      * @throws    
  137.      */
  138.     function getValue()
  139.     {
  140.         return;
  141.     } // end func getValue
  142.  
  143.     
  144.     // }}}
  145.     // {{{ setHref()
  146.  
  147.     /**
  148.      * Sets the links href
  149.      *
  150.      * @param     string    $href
  151.      * @since     1.0
  152.      * @access    public
  153.      * @return    void
  154.      * @throws    
  155.      */
  156.     function setHref($href)
  157.     {
  158.         $this->updateAttributes(array('href'=>$href));
  159.     } // end func setHref
  160.  
  161.     // }}}
  162.     // {{{ toHtml()
  163.  
  164.     /**
  165.      * Returns the textarea element in HTML
  166.      * 
  167.      * @since     1.0
  168.      * @access    public
  169.      * @return    string
  170.      * @throws    
  171.      */
  172.     function toHtml()
  173.     {
  174.         $tabs = $this->_getTabs();
  175.         $html = "$tabs<a".$this->_getAttrString($this->_attributes).">";
  176.         $html .= $this->_text;
  177.         $html .= "</a>";
  178.         return $html;
  179.     } //end func toHtml
  180.     
  181.     // }}}
  182.     // {{{ getFrozenHtml()
  183.  
  184.     /**
  185.      * Returns the value of field without HTML tags (in this case, value is changed to a mask)
  186.      * 
  187.      * @since     1.0
  188.      * @access    public
  189.      * @return    string
  190.      * @throws    
  191.      */
  192.     function getFrozenHtml()
  193.     {
  194.         return;
  195.     } //end func getFrozenHtml
  196.  
  197.     // }}}
  198.  
  199. } //end class HTML_QuickForm_textarea
  200. ?>
  201.