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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<?php
/**
* 管理员权限分配用静态类
* $Id$
* @author zongbiao
* @package jp.fishow.entity.definition
*/
class AcountModule
{
public $id;
public $module;
function __construct($record) {
$this->id = $record["id"];
$this->module = $record["module"];
}
/**
* このクラスのインスタンスのリストを返します。
* @return array ImageType一覧
*/
public static function getList() {
static $result;
if ((!is_array($result)) || (count($result) < 1)) {
$data = array();
$tmp = array("id"=>1, "module"=>"账户管理");
array_push($data, $tmp);
$tmp = array("id"=>2, "module"=>"领导机构管理");
array_push($data, $tmp);
$tmp = array("id"=>3, "module"=>"学校管理");
array_push($data, $tmp);
$tmp = array("id"=>4, "module"=>"班级管理");
array_push($data, $tmp);
$tmp = array("id"=>5, "module"=>"公益活动发布");
array_push($data, $tmp);
$tmp = array("id"=>6, "module"=>"公益活动审核");
array_push($data, $tmp);
$tmp = array("id"=>7, "module"=>"社会实践发布");
array_push($data, $tmp);
$tmp = array("id"=>8, "module"=>"社会实践审核");
array_push($data, $tmp);
$tmp = array("id"=>9, "module"=>"亲子活动发布");
array_push($data, $tmp);
$tmp = array("id"=>10, "module"=>"亲子活动审核");
array_push($data, $tmp);
$tmp = array("id"=>11, "module"=>"公益课堂管理");
array_push($data, $tmp);
$tmp = array("id"=>12, "module"=>"用户管理");
array_push($data, $tmp);
$tmp = array("id"=>13, "module"=>"机构用户管理");
array_push($data, $tmp);
$result = array();
foreach ($data as $row) {
$tmp2 = new AcountModule($row);
array_push($result, $tmp2);
}
}
return $result;
}
/**
* IDから対応するインスタンスを返します。
* @return AcountModule 対応するインスタンス。ない場合null。
*/
public static function getById($id) {
$list = AcountModule::getList();
foreach ($list as $tmp) {
if ($tmp->id == $id) {
return $tmp;
}
}
return null;
}
/**
* 定義名から対応するインスタンスを返します。
* @return AcountModule 対応するインスタンス。ない場合null。
*/
public static function getByName($name) {
$list = AcountModule::getList();
foreach ($list as $tmp) {
if ($tmp->name == $name) {
return $tmp;
}
}
return null;
}
}