forked from StartupAPI/users
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodules.php
More file actions
35 lines (30 loc) · 711 Bytes
/
modules.php
File metadata and controls
35 lines (30 loc) · 711 Bytes
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
<?php
require_once(dirname(__FILE__).'/config.php');
interface IUserBaseModule
{
/**
* Returns module ID
* Each module must implement this method and use unique ID
*/
public function getID();
public function getTitle();
}
abstract class UserBaseModule implements IUserBaseModule {
public function __construct() {
UserConfig::$all_modules[] = $this;
}
/**
* Returns module by ID
* @param string $id ID of the module
*/
public static function get($id) {
foreach (UserConfig::$all_modules as $module)
{
if ($module->getID() == $id) {
return $module;
}
}
}
}
require_once(dirname(__FILE__).'/AuthenticationModule.php');
require_once(dirname(__FILE__).'/EmailModule.php');