Ejemplo n.º 1
0
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);
}
Ejemplo n.º 2
0
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("'", '&#39;', $opt[$a]) . "'";
    }
    $FmtV['$InputSelectArgs'] = implode(' ', $attr);
    $FmtV['$InputSelectOptions'] = $optionshtml;
    return Keep(FmtPageName($selectopt[':html'], $pagename));
}