mirror of
https://github.com/e107inc/e107.git
synced 2025-08-02 12:48:26 +02:00
bootstrap $frm->radio fixes. $frm->label() and $frm-radio_multi() should not be used.
This commit is contained in:
@@ -308,8 +308,8 @@ $text = "
|
|||||||
<tr>
|
<tr>
|
||||||
<td>".PRFLAN_134."</td>
|
<td>".PRFLAN_134."</td>
|
||||||
<td>
|
<td>
|
||||||
".$frm->radio('redirectsiteurl', 1, $pref['redirectsiteurl']).$frm->label(LAN_ENABLED, 'redirectsiteurl', 1)."
|
".$frm->radio('redirectsiteurl', 1, $pref['redirectsiteurl'], array('label'=>LAN_ENABLED))."
|
||||||
".$frm->radio('redirectsiteurl', 0, !$pref['redirectsiteurl']).$frm->label(LAN_DISABLED, 'redirectsiteurl', 0)."
|
".$frm->radio('redirectsiteurl', 0, !$pref['redirectsiteurl'], array('label'=>LAN_DISABLED))."
|
||||||
<div class='field-help'>".PRFLAN_135."</div>
|
<div class='field-help'>".PRFLAN_135."</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -1470,7 +1470,7 @@ $text .= " <tr>
|
|||||||
<tr>
|
<tr>
|
||||||
<td>".PRFLAN_48.":</td>
|
<td>".PRFLAN_48.":</td>
|
||||||
<td class='form-inline'>
|
<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>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
@@ -1763,7 +1763,7 @@ $text .= "
|
|||||||
$name = $arr['name'];
|
$name = $arr['name'];
|
||||||
$text .= "<tr>
|
$text .= "<tr>
|
||||||
<td>".$name."</td>
|
<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>";
|
</tr>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -85,7 +85,7 @@ $elements = array(e_UC_PUBLIC=>LAN_DISABLED,
|
|||||||
$text .= "
|
$text .= "
|
||||||
<tr>
|
<tr>
|
||||||
<td>".UGFLAN_2.": </td>
|
<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>";
|
</tr>";
|
||||||
|
|
||||||
//TODO multilanguage pref
|
//TODO multilanguage pref
|
||||||
|
@@ -851,7 +851,7 @@ class e_form
|
|||||||
{
|
{
|
||||||
//size - large|medium|small
|
//size - large|medium|small
|
||||||
//width should be explicit set by current admin theme
|
//width should be explicit set by current admin theme
|
||||||
$size = 'span12';
|
$size = 'input-large';
|
||||||
|
|
||||||
switch($size)
|
switch($size)
|
||||||
{
|
{
|
||||||
@@ -869,7 +869,7 @@ class e_form
|
|||||||
case 'large':
|
case 'large':
|
||||||
default:
|
default:
|
||||||
$rows = '15';
|
$rows = '15';
|
||||||
$size = 'large span10';
|
$size = 'large input-block-level';
|
||||||
// $height = "style='height:500px;width:1025px'"; // inline required for wysiwyg
|
// $height = "style='height:500px;width:1025px'"; // inline required for wysiwyg
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1011,7 +1011,7 @@ class e_form
|
|||||||
* @param $checked boolean
|
* @param $checked boolean
|
||||||
* @param $options
|
* @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);
|
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
|
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_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.
|
if(vartrue($options['reverse'])) // reverse order.
|
||||||
{
|
{
|
||||||
unset($options['reverse']);
|
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)."
|
$label = defset($label, $label);
|
||||||
".$this->radio($name, 0, !$checked_enabled, $options_off)."".$this->label($label_disabled ? $label_disabled : LAN_DISABLED, $name, 0);
|
|
||||||
|
$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 string $name
|
||||||
* @param array $elements = arrays value => label
|
* @param array $elements = arrays value => label
|
||||||
* @param string/integer $checked = current value
|
* @param string/integer $checked = current value
|
||||||
* @param boolean $multi_line
|
* @param boolean $multi_line
|
||||||
* @param mixed $help array of field help items or string of field-help (to show on all)
|
* @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();
|
$text = array();
|
||||||
|
|
||||||
if(is_string($elements)) parse_str($elements, $elements);
|
if(is_string($elements)) parse_str($elements, $elements);
|
||||||
|
|
||||||
foreach ($elements as $value => $label)
|
foreach ($elements as $value => $label)
|
||||||
@@ -1126,27 +1146,37 @@ class e_form
|
|||||||
$helpLabel = (is_array($help)) ? vartrue($help[$value]) : $help;
|
$helpLabel = (is_array($help)) ? vartrue($help[$value]) : $help;
|
||||||
|
|
||||||
// Bootstrap Style Code - for use later.
|
// Bootstrap Style Code - for use later.
|
||||||
// $options['label'] = $label;
|
$options['label'] = $label;
|
||||||
// $options['help'] = $helpLabel;
|
$options['help'] = $helpLabel;
|
||||||
// $text[] = $this->radio($name, $value, (string) $checked === (string) $value, $options);
|
$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)
|
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 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 = '')
|
function label($text, $name = '', $value = '')
|
||||||
{
|
{
|
||||||
|
e107::getMessage()->addDebug("Deprecated \$frm->label() used");
|
||||||
$for_id = $this->_format_id('', $name, $value, 'for');
|
$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)
|
function help($text)
|
||||||
@@ -1759,7 +1789,7 @@ class e_form
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'radio':
|
case 'radio':
|
||||||
$def_options['class'] = 'radio inline';
|
//$def_options['class'] = ' ';
|
||||||
unset($def_options['size'], $def_options['selected']);
|
unset($def_options['size'], $def_options['selected']);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -2866,7 +2896,7 @@ class e_form
|
|||||||
}
|
}
|
||||||
|
|
||||||
//$this->selectbox($key, $layouts, $value)
|
//$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;
|
break;
|
||||||
|
|
||||||
case 'templates': //to do - exclude param (exact match)
|
case 'templates': //to do - exclude param (exact match)
|
||||||
|
@@ -105,7 +105,7 @@ $text = "
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>".CHBLAN_36."</td>
|
<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>
|
</tr>
|
||||||
";
|
";
|
||||||
|
|
||||||
|
@@ -188,7 +188,7 @@ $text = "
|
|||||||
<td>";
|
<td>";
|
||||||
$array = array(NFLAN_13,NFLAN_14,NFLAN_20,NFLAN_21);
|
$array = array(NFLAN_13,NFLAN_14,NFLAN_20,NFLAN_21);
|
||||||
$text .=
|
$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>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
@@ -5,7 +5,6 @@ body { }
|
|||||||
|
|
||||||
body { padding-top: 75px; }
|
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 */
|
/* Core Icons & Image Buttons */
|
||||||
img.icon { border: 0px; vertical-align: middle; }
|
img.icon { border: 0px; vertical-align: middle; }
|
||||||
|
@@ -108,6 +108,12 @@ $(document).ready(function()
|
|||||||
// On
|
// On
|
||||||
$(".e-expandit-on").click(function () {
|
$(".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") : '';
|
var href = ($(this).is("a")) ? $(this).attr("href") : '';
|
||||||
|
|
||||||
if(href === "#" || href == "")
|
if(href === "#" || href == "")
|
||||||
@@ -133,6 +139,13 @@ $(document).ready(function()
|
|||||||
// Off.
|
// Off.
|
||||||
$(".e-expandit-off").click(function () {
|
$(".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") : '';
|
var href = ($(this).is("a")) ? $(this).attr("href") : '';
|
||||||
|
|
||||||
if(href === "#" || href == "")
|
if(href === "#" || href == "")
|
||||||
|
Reference in New Issue
Block a user