Module ui.menusorter

This module is responsible for constructing the KOReader menu based on a list of menu_items and a separate menu order.

Functions

MenuSorter:sort (item_table, order) Sorts a flat table of menu items into a hierarchical menu based on supplied order.
MenuSorter:findById (tbl, needle_id) Returns a menu item by ID.


Functions

MenuSorter:sort (item_table, order)
Sorts a flat table of menu items into a hierarchical menu based on supplied order.

Parameters:

  • item_table table menu item table
  • order table sorting order

Returns:

    table the sorted menu item table
MenuSorter:findById (tbl, needle_id)
Returns a menu item by ID.

Parameters:

  • tbl table Lua table
  • needle_id string Menu item ID string

Returns:

    table a reference to the table item if found
generated by LDoc 1.5.0 Last updated 2024-12-19 07:44:17