====== Module Index ====== ===== Module Tiers ===== LEAST modules are classified by risk and centrality: ^ Tier ^ Modules ^ Risk level ^ | Tier 1 — Platform Core | libgeneral, libdb, liblogin, libdatetime, libengine, libmenu, libdashboard | Highest — used by everything | | Tier 2 — Business Core | libassociation, libcollection_admin, libcollection_use, liblesson, libprimary | High — core business logic | | Tier 3 — Secondary | quiz, discussion, course, keyring, educator tools | Medium | | Tier 4 — Specialised | mindfulwriting, family, rollcall, logictree, openbadge, entrepreneur, slack | Lowest — isolated | ===== Core Modules ===== ==== libgeneral ==== The most-used module. ''fn_Gen_*'' functions are called everywhere. Includes: * ''fn_Gen_PageStart()'' / ''fn_Gen_PageEnd()'' — page wrapper * ''fn_Gen_Array_GetValue()'' / ''fn_Gen_Array_SetValue()'' — array helpers * ''fn_Gen_HasData()'' — safe array check * ''fn_T()'' — translation/localisation (most-called function in the platform) * Engine array rendering system ==== libdb ==== All database access flows through here: * ''fn_Db_GenericSQLRead_Array()'' — read query returning PHP array * ''fn_Db_GenericSQLExecute()'' — write query execution * ''fn_Db_CreateArray()'' / ''fn_Db_CreateInsertIgnoreSQL()'' — insert helpers * ''fn_Db_ScrapeInput()'' — input sanitisation (always use this before writing user input) ==== liblogin ==== Authentication and session management: * ''fn_Login_ValidateLogin()'' — standard auth gate * ''fn_Login_Admin_ValidateLogin()'' — admin auth gate (Level 3 required) * ''fn_Login_ValidateLogin_Generic()'' — underlying auth implementation ==== libassociation ==== Association management and permissions: * ''fn_Association_Security()'' — the main permission check function * ''fn_Association_PermissionProcess()'' — grant/revoke permissions * ''fn_Association_NoPermissionBlock()'' — renders "access denied" message * ''fn_Db_AssocMember()'' — membership check ==== libcollection_admin / libcollection_use ==== Collection engine administration and end-user display: * Admin: create/edit collections, fields, views, actions * Use: display records, handle interactions, render swim lanes ==== liblesson ==== Lesson and material management: * ''fn_Lesson_Manage()'' — lesson CRUD * ''fn_Lesson_Materials_*()'' — material attachment * ''fn_Lesson_Progress_*()'' — learner progress tracking ===== Key Global Variables ===== ^ Variable ^ Set by ^ Purpose ^ | ''$objGlobal_ODBC'' | const_db.php | Global MySQL connection | | ''$intGlobal_LoginId'' | fn_Login_ValidateLogin() | Current user's ID | | ''$aryGlobal_Login'' | fn_Login_ValidateLogin() | Current user's full record | | ''$strGlobal_AssociationRef'' | Request URL | Current association context | | ''$strGlobal_Master_IncludePath'' | Entry page | Path to /lib/ | | ''$aryZLeastSettings'' | fn_db_data.php | ZLEASTSettings table (global config) | ===== Request Flow ===== Every page request follows: Browser → Entry Page → const_globals.php → fn_standard_library.php → fn_Login_ValidateLogin() → Domain Aggregator → Domain Functions → DB reads/writes → HTML render → fn_standard_close.php See the [[developer:start|Developer Guide]] for API and integration flows.