Hide hour sum per default
[misc/kostenrechnung] / masks / sys_mask.php
1 <?php
2
3 function discover_cmp($a, $b)
4 {
5   return strcmp($a['id'],$b['id']);
6 }
7
8 function discover_masks()
9 {
10   $info = array();
11
12   if (($d = opendir($_SESSION['sys']['basedir'].'masks')) === false)
13     return $info;
14
15   while (($file = readdir($d)) !== false)
16     if (substr($file,-4) == '.php') {
17       $fname = substr($file,0,-4);
18       $info[] = array('id' => $fname, 'text' => $fname);
19     }
20   closedir($d);
21
22   usort($info,discover_cmp);
23   return $info;
24 }
25
26 $mask = array(
27               'table' => 'sys_mask',
28               'title' => 'Liste der Menüpunkte',
29               'join' => array('sys_menu ON sys_mask.menu = sys_menu.id'),
30               'list' => array(
31                               'id' => array(
32                                             'name' => 'ID',
33                                             'visible' => false,
34                                             'sql' => 'sys_mask.id',
35                                             ),
36                               'fname' => array(
37                                             'name' => 'Dateiname',
38                                             'width' => 100,
39                                             ),
40                               'name' => array(
41                                             'name' => 'Name',
42                                             'width' => 150,
43                                             'sql' => 'sys_mask.name',
44                                             ),
45                               'menutitle' => array(
46                                             'name' => 'Menüpunkt',
47                                             'width' => 100,
48                                             ),
49                               'menu' => array(
50                                             'name' => 'Menü',
51                                             'sql' => 'sys_menu.name',
52                                             'width' => 100,
53                                             ),
54                               'edit' => array(
55                                             'name' => 'Edit',
56                                             'width' => 40,
57                                             'specs' => "ClassName: 'aligncenter', canSort: false",
58                                             ),
59                               'priority' => array(
60                                             'name' => 'Priorität',
61                                             'width' => 60,
62                                             'type' => 'number',
63                                             'specs' => "ClassName: 'alignright', canSort: false",
64                                             'sql' => 'sys_mask.priority',
65                                             ),
66                               ),
67               'edit' => array(
68                               'fname' => array(
69                                             'name' => 'Dateiname',
70                                             'type' => 'select',
71                                             'options' => discover_masks(),
72                                             'options_string' => true,
73                                             ),
74                               'name' => array(
75                                             'name' => 'Name',
76                                             'type' => 'text',
77                                             'size' => 24,
78                                             ),
79                               'menutitle' => array(
80                                             'name' => 'Menüpunkt',
81                                             'type' => 'text',
82                                             'size' => 24,
83                                             ),
84                               'title' => array(
85                                             'name' => 'Beschreibung',
86                                             'type' => 'text',
87                                             'size' => 24,
88                                             'null' => true,
89                                             ),
90                               'menu' => array(
91                                             'name' => 'Menü',
92                                             'type' => 'select',
93                                             'options' => 'SELECT id,name AS text FROM sys_menu ORDER BY name',
94                                             ),
95                               'edit' => array(
96                                             'name' => 'Edit',
97                                             'type' => 'boolean',
98                                             ),
99                               'priority' => array(
100                                             'name' => 'Priorität',
101                                             'type' => 'number',
102                                             'size' => 10,
103                                             ),
104                               ),
105               );
106
107 ?>