Zeile 6 | Zeile 6 |
---|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* $Id: class_form.php 5297 2010-12-28 22:01:14Z Tomm $
| * $Id$
|
*/
/**
| */
/**
|
Zeile 81 | Zeile 81 |
---|
*/ function generate_hidden_field($name, $value, $options=array()) {
|
*/ function generate_hidden_field($name, $value, $options=array()) {
|
$input = "<input type=\"hidden\" name=\"{$name}\" value=\"".htmlspecialchars($value)."\"";
| $input = "<input type=\"hidden\" name=\"{$name}\" value=\"".htmlspecialchars_uni($value)."\"";
|
if(isset($options['id'])) { $input .= " id=\"".$options['id']."\"";
| if(isset($options['id'])) { $input .= " id=\"".$options['id']."\"";
|
Zeile 100 | Zeile 100 |
---|
*/ function generate_text_box($name, $value="", $options=array()) {
|
*/ function generate_text_box($name, $value="", $options=array()) {
|
$input = "<input type=\"text\" name=\"".$name."\" value=\"".htmlspecialchars($value)."\"";
| $input = "<input type=\"text\" name=\"".$name."\" value=\"".htmlspecialchars_uni($value)."\"";
|
if(isset($options['class'])) { $input .= " class=\"text_input ".$options['class']."\"";
| if(isset($options['class'])) { $input .= " class=\"text_input ".$options['class']."\"";
|
Zeile 131 | Zeile 131 |
---|
*/ function generate_password_box($name, $value="", $options=array()) {
|
*/ function generate_password_box($name, $value="", $options=array()) {
|
$input = "<input type=\"password\" name=\"".$name."\" value=\"".htmlspecialchars($value)."\"";
| $input = "<input type=\"password\" name=\"".$name."\" value=\"".htmlspecialchars_uni($value)."\"";
|
if(isset($options['class'])) { $input .= " class=\"text_input ".$options['class']."\"";
| if(isset($options['class'])) { $input .= " class=\"text_input ".$options['class']."\"";
|
Zeile 206 | Zeile 206 |
---|
{ $textarea .= " id=\"{$options['id']}\""; }
|
{ $textarea .= " id=\"{$options['id']}\""; }
|
if($options['style'])
| if(isset($options['style']))
|
{ $textarea .= " style=\"{$options['style']}\""; }
|
{ $textarea .= " style=\"{$options['style']}\""; }
|
if($options['disabled'])
| if(isset($options['disabled']))
|
{ $textarea .= " disabled=\"disabled\""; }
|
{ $textarea .= " disabled=\"disabled\""; }
|
if(!$options['rows'])
| if(!isset($options['rows']))
|
{ $options['rows'] = 5; }
|
{ $options['rows'] = 5; }
|
if(!$options['cols'])
| if(!isset($options['cols']))
|
{ $options['cols'] = 45; }
| { $options['cols'] = 45; }
|
Zeile 238 | Zeile 238 |
---|
* @return string The generated radio button. */ function generate_radio_button($name, $value="", $label="", $options=array())
|
* @return string The generated radio button. */ function generate_radio_button($name, $value="", $label="", $options=array())
|
{ $input = "<label"; if(isset($options['id'])) { $input .= " for=\"{$options['id']}\""; }
| { $input = "<label"; if(isset($options['id'])) { $input .= " for=\"{$options['id']}\""; }
|
if(isset($options['class'])) { $input .= " class=\"label_{$options['class']}\""; }
|
if(isset($options['class'])) { $input .= " class=\"label_{$options['class']}\""; }
|
$input .= "><input type=\"radio\" name=\"{$name}\" value=\"".htmlspecialchars($value)."\"";
| $input .= "><input type=\"radio\" name=\"{$name}\" value=\"".htmlspecialchars_uni($value)."\"";
|
if(isset($options['class'])) { $input .= " class=\"radio_input ".$options['class']."\"";
| if(isset($options['class'])) { $input .= " class=\"radio_input ".$options['class']."\"";
|
Zeile 289 | Zeile 289 |
---|
if(isset($options['id'])) { $input .= " for=\"{$options['id']}\"";
|
if(isset($options['id'])) { $input .= " for=\"{$options['id']}\"";
|
} if(isset($options['class'])) {
| } if(isset($options['class'])) {
|
$input .= " class=\"label_{$options['class']}\""; }
|
$input .= " class=\"label_{$options['class']}\""; }
|
$input .= "><input type=\"checkbox\" name=\"{$name}\" value=\"".htmlspecialchars($value)."\"";
| $input .= "><input type=\"checkbox\" name=\"{$name}\" value=\"".htmlspecialchars_uni($value)."\"";
|
if(isset($options['class']))
|
if(isset($options['class']))
|
{
| {
|
$input .= " class=\"checkbox_input ".$options['class']."\""; } else { $input .= " class=\"checkbox_input\"";
|
$input .= " class=\"checkbox_input ".$options['class']."\""; } else { $input .= " class=\"checkbox_input\"";
|
} if(isset($options['id']))
| } if(isset($options['id']))
|
{ $input .= " id=\"".$options['id']."\"";
|
{ $input .= " id=\"".$options['id']."\"";
|
} if($options['checked'] === true || $options['checked'] == 1) {
| } if(isset($options['checked']) && ($options['checked'] === true || $options['checked'] == 1)) {
|
$input .= " checked=\"checked\"";
|
$input .= " checked=\"checked\"";
|
}
| }
|
if(isset($options['onclick'])) { $input .= " onclick=\"{$options['onclick']}\"";
|
if(isset($options['onclick'])) { $input .= " onclick=\"{$options['onclick']}\"";
|
}
| }
|
$input .= " /> "; if($label != "") {
| $input .= " /> "; if($label != "") {
|
Zeile 336 | Zeile 336 |
---|
function generate_select_box($name, $option_list, $selected=array(), $options=array()) { if(!isset($options['multiple']))
|
function generate_select_box($name, $option_list, $selected=array(), $options=array()) { if(!isset($options['multiple']))
|
{
| {
|
$select = "<select name=\"{$name}\""; } else
| $select = "<select name=\"{$name}\""; } else
|
Zeile 391 | Zeile 391 |
---|
$selectoptions = ''; }
|
$selectoptions = ''; }
|
if(!$options['depth'])
| if(!isset($options['depth']))
|
{ $options['depth'] = 0;
|
{ $options['depth'] = 0;
|
} $options['depth'] = intval($options['depth']);
| } $options['depth'] = intval($options['depth']);
|
|
|
if(!$options['pid'])
| if(!isset($options['pid']))
|
{
|
{
|
$pid = 0;
| $options['pid'] = 0;
|
} $pid = intval($options['pid']);
| } $pid = intval($options['pid']);
|
Zeile 429 | Zeile 429 |
---|
$selectoptions .= "<option value=\"-1\"{$select_add}>{$options['main_option']}</option>\n"; }
|
$selectoptions .= "<option value=\"-1\"{$select_add}>{$options['main_option']}</option>\n"; }
|
if(is_array($fselectcache[$pid]))
| if(isset($fselectcache[$pid]))
|
{ foreach($fselectcache[$pid] as $main) {
| { foreach($fselectcache[$pid] as $main) {
|
Zeile 563 | Zeile 563 |
---|
*/ function generate_submit_button($value, $options=array()) {
|
*/ function generate_submit_button($value, $options=array()) {
|
$input = "<input type=\"submit\" value=\"".htmlspecialchars($value)."\"";
| $input = "<input type=\"submit\" value=\"".htmlspecialchars_uni($value)."\"";
|
if(isset($options['class'])) {
| if(isset($options['class'])) {
|
Zeile 581 | Zeile 581 |
---|
{ $input .= " name=\"".$options['name']."\""; }
|
{ $input .= " name=\"".$options['name']."\""; }
|
if($options['disabled'])
| if(isset($options['disabled']))
|
{ $input .= " disabled=\"disabled\""; }
|
{ $input .= " disabled=\"disabled\""; }
|
if($options['onclick'])
| if(isset($options['onclick']))
|
{ $input .= " onclick=\"".str_replace('"', '\"', $options['onclick'])."\""; } $input .= " />"; return $input; }
|
{ $input .= " onclick=\"".str_replace('"', '\"', $options['onclick'])."\""; } $input .= " />"; return $input; }
|
|
|
/** * Generate a reset button.
|
/** * Generate a reset button.
|
*
| *
|
* @param string The value for the reset button. * @param array Array of options for the reset button (class, id, name) * @return string The generated reset button. */ function generate_reset_button($value, $options=array()) {
|
* @param string The value for the reset button. * @param array Array of options for the reset button (class, id, name) * @return string The generated reset button. */ function generate_reset_button($value, $options=array()) {
|
$input = "<input type=\"reset\" value=\"".htmlspecialchars($value)."\"";
| $input = "<input type=\"reset\" value=\"".htmlspecialchars_uni($value)."\"";
|
if(isset($options['class']))
|
if(isset($options['class']))
|
{
| {
|
$input .= " class=\"submit_button ".$options['class']."\""; } else
| $input .= " class=\"submit_button ".$options['class']."\""; } else
|
Zeile 623 | Zeile 623 |
---|
$input .= " />"; return $input; }
|
$input .= " />"; return $input; }
|
|
|
/** * Generate a yes/no radio button choice. *
| /** * Generate a yes/no radio button choice. *
|
Zeile 660 | Zeile 660 |
---|
$yes_value = "yes"; $no_value = "no"; }
|
$yes_value = "yes"; $no_value = "no"; }
|
| if(!isset($yes_options['class'])) { $yes_options['class'] = ''; }
if(!isset($no_options['class'])) { $no_options['class'] = ''; }
|
// Set the options straight $yes_options['class'] = "radio_yes ".$yes_options['class']; $yes_options['checked'] = $yes_checked;
| // Set the options straight $yes_options['class'] = "radio_yes ".$yes_options['class']; $yes_options['checked'] = $yes_checked;
|
Zeile 709 | Zeile 720 |
---|
} // Set the options straight
|
} // Set the options straight
|
| if(!isset($on_options['class'])) { $on_options['class'] = ''; }
if(!isset($off_options['class'])) { $off_options['class'] = ''; }
|
$on_options['class'] = "radio_on ".$on_options['class']; $on_options['checked'] = $on_checked; $off_options['class'] = "radio_off ".$off_options['class'];
| $on_options['class'] = "radio_on ".$on_options['class']; $on_options['checked'] = $on_checked; $off_options['class'] = "radio_off ".$off_options['class'];
|
Zeile 746 | Zeile 767 |
---|
} if(!$day)
|
} if(!$day)
|
{
| {
|
$day = date("j", TIME_NOW); } if(!$month) { $month = date("n", TIME_NOW);
|
$day = date("j", TIME_NOW); } if(!$month) { $month = date("n", TIME_NOW);
|
}
| }
|
if(!$year) {
| if(!$year) {
|
Zeile 768 | Zeile 789 |
---|
/** * Output a row of buttons in a wrapped container.
|
/** * Output a row of buttons in a wrapped container.
|
*
| *
|
* @param array Array of the buttons (html) to output. * @return string The submit wrapper (optional) */ function output_submit_wrapper($buttons) { global $plugins;
|
* @param array Array of the buttons (html) to output. * @return string The submit wrapper (optional) */ function output_submit_wrapper($buttons) { global $plugins;
|
$plugins->run_hooks_by_ref("admin_form_output_submit_wrapper", $buttons);
| $buttons = $plugins->run_hooks("admin_form_output_submit_wrapper", $buttons);
|
$return = "<div class=\"form_button_wrapper\">\n"; foreach($buttons as $button) {
| $return = "<div class=\"form_button_wrapper\">\n"; foreach($buttons as $button) {
|
Zeile 800 | Zeile 821 |
---|
function end() { global $plugins;
|
function end() { global $plugins;
|
$plugins->run_hooks_by_ref("admin_form_end", $this);
| $plugins->run_hooks("admin_form_end", $this);
|
if($this->_return == false) { echo "</form>";
| if($this->_return == false) { echo "</form>";
|
Zeile 866 | Zeile 887 |
---|
'row_options' => &$row_options, 'this' => &$this );
|
'row_options' => &$row_options, 'this' => &$this );
|
$plugins->run_hooks_by_ref("admin_formcontainer_output_row", $pluginargs);
| $plugins->run_hooks("admin_formcontainer_output_row", $pluginargs);
$row = $for = '';
|
if($label_for != '')
|
if($label_for != '')
|
{
| {
|
$for = " for=\"{$label_for}\"";
|
$for = " for=\"{$label_for}\"";
|
}
| }
|
if($title)
|
if($title)
|
{
| {
|
$row = "<label{$for}>{$title}</label>"; }
|
$row = "<label{$for}>{$title}</label>"; }
|
if($options['id']) { $options['id'] = " id=\"{$options['id']}\""; }
| if(isset($options['id'])) { $options['id'] = " id=\"{$options['id']}\""; } else { $options['id'] = ''; }
|
if($description != '') { $row .= "\n<div class=\"description\">{$description}</div>\n"; }
|
if($description != '') { $row .= "\n<div class=\"description\">{$description}</div>\n"; }
|
|
|
$row .= "<div class=\"form_row\"{$options['id']}>{$content}</div>\n";
|
$row .= "<div class=\"form_row\"{$options['id']}>{$content}</div>\n";
|
| |
$this->_container->construct_cell($row, $options);
|
$this->_container->construct_cell($row, $options);
|
|
|
if(!isset($options['skip_construct'])) { $this->_container->construct_row($row_options);
| if(!isset($options['skip_construct'])) { $this->_container->construct_row($row_options);
|
Zeile 911 | Zeile 939 |
---|
* Build a row for the table based form row. * * @param array Array of extra options for the cell (optional).
|
* Build a row for the table based form row. * * @param array Array of extra options for the cell (optional).
|
*/
| */
|
function construct_row($extra=array()) { $this->_container->construct_row($extra);
| function construct_row($extra=array()) { $this->_container->construct_row($extra);
|
Zeile 956 | Zeile 984 |
---|
{ global $plugins;
|
{ global $plugins;
|
$plugins->run_hooks("admin_formcontainer_end", $return);
| $hook = array( 'return' => &$return, 'this' => &$this ); $plugins->run_hooks("admin_formcontainer_end", $hook);
|
if($return == true) { return $this->_container->output($this->_title, 1, "general form_container {$this->extra_class}", true);
| if($return == true) { return $this->_container->output($this->_title, 1, "general form_container {$this->extra_class}", true);
|