function InputActionForm($pagename, $type, $args) { global $InputAttrs; $args = ParseArgs($args); if (@$args['pagename']) $pagename = $args['pagename']; $opt = NULL; $html = InputToHTML($pagename, $type, $args, $opt); foreach(preg_grep('/^[\\w$]/', array_keys($args)) as $k) { if (is_array($args[$k]) || in_array($k, $InputAttrs)) continue; if ($k == 'n' || $k == 'pagename') continue; $html .= "<input type='hidden' name='$k' value='{$args[$k]}' />"; } return Keep($html); }
function InputSelect($pagename, $type, $markup) { global $InputTags, $InputAttrs, $FmtV; preg_match_all('/\\(:input\\s+\\S+\\s+(.*?):\\)/', $markup, $match); $selectopt = (array) $InputTags[$type]; $opt = $selectopt; $optionshtml = ''; $optiontype = isset($InputTags["{$type}-option"]) ? "{$type}-option" : "select-option"; foreach ($match[1] as $args) { $optionshtml .= InputToHTML($pagename, $optiontype, $args, $oo); $opt = array_merge($opt, $oo); } $attrlist = array_diff($InputAttrs, array('value')); foreach ($attrlist as $a) { if (!isset($opt[$a]) || $opt[$a] === false) { continue; } $attr[] = "{$a}='" . str_replace("'", ''', $opt[$a]) . "'"; } $FmtV['$InputSelectArgs'] = implode(' ', $attr); $FmtV['$InputSelectOptions'] = $optionshtml; return Keep(FmtPageName($selectopt[':html'], $pagename)); }