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 5730 2011-12-11 07:23:23Z ralgith $
| * $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']) { $options['rows'] = 5; } if(!$options['cols'])
| if(!isset($options['rows'])) { $options['rows'] = 5; } 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']}\""; } if(isset($options['class'])) { $input .= " class=\"label_{$options['class']}\""; } $input .= "><input type=\"radio\" name=\"{$name}\" value=\"".htmlspecialchars($value)."\""; if(isset($options['class'])) { $input .= " class=\"radio_input ".$options['class']."\"";
| { $input = "<label"; if(isset($options['id'])) { $input .= " for=\"{$options['id']}\""; } if(isset($options['class'])) { $input .= " class=\"label_{$options['class']}\""; } $input .= "><input type=\"radio\" name=\"{$name}\" value=\"".htmlspecialchars_uni($value)."\""; if(isset($options['class'])) { $input .= " class=\"radio_input ".$options['class']."\"";
|
} else {
| } else {
|
Zeile 293 | Zeile 293 |
---|
if(isset($options['class'])) { $input .= " class=\"label_{$options['class']}\"";
|
if(isset($options['class'])) { $input .= " class=\"label_{$options['class']}\"";
|
} $input .= "><input type=\"checkbox\" name=\"{$name}\" value=\"".htmlspecialchars($value)."\""; if(isset($options['class']))
| } $input .= "><input type=\"checkbox\" name=\"{$name}\" value=\"".htmlspecialchars_uni($value)."\""; if(isset($options['class']))
|
{ $input .= " class=\"checkbox_input ".$options['class']."\""; }
| { $input .= " class=\"checkbox_input ".$options['class']."\""; }
|
Zeile 307 | Zeile 307 |
---|
{ $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\""; }
|
Zeile 391 | Zeile 391 |
---|
$selectoptions = ''; }
|
$selectoptions = ''; }
|
if(!$options['depth'])
| if(!isset($options['depth']))
|
{ $options['depth'] = 0; } $options['depth'] = intval($options['depth']);
|
{ $options['depth'] = 0; } $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 466 | Zeile 466 |
---|
$options['depth'] -= 5; } }
|
$options['depth'] -= 5; } }
|
} }
| } }
|
} if($is_first == 1)
| } if($is_first == 1)
|
Zeile 509 | Zeile 509 |
---|
function generate_group_select($name, $selected=array(), $options=array()) { global $cache;
|
function generate_group_select($name, $selected=array(), $options=array()) { global $cache;
|
|
|
$select = "<select name=\"{$name}\""; if(isset($options['multiple']))
| $select = "<select name=\"{$name}\""; if(isset($options['multiple']))
|
Zeile 530 | Zeile 530 |
---|
if(isset($options['size'])) { $select .= " size=\"{$options['size']}\"";
|
if(isset($options['size'])) { $select .= " size=\"{$options['size']}\"";
|
}
| }
|
$select .= ">\n";
| $select .= ">\n";
|
Zeile 550 | Zeile 550 |
---|
} $select .= "</select>";
|
} $select .= "</select>";
|
|
|
return $select; }
| return $select; }
|
Zeile 560 | Zeile 560 |
---|
* @param string The value for the submit button. * @param array Array of options for the submit button (class, id, name, dsiabled, onclick) * @return string The generated submit button.
|
* @param string The value for the submit button. * @param array Array of options for the submit button (class, id, name, dsiabled, onclick) * @return string The generated submit button.
|
*/
| */
|
function generate_submit_button($value, $options=array())
|
function generate_submit_button($value, $options=array())
|
{ $input = "<input type=\"submit\" value=\"".htmlspecialchars($value)."\"";
if(isset($options['class'])) { $input .= " class=\"submit_button ".$options['class']."\""; } else { $input .= " class=\"submit_button\""; } if(isset($options['id'])) { $input .= " id=\"".$options['id']."\""; } if(isset($options['name'])) { $input .= " name=\"".$options['name']."\""; } if($options['disabled']) {
| { $input = "<input type=\"submit\" value=\"".htmlspecialchars_uni($value)."\"";
if(isset($options['class'])) { $input .= " class=\"submit_button ".$options['class']."\""; } else { $input .= " class=\"submit_button\""; } if(isset($options['id'])) { $input .= " id=\"".$options['id']."\""; } if(isset($options['name'])) { $input .= " name=\"".$options['name']."\""; } if(isset($options['disabled'])) {
|
$input .= " disabled=\"disabled\""; }
|
$input .= " disabled=\"disabled\""; }
|
if($options['onclick'])
| if(isset($options['onclick']))
|
{ $input .= " onclick=\"".str_replace('"', '\"', $options['onclick'])."\"";
|
{ $input .= " onclick=\"".str_replace('"', '\"', $options['onclick'])."\"";
|
} $input .= " />"; return $input; }
| } $input .= " />"; return $input; }
|
/** * Generate a reset button. *
| /** * Generate a reset button. *
|
Zeile 602 | Zeile 602 |
---|
*/ function generate_reset_button($value, $options=array()) {
|
*/ 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'])) {
|
Zeile 635 | Zeile 635 |
---|
* @return string The generated yes/no radio button. */ function generate_yes_no_radio($name, $value=1, $int=true, $yes_options=array(), $no_options = array())
|
* @return string The generated yes/no radio button. */ function generate_yes_no_radio($name, $value=1, $int=true, $yes_options=array(), $no_options = array())
|
{ global $lang; // Checked status
| { global $lang; // Checked status
|
if($value == "no" || $value === '0') { $no_checked = 1;
| if($value == "no" || $value === '0') { $no_checked = 1;
|
Zeile 654 | Zeile 654 |
---|
{ $yes_value = 1; $no_value = 0;
|
{ $yes_value = 1; $no_value = 0;
|
} else {
| } else {
|
$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; $no_options['class'] = "radio_no ".$no_options['class']; $no_options['checked'] = $no_checked;
|
// Set the options straight $yes_options['class'] = "radio_yes ".$yes_options['class']; $yes_options['checked'] = $yes_checked; $no_options['class'] = "radio_no ".$no_options['class']; $no_options['checked'] = $no_checked;
|
|
|
$yes = $this->generate_radio_button($name, $yes_value, $lang->yes, $yes_options); $no = $this->generate_radio_button($name, $no_value, $lang->no, $no_options); return $yes." ".$no;
| $yes = $this->generate_radio_button($name, $yes_value, $lang->yes, $yes_options); $no = $this->generate_radio_button($name, $no_value, $lang->no, $no_options); return $yes." ".$no;
|
Zeile 690 | Zeile 701 |
---|
{ $off_checked = 1; $on_checked = 0;
|
{ $off_checked = 1; $on_checked = 0;
|
} else
| } else
|
{ $on_checked = 1; $off_checked = 0;
| { $on_checked = 1; $off_checked = 0;
|
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 804 | Zeile 825 |
---|
if($this->_return == false) { echo "</form>";
|
if($this->_return == false) { echo "</form>";
|
} else
| } else
|
{ return "</form>"; }
| { return "</form>"; }
|
Zeile 866 | Zeile 887 |
---|
'row_options' => &$row_options, 'this' => &$this );
|
'row_options' => &$row_options, 'this' => &$this );
|
|
|
$plugins->run_hooks("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) { $row = "<label{$for}>{$title}</label>"; }
|
if($title) { $row = "<label{$for}>{$title}</label>"; }
|
if($options['id'])
| if(isset($options['id']))
|
{ $options['id'] = " id=\"{$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);
|