| 433 | | $checkboxes = new CheckboxSetField("ResultAssembly", false, $source, $value); |
| | 433 | |
| | 434 | // Reorder the source so that you read items down the column and then across |
| | 435 | $columnisedSource = array(); |
| | 436 | $keys = array_keys($source); |
| | 437 | $midPoint = ceil(sizeof($source)/2); |
| | 438 | for($i=0;$i<$midPoint;$i++) { |
| | 439 | $key1 = $keys[$i]; |
| | 440 | $columnisedSource[$key1] = $source[$key1]; |
| | 441 | // If there are an odd number of items, the last item will be unset |
| | 442 | if(isset($keys[$i+$midPoint])) { |
| | 443 | $key2 = $keys[$i+$midPoint]; |
| | 444 | $columnisedSource[$key2] = $source[$key2]; |
| | 445 | } |
| | 446 | } |
| | 447 | |
| | 448 | $checkboxes = new CheckboxSetField("ResultAssembly", false, $columnisedSource, $value); |