public static function CleantalkFuncs::print_form in Anti Spam by CleanTalk 8.4
Same name and namespace in other branches
- 9.1.x src/CleantalkFuncs.php \Drupal\cleantalk\CleantalkFuncs::print_form()
1 call to CleantalkFuncs::print_form()
- BootSubscriber::handle in src/
EventSubscriber/ BootSubscriber.php - Handles a Request to convert it to a Response.
File
- src/
CleantalkFuncs.php, line 742
Class
- CleantalkFuncs
- Cleantalk class create request
Namespace
Drupal\cleantalkCode
public static function print_form($arr, $k) {
// Fix for pages04.net forms
if (isset($arr['formSourceName'])) {
$tmp = array();
foreach ($arr as $key => $val) {
$tmp_key = str_replace('_', '+', $key);
$tmp[$tmp_key] = $val;
}
$arr = $tmp;
unset($tmp, $key, $tmp_key, $val);
}
foreach ($arr as $key => $value) {
if (!is_array($value)) {
print '<textarea
name="' . ($k == '' ? $key : $k . '[' . $key . ']') . '"
style="display:none;">' . htmlspecialchars($value) . '</textarea>';
}
else {
self::print_form($value, $k == '' ? $key : $k . '[' . $key . ']');
}
}
}