Hi
I bought RSPro yesterday morning, and on the whole I am pretty happy with it. There are one or two things that are causing me a big headach though, and I consider these to be bugs that would be easy to fix in subsequent versions.
Specifically, I am trying to lay out a set of radio buttons in a vertical column. For reasons beyond the scope of this post, I need to set it so that the lable is on the left of the input element, not to the right. Whilst this is not too difficult to address with CSS, you have made it a challange by not including the pair of elements (the input and the label) in a single div or span. Furthermore, you have seperated them with a <br> tag when displaying in vertical mode. I realise that this may make it super easy for the less informed person to use the system, but it really limits how you can lay out the forms.
Can I suggest the following;
- Rather than optionally using a <br> tag to do the vertical display, make it a choice between a <div> and a <span> tag.
- Include a parameter that lets me give an id paramater to the <div> or <span> tag (although I can get around that through manually editing the form layout)
- If letting me create the ID parameter is too much, hard code it in the same way you have hard coded the IDs of the radio button inputs, just with a different word (e.g. setBandingx or something similar).
These simple changes will make the system far more flexable.
For those that read this and want to change it themselves, For those that want to do this themselves, go to functions.php in the controller folder of the component. Edit the case 'radioGroup' option, which is in (approx) line 610 of the file to something like the following;
case 'radioGroup':
{
$i=0;
$data=RSgetComponentProperties($componentId);
$data['ITEMS']=str_replace(\"\r\",\"\",$data['ITEMS']);
$items=explode(\"\n\",$data['ITEMS']);
foreach($items as $item)
{
$out.= \"<div id=\\"set$data[NAME]$i\\">\";
$item = stripslashes($item);
$buf=explode(\"|\",$item);
if(count($buf)==1)
{
if(empty($value))
if(preg_match('/\[c\]/',$buf[0]))
{
$v=str_replace('[c]','',$buf[0]);
$out.=\"<input checked=\\"checked\\" type=\\"radio\\" value=\\"$v\\" name =\\"form[$data[NAME]]\\" id=\\"$data[NAME]$i\\"/><label for=\\"$data[NAME]$i\\" $data[ADDITIONALATTRIBUTES]>$v</label>\";
}
else
$out.=\"<input type=\\"radio\\" value=\\"$buf[0]\\" name =\\"form[$data[NAME]]\\" id=\\"$data[NAME]$i\\" $data[ADDITIONALATTRIBUTES]/><label for=\\"$data[NAME]$i\\">$buf[0]</label>\";
else if(!empty($value[$data['NAME']]))
if(str_replace('[c]','',$buf[0])==$value[$data['NAME']])
{
$v=str_replace('[c]','',$buf[0]);
$out.=\"<input checked=\\"checked\\" type=\\"radio\\" value=\\"$v\\" name =\\"form[$data[NAME]]\\" id=\\"$data[NAME]$i\\" $data[ADDITIONALATTRIBUTES]/><label for=\\"$data[NAME]$i\\">$v</label>\";
}
else
{
$v=str_replace('[c]','',$buf[0]);
$out.=\"<input type=\\"radio\\" value=\\"$v\\" name =\\"form[$data[NAME]]\\" id=\\"$data[NAME]$i\\" $data[ADDITIONALATTRIBUTES]/><label for=\\"$data[NAME]$i\\">$v</label>\";
}
else
{
$v=str_replace('[c]','',$buf[0]);
$out.=\"<input type=\\"radio\\" value=\\"$v\\" name =\\"form[$data[NAME]]\\" id=\\"$data[NAME]$i\\" $data[ADDITIONALATTRIBUTES]><label for=\\"$data[NAME]$i\\"/>$v</label>\";
}
}
if(count($buf)==2)
{
if(empty($value))
if(preg_match('/\[c\]/',$buf[1]))
{
$v=str_replace('[c]','',$buf[1]);
$out.=\"<input checked=\\"checked\\" type=\\"radio\\" value=\\"$buf[0]\\" name =\\"form[$data[NAME]]\\" id=\\"$data[NAME]$i\\" $data[ADDITIONALATTRIBUTES]/><label for=\\"$data[NAME]$i\\">$v</label>\";
}
else
$out.=\"<input type=\\"radio\\" value=\\"$buf[0]\\" name =\\"form[$data[NAME]]\\" id=\\"$data[NAME]$i\\" $data[ADDITIONALATTRIBUTES]/><label for=\\"$data[NAME]$i\\">$buf[1]</label>\";
else if (!empty($value[$data['NAME']]))
if(str_replace('[c]','',$buf[0])==$value[$data['NAME']])
{
$v=str_replace('[c]','',$buf[1]);
$out.=\"<input checked=\\"checked\\" type=\\"radio\\" value=\\"$buf[0]\\" name =\\"form[$data[NAME]]\\" id=\\"$data[NAME]$i\\" $data[ADDITIONALATTRIBUTES]/><label for=\\"$data[NAME]$i\\">$v</label>\";
}
else
{
$v=str_replace('[c]','',$buf[1]);
$out.=\"<input type=\\"radio\\" value=\\"$buf[0]\\" name =\\"form[$data[NAME]]\\" id=\\"$data[NAME]$i\\" $data[ADDITIONALATTRIBUTES]/><label for=\\"$data[NAME]$i\\">$v</label>\";
}
else
{
$v=str_replace('[c]','',$buf[1]);
$out.=\"<input type=\\"radio\\" value=\\"$buf[0]\\" name =\\"form[$data[NAME]]\\" id=\\"$data[NAME]$i\\" $data[ADDITIONALATTRIBUTES]/><label for=\\"$data[NAME]$i\\">$v</label>\";
}
}
$out.=\"</div>\";
$i++;
}
}break;