Skip to content

UI improvement: Sorted the layout and styles documentation tree in alphabetical order#11215

Open
amgad52 wants to merge 1 commit intoILIAS-eLearning:trunkfrom
amgad52:docu/12/sort-documentation
Open

UI improvement: Sorted the layout and styles documentation tree in alphabetical order#11215
amgad52 wants to merge 1 commit intoILIAS-eLearning:trunkfrom
amgad52:docu/12/sort-documentation

Conversation

@amgad52
Copy link

@amgad52 amgad52 commented Mar 2, 2026

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

@matheuszych
Copy link
Contributor

If possible, I would highly appreciate it if this change could also be implemented in ILIAS 10 and ILIAS 11.

@matheuszych
Copy link
Contributor

@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()));
Copy link
Contributor

@mjansenDatabay mjansenDatabay Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your feedback. I have implemented the changes as you suggested.

@oliversamoila oliversamoila self-assigned this Mar 2, 2026
@oliversamoila oliversamoila added improvement kitchen sink php Pull requests that update Php code labels Mar 2, 2026
@amgad52 amgad52 force-pushed the docu/12/sort-documentation branch from 29cd3b4 to f8feea1 Compare March 2, 2026 09:27
@Annett7811 Annett7811 added the accessibility Pull requests that propose A11Y changes. label Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accessibility Pull requests that propose A11Y changes. improvement kitchen sink php Pull requests that update Php code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants