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