Name: Password: Want to register?

API Documentation

[Parent dir]

Information about libs/Module.php

Classes

Code

1<?php
This class would probably be called "page controller" in MVC lingo. However, it can be used as a stand-alone script without using any models or views. Essentially, anything that extends it will be callable via ?Class_Name.Method_Name.Traget&other=stuff URL. Target will be passed as the first parameter of the method, and a merged array of of POST and GET variables as the second. (2007.11.15 19:07)[update][delete]
2
abstract class Module extends LightModule{ 3 protected $aliasedActions = array(); //for the purpose of permission checks 4 5 function permits($action, $target = '', $user = NULL){ 6 if (substr($action, -2, 2) == 'Do') { 7 $action = substr($action, 0, -2); //xyzDo always has the same perms as xyz 8 } 9 if (isset($this->aliasedActions[$action])) { 10 $action = $this->aliasedActions[$action]; 11 } 12 if (in_array($action, $this->permittedActions)) { 13 return TRUE; 14 } 15 return Perm::get(get_class($this).".$action.$target", $user); 16 } 17}
[download]
Made with Notepad++ Also on SourceForge.net