Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Removed useless and excessive $groupContainer option in CHtml::checkB…

…oxList() and CHtml::radioButtonList().
  • Loading branch information...
commit ae9f37e6cf74de3ec1b21b82edcf91082fa30170 1 parent 4ea7dd7
@resurtm authored
Showing with 6 additions and 19 deletions.
  1. +1 −1  CHANGELOG
  2. +5 −18 framework/web/helpers/CHtml.php
View
2  CHANGELOG
@@ -17,6 +17,7 @@ Version 1.1.13 work in progress
- Bug #1330: SQLite column default value was incorrect for column of type string and DEFAULT NULL (cebe)
- Bug #1351: CClientScript::registerMetaTag() now allows to register multiple meta tags with the same set of attributes (klimov-paul)
- Bug #1364: Empty CHtml::$errorCss cause class attribute rendering errors (creocoder)
+- Bug #1379: CHtml::checkBoxList() and CHtml::radioButtonList(): added support of the grouped data (e.g. result of CHtml::listData() with specified third parameter) (resurtm)
- Enh #117: Added CPhpMessageSource::$extensionPaths to allow extensions, that do not have a base class to use as category prefix, to register message source (rcoelho, cebe)
- Enh #291: CFormatter::formatDate and formatDateTime now also accept strings in strtotime() format (francis_tm, cebe)
- Enh #486: CHttpSession::$gCProbability and CDbHttpSession::$gCProbability are floats now. Minimal possible $gCProbability value has been changed to the ≈0.00000005% (1/2147483647), was integer 1% before, default value left unchanged (1%) (resurtm)
@@ -34,7 +35,6 @@ Version 1.1.13 work in progress
- Enh #1289: Added support for column comments for MSSQL (CDbColumnSchema::$comment property) (resurtm)
- Enh #1299: Added CSRF token validation for PUT and DELETE (miraage, samdark)
- Enh #1369: Added CCheckBoxColumn::disabled that accepts PHP expression or anonymous function determining if checkbox for the row should be disabled (sucotronic)
-- Enh #1379: CHtml::checkBoxList() and CHtml::radioButtonList(): added support of the grouped data (e.g. result of CHtml::listData() with specified third parameter) (resurtm)
- Enh #1386: Second parameter of the CHtml::value() is now able to accept anonymous function which calculates value to be used (Qiang, resurtm)
- Enh #1396: Added 'text/csv' mime-type for the 'csv' file extension in utils/mimeTypes.php (effectively used by e.g. CHttpRequest::sendFile()) (rawtaz)
- Enh: Fixed the check for ajaxUpdate false value in jquery.yiilistview.js as that never happens (mdomba)
View
23 framework/web/helpers/CHtml.php
@@ -859,9 +859,6 @@ public static function listBox($name,$select,$data,$htmlOptions=array())
* items tags of the group. This option is available since 1.1.13.</li>
* <li>groupSeparator: string, specifies the string that separates the generated groups.
* This option is available since 1.1.13.</li>
- * <li>groupContainer: string, specifies the groups enclosing tag. Defaults to 'span'.
- * If the value is an empty string, no enclosing tag will be generated. This option
- * is available since 1.1.13.</li>
* </ul>
* @return string the generated check box list
*/
@@ -878,8 +875,7 @@ public static function checkBoxList($name,$select,$data,$htmlOptions=array())
$hasGroups=true;
$groupTemplate=isset($htmlOptions['groupTemplate'])?$htmlOptions['groupTemplate']:"{title}<br/>\n{items}";
$groupSeparator=isset($htmlOptions['groupSeparator'])?$htmlOptions['groupSeparator']:"<br/>\n";
- $groupContainer=isset($htmlOptions['groupContainer'])?$htmlOptions['groupContainer']:'span';
- unset($htmlOptions['groupTemplate'],$htmlOptions['groupSeparator'],$htmlOptions['groupContainer']);
+ unset($htmlOptions['groupTemplate'],$htmlOptions['groupSeparator']);
}
if(substr($name,-2)!=='[]')
@@ -964,10 +960,7 @@ public static function checkBoxList($name,$select,$data,$htmlOptions=array())
{
// array value contains group elements
if(is_array($groupItems))
- {
- $groupData=strtr($groupTemplate,array('{title}'=>$groupName,'{items}'=>implode($separator,$groupItems)));
- $groups[]=empty($groupContainer) ? $groupData : self::tag($groupContainer,array(),$groupData);
- }
+ $groups[]=strtr($groupTemplate,array('{title}'=>$groupName,'{items}'=>implode($separator,$groupItems)));
// non array value represents checkAll checkbox
else
$groups[]=$groupItems;
@@ -1012,9 +1005,6 @@ public static function checkBoxList($name,$select,$data,$htmlOptions=array())
* items tags of the group. This option is available since 1.1.13.</li>
* <li>groupSeparator: string, specifies the string that separates the generated groups.
* This option is available since 1.1.13.</li>
- * <li>groupContainer: string, specifies the groups enclosing tag. Defaults to 'span'.
- * If the value is an empty string, no enclosing tag will be generated. This option
- * is available since 1.1.13.</li>
* </ul>
* @return string the generated radio button list
*/
@@ -1031,8 +1021,7 @@ public static function radioButtonList($name,$select,$data,$htmlOptions=array())
$hasGroups=true;
$groupTemplate=isset($htmlOptions['groupTemplate'])?$htmlOptions['groupTemplate']:"{title}<br/>\n{items}";
$groupSeparator=isset($htmlOptions['groupSeparator'])?$htmlOptions['groupSeparator']:"<br/>\n";
- $groupContainer=isset($htmlOptions['groupContainer'])?$htmlOptions['groupContainer']:'span';
- unset($htmlOptions['groupTemplate'],$htmlOptions['groupSeparator'],$htmlOptions['groupContainer']);
+ unset($htmlOptions['groupTemplate'],$htmlOptions['groupSeparator']);
}
$labelOptions=isset($htmlOptions['labelOptions'])?$htmlOptions['labelOptions']:array();
@@ -1060,10 +1049,8 @@ public static function radioButtonList($name,$select,$data,$htmlOptions=array())
$groups=array();
foreach($items as $groupName=>$groupItems)
- {
- $groupData=strtr($groupTemplate,array('{title}'=>$groupName,'{items}'=>implode($separator,$groupItems)));
- $groups[]=empty($groupContainer) ? $groupData : self::tag($groupContainer,array(),$groupData);
- }
+ $groups[]=strtr($groupTemplate,array('{title}'=>$groupName,'{items}'=>implode($separator,$groupItems)));
+
return empty($container) ? implode($groupSeparator,$groups) : self::tag($container,array('id'=>$baseID),implode($groupSeparator,$groups));
}
else
Please sign in to comment.
Something went wrong with that request. Please try again.