diff --git a/ReadMe.md b/ReadMe.md index 9c691df..5c57200 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -43,7 +43,7 @@ Alternative setup composer local zip file repot: 3) Upate the global `src/Extensions/DefaultExtension.php`: 1) `getFunctionHandler`: popup_init, popup 2) `getBlockHandler`: t - 4) check either `src/FunctionHander/HtmlCheckboxes.php` and `src/FunctionHander/HtmlOptions.php` have changed + 4) check either `src/FunctionHander/HtmlCheckboxes.php`, `src/FunctionHander/HtmlOptions.php` and `src/FunctionHander/HtmlBase.php` have changed 1) Update and leep the label/pos changes 5) Create new release version as official relase number @@ -84,6 +84,42 @@ Then open the vscode settings and set for the Folder (if multiple folders are in ### Changed +- `src/FunctionHander/HtmlBase.php` + +```diff +diff --git i/src/FunctionHandler/HtmlBase.php w/src/FunctionHandler/HtmlBase.php +index 99f8e6c..99a82a6 100644 +--- i/src/FunctionHandler/HtmlBase.php ++++ w/src/FunctionHandler/HtmlBase.php +@@ -16,6 +16,7 @@ class HtmlBase extends Base { + * @param $labels + * @param $label_ids + * @param bool $escape ++ * @param $pos [default=''] + * + * @return string + */ +@@ -30,7 +31,8 @@ class HtmlBase extends Base { + $separator, + $labels, + $label_ids, +- $escape = true ++ $escape = true, ++ $pos = '' + ) { + + $_output = ''; +@@ -83,7 +85,7 @@ class HtmlBase extends Base { + } + $_output .= '
LOOP OUTPUT: {$smarty.section.page_list.index}
{/section} +
+ Drop Down simple +
+
+ Drop Down nested +
+
+ radio plain +
{html_radios name="radio_test" options=$radio_test selected=$radio_test_selected}
+
+ checkbox plain +
{html_checkboxes name="checkbox_test" options=$checkbox_test selected=$checkbox_test_selected}
+
+ checkbox pos +
{html_checkboxes name="checkbox_test_pos" options=$checkbox_test selected=$checkbox_test_pos_selected pos=$checkbox_test_pos}
diff --git a/test/includes/templates/frontend/test.simple.tpl b/test/includes/templates/frontend/test.simple.tpl index a312ca0..4afe87b 100644 --- a/test/includes/templates/frontend/test.simple.tpl +++ b/test/includes/templates/frontend/test.simple.tpl @@ -62,22 +62,37 @@ BASE: {$BASE}
LOOP OUTPUT: {$smarty.section.page_list.index}
{/section} +
+ Drop Down simple +
+
+ Drop Down nested +
+
+ radio plain +
{html_radios name="radio_test" options=$radio_test selected=$radio_test_selected}
+
+ checkbox plain +
{html_checkboxes name="checkbox_test" options=$checkbox_test selected=$checkbox_test_selected}
+
+ checkbox pos +
{html_checkboxes name="checkbox_test_pos" options=$checkbox_test selected=$checkbox_test_pos_selected pos=$checkbox_test_pos}
diff --git a/update/src/FunctionHandler/HtmlBase.php b/update/src/FunctionHandler/HtmlBase.php new file mode 100644 index 0000000..99a82a6 --- /dev/null +++ b/update/src/FunctionHandler/HtmlBase.php @@ -0,0 +1,109 @@ +__toString(); + } else { + trigger_error( + 'value is an object of class \'' . get_class($value) . + '\' without __toString() method', + E_USER_NOTICE + ); + return ''; + } + } else { + $value = (string)$value; + } + if (is_object($output)) { + if (method_exists($output, '__toString')) { + $output = (string)$output->__toString(); + } else { + trigger_error( + 'output is an object of class \'' . get_class($output) . + '\' without __toString() method', + E_USER_NOTICE + ); + return ''; + } + } else { + $output = (string)$output; + } + if ($labels) { + if ($label_ids) { + $_id = smarty_function_escape_special_chars( + preg_replace( + '![^\w\-\.]!' . \Smarty\Smarty::$_UTF8_MODIFIER, + '_', + $name . '_' . $value + ) + ); + $_output .= '