Adjustments, add edit facility, use select for mask filename
authorJoey Schulze <joey@infodrom.org>
Thu, 25 Feb 2010 11:29:13 +0000 (12:29 +0100)
committerJoey Schulze <joey@infodrom.org>
Thu, 25 Feb 2010 11:29:13 +0000 (12:29 +0100)
masks/sys_mask.php

index a96d56a..6ae3e64 100644 (file)
@@ -1,5 +1,22 @@
 <?php
 
 <?php
 
+function discover_masks()
+{
+  $info = array();
+
+  if (($d = opendir('masks')) === false)
+    return $info;
+
+  while (($file = readdir($d)) !== false)
+    if (substr($file,-4) == '.php') {
+      $fname = substr($file,0,-4);
+      $info[] = array('id' => $fname, 'text' => $fname);
+    }
+  closedir($d);
+
+  return $info;
+}
+
 $mask = array(
              'table' => 'sys_mask',
              'title' => 'Liste der Menüpunkte',
 $mask = array(
              'table' => 'sys_mask',
              'title' => 'Liste der Menüpunkte',
@@ -11,21 +28,21 @@ $mask = array(
                                            'sql' => 'sys_mask.id',
                                            ),
                              'mask' => array(
                                            'sql' => 'sys_mask.id',
                                            ),
                              'mask' => array(
-                                           'name' => 'Menüpunkt',
+                                           'name' => 'Dateiname',
                                            'width' => 100,
                                            ),
                              'title' => array(
                                            'width' => 100,
                                            ),
                              'title' => array(
-                                           'name' => 'Name',
+                                           'name' => 'Beschreibung',
                                            'width' => 150,
                                            ),
                              'menutitle' => array(
                                            'width' => 150,
                                            ),
                              'menutitle' => array(
-                                           'name' => 'Menütitel',
-                                           'width' => 150,
+                                           'name' => 'Menüpunkt',
+                                           'width' => 120,
                                            ),
                              'menu' => array(
                                            'name' => 'Menü',
                                            'sql' => 'sys_menu.name',
                                            ),
                              'menu' => array(
                                            'name' => 'Menü',
                                            'sql' => 'sys_menu.name',
-                                           'width' => 150,
+                                           'width' => 100,
                                            ),
                              'edit' => array(
                                            'name' => 'Edit',
                                            ),
                              'edit' => array(
                                            'name' => 'Edit',
@@ -54,6 +71,30 @@ $mask = array(
                                            ),
                              ),
              'rows' => 20,
                                            ),
                              ),
              'rows' => 20,
+             'edit' => array(
+                             'mask' => array(
+                                           'name' => 'Dateiname',
+                                           'type' => 'select',
+                                           'options' => discover_masks(),
+                                           'size' => 30,
+                                           ),
+                             'title' => array(
+                                           'name' => 'Beschreibung',
+                                           'type' => 'text',
+                                           'size' => 40,
+                                           ),
+                             'menutitle' => array(
+                                           'name' => 'Menüpunkt',
+                                           'type' => 'text',
+                                           'size' => 40,
+                                           ),
+                             'menu' => array(
+                                           'name' => 'Menü',
+                                           'type' => 'select',
+                                           'options' => 'SELECT id,name AS text FROM sys_menu ORDER BY name',
+                                           'size' => 10,
+                                           ),
+                             ),
              );
 
 ?>
              );
 
 ?>