From 8ed77656faf105f9b2b34f312bf5634ca7187c1d Mon Sep 17 00:00:00 2001 From: Vladimir Kolesnikov Date: Wed, 2 Oct 2013 20:32:26 +0300 Subject: [PATCH] Implement #824 --- ext/tag.c | 110 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ ext/tag.h | 85 ++++++++++++++++------------------------- 2 files changed, 142 insertions(+), 53 deletions(-) diff --git a/ext/tag.c b/ext/tag.c index dea82543511..cf7bca95038 100644 --- a/ext/tag.c +++ b/ext/tag.c @@ -773,6 +773,17 @@ static void phalcon_tag_generic_field_checked(INTERNAL_FUNCTION_PARAMETERS, cons zval_ptr_dtor(&name); } +/** + * Builds a HTML input[type="color"] tag + * + * @param array $parameters + * @return string + */ +PHP_METHOD(Phalcon_Tag, colorField){ + + phalcon_tag_generic_field(INTERNAL_FUNCTION_PARAM_PASSTHRU, "color", 0); +} + /** * Builds a HTML input[type="text"] tag * @@ -803,6 +814,17 @@ PHP_METHOD(Phalcon_Tag, numericField){ phalcon_tag_generic_field(INTERNAL_FUNCTION_PARAM_PASSTHRU, "number", 0); } +/** + * Builds a HTML input[type="range"] tag + * + * @param array $parameters + * @return string + */ +PHP_METHOD(Phalcon_Tag, rangeField){ + + phalcon_tag_generic_field(INTERNAL_FUNCTION_PARAM_PASSTHRU, "range", 0); +} + /** * Builds a HTML input[type="email"] tag * @@ -833,6 +855,61 @@ PHP_METHOD(Phalcon_Tag, dateField){ phalcon_tag_generic_field(INTERNAL_FUNCTION_PARAM_PASSTHRU, "date", 0); } +/** + * Builds a HTML input[type="datetime"] tag + * + * @param array $parameters + * @return string + */ +PHP_METHOD(Phalcon_Tag, dateTimeField){ + + phalcon_tag_generic_field(INTERNAL_FUNCTION_PARAM_PASSTHRU, "datetime", 0); +} + +/** + * Builds a HTML input[type="datetime-local"] tag + * + * @param array $parameters + * @return string + */ +PHP_METHOD(Phalcon_Tag, dateTimeLocalField){ + + phalcon_tag_generic_field(INTERNAL_FUNCTION_PARAM_PASSTHRU, "datetime-local", 0); +} + +/** + * Builds a HTML input[type="month"] tag + * + * @param array $parameters + * @return string + */ +PHP_METHOD(Phalcon_Tag, monthField){ + + phalcon_tag_generic_field(INTERNAL_FUNCTION_PARAM_PASSTHRU, "month", 0); +} + +/** + * Builds a HTML input[type="time"] tag + * + * @param array $parameters + * @return string + */ +PHP_METHOD(Phalcon_Tag, timeField){ + + phalcon_tag_generic_field(INTERNAL_FUNCTION_PARAM_PASSTHRU, "time", 0); +} + +/** + * Builds a HTML input[type="week"] tag + * + * @param array $parameters + * @return string + */ +PHP_METHOD(Phalcon_Tag, weekField){ + + phalcon_tag_generic_field(INTERNAL_FUNCTION_PARAM_PASSTHRU, "week", 0); +} + /** * Builds a HTML input[type="password"] tag * @@ -878,6 +955,39 @@ PHP_METHOD(Phalcon_Tag, fileField){ phalcon_tag_generic_field(INTERNAL_FUNCTION_PARAM_PASSTHRU, "file", 0); } +/** + * Builds a HTML input[type="search"] tag + * + * @param array $parameters + * @return string + */ +PHP_METHOD(Phalcon_Tag, searchField){ + + phalcon_tag_generic_field(INTERNAL_FUNCTION_PARAM_PASSTHRU, "search", 0); +} + +/** + * Builds a HTML input[type="tel"] tag + * + * @param array $parameters + * @return string + */ +PHP_METHOD(Phalcon_Tag, telField){ + + phalcon_tag_generic_field(INTERNAL_FUNCTION_PARAM_PASSTHRU, "tel", 0); +} + +/** + * Builds a HTML input[type="url"] tag + * + * @param array $parameters + * @return string + */ +PHP_METHOD(Phalcon_Tag, urlField){ + + phalcon_tag_generic_field(INTERNAL_FUNCTION_PARAM_PASSTHRU, "url", 0); +} + /** * Builds a HTML input[type="check"] tag * diff --git a/ext/tag.h b/ext/tag.h index 27e663d523e..f4c86f0c61f 100644 --- a/ext/tag.h +++ b/ext/tag.h @@ -36,16 +36,26 @@ PHP_METHOD(Phalcon_Tag, resetInput); PHP_METHOD(Phalcon_Tag, linkTo); PHP_METHOD(Phalcon_Tag, _inputField); PHP_METHOD(Phalcon_Tag, _inputFieldChecked); +PHP_METHOD(Phalcon_Tag, colorField); PHP_METHOD(Phalcon_Tag, textField); PHP_METHOD(Phalcon_Tag, numericField); +PHP_METHOD(Phalcon_Tag, rangeField); PHP_METHOD(Phalcon_Tag, emailField); PHP_METHOD(Phalcon_Tag, dateField); +PHP_METHOD(Phalcon_Tag, dateTimeField); +PHP_METHOD(Phalcon_Tag, dateTimeLocalField); +PHP_METHOD(Phalcon_Tag, monthField); +PHP_METHOD(Phalcon_Tag, timeField); +PHP_METHOD(Phalcon_Tag, weekField); PHP_METHOD(Phalcon_Tag, passwordField); PHP_METHOD(Phalcon_Tag, hiddenField); PHP_METHOD(Phalcon_Tag, fileField); PHP_METHOD(Phalcon_Tag, checkField); PHP_METHOD(Phalcon_Tag, radioField); PHP_METHOD(Phalcon_Tag, imageInput); +PHP_METHOD(Phalcon_Tag, searchField); +PHP_METHOD(Phalcon_Tag, telField); +PHP_METHOD(Phalcon_Tag, urlField); PHP_METHOD(Phalcon_Tag, submitButton); PHP_METHOD(Phalcon_Tag, selectStatic); PHP_METHOD(Phalcon_Tag, select); @@ -96,47 +106,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_linkto, 0, 0, 1) ZEND_ARG_INFO(0, text) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_textfield, 0, 0, 1) - ZEND_ARG_INFO(0, parameters) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_numericfield, 0, 0, 1) - ZEND_ARG_INFO(0, parameters) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_emailfield, 0, 0, 1) - ZEND_ARG_INFO(0, parameters) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_datefield, 0, 0, 1) - ZEND_ARG_INFO(0, parameters) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_passwordfield, 0, 0, 1) - ZEND_ARG_INFO(0, parameters) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_hiddenfield, 0, 0, 1) - ZEND_ARG_INFO(0, parameters) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_filefield, 0, 0, 1) - ZEND_ARG_INFO(0, parameters) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_checkfield, 0, 0, 1) - ZEND_ARG_INFO(0, parameters) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_radiofield, 0, 0, 1) - ZEND_ARG_INFO(0, parameters) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_imageinput, 0, 0, 1) - ZEND_ARG_INFO(0, parameters) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_submitbutton, 0, 0, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_generic_field, 0, 0, 1) ZEND_ARG_INFO(0, parameters) ZEND_END_ARG_INFO() @@ -228,17 +198,27 @@ PHALCON_INIT_FUNCS(phalcon_tag_method_entry){ PHP_ME(Phalcon_Tag, linkTo, arginfo_phalcon_tag_linkto, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_ME(Phalcon_Tag, _inputField, NULL, ZEND_ACC_STATIC|ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Tag, _inputFieldChecked, NULL, ZEND_ACC_STATIC|ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Tag, textField, arginfo_phalcon_tag_textfield, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Tag, numericField, arginfo_phalcon_tag_numericfield, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Tag, emailField, arginfo_phalcon_tag_emailfield, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Tag, dateField, arginfo_phalcon_tag_datefield, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Tag, passwordField, arginfo_phalcon_tag_passwordfield, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Tag, hiddenField, arginfo_phalcon_tag_hiddenfield, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Tag, fileField, arginfo_phalcon_tag_filefield, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Tag, checkField, arginfo_phalcon_tag_checkfield, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Tag, radioField, arginfo_phalcon_tag_radiofield, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Tag, imageInput, arginfo_phalcon_tag_imageinput, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Tag, submitButton, arginfo_phalcon_tag_submitbutton, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Tag, colorField, arginfo_phalcon_tag_generic_field, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Tag, textField, arginfo_phalcon_tag_generic_field, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Tag, numericField, arginfo_phalcon_tag_generic_field, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Tag, rangeField, arginfo_phalcon_tag_generic_field, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Tag, emailField, arginfo_phalcon_tag_generic_field, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Tag, dateField, arginfo_phalcon_tag_generic_field, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Tag, dateTimeField, arginfo_phalcon_tag_generic_field, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Tag, dateTimeLocalField, arginfo_phalcon_tag_generic_field, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Tag, monthField, arginfo_phalcon_tag_generic_field, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Tag, timeField, arginfo_phalcon_tag_generic_field, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Tag, weekField, arginfo_phalcon_tag_generic_field, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Tag, passwordField, arginfo_phalcon_tag_generic_field, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Tag, hiddenField, arginfo_phalcon_tag_generic_field, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Tag, searchField, arginfo_phalcon_tag_generic_field, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Tag, telField, arginfo_phalcon_tag_generic_field, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Tag, urlField, arginfo_phalcon_tag_generic_field, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Tag, fileField, arginfo_phalcon_tag_generic_field, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Tag, checkField, arginfo_phalcon_tag_generic_field, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Tag, radioField, arginfo_phalcon_tag_generic_field, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Tag, imageInput, arginfo_phalcon_tag_generic_field, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Tag, submitButton, arginfo_phalcon_tag_generic_field, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Tag, selectStatic, arginfo_phalcon_tag_selectstatic, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_ME(Phalcon_Tag, select, arginfo_phalcon_tag_select, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_ME(Phalcon_Tag, textArea, arginfo_phalcon_tag_textarea, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) @@ -258,4 +238,3 @@ PHALCON_INIT_FUNCS(phalcon_tag_method_entry){ PHP_ME(Phalcon_Tag, tagHtmlClose, arginfo_phalcon_tag_taghtmlclose, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_FE_END }; -