UI improvement: Sorted the layout and styles documentation tree in alphabetical order#11215
UI improvement: Sorted the layout and styles documentation tree in alphabetical order#11215amgad52 wants to merge 1 commit intoILIAS-eLearning:trunkfrom
Conversation
|
If possible, I would highly appreciate it if this change could also be implemented in ILIAS 10 and ILIAS 11. |
|
@thibsy Could you please take a look at this? |
| */ | ||
| return $this->entries->getChildrenOfEntry($record->getId()); | ||
| $entries = $this->entries->getChildrenOfEntry($record->getId()); | ||
| usort($entries, static fn(Entry $a, Entry $b): int => strcmp($a->getTitle(), $b->getTitle())); |
There was a problem hiding this comment.
I suggest using strcoll(ilStr::strToUpper($a), ilStr::strToUpper($b)); when sorting alphanumeric strings, since this is what our users were used to in former ILIAS versions when sorting is done via PHP (and not via the database).
See: \ilStr::strCmp (used in \ilArrayUtil::sort_func).
Of course\ilStr::strCmp is marked as "deprecated", but it would be easy to replace such calls (e.g. with rector) once we have a new centralized way of sorting things for humans. I don't say this is the only/best/correct way to sort elements, but it is the way list elements had been sorted before.
There was a problem hiding this comment.
Thank you for your feedback. I have implemented the changes as you suggested.
29cd3b4 to
f8feea1
Compare
This pull request addresses an observation made by @oliversamoila regarding the unsorted state of entries in the KS documentation components list. The lack of sorting makes finding specific entries more challenging. To improve usability and navigation, I have implemented a solution which sorts the entries in an alphabetical order. This change will enhance the readability and accessibility of the components in the list. Please review the changes and let me know if any adjustments are necessary.
@thojou @matheuszych