mirror of
https://github.com/e107inc/e107.git
synced 2025-04-14 01:22:13 +02:00
bootstrap $frm->radio fixes. $frm->label() and $frm-radio_multi() should not be used.
This commit is contained in:
parent
f188f7c290
commit
ec633d2fc2
@ -308,8 +308,8 @@ $text = "
|
||||
<tr>
|
||||
<td>".PRFLAN_134."</td>
|
||||
<td>
|
||||
".$frm->radio('redirectsiteurl', 1, $pref['redirectsiteurl']).$frm->label(LAN_ENABLED, 'redirectsiteurl', 1)."
|
||||
".$frm->radio('redirectsiteurl', 0, !$pref['redirectsiteurl']).$frm->label(LAN_DISABLED, 'redirectsiteurl', 0)."
|
||||
".$frm->radio('redirectsiteurl', 1, $pref['redirectsiteurl'], array('label'=>LAN_ENABLED))."
|
||||
".$frm->radio('redirectsiteurl', 0, !$pref['redirectsiteurl'], array('label'=>LAN_DISABLED))."
|
||||
<div class='field-help'>".PRFLAN_135."</div>
|
||||
</td>
|
||||
</tr>
|
||||
@ -1470,7 +1470,7 @@ $text .= " <tr>
|
||||
<tr>
|
||||
<td>".PRFLAN_48.":</td>
|
||||
<td class='form-inline'>
|
||||
".$frm->radio_multi('user_tracking', array('cookie' => PRFLAN_49, 'session' => PRFLAN_50), $pref['user_tracking'])." ".PRFLAN_55.": ".$frm->text('cookie_name', $pref['cookie_name'], 20)."
|
||||
".$frm->radio('user_tracking', array('cookie' => PRFLAN_49, 'session' => PRFLAN_50), $pref['user_tracking'])." ".PRFLAN_55.": ".$frm->text('cookie_name', $pref['cookie_name'], 20)."
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@ -1763,7 +1763,7 @@ $text .= "
|
||||
$name = $arr['name'];
|
||||
$text .= "<tr>
|
||||
<td>".$name."</td>
|
||||
<td>".$frm->radio_multi("e_jslib_core[{$k}]",$js_options,$pref['e_jslib_core'][$k])."</td>
|
||||
<td>".$frm->radio("e_jslib_core[{$k}]", $js_options, $pref['e_jslib_core'][$k])."</td>
|
||||
</tr>";
|
||||
}
|
||||
|
||||
|
@ -85,7 +85,7 @@ $elements = array(e_UC_PUBLIC=>LAN_DISABLED,
|
||||
$text .= "
|
||||
<tr>
|
||||
<td>".UGFLAN_2.": </td>
|
||||
<td>".$frm->radio_multi('maintainance_flag', $elements, $pref['maintainance_flag'], TRUE)."</td>
|
||||
<td>".$frm->radio('maintainance_flag', $elements, $pref['maintainance_flag'], TRUE)."</td>
|
||||
</tr>";
|
||||
|
||||
//TODO multilanguage pref
|
||||
|
@ -851,7 +851,7 @@ class e_form
|
||||
{
|
||||
//size - large|medium|small
|
||||
//width should be explicit set by current admin theme
|
||||
$size = 'span12';
|
||||
$size = 'input-large';
|
||||
|
||||
switch($size)
|
||||
{
|
||||
@ -869,7 +869,7 @@ class e_form
|
||||
case 'large':
|
||||
default:
|
||||
$rows = '15';
|
||||
$size = 'large span10';
|
||||
$size = 'large input-block-level';
|
||||
// $height = "style='height:500px;width:1025px'"; // inline required for wysiwyg
|
||||
break;
|
||||
}
|
||||
@ -1011,7 +1011,7 @@ class e_form
|
||||
* @param $checked boolean
|
||||
* @param $options
|
||||
*/
|
||||
function radio($name, $value, $checked = false, $options = array())
|
||||
function radio($name, $value, $checked = false, $options = null)
|
||||
{
|
||||
|
||||
if(!is_array($options)) parse_str($options, $options);
|
||||
@ -1031,10 +1031,10 @@ class e_form
|
||||
|
||||
|
||||
|
||||
|
||||
// return print_a($options,true);
|
||||
if($labelFound) // Bootstrap compatible markup
|
||||
{
|
||||
$text .= "<label class='radio'>";
|
||||
$text .= "<label class='radio inline'>";
|
||||
|
||||
}
|
||||
|
||||
@ -1073,28 +1073,47 @@ class e_form
|
||||
$options_off = array('class' => 'e-expandit-off');
|
||||
}
|
||||
|
||||
$options_on['label'] = $label_enabled ? $label_enabled : LAN_ENABLED;
|
||||
$options_off['label'] = $label_disabled ? $label_disabled : LAN_DISABLED;
|
||||
|
||||
if(vartrue($options['reverse'])) // reverse order.
|
||||
{
|
||||
unset($options['reverse']);
|
||||
return $this->radio($name, 0, !$checked_enabled, $options_off)."".$this->label($label_disabled ? $label_disabled : LAN_DISABLED, $name, 0)." ".
|
||||
$this->radio($name, 1, $checked_enabled, $options_on)."".$this->label($label_enabled ? $label_enabled : LAN_ENABLED, $name, 1);
|
||||
|
||||
return $this->radio($name, 0, !$checked_enabled, $options_off)." ".
|
||||
$this->radio($name, 1, $checked_enabled, $options_on);
|
||||
|
||||
// return $this->radio($name, 0, !$checked_enabled, $options_off)."".$this->label($label_disabled ? $label_disabled : LAN_DISABLED, $name, 0)." ".
|
||||
// $this->radio($name, 1, $checked_enabled, $options_on)."".$this->label($label_enabled ? $label_enabled : LAN_ENABLED, $name, 1);
|
||||
}
|
||||
|
||||
return $this->radio($name, 1, $checked_enabled, $options_on)."".$this->label($label_enabled ? $label_enabled : LAN_ENABLED, $name, 1)."
|
||||
".$this->radio($name, 0, !$checked_enabled, $options_off)."".$this->label($label_disabled ? $label_disabled : LAN_DISABLED, $name, 0);
|
||||
$label = defset($label, $label);
|
||||
|
||||
$helpLabel = (is_array($help)) ? vartrue($help[$value]) : $help;
|
||||
|
||||
// Bootstrap Style Code - for use later.
|
||||
|
||||
|
||||
// ['help'] = $helpLabel;
|
||||
// $text[] = $this->radio($name, $value, (string) $checked === (string) $value, $options);
|
||||
return $this->radio($name, 1, $checked_enabled, $options_on)." ".$this->radio($name, 0, !$checked_enabled, $options_off);
|
||||
|
||||
|
||||
// return $this->radio($name, 1, $checked_enabled, $options_on)."".$this->label($label_enabled ? $label_enabled : LAN_ENABLED, $name, 1)."
|
||||
// ".$this->radio($name, 0, !$checked_enabled, $options_off)."".$this->label($label_disabled ? $label_disabled : LAN_DISABLED, $name, 0);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* XXX INTERNAL ONLY - Use radio() with the 'multiple=1' option instead of using this directly.
|
||||
* XXX INTERNAL ONLY - Use radio() instead. array will automatically trigger this internal method.
|
||||
* @param string $name
|
||||
* @param array $elements = arrays value => label
|
||||
* @param string/integer $checked = current value
|
||||
* @param boolean $multi_line
|
||||
* @param mixed $help array of field help items or string of field-help (to show on all)
|
||||
*/
|
||||
function radio_multi($name, $elements, $checked, $multi_line = false, $help = null)
|
||||
private function radio_multi($name, $elements, $checked, $options=array(), $help = null)
|
||||
{
|
||||
|
||||
|
||||
@ -1117,6 +1136,7 @@ class e_form
|
||||
|
||||
|
||||
$text = array();
|
||||
|
||||
if(is_string($elements)) parse_str($elements, $elements);
|
||||
|
||||
foreach ($elements as $value => $label)
|
||||
@ -1126,27 +1146,37 @@ class e_form
|
||||
$helpLabel = (is_array($help)) ? vartrue($help[$value]) : $help;
|
||||
|
||||
// Bootstrap Style Code - for use later.
|
||||
// $options['label'] = $label;
|
||||
// $options['help'] = $helpLabel;
|
||||
// $text[] = $this->radio($name, $value, (string) $checked === (string) $value, $options);
|
||||
$options['label'] = $label;
|
||||
$options['help'] = $helpLabel;
|
||||
$text[] = $this->radio($name, $value, (string) $checked === (string) $value, $options);
|
||||
|
||||
$text[] = $this->radio($name, $value, (string) $checked === (string) $value)."".$this->label($label, $name, $value).(isset($helpLabel) ? "<div class='field-help'>".$helpLabel."</div>" : '');
|
||||
// $text[] = $this->radio($name, $value, (string) $checked === (string) $value)."".$this->label($label, $name, $value).(isset($helpLabel) ? "<div class='field-help'>".$helpLabel."</div>" : '');
|
||||
}
|
||||
|
||||
if($multi_line === false)
|
||||
{
|
||||
return implode(" ", $text);
|
||||
// return implode(" ", $text);
|
||||
}
|
||||
|
||||
|
||||
$separator = varset($options['sep']," ");
|
||||
// return print_a($text,true);
|
||||
return implode($separator, $text);
|
||||
|
||||
// return implode("\n", $text);
|
||||
return "<div class='field-spacer' style='width:50%;float:left'>".implode("</div><div class='field-spacer' style='width:50%;float:left'>", $text)."</div>";
|
||||
//XXX Limiting markup.
|
||||
// return "<div class='field-spacer' style='width:50%;float:left'>".implode("</div><div class='field-spacer' style='width:50%;float:left'>", $text)."</div>";
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Just for BC - use the $options['label'] instead.
|
||||
*/
|
||||
function label($text, $name = '', $value = '')
|
||||
{
|
||||
e107::getMessage()->addDebug("Deprecated \$frm->label() used");
|
||||
$for_id = $this->_format_id('', $name, $value, 'for');
|
||||
return "<label$for_id class='e-tip '>{$text}</label>";
|
||||
return "<label$for_id class='e-tip legacy'>{$text}</label>";
|
||||
}
|
||||
|
||||
function help($text)
|
||||
@ -1759,7 +1789,7 @@ class e_form
|
||||
break;
|
||||
|
||||
case 'radio':
|
||||
$def_options['class'] = 'radio inline';
|
||||
//$def_options['class'] = ' ';
|
||||
unset($def_options['size'], $def_options['selected']);
|
||||
break;
|
||||
|
||||
@ -2866,7 +2896,7 @@ class e_form
|
||||
}
|
||||
|
||||
//$this->selectbox($key, $layouts, $value)
|
||||
$ret = (vartrue($parms['raw']) ? $layouts[0] : $this->radio_multi($key, $layouts[0], $value, true, $info));
|
||||
$ret = (vartrue($parms['raw']) ? $layouts[0] : $this->radio_multi($key, $layouts[0], $value,array('sep'=>"<br />"), $info));
|
||||
break;
|
||||
|
||||
case 'templates': //to do - exclude param (exact match)
|
||||
|
@ -105,7 +105,7 @@ $text = "
|
||||
</tr>
|
||||
<tr>
|
||||
<td>".CHBLAN_36."</td>
|
||||
<td>".$frm->radio_multi('cb_layer', array(0 => CHBLAN_37, 1 => str_replace("[x]", $frm->text('cb_layer_height', $pref['cb_layer_height'], 3), CHBLAN_29), 2 => CHBLAN_38), $pref['cb_layer'], true)."</td>
|
||||
<td>".$frm->radio('cb_layer', array(0 => CHBLAN_37, 1 => str_replace("[x]", $frm->text('cb_layer_height', $pref['cb_layer_height'], 3), CHBLAN_29), 2 => CHBLAN_38), $pref['cb_layer'], true)."</td>
|
||||
</tr>
|
||||
";
|
||||
|
||||
|
@ -188,7 +188,7 @@ $text = "
|
||||
<td>";
|
||||
$array = array(NFLAN_13,NFLAN_14,NFLAN_20,NFLAN_21);
|
||||
$text .=
|
||||
$frm->radio_multi('newsfeed_active', $array, ($newsfeeed_active ? $newsfeeed_active : 0), true, NFLAN_22)."
|
||||
$frm->radio('newsfeed_active', $array, ($newsfeeed_active ? $newsfeeed_active : 0), true, NFLAN_22)."
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -5,7 +5,6 @@ body { }
|
||||
|
||||
body { padding-top: 75px; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -136,9 +135,9 @@ input:-moz-placeholder { font-style:italic }
|
||||
|
||||
|
||||
|
||||
input[type='radio'] { vertical-align:top; }
|
||||
/* input[type='radio'] { vertical-align:top; } */
|
||||
|
||||
label { margin-left:5px; margin-right:10px; display: inline; vertical-align:bottom; }
|
||||
label.legacy { margin-left:5px;margin-right:10px; display: inline-block; }
|
||||
|
||||
/* Core Icons & Image Buttons */
|
||||
img.icon { border: 0px; vertical-align: middle; }
|
||||
|
@ -108,6 +108,12 @@ $(document).ready(function()
|
||||
// On
|
||||
$(".e-expandit-on").click(function () {
|
||||
|
||||
if($(this).is("input") && $(this).attr("type")=='radio')
|
||||
{
|
||||
idt = $(this).parent().nextAll("div.e-expandit-container");
|
||||
$(idt).show("slow");
|
||||
return true;
|
||||
}
|
||||
var href = ($(this).is("a")) ? $(this).attr("href") : '';
|
||||
|
||||
if(href === "#" || href == "")
|
||||
@ -133,6 +139,13 @@ $(document).ready(function()
|
||||
// Off.
|
||||
$(".e-expandit-off").click(function () {
|
||||
|
||||
if($(this).is("input") && $(this).attr("type")=='radio')
|
||||
{
|
||||
idt = $(this).parent().nextAll("div.e-expandit-container");
|
||||
$(idt).hide("slow");
|
||||
return true;
|
||||
}
|
||||
|
||||
var href = ($(this).is("a")) ? $(this).attr("href") : '';
|
||||
|
||||
if(href === "#" || href == "")
|
||||
|
Loading…
x
Reference in New Issue
Block a user