HTML_QuickForm
[ class tree: HTML_QuickForm ] [ index: HTML_QuickForm ] [ all elements ]

Source for file link.php

Documentation is available at link.php

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

Documentation generated on Mon, 11 Mar 2019 14:16:34 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.