Shop Project - Documentation
Navigation Generation & nav_UID Context
The navigation system is designed as a data-driven domain model (nav.service.php & nav.model.php). It strictly separates logical structure, access security, localization, and the UI presentation layer.
Architectural Rules & State Retention (nav_UID)
- The nav_UID is extracted from the URL and held stable within the session for the duration of the context.
- Both the sidebar and the content tiles use this nav_UID for exact matching of the active node.
- If a nav_UID is entirely missing, a fallback mechanism automatically triggers based on the category ID or current page key.
Layer Responsibilities
Data Structure & State Management
The navigation is dynamically generated from the SQL view v_navigation_base (combining tb_page for controller targets and tb_category for business structure). The nav.service.php converts this flat list into a tree structure via the buildSidebarTree() method. A navigation node is uniquely identified by the pair {page, cat}. State detection (active and open) is automatically handled via session and URL parameters.
Internationalization (Label System)
Labeling is strictly separated: Static menu texts and buttons utilize the interface label system (groups nav and global). Dynamic category names (content data) are loaded directly from a language-specific category table.
The Request Lifecycle in Navigation Context
- Request: Request hits the central
index.php. - Routing: Resolution via
resolvePage(),resolveCategory(), andresolveLanguage(). Storing IDs in the session (Lazy Loading). - Security: Calling
checkPageByKey()and matching role permissions usinguserHasAccess(). - Service Load: The Nav-Service generates the structures based on the current context keys and the
nav_UID. - Rendering: The view receives specialized arrays (
sidebarfor the menu tree,pathfor breadcrumbs,tilesfor dashboard tiles).
Current Tree Structure (Logical View)
Hierarchical overview of the page and category merging within the marketplace:
home page & cat - lv 0
├─ article_editor page & cat - lv 1
├─ product page & cat - lv 1 (special)
├─ article page & cat - lv 1 (special)
├─ marketplace page & cat - lv 1
├─ trading page & cat - lv 1
│ ├─ trading_cards cat - lv 2
│ │ ├─ trading_cards_yugioh cat - lv 3
│ │ ├─ trading_cards_magic cat - lv 3
│ │ └─ trading_cards_pokemon cat - lv 3
│ ├─ trading_model cat - lv 2
│ │ ├─ trading_model_maerklin cat - lv 3
│ │ ├─ trading_model_roco cat - lv 3
│ │ └─ trading_model_kleinbahn cat - lv 3
│ └─ trading_stamps cat - lv 2
├─ topic page & cat - lv 1
│ ├─ topic_onepiece cat - lv 2
│ ├─ topic_lordofthering cat - lv 2
│ └─ topic_yugioh cat - lv 2
│ └─ trading_cards_yugioh (ref)
├─ digital page & cat - lv 1
│ ├─ digital_service cat - lv 2
│ ├─ digital_support cat - lv 2
│ ├─ digital_design cat - lv 2
│ └─ digital_3d cat - lv 2
├─ workshop page & cat - lv 1
│ ├─ workshop_service cat - lv 2
│ └─ workshop_build cat - lv 2
├─ community page & cat - lv 1
│ ├─ community_feed cat - lv 2
│ └─ community_vote cat - lv 2
├─ helper page & cat - lv 1
│ ├─ category_editor page & cat - lv 2
│ └─ product_editor page & cat - lv 2
├─ support page & cat - lv 1
│ ├─ frequently_asked_questions cat - lv 2
│ ├─ general_terms_conditions cat - lv 2
│ └─ about (ref)
└─ messenger page & cat - lv 1
user_list page & cat2 - lv 0
├─ user_add page & cat2 - lv 1 (special)
└─ user_edit page & cat2 - lv 1 (special)
label_editor page - lv 0
about page - lv 0
login page - lv 0
signup page - lv 0
profile page & cat3 - lv 0
├─ wantlist page & cat3 - lv 1
├─ saved_search page & cat3 - lv 1
└─ address page & cat3 - lv 1
logout page - lv 0
mail_verify page - lv 0 (special)
reset_password page - lv 0 (special)
search_user page - lv 0 (special)
public_profile page - lv 0 (special)