+<?php
+
+$jscode[] = <<<EOC
+
+Rico.moduleDependencies['checkboxDB'] = ['+LiveGrid', '../ricoTableColumnDB.js'];
+Rico.loadModule('checkboxDB');
+
+function select_group_calback(data)
+{
+ grid_update(grid);
+}
+
+function select_group(obj)
+{
+ if (!obj.options[obj.selectedIndex].value.length)
+ val = -1;
+ else
+ val = obj.options[obj.selectedIndex].value;
+
+ ajax_request('setvar','source=sys_group_mask&name=group&value='+val,select_group_calback);
+
+ if (obj.options[obj.selectedIndex].value.length)
+ info('Gruppe ' + obj.options[obj.selectedIndex].innerHTML + ' ausgewählt');
+ else
+ info('');
+}
+EOC;
+
+if (empty($_SESSION['sys_group_mask.group'])) $_SESSION['sys_group_mask.group'] = 0;
+
+$mask = array(
+ 'table' => 'sys_mask',
+ 'title' => 'Berechtigungen',
+ 'select' => array(
+ 'title' => 'Auswahl',
+ 'options' => 'SELECT id,name AS text FROM sys_group ORDER BY name',
+ 'default' => 'Gruppe wählen',
+ 'selected' => $_SESSION['sys_group_mask.group'],
+ 'onchange' => 'select_group(this)',
+ ),
+ 'list' => array(
+ 'id' => array(
+ 'name' => 'ID',
+ 'sql' => 'sys_mask.id',
+ 'visible' => false,
+ ),
+ 'menutitle' => array(
+ 'name' => 'Menüpunkt',
+ 'sql' => 'sys_mask.menutitle',
+ ),
+ 'title' => array(
+ 'name' => 'Beschreibung',
+ 'width' => 150,
+ 'sql' => 'sys_mask.title',
+ ),
+ 'edit' => array(
+ 'name' => 'Edit',
+ 'width' => 40,
+ 'specs' => "ClassName: 'aligncenter'",
+ 'sql' => 'sys_mask.edit',
+ ),
+ 'option' => array(
+ 'name' => 'Menü',
+ 'width' => 40,
+ 'sql' => '(SELECT count(*) FROM sys_group_mask WHERE gid = '
+ . intval($_SESSION['sys_group_mask.group'])
+ . ' AND mask = sys_mask.id)',
+ 'control' => "new Rico.TableColumn.checkboxDB(0, 'ajax/ricoUpdateConnection.php')",
+ 'specs' => "filterUI: 'c'",
+ 'update' => array('table' => 'sys_group_mask',
+ 'basecol' => 'gid',
+ 'baseval' => $_SESSION['sys_group_mask.group'],
+ 'refcol' => 'mask',
+ 'reftable' => 'sys_mask',
+ 'refid' => 'id',
+ ),
+ ),
+ ),
+ 'rows' => 20,
+ 'variables' => array(
+ 'group' => array(),
+ ),
+ );
+
+?>