/
init_module_page.html
43 lines (39 loc) · 1.67 KB
/
init_module_page.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
---
layout: default
navPage: docs
heading: Modules::initModulePage()
breadcrumbs:
- Module Development,/module_development/
- Form Tools 3,/module_development/ft3/
- Helper Methods,/module_development/ft3/helper_methods/
- Modules::initModulePage()
prev: Modules::checkModuleAvailable(),/module_development/ft3/check_module_available/
next: Modules::loadModuleField(),/module_development/ft3/load_module_field/
categories: module_development
versions: FT3
---
{% include open_section.html nav='nav_module_development_ft3.html' selected='init_module_page' nav_width=4 %}
<p>
This function is generally called on every page of your module. It does the following:
</p>
<ul>
<li>Starts sessions</li>
<li>Ensures that the person viewing the page has the right permissions [This function accepts a single,
optional string parameter: <b>$account_type</b> ("admin" or "client") to determine who can see the page.
Administrators can see all pages, including those marked as "client"]
</li>
<li>
Includes your module's library.php file if it has been defined in your module folder. This is a handy
place to store the code for your module.
</li>
<li>
Loads the contents of the appropriate module language file into memory and stores it in two places:
<ul>
<li><b>$L</b>: this global variable is accessible anywhere within your module, but NOT in those
aspects of the module that are accessible outside of your module folder. This is a shortcut for
the second variable which is accessible everywhere:</li>
<li><b>$LANG["my_module"]</b>: where "my_module" is the name of your module folder.</li>
</ul>
</li>
</ul>
{% include close_section.html %}