/** * TextArea::TextArea() * * Constructor: create a new textarea * * @param object &$oForm: The form where this field is located on * @param string $sName: The name of the field * @return TextArea * @author Teye Heimans * @access public */ function TextArea(&$oform, $sName) { // call the constructor of the Field class parent::Field($oform, $sName); $this->setCols(40); $this->setRows(7); }
/** * TextField::TextField() * * 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 TextField(&$oForm, $sName) { // call the constructor of the Field class parent::Field($oForm, $sName); $this->setSize(20); $this->setMaxlength(0); }
/** * SelectField::SelectField() * * Public constructor: Create a selectfield object * * @param object $oForm: The form where the field is located on * @param string $sName: The name of the form * @return SelectField * @access public * @author Teye Heimans */ function SelectField(&$oForm, $sName) { // call the constructor of the Field class parent::Field($oForm, $sName); $this->setSize(1); $this->useArrayKeyAsValue(FH_DEFAULT_USEARRAYKEY); $this->setMultiple(false); }
/** * RadioButton::RadioButton() * * Constructor: Create a new radiobutton object * * @param object $oForm: The form where this field is located on * @param string $sName: The name of the field * @param array|string $aOptions: The options for the field * @return RadioButton * @author Teye Heimans */ function RadioButton(&$oForm, $sName, $aOptions) { // call the constructor of the Field class parent::Field($oForm, $sName); $this->_aOptions = $aOptions; $this->setMask(FH_DEFAULT_GLUE_MASK); $this->useArrayKeyAsValue(FH_DEFAULT_USEARRAYKEY); }
/** * CheckBox::CheckBox() * * Constructor: Create a new checkbox object * * @param object $oForm: The form where this field is located on * @param string $sName: The name of the field * @param mixed: array|string $aOptions - The options for the field * @return CheckBox * @access public * @author Teye Heimans */ function CheckBox(&$oForm, $sName, $aOptions) { $this->_mValue = ''; $sName = str_replace('[]', '', $sName); $this->_aOptions = $aOptions; // call the constructor of the Field class parent::Field($oForm, $sName); $this->setMask(FH_DEFAULT_GLUE_MASK); $this->useArrayKeyAsValue(FH_DEFAULT_USEARRAYKEY); }
/** * class constructor */ function Field_Country($id_common) { parent::Field($id_common); $query_tax_country = "\r\n\t\tSELECT id_country, name_country\r\n\t\tFROM " . $this->getCountryTable() . "\r\n\t\tORDER BY name_country"; $re_field_element = sql_query($query_tax_country); $this->_options[0] = ''; while (list($id_common_son, $element) = sql_fetch_row($re_field_element)) { $this->_options[$id_common_son] = $this->convert_name($element); } }
/** * TextField::BrowserField() * * 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 * @param string $sPath: The path to browse * @return BrowserField * @author Johan Wiegel * @access public */ function BrowserField(&$oForm, $sName, $sPath) { // call the constructor of the Field class parent::Field($oForm, $sName); $this->_path = $sPath; $this->_form = $oForm; $this->setSize(20); $bSetJS = true; $oForm->_setJS('function SetUrl( sUrl, sName ){document.getElementById( sName ).value=sUrl}', $isFile = false, $before = true); }
/** * TimeField::TimeField() * * Constructor: create a new TimeField on the given form * * @param object $oForm: The form where the field is located on * @param string $sName: The name of the field * @return TimeField * @author Teye Heimans */ function TimeField(&$oForm, $sName) { // set the default hour format $this->setHourFormat(FH_TIMEFIELD_DEFAULT_HOUR_FORMAT); // set if the field is required $this->setRequired(FH_TIMEFIELD_DEFAULT_REQUIRED); // make the hour and minute fields $this->_oHour = new SelectField($oForm, $sName . '_hour'); $this->_oMinute = new SelectField($oForm, $sName . '_minute'); parent::Field($oForm, $sName); // posted or edit form? Then load the value of the time if ($oForm->isPosted() || isset($oForm->edit) && $oForm->edit) { $this->_mValue = $this->_oHour->getValue() . ':' . $this->_oMinute->getValue(); } }
/** * Editor::Editor() * * Constructor: create a new Editor object * * @param object $oForm: The form where the field is located on * @return Editor * @access public * @author Teye Heimans */ function Editor(&$oForm, $sName) { $this->_oEditor = new ckeditor($sName); $this->_oEditor->returnOutput = true; $this->_oEditor->basePath = FH_FHTML_DIR . 'ckeditor/'; // added as workarround IE9 $this->_oEditor->Value = isset($this->_mValue) ? $this->_mValue : ''; $this->setToolbar('Default'); // Default or Basic $this->setServerPath(''); parent::Field($oForm, $sName); // set the language $this->_oEditor->config['language'] = str_replace('-utf8', '', $oForm->_lang); // default height & width $this->setWidth(720); $this->setHeight(400); // default, silver or office2003 $this->setSkin('v2'); }
/** * ListField::ListField() * * Constructor: Create a new ListField * * @param object &$oForm: The form where this field is located on * @param string $sName: The name of the field * @param array $aOptions: The options of the field * @return ListField * @access public * @author Teye Heimans */ function ListField(&$oForm, $sName, $aOptions) { $this->_mValue = array(); static $bSetJS = false; // needed javascript included yet ? if (!$bSetJS) { $bSetJS = true; $oForm->_setJS(FH_FHTML_DIR . "js/listfield.js", true); } // set the options $this->_aOptions = $aOptions; parent::Field($oForm, $sName, $aOptions); // make the fields of the listfield $this->_oHidden = new HiddenField($oForm, $sName); $this->_oOn = new SelectField($oForm, $sName . '_ListOn'); $this->_oOff = new SelectField($oForm, $sName . '_ListOff'); $this->_oOn->setMultiple(true); $this->_oOff->setMultiple(true); // set some default values $this->useArrayKeyAsValue(FH_DEFAULT_USEARRAYKEY); $this->setSize(FH_DEFAULT_LISTFIELD_SIZE); $this->setOffTitle($oForm->_text(29)); $this->setOnTitle($oForm->_text(30)); }
/** * class constructor */ function Field_Freetext($id_common) { parent::Field($id_common); }
/** * DateField::DateField() * * Constructor: create a new datefield 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 * @return DateField * @access public * @author Teye Heimans */ function DateField(&$oForm, $sName, $sMask = null, $bRequired = null, $sInterval = null) { // set the default date display $this->setMask(!is_null($sMask) ? $sMask : FH_DATEFIELD_DEFAULT_DISPLAY); // set the default interval $this->setInterval(!is_null($sInterval) ? $sInterval : FH_DATEFIELD_DEFAULT_DATE_INTERVAL); // set if the field is required $this->setRequired(!is_null($bRequired) ? $bRequired : FH_DATEFIELD_DEFAULT_REQUIRED); // d = selectfield day // m = selectfield month // y = selectfield year // D = textfield day // M = textfield month // Y = textfield year // generate the objects for the fields $fields = $this->_getFieldsFromMask(); $len = strlen($fields); for ($x = 0; $x < $len; $x++) { $c = $fields[$x]; switch ($c) { // year selectfield case 'y': $this->_oYear = new SelectField($oForm, $sName . '_year'); // get the year interval list($iStart, $iEnd) = $this->_getYearInterval(); $iEnd = intval($iEnd); $iStart = intval($iStart); $iYear = date('Y'); // set the years $aYears = array(); if (!$bRequired) { $aYears[''] = ''; } // was 0000 // calculate the difference between the years $iDiff = $iYear + $iEnd - ($iYear - $iStart); $iCounter = 0; while ($iDiff != $iCounter) { $i = $iYear + $iEnd - $iCounter; $aYears[$i] = $i; $iCounter += $iCounter < $iDiff ? 1 : -1; } // set the options $this->_oYear->setOptions($aYears); break; // year textfield // year textfield case 'Y': $this->_oYear = new TextField($oForm, $sName . '_year'); $this->_oYear->setSize(4); $this->_oYear->setMaxlength(4); $this->_oYear->setValidator(_FH_DIGIT); break; // month selectfield // month selectfield case 'm': $this->_oMonth = new SelectField($oForm, $sName . '_month'); // set the months in the field $aMonths = array('01' => $oForm->_text(1), '02' => $oForm->_text(2), '03' => $oForm->_text(3), '04' => $oForm->_text(4), '05' => $oForm->_text(5), '06' => $oForm->_text(6), '07' => $oForm->_text(7), '08' => $oForm->_text(8), '09' => $oForm->_text(9), '10' => $oForm->_text(10), '11' => $oForm->_text(11), '12' => $oForm->_text(12)); if (!$bRequired) { $aMonths[''] = ''; // was 00 ksort($aMonths); } // set the options $this->_oMonth->setOptions($aMonths); break; // month textfield // month textfield case 'M': $this->_oMonth = new TextField($oForm, $sName . '_month'); $this->_oMonth->setSize(2); $this->_oMonth->setMaxlength(2); $this->_oMonth->setValidator(_FH_DIGIT); break; // day selectfield // day selectfield case 'd': $this->_oDay = new SelectField($oForm, $sName . '_day'); // get the days $aDays = array(); if (!$bRequired) { $aDays[''] = ''; } // was 00 for ($i = 1; $i <= 31; $i++) { $aDays[sprintf('%02d', $i)] = sprintf('%02d', $i); } $this->_oDay->setOptions($aDays); break; // day textfield // day textfield case 'D': $this->_oDay = new TextField($oForm, $sName . '_day'); $this->_oDay->setSize(2); $this->_oDay->setMaxlength(2); $this->_oDay->setValidator(_FH_DIGIT); break; } } // call the Field constructor parent::Field($oForm, $sName); }
function TextField($name, $label, $default) { parent::Field($name, $label, 'text', $default); }
/** * class constructor */ function Field_Upload($id_common) { parent::Field($id_common); }
/** * class constructor */ function Field_Cf($id_common) { parent::Field($id_common); }
/** * class constructor */ function Field_Dropdown($id_common) { parent::Field($id_common); }
function LastModifField($field = "lastModif", $title = "Última modificação", $fieldOpts = array()) { parent::Field($field, $title, $fieldOpts); }
function StringField($field, $title, $fieldOpts = array()) { $size = isset($fieldOpts['size']) ? $fieldOpts['size'] : 255; $this->dbRep = "varchar({$size})"; parent::Field($field, $title, $fieldOpts); }
function SeparatorField($label) { parent::Field('', $label, 'separator', ''); }
function ThumbField($field = 'thumb', $title = 'Foto', $dir = 'img/thumb', $fieldOpts = array()) { $this->imgDir = preg_replace("/\\/?\$/", "/", $dir); parent::Field($field, $title, $fieldOpts); }
function SelectField($name, $label, $options, $values, $default) { parent::Field($name, $label, 'select', $default); $this->options = $options; $this->values = $values; }
/** * class constructor */ function Field_Date($id_common) { parent::Field($id_common); }
function PasswordField($name, $label, $default) { parent::Field($name, $label, 'password', $default); }
/** * class constructor */ function Field_Textlabel($id_common) { parent::Field($id_common); }
/** * class constructor */ function ContactField($id_common) { parent::Field($id_common); }
/** * class constructor */ function Field_YesNo($id_common) { parent::Field($id_common); }