Commits

garyf76 committed 78e8267

Allow InputsList to process an array of selected items in additional to a single selected item.

  • Participants
  • Parent commits 10a9dfd

Comments (0)

Files changed (1)

File widgets/BootActiveForm.php

 
 		foreach($data as $value => $label)
 		{
-			$checked =! strcmp($value, $selection);
+			if(is_array($selection)) {
+				$checked = false;
+				foreach ($selection as $selectedItem) {
+					if (strcmp($value, $selectedItem)) {
+						$checked = true;
+						break;
+					}
+				}
+			} else {
+				$checked =! strcmp($value, $selection);
+			}
 			$htmlOptions['value'] = $value;
 			$htmlOptions['id'] = $baseID.'_'.$id++;
 			$option = CHtml::$method($name, $checked, $htmlOptions);