Beispiel #1
0
function admin_calendar()
{
    global $db, $countries;
    $tpl = new smarty();
    $tpl->assign('events', get_events());
    $tpl->assign('lang', get_languages());
    $tpl->assign('rights', get_form_rights());
    ob_start();
    $tpl->display(DESIGN . '/tpl/admin/calendar.html');
    $content = ob_get_contents();
    ob_end_clean();
    main_content(CALENDAR, $content, '', 1);
}
Beispiel #2
0
function admin_cms()
{
    global $db;
    $tpl = new Smarty();
    $tpl->assign('cms', get_cms());
    $tpl->assign('lang', get_languages());
    $tpl->assign('rights', get_form_rights(@$_POST['rights']));
    ob_start();
    $tpl->display(DESIGN . '/tpl/admin/cms.html');
    $content = ob_get_contents();
    ob_end_clean();
    main_content(OWN_SITES, $content, '', 1);
}
Beispiel #3
0
function admin_downloads()
{
    global $db;
    $tpl = new smarty();
    $tpl->assign('lang', get_languages());
    $tpl->assign('rights', get_form_rights(@$_POST['rights']));
    $tpl->assign('kate', download_get_cate(@$_POST['subID']));
    $db->query('SELECT name, dID FROM ' . DB_PRE . 'ecp_downloads ORDER BY name ASC');
    $dl = '<option value="0">' . CHOOSE . '</option>';
    while ($row = $db->fetch_assoc()) {
        $dl .= '<option value="' . $row['dID'] . '">' . $row['name'] . '</option>';
    }
    $tpl->assign('dls', $dl);
    //foreach($_POST AS $key=>$value) $tpl->assign($key, $value);
    ob_start();
    $tpl->display(DESIGN . '/tpl/admin/downloads.html');
    $content = ob_get_contents();
    ob_end_clean();
    main_content(DOWNLOADS, $content, '', 1);
}
Beispiel #4
0
function admin_gallery()
{
    global $db;
    $tpl = new smarty();
    $tpl->assign('access', get_form_rights());
    $tpl->assign('folders', get_dirs());
    $tpl->assign('lang', get_languages());
    $db->query('SELECT kateID, katename, galleries FROM ' . DB_PRE . 'ecp_gallery_kate ORDER BY katename ASC');
    $kate = array();
    while ($row = $db->fetch_assoc()) {
        @($options .= '<option value="' . $row['kateID'] . '">' . $row['katename'] . '</option>');
        $kate[] = $row;
    }
    $tplc = new Smarty();
    $tplc->assign('kate', $kate);
    ob_start();
    $tplc->display(DESIGN . '/tpl/admin/gallery_kate_overview.html');
    $content = ob_get_contents();
    ob_end_clean();
    $tpl->assign('kate', $content);
    $tpl->assign('kategorien', @$options);
    $db->query('SELECT galleryID, folder, name, images, katename FROM ' . DB_PRE . 'ecp_gallery LEFT JOIN ' . DB_PRE . 'ecp_gallery_kate ON cID = kateID ORDER BY name ASC');
    $gallery = array();
    while ($row = $db->fetch_assoc()) {
        $gallery[] = $row;
    }
    $tplc = new Smarty();
    $tplc->assign('gallery', $gallery);
    ob_start();
    $tplc->display(DESIGN . '/tpl/admin/gallery_overview.html');
    $content = ob_get_contents();
    ob_end_clean();
    $tpl->assign('gallery', $content);
    ob_start();
    $tpl->display(DESIGN . '/tpl/admin/gallery.html');
    $content = ob_get_contents();
    ob_end_clean();
    main_content(GALLERY, $content, '', 1);
}
Beispiel #5
0
function admin_menu_edit($id)
{
    global $db;
    if (@$_SESSION['rights']['admin']['menu']['edit'] or @$_SESSION['rights']['superadmin']) {
        if (isset($_POST['submit'])) {
            if ($_POST['name'] == '' or $_POST['design'] == '') {
                table(ERROR, NOT_NEED_ALL_INPUTS);
                $tpl = new smarty();
                foreach ($_POST as $key => $value) {
                    $tpl->assign($key, $value);
                }
                $tpl->assign('module', get_module($_POST['modul']));
                $tpl->assign('designs', get_designs($_POST['design']));
                $tpl->assign('access', get_form_rights($_POST['access']));
                $tpl->assign('func', 'add');
                $lang = get_languages();
                in_array('all', $_POST['language']) ? $options = '<option value="all" selected="selected">' . ALL . '</option>' : ($options = '<option value="all">' . ALL . '</option>');
                foreach ($lang as $value) {
                    $options .= '<option ' . (in_array($value['lang'], $_POST['language']) ? ' selected="selected"' : '') . 'value="' . $value['lang'] . '">' . $value['name'] . '</option>';
                }
                $tpl->assign('languages', $options);
                ob_start();
                $tpl->display(DESIGN . '/tpl/admin/menu_add_edit.html');
                $content = ob_get_contents();
                ob_end_clean();
                main_content(MENU_ADD, $content, '', 1);
            } else {
                if (in_array('all', $_POST['language'])) {
                    $lang = '';
                } else {
                    $lang = ',' . implode(',', $_POST['language']) . ',';
                }
                $sql = sprintf('UPDATE ' . DB_PRE . 'ecp_menu SET `name` = \'%s\', `headline` = \'%s\', `inhalt` = \'%s\', `hposi` = \'%s\', `usetpl` =%d, `design` = \'%s\', `access` = \'%s\', `lang` = \'%s\', `modul` = \'%s\' WHERE menuID = %d', strsave($_POST['name']), strsave($_POST['headline']), strsave($_POST['inhalt']), strsave($_POST['postion']), (int) @$_POST['usetpl'], strsave($_POST['design']), strsave(admin_make_rights($_POST['access'])), strsave($lang), strsave($_POST['modul']), $id);
                if ($db->query($sql)) {
                    header1('?section=admin&site=menu');
                }
            }
        } else {
            $menu = $db->fetch_assoc('SELECT * FROM ' . DB_PRE . 'ecp_menu WHERE menuID = ' . $id);
            $tpl = new smarty();
            $menu['headline'] = htmlentities($menu['headline']);
            foreach ($menu as $key => $value) {
                $tpl->assign($key, $value);
            }
            $tpl->assign('func', 'edit&id=' . $id);
            $tpl->assign('module', get_module($menu['modul']));
            $tpl->assign('designs', get_designs($menu['design']));
            $tpl->assign('access', get_form_rights(explode(',', $menu['access'])));
            $lang = get_languages();
            $langs = explode(',', $menu['lang']);
            $options = '<option value="all" ' . (count($langs) < 3 ? 'selected="selected"' : '') . '>' . ALL . '</option>';
            foreach ($lang as $value) {
                $options .= '<option ' . (in_array($value['lang'], $langs) ? ' selected="selected"' : '') . 'value="' . $value['lang'] . '">' . $value['name'] . '</option>';
            }
            $tpl->assign('languages', $options);
            ob_start();
            $tpl->display(DESIGN . '/tpl/admin/menu_add_edit.html');
            $content = ob_get_contents();
            ob_end_clean();
            main_content(MENU_EDIT, $content, '', 1);
        }
    } else {
        table(ERROR, NO_ADMIN_RIGHTS);
    }
}