summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUwe Steinmann <steinm@php.net>2000-08-21 09:23:37 +0000
committerUwe Steinmann <steinm@php.net>2000-08-21 09:23:37 +0000
commit1bbea8d0eb692df29afd1032d4046c4a12040ef6 (patch)
tree4180535b1aee3f297a0efe79abac79757c2901b0
parent82115ea03984b8c7d79f12aa78c0af0f40624882 (diff)
downloadphp-git-1bbea8d0eb692df29afd1032d4046c4a12040ef6.tar.gz
- added function fdf_set_javascript_action()
-rw-r--r--ext/fdf/fdf.c43
-rw-r--r--ext/fdf/php_fdf.h1
2 files changed, 44 insertions, 0 deletions
diff --git a/ext/fdf/fdf.c b/ext/fdf/fdf.c
index 8269262974..7580c38d50 100644
--- a/ext/fdf/fdf.c
+++ b/ext/fdf/fdf.c
@@ -82,6 +82,7 @@ function_entry fdf_functions[] = {
PHP_FE(fdf_set_flags, NULL)
PHP_FE(fdf_set_opt, NULL)
PHP_FE(fdf_set_submit_form_action, NULL)
+ PHP_FE(fdf_set_javascript_action, NULL)
{NULL, NULL, NULL}
};
@@ -103,6 +104,7 @@ PHP_MINIT_FUNCTION(fdf)
FDFErc err;
FDF_GLOBAL(le_fdf) = register_list_destructors(phpi_FDFClose, NULL);
+ /* Constants used by fdf_set_opt() */
REGISTER_LONG_CONSTANT("FDFValue", FDFValue, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("FDFStatus", FDFStatus, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("FDFFile", FDFFile, CONST_CS | CONST_PERSISTENT);
@@ -119,6 +121,17 @@ PHP_MINIT_FUNCTION(fdf)
REGISTER_LONG_CONSTANT("FDFAA", FDFAA, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("FDFAPRef", FDFAPRef, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("FDFIF", FDFIF, CONST_CS | CONST_PERSISTENT);
+
+ /* Constants used by fdf_set_javascript_action() */
+ REGISTER_LONG_CONSTANT("FDFEnter", FDFEnter, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("FDFExit", FDFExit, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("FDFDown", FDFDown, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("FDFUp", FDFUp, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("FDFFormat", FDFFormat, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("FDFValidate", FDFValidate, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("FDFKeystroke", FDFKeystroke, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("FDFCalculate", FDFCalculate, CONST_CS | CONST_PERSISTENT);
+
#ifdef PHP_WIN32
return SUCCESS;
#endif
@@ -693,6 +706,36 @@ PHP_FUNCTION(fdf_set_submit_form_action) {
RETURN_TRUE;
}
+/* {{{ proto void fdf_set_javascript_action(int fdfdoc, string fieldname, int whichTrigger, string script)
+ sets the javascript action for a field in the fdf*/
+PHP_FUNCTION(fdf_set_javascript_action) {
+ pval **arg1, **arg2, **arg3, **arg4;
+ int id, type;
+ FDFDoc fdf;
+ FDFErc err;
+ FDF_TLS_VARS;
+
+ if (ZEND_NUM_ARGS() != 5 || zend_get_parameters_ex(4, &arg1, &arg2,&arg3, &arg4) == FAILURE) {
+ WRONG_PARAM_COUNT;
+ }
+ convert_to_long_ex(arg1);
+ convert_to_string_ex(arg2);
+ convert_to_long_ex(arg3);
+ convert_to_string_ex(arg4);
+ id=(*arg1)->value.lval;
+ fdf = zend_list_find(id,&type);
+ if(!fdf || type!=FDF_GLOBAL(le_fdf)) {
+ php_error(E_WARNING,"Unable to find file identifier %d",id);
+ RETURN_FALSE;
+ }
+
+ err = FDFSetJavaScriptAction(fdf,(*arg2)->value.str.val,(*arg3)->value.lval,(*arg4)->value.str.val);
+ if(err != FDFErcOK)
+ printf("Error setting FDF JavaScript action: %d",err);
+
+ RETURN_TRUE;
+}
+
#endif
/*
diff --git a/ext/fdf/php_fdf.h b/ext/fdf/php_fdf.h
index 50409a2abd..2e6ea5a690 100644
--- a/ext/fdf/php_fdf.h
+++ b/ext/fdf/php_fdf.h
@@ -52,6 +52,7 @@ PHP_FUNCTION(fdf_add_template);
PHP_FUNCTION(fdf_set_flags);
PHP_FUNCTION(fdf_set_opt);
PHP_FUNCTION(fdf_set_submit_form_action);
+PHP_FUNCTION(fdf_set_javascript_action);
#else
#define fdf_module_ptr NULL
#endif