コード例 #1
0
ファイル: n_quickform.php プロジェクト: nonfiction/nterchange
        if (!HTML_QuickForm_file::_ruleIsUploadedFile($elementValue)) {
            return true;
        }
        return preg_match($regex, $elementValue['name']);
    }
    // end func _ruleCheckFileName
    // }}}
    // {{{ _ruleCheckRemove()
    /**
     * Checks if the removed element should be uploaded
     *
     * @param     values    All values
     * @access    private
     * @return    bool      true if remove, array of errors otherwise
     */
    function _ruleCheckRemove($values)
    {
        $errors = array();
        if (isset($values['media_file__remove'])) {
            $errors['media_file'] = 'Media File is a required field';
        }
        return empty($errors) ? true : $errors;
    }
}
NQuickForm::registerElementType('cmserror', 'n_quickform.php', 'HTML_QuickForm_cmserror');
NQuickForm::registerElementType('cmsalert', 'n_quickform.php', 'HTML_QuickForm_cmsalert');
NQuickForm::registerElementType('cms_file', 'controller/form.php', 'HTML_QuickForm_CMS_file');
NQuickForm::registerElementType('foreignkey', 'controller/form.php', 'HTML_QuickForm_foreignkey');
NQuickForm::registerElementType('fckeditor', 'controller/form.php', 'HTML_QuickForm_fckeditor');
//NQuickForm::registerElementType('CAPTCHA_Image', 'n_quickform.php', 'HTML_QuickForm_captcha');
// NQuickForm::registerElementType('nterchange_date', 'HTML/QuickForm/nterchange_date.php', 'HTML_QuickForm_nterchange_date');