cvs: php4 /ext/fdf fdf.c php_fdf.h
| From: | Uwe Steinmann | Date: | Mon, 21 Aug 2000 09:23:37 +0000 |
| Subject: | cvs: php4 /ext/fdf fdf.c php_fdf.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-1283@lists.php.net to get a copy of this message | ||
steinm Mon Aug 21 02:23:37 2000 EDT
Modified files:
/php4/ext/fdf fdf.c php_fdf.h
Log:
- added function fdf_set_javascript_action()
Index: php4/ext/fdf/fdf.c
diff -u php4/ext/fdf/fdf.c:1.30 php4/ext/fdf/fdf.c:1.31
--- php4/ext/fdf/fdf.c:1.30 Tue Aug 15 11:46:59 2000
+++ php4/ext/fdf/fdf.c Mon Aug 21 02:23:37 2000
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: fdf.c,v 1.30 2000/08/15 18:46:59 steinm Exp $ */
+/* $Id: fdf.c,v 1.31 2000/08/21 09:23:37 steinm Exp $ */
/* FdfTk lib 2.0 is a Complete C/C++ FDF Toolkit available from
http://beta1.adobe.com/ada/acrosdk/forms.html.
*/
@@ -82,6 +82,7 @@
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 @@
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 @@
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
@@ -689,6 +702,36 @@
err =
FDFSetSubmitFormAction(fdf,(*arg2)->value.str.val,(*arg3)->value.lval,(*arg4)->value.str.val,(*arg5)->value.lval);
if(err != FDFErcOK)
printf("Error setting FDF submit action: %d",err);
+
+ 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;
}
Index: php4/ext/fdf/php_fdf.h
diff -u php4/ext/fdf/php_fdf.h:1.9 php4/ext/fdf/php_fdf.h:1.10
--- php4/ext/fdf/php_fdf.h:1.9 Mon Aug 7 04:37:42 2000
+++ php4/ext/fdf/php_fdf.h Mon Aug 21 02:23:37 2000
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_fdf.h,v 1.9 2000/08/07 11:37:42 steinm Exp $ */
+/* $Id: php_fdf.h,v 1.10 2000/08/21 09:23:37 steinm Exp $ */
#ifndef PHP_FDF_H
#define PHP_FDF_H
@@ -52,6 +52,7 @@
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