|
SelfHelp WebApp
v2.0.6
A WebApp to Create WebApps for Studies in Human Sciences
|
Public Member Functions | |
| __construct ($router, $db, $keyword, $root_id) | |
| get_navigation_items () | |
| get_root_id () | |
| get_current_id () | |
| get_next_id () | |
| get_page_keyword () | |
| get_previous_id () | |
| get_count () | |
| section_id_exists ($id) | |
| set_current_index ($id) | |
Private Member Functions | |
| fetch_children ($id_section) | |
Private Attributes | |
| $db | |
| $router | |
| $keyword | |
| $items_tree | |
| $items_list | |
| $root_id | |
| $current_id | |
| $current_idx | |
This class is used to prepare all data related to the navSection component such that the data can easily be displayed in the view of the component.
| Navigation::__construct | ( | $router, | |
| $db, | |||
| $keyword, | |||
| $root_id | |||
| ) |
The constructor.
| object | $router | The router instance is used to generate valid links. |
| object | $db | The db instance which grants access to the DB. |
| string | $keyword | The identification name of the page. |
| int | $root_id | The id of the root section. |
|
private |
Fetches all navigation items from the database and assembles them hierarchically in an array. Further, items are added to list structure.
| int | $id_section | The root item id. |
Referenced by __construct().
| Navigation::get_count | ( | ) |
Gets the number of root navigation items.
| int | The number of navigation items. |
| Navigation::get_current_id | ( | ) |
Gets the current navigation item id.
| int | The current navigation item id. |
| Navigation::get_navigation_items | ( | ) |
Gets the hierarchical assembled navigation items.
| Navigation::get_next_id | ( | ) |
Gets the next navigation item id.
| int | The next navigation item id or false if it does not exist. |
| Navigation::get_page_keyword | ( | ) |
Get the keyword of the navigation page.
| string | The keyword of the navigation page. |
| Navigation::get_previous_id | ( | ) |
Gets the previous navigation item id.
| int | The previous navigation item id or false if it does not exist. |
| Navigation::get_root_id | ( | ) |
Gets the root navigation item id.
| int | The root navigation item id. |
| Navigation::section_id_exists | ( | $id | ) |
Returns true if a given section id can be found in the list of sections associated to the navigation page.
| int | $id | The id to check. |
| bool | True if the id exists, false otherwise. |
| Navigation::set_current_index | ( | $id | ) |
Given the current id, set the current index of the flattened item list.
| int | $id | The current navigation item id. |
|
private |
The id of the currently selected navigation item.
Referenced by get_current_id().
|
private |
The index of the currently selected navigation item.
|
private |
The db instance which grants access to the DB.
Referenced by __construct().
|
private |
A flat list of the navigation items.
|
private |
A hierarchical list of the navigation items.
Referenced by get_navigation_items().
|
private |
The identification name of the page.
Referenced by __construct(), and get_page_keyword().
|
private |
The id of the root section.
Referenced by __construct(), and get_root_id().
|
private |
The router instance is used to generate valid links.
Referenced by __construct().