Code Duplication    Length = 8-8 lines in 2 locations

forms/ListboxField.php 2 locations

@@ 81-88 (lines=8) @@
78
		// We have an array of values
79
		if(is_array($this->value)){
80
			// Loop through and figure out which values were selected.
81
			foreach($this->getSource() as $value => $title) {
82
				$options[] = new ArrayData(array(
83
					'Title' => $title,
84
					'Value' => $value,
85
					'Selected' => (in_array($value, $this->value) || in_array($value, $this->defaultItems)),
86
					'Disabled' => $this->disabled || in_array($value, $this->disabledItems),
87
				));
88
			}
89
		} else {
90
			// Listbox was based a singlular value, so treat it like a dropdown.
91
			foreach($this->getSource() as $value => $title) {
@@ 91-98 (lines=8) @@
88
			}
89
		} else {
90
			// Listbox was based a singlular value, so treat it like a dropdown.
91
			foreach($this->getSource() as $value => $title) {
92
				$options[] = new ArrayData(array(
93
					'Title' => $title,
94
					'Value' => $value,
95
					'Selected' => ($value == $this->value || in_array($value, $this->defaultItems)),
96
					'Disabled' => $this->disabled || in_array($value, $this->disabledItems),
97
				));
98
			}
99
		}
100
101
		$properties = array_merge($properties, array(