예제 #1
0
 /**
  * Constructor: create a new dateTextField object
  *
  * @param object &$oForm: the form where the datefield is located on
  * @param string $sName: the name of the datefield
  * @param string $sMask: the mask which is used to display the fields
  * @param bool $bParseOtherPresentations: try to parse other presentations of dateformat
  * @return dateTextField
  * @access public
  * @author Thomas Branius
  * @since 16-03-2010
  */
 function DateTextField(&$oForm, $sName, $sMask = null, $bParseOtherPresentations = false)
 {
     // set the default date display
     $this->setMask(!is_null($sMask) ? $sMask : FH_DATETEXTFIELD_DEFAULT_DISPLAY);
     $this->_bParseOtherPresentations = $bParseOtherPresentations;
     //$this->setValidator(array(&$this, "validate"));
     // call the constructor of the Field class
     parent::TextField($oForm, $sName);
 }
예제 #2
0
 /**
  * ColorPicker::ColorPicker()
  *
  * Constructor: Create a new ColorPicker object
  *
  * @param object &$oForm: The form where this field is located on
  * @param string $sName: The name of the field
  * @return ColorPicker
  * @access public
  * @author Rick den Haan
  */
 function ColorPicker(&$oForm, $sName)
 {
     parent::TextField($oForm, $sName);
     static $bSetJS = false;
     // needed javascript included yet ?
     if (!$bSetJS) {
         // include the needed javascript
         $bSetJS = true;
         $oForm->_setJS(FH_FHTML_DIR . "js/jscolor/jscolor.js", true);
     }
 }
예제 #3
0
 /**
  * TextSelectField::TextSelectField()
  *
  * Constructor: Create a new textfield object
  *
  * @param object &$oForm: The form where this field is located on
  * @param string $sName: The name of the field
  * @return TextField
  * @author Teye Heimans
  * @access public
  */
 function TextSelectField(&$oForm, $sName, $aOptions)
 {
     parent::TextField($oForm, $sName);
     static $bSetJS = false;
     // needed javascript included yet ?
     if (!$bSetJS) {
         $bSetJS = true;
         // add the needed javascript
         $oForm->_setJS("function FH_CLOSE_TEXTSELECT( id )" . "\n" . "{" . "\n" . "  setTimeout( 'document.getElementById(\"'+id+'\").style.display=\"none\"', 110 );" . "\n" . "}" . "\n\n" . "function FH_SET_TEXTSELECT( id, waarde )" . "\n" . "{" . "\n" . "  document.getElementById(id).value=waarde;" . "\n" . "  FH_CLOSE_TEXTSELECT( 'FHSpan_'+id );return false;" . "\n" . "}" . "\n\n");
     }
     foreach ($aOptions as $key => $value) {
         $this->_sOptions .= sprintf(FH_TEXTSELECT_OPTION_MASK, $sName, $value);
     }
     $this->setSize(20);
     $this->setMaxlength(0);
 }