Class module

Description

This class is to display modules in DiY-CMS.

It manages modules files display, templates, settings, permissons and template inclusion

  • author: Abdul Al-Hasany
  • version: 2010
  • copyright: Abdul Al-hasany (c) 2010
  • access: public

Located in /includes/module.class.php (line 40)


	
			
Variable Summary
mixed $dir
mixed $modfile
mixed $modInfo
mixed $module
mixed $settings
mixed $templates
Method Summary
null module ([string $module_name = ''])
string gettemplate (string $temp_title)
string include_module_template ( $matches, string $temp_title)
array load_modInfo ()
null module_active ()
string module_name (string $name)
mixed module_OutPut ()
mixed nav_bar ([string $extra = ''])
null permission (string $info)
string setting (string $setting_value, [int $search = ''])
Variables
mixed $dir (line 44)
mixed $language_array = array() (line 48)
mixed $modfile = "index" (line 43)
mixed $modInfo = array() (line 45)
mixed $module = "" (line 42)
mixed $settings = array() (line 46)
mixed $templates = array() (line 47)
Methods
Constructor module (line 63)

Constructor: load main functions, search for the main files and load templates

First this function searches for the first parmater as the module to be loaded, if it is empty then $_GET['mod'] value will be loaded otherwise redirect to the website's home page. If $_GET['dir'] is speicifed and it is not the admin directory then assign its value to $this->dir otherwise assume it is the main module directory. If the value of $_GET['file'] is not set the function will display the index.php page, otherwise dispaly the file if the file does not exist then display an error message. Lastly, the function will load the module templates and module settings into arrays to reduce page load and for later use by other functions

  • return: templates array, settings array and module info will be loaded once the module name is known
null module ([string $module_name = ''])
  • string $module_name: Module name, when not set it will get the value of $_GET['mod']
gettemplate (line 154)

retrive the template specificed for the loaded module

  • return: module content
string gettemplate (string $temp_title)
  • string $temp_title: the title of template to be retrived
include_module_template (line 185)

proccess template inclusion within loaded module.

if a template is included within a template then this function will proccess it as a template , this function is dependent on $mod->setting()

  • return: template content
string include_module_template ( $matches, string $temp_title)
  • string $temp_title: the title of the template
  • $matches
load_modInfo (line 222)

get loaded module detalies: name, groups allowed to view module, menus alignment .. etc.

  • return: array of module info
array load_modInfo ()
module_active (line 288)

check if loaded module is enabled or disabled.

If it it is disabled then check if Admin is logged in and display it, otherwise display a login page

  • return: login page
null module_active ()
module_name (line 277)

get module name and clean it

  • return: cleaned module name
string module_name (string $name)
  • string $name: module name
module_OutPut (line 244)

output the module. Function checks if a page is set (within a directory or not) and then display it

  • return: module output
mixed module_OutPut ()
nav_bar (line 313)

This function get the navigation bar for the loaded module

  • return: module navigation bar template
mixed nav_bar ([string $extra = ''])
  • string $extra: to add any extra elements to the module navigation bar
permission (line 206)

check for for the value retrived from module::setting if a group setting was specified

  • return: the function will return a login page
null permission (string $info)
  • string $info: the value to be evaluated
setting (line 130)

This function gets the value of a specific setting of the loaded moudle.

The second paramater can be empty when the value of the settings is not based on a group permission which has type 7 in the database.

  • return: the value of the setting
string setting (string $setting_value, [int $search = ''])
  • string $setting_value: setting to be queried
  • int $search: search for groupid in case setting is for group permission

Documentation generated on Fri, 16 Apr 2010 12:54:46 +1000 by phpDocumentor 1.4.1