Home » Projects » Mambo CMS » SVN » Browse repository
Diff of /mambo/tags/46_release/includes/mamboHTML.php
Parent Directory
|
Revision Log
|
Patch
| 138 |
function radioList( &$arr, $tag_name, $tag_attribs, $selected=null, $key='value', $text='text' ) { |
function radioList( &$arr, $tag_name, $tag_attribs, $selected=null, $key='value', $text='text' ) { |
| 139 |
reset( $arr ); |
reset( $arr ); |
| 140 |
$html = ""; |
$html = ""; |
| 141 |
for ($i=0, $n=count( $arr ); $i < $n; $i++ ) { |
foreach ($arr as $choice) { |
| 142 |
$k = $arr[$i]->$key; |
$id = @$choice->id; |
| 143 |
$t = $arr[$i]->$text; |
$extra = $id ? " id=\"" . $choice->id . "\"" : ''; |
|
$id = @$arr[$i]->id; |
|
|
|
|
|
$extra = ''; |
|
|
$extra .= $id ? " id=\"" . $arr[$i]->id . "\"" : ''; |
|
| 144 |
if (is_array( $selected )) { |
if (is_array( $selected )) { |
| 145 |
foreach ($selected as $obj) { |
foreach ($selected as $obj) { |
| 146 |
$k2 = $obj->$key; |
if ($choice->$key == $obj->$key) { |
| 147 |
if ($k == $k2) { |
$extra .= ' selected="selected"'; |
|
$extra .= " selected=\"selected\""; |
|
| 148 |
break; |
break; |
| 149 |
} |
} |
| 150 |
} |
} |
| 151 |
} else { |
} else { |
| 152 |
$extra .= ($k == $selected ? " checked=\"checked\"" : ''); |
$extra .= ($choice->$key == $selected ? " checked=\"checked\"" : ''); |
| 153 |
} |
} |
| 154 |
$html .= "\n\t<input type=\"radio\" name=\"$tag_name\" value=\"".$k."\"$extra $tag_attribs />" . $t; |
$html .= "\n\t<input type=\"radio\" name=\"$tag_name\" value=\"".$choice->$key."\"$extra $tag_attribs />" . $choice->$text; |
| 155 |
} |
} |
| 156 |
$html .= "\n"; |
$html .= "\n"; |
| 157 |
return $html; |
return $html; |
|
|
Legend:
| Removed from v.149 |
|
| changed lines |
| |
Added in v.151 |
|
|

Web Hosting provided by Network
Redux.