예제 #1
0
파일: form.php 프로젝트: Bob-586/cx_old
 /**
  * Purpose: To make Checkboxes and Radios work.
  */
 private function input($type, $name, $value, $label, $additional_attr, $htmlOptions)
 {
     $id = $this->get_form_id($name, $type);
     $id .= '-' . $value;
     $req = $this->get_required($htmlOptions);
     $label = $label === '' ? ucwords(str_replace('_', ' ', $value)) : $label;
     $this->set_html('<input type="' . $type . '" name="' . $name . '" value="' . $value . '" id="' . $id . '"' . $req['required']);
     $this->get_readonly_and_asktosave_check('input', $name, $htmlOptions);
     $this->set_html(get_default_options('input', $name, $htmlOptions, $this->extra));
     $more = !empty($additional_attr) ? $additional_attr . ' />' : ' />';
     $this->set_html($more);
     $this->label_for($name, $id, $label . $req['label'], $htmlOptions);
 }
예제 #2
0
function options_validate($input)
{
    $default_options = get_default_options();
    $valid_input = $default_options;
    $submit = !empty($input['submit']) ? true : false;
    if ($submit) {
        $valid_input = $input;
    }
    return $valid_input;
}
예제 #3
0
        $attrs .= 'cols="70"';
    }
    if (strpos($attrs, 'rows') === false) {
        $attrs .= 'rows="5"';
    }
    echo '<tr valign="top"><th scope="row">';
    echo '<label for="options[' . $name . ']">' . $label . '</label></th>';
    echo '<td><textarea wrap="off" ' . $attrs . ' name="options[' . $name . ']">' . htmlspecialchars($options[$name]) . '</textarea>';
    echo '<br /> ' . $tips;
    echo '</td></tr>';
}
if (isset($_POST['save'])) {
    $options = callout_request('options');
    update_option('calloutopts', $options);
} else {
    $options = get_option('calloutopts', get_default_options());
}
?>
<div class="wrap">
<form method="post">

<h2>Callout box options</h2>
A callout box is constructed as three DIV objects: an outside DIV with an embedded title and body.
&nbsp;Enter css in the boxes below to format these DIVs.
<table class="form-table">
<?php 
callout_field_textarea('callout_style', 'Style to use for the callout frame.');
callout_field_textarea('callout_title_style', 'Style to use for the callout title.');
callout_field_textarea('callout_body_style', 'Style to use for the callout body.');
?>
</table>