Skip to content

Commit

Permalink
Merge pull request #323 from dnop-software/feature/sorted_files
Browse files Browse the repository at this point in the history
Alphabetically ordered drop down list
  • Loading branch information
mattimaier committed Oct 30, 2018
2 parents 22af4c2 + a7f503d commit aea4c6a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions BNote/src/presentation/modules/repertoireview.php
Expand Up @@ -277,6 +277,7 @@ private function songFiles() {
foreach($possibleFiles as $i => $fileinfo) {
$dd->addOption($fileinfo["filename"], $fileinfo["fullpath"]);
}
$dd->sortOptions();
$form->addElement("", $dd);
$form->write();
?>
Expand Down
4 changes: 4 additions & 0 deletions BNote/src/presentation/widgets/dropdown.php
Expand Up @@ -22,6 +22,10 @@ public function addOption($label, $value) {
$this->options[$label] = $value;
}

public function sortOptions() {
ksort($this->options);
}

public function cleanOptions() {
$this->options = array();
}
Expand Down

0 comments on commit aea4c6a

Please sign in to comment.