Exemplo n.º 1
0
        $passform->password('pass_new', 'Neues Passwort');
        $passform->password('pass_rep', 'Passwort Wiederholung');
        $tabs->add('Password', $msg . $passform);
    }
    if ($modulrights['rights']) {
        $i++;
        if (isset($_POST['type'])) {
            $type = 4 * $_POST['type']['sysadmin'] + 2 * $_POST['type']['backend'] + $_POST['type']['frontend'];
            db()->id_update('user_data', array('type' => $type), $_GET['edit']);
            throw new redirect($uri . '#tabs-' . $i . '-hash');
        }
        $typeform = new form_renderer($uri . '#tabs-' . $i . '-hash');
        $typeform->checkbox('type[frontend]', 'Frontend', $edituser['type'] & 1);
        $typeform->checkbox('type[backend]', 'Backend', $edituser['type'] & 2);
        $typeform->checkbox('type[sysadmin]', 'Sysadmin', $edituser['type'] & 4);
        $tabs->add('Type', $typeform);
        $i++;
        $rc_groups = new data_controller('user_group_owner', $uri . '#tabs-' . $i . '-hash');
        $rc_groups->add('group', 'Gruppe', 1, 1, 1, 1, 'select', db()->select('user_groups')->relate());
        $rc_groups->add('start_date', 'Start Datum', 1, 1, 1, 0, 'date');
        $rc_groups->add('end_date', 'End Datum', 1, 1, 1, 0, 'date');
        $rc_groups->auto['create'] = array('user' => $edituser['id']);
        $rc_groups->condition = 'user = '******'id'];
        $rc_groups->pk = $rc_groups->prefix = 'group';
        if ($rc_groups->run()) {
            throw new redirect($uri . '#tabs-' . $i . '-hash');
        }
        $tabs->add('Rechte', $rc_groups->get_list() . '<h4>Gruppe hinzufügen</h4>' . $rc_groups->get_form());
    }
    $grid[1]->box($form . $tabs, 'User bearbeiten');
}
Exemplo n.º 2
0
<?php

$rc = new data_controller('user_profil', MODUL_SELF);
$rc->add('id', 'Id', 1, 0, 0, 0);
$rc->add('name', 'Name', 1, 1, 1, 1);
$rc->add('caption', 'Beschriftung', 1, 1, 1, 1);
$rc->add('value', 'Standardwert', 0, 1, 1, 0);
$rc->add('type', 'Typ', 0, 1, 1, 1, 'select', array('text' => 'Einzeiliger Text', 'textarea' => 'Mehrzeiliger Text', 'checkbox' => 'Checkbox', 'select' => 'Auswahlfeld'));
$rc->add('options', 'Auswahlmöglichkeiten', 0, 1, 1, 0, 'textarea');
if (!empty($_GET['delete'])) {
    $field = $db->user_profil->row($_GET['delete'])->assoc();
    $db->user_details->del("category = 'profil' AND name = '%s'", $field['name']);
}
if (!empty($_GET['update'])) {
    $field = $db->user_profil->row($_GET['update'])->assoc();
    $db->user_details->update(array('name' => $_POST['name']), "category = 'profil' AND name = '%s'", $field['name']);
}
if ($rc->run()) {
    throw new redirect(MODUL_SELF);
}
$grid = $view->grid();
$grid[0]->box($rc->get_list(), 'Felder verwalten');
$grid[1]->box($rc->get_form(), 'Feld ' . (empty($_GET['edit']) ? 'erstellen' : 'bearbeiten'));
Exemplo n.º 3
0
        throw new redirect($self);
    }
    if (!empty($_GET['editform'])) {
        $view->content($rc_layer->get_edit($_GET['editform']));
        $view->format = 'plain';
    } else {
        $view->js('assets/js/contentmanager.js');
        $view->content($grid = new widget_grid(6, 6));
        $grid[0]->box(template('iv.content.layertree')->render(array('tree' => $root, 'self' => $self, 'create' => $rc_layer->get_create(), 'current' => intval($_GET['layeredit']), 'panelgroups' => db()->query("SELECT DISTINCT `group` FROM content_panel")->values(), 'startpage' => $conf->page->startpage)), 'Layerliste');
        //		if( !empty( $_GET['layeredit'])) {
        //			$edit = $rc_layer->get_edit($_GET['layeredit']);
        //			$grid[1]->box($edit, 'Layer bearbeiten');
        //		}
        $panelform = $rc_panel->get_form();
        $panelform->id = 'panelform';
        $liste = $rc_panel->get_list();
        $liste->list->id = 'panellist';
        $liste->list->unshift(new list_column_format(' ', '<div class="btn btn-small handle" data-panel="%d"><span class="icon-move"></span></div>', 'id'));
        $grid[1]->box($liste, 'Panelliste');
        $grid[1]->box($panelform, 'Panel ' . (empty($_GET['paneledit']) ? 'erstellen' : 'bearbeiten'));
    }
} else {
    $scripts = iv::get('scripts');
    if (!($panel = db()->id_get('content_panel', $_GET['content']))) {
        throw new Exception('Das angeforderte Panel wurde nicht gefunden!');
    } elseif (!$rights->has('script', $panel['script'])) {
        throw new Exception('Sie besitzen keine berechtigung auf dieses Panel zuzugreifen.');
    } elseif (!($script = $scripts[$panel['script']])) {
        throw new Exception('Das angeforderte Script wurde nicht gefunden!');
    } elseif (empty($script['editor'])) {
        throw new Exception('Für dieses Panel bestehen keine Möglichkeiten zur Inhaltsbearbeitung.');
Exemplo n.º 4
0
            $db->query("REPLACE INTO base_menu_point ( user, modul, category )\n\t\t\t\t\tVALUES " . implode(',', $insert));
        }
        if (count($delete)) {
            $db->query("DELETE FROM base_menu_point\n\t\t\t\t\tWHERE user = %d AND modul IN (" . implode(',', $delete) . ")", $user->id);
        }
        throw new redirect($self);
    }
    $rc = new data_controller('base_menu_category', $self);
    $rc->add('name', 'Name', 1, 1, 1, 1);
    $rc->auto['create'] = array('user' => $user->id);
    $rc->condition = $db->format('user = %d', $user->id);
    if ($rc->run()) {
        throw new redirect($self);
    }
    $possible = $db->base_menu_category->all()->relate();
    $possible[-1] = 'Allgemein';
    $possible[0] = 'Versteckt';
    $form = new form($self);
    foreach (iv::get('moduls') as $mod) {
        if ($rights->has('modul', $mod['file'])) {
            $form->select('points[' . $mod['file'] . ']', $mod['name'], $possible, isset($assignment[$mod['file']]) ? $assignment[$mod['file']] : -1);
        }
    }
    $grid = $view->grid();
    $grid[0]->box($rc->get_list(), 'Kategorien');
    $grid[0]->box($rc->get_form(), 'Kategorie ändern');
    $grid[1]->box($form, 'Menü Verwalten');
} else {
    $cat = isset($menu[$_GET['category']]) ? $menu[$_GET['category']] : $menu[0];
    $view->content(template('iv.nav.list')->render($cat));
}
Exemplo n.º 5
0
 public function index()
 {
     $pack = $this->package;
     $self = MODUL_SELF . '&edit=' . $pack['id'];
     $cond = db()->format("package = '%s'", $pack['id']);
     $rcf = new data_controller('update_file', $self . '#tabs-2-hash');
     $rcf->add('path', 'Datei-Pfad');
     $rcf->add('version', 'Version');
     $rcf->edit = $rcf->create = false;
     $rcf->condition = $cond;
     $rcf->prefix = 'file_';
     $rcf->pk = 'path';
     $plink = MODUL_SELF . '&action=add_files&edit=' . $pack['id'];
     $addbtn = '<p align="center"><input type="button" class="btn btn-primary" ' . 'value="Dateien hinzufügen" onclick="popup( \'' . $plink . '\', 800 )"></p>';
     if ($rcf->run()) {
         throw new redirect($self . '#tabs-2-hash');
     }
     $rcs = new data_controller('update_share', $self . '#tabs-3-hash');
     $rcs->add('comment', 'Kommentar', 1, 1, 1, 1);
     $rcs->add('pattern', 'Freigabe', 1, 1, 1, 1);
     $rcs->condition = $cond;
     $rcs->auto['create'] = array('package' => $pack['id']);
     $rcs->prefix = 'share_';
     if ($rcs->run()) {
         throw new redirect($self . '#tabs-3-hash');
     }
     $depend = array_keys($GLOBALS['packages']);
     $rcd = new data_controller('update_dependency', $self . '#tabs-4-hash');
     $rcd->add('required', 'Benötigtes Paket', 1, 1, 1, 1, 'select', $depend);
     $rcd->add('version', 'Version', 1, 1, 1, 1);
     $rcd->condition = $cond;
     $rcd->auto['create'] = array('package' => $pack['id']);
     $rcd->prefix = 'depend_';
     if ($rcd->run()) {
         throw new redirect($self . '#tabs-4-hash');
     }
     $tabs = new widget_tabs('update_files', $self);
     $tabs->add('Infos', template('iv.packages.info')->render($pack));
     $tabs->add('Dateien', $rcf->get_list(25) . $addbtn);
     $tabs->add('Freigaben', $rcs->get_form() . $rcs->get_list());
     $tabs->add('Abhängigkeiten', $rcd->get_form() . $rcd->get_list());
     $this->view->box($tabs, 'Paket bearbeiten', '600px');
 }
Exemplo n.º 6
0
<?php

$rights = iv::get('rights');
$_POST['rights'] = serialize($_POST['r']);
$rc = new data_controller('user_groups', MODUL_SELF);
$rc->add('name', 'Name', 1, 1, 1, 1);
$rc->add('rights', 'Rechte', 0, 0, 1, 0, 'hidden');
if ($rc->run()) {
    throw new redirect(MODUL_SELF . '&edit=' . intval($_GET['update']));
}
$grid = $view->grid();
$grid[0]->box($rc->get_create(), 'Gruppe erstellen');
$grid[0]->box($rc->get_list(), 'Gruppen verwalte');
if (!empty($_GET['edit']) && ($group = db()->id_get('user_groups', $_GET['edit']))) {
    $form = $rc->get_edit($_GET['edit']);
    $form->append($tabs = new tabs());
    $grouprights = (array) unserialize($group['rights']);
    foreach ($rights->providers as $type => $provider) {
        $inputs = array();
        $typerights = $grouprights[$type] ?: array();
        foreach ($provider->keys() as $key => $caption) {
            if (!isset($provider->always[$key])) {
                $inputs[] = $inp = new form_field_boxtree("r[{$type}][{$key}]", $caption, isset($typerights[$key]));
                foreach ($provider->flagNames($key) as $flag => $caption) {
                    $inp->sub("r[{$type}][{$key}][{$flag}]", $caption, isset($typerights[$key][$flag]));
                }
            }
        }
        $tabs->add($provider->name, implode($inputs));
    }
    $grid[1]->box($form, 'Rechte bearbeiten');