Beispiel #1
0
    /**
     * Can be used to generate simple form fields
     *
     * @param string $field field name
     * @param string $value Value for the input field
     * @param integer $size Can be used to set a specific size for the input field in em's.
     * @return string Input field with label wrapped in div tag
     */
    function getFormInputField($field, $value, $size = 0)
    {
        global $LANG, $TCA;
        t3lib_div::loadTCA('tx_dam');
        $size = $size ? $size : $TCA['tx_dam']['columns'][$field]['config']['size'];
        $size = $size ? $size : 20;
        $max = $TCA['tx_dam']['columns'][$field]['config']['max'];
        $max = $max ? $max : 256;
        return '<div style="margin-bottom:0.8em">
					<strong>' . tx_dam_guifunc::getFieldLabel($field) . '</strong><br />
					<input type="text" name="data[' . htmlspecialchars($field) . ']" value="' . htmlspecialchars($value) . '" style="width:' . $size . 'em;" maxlength="' . $max . '" />
				</div>';
    }