Ejemplo n.º 1
0
if ($gCurrentUser->manageRoles() && !$gCurrentUser->isWebmaster()) {
    // show link to maintain categories
    $ListsMenu->addItem('menu_item_maintain_categories', $g_root_path . '/adm_program/modules/categories/categories.php?type=ROL', $gL10n->get('SYS_MAINTAIN_CATEGORIES'), 'application_view_tile.png');
}
$page->addJavascript('$("#cat_id").change(function() { $("#navbar_cat_id_form").submit(); });', true);
$navbarForm = new HtmlForm('navbar_cat_id_form', $g_root_path . '/adm_program/modules/lists/lists.php?active_role=' . $getActiveRole, $page, array('type' => 'navbar', 'setFocus' => false));
$navbarForm->addSelectBoxForCategories('cat_id', $gL10n->get('SYS_CATEGORY'), $gDb, 'ROL', 'FILTER_CATEGORIES', array('defaultValue' => $getCatId));
$ListsMenu->addForm($navbarForm->show(false));
if ($gCurrentUser->isWebmaster()) {
    // show link to system preferences of roles
    $ListsMenu->addItem('admMenuItemPreferencesLists', $g_root_path . '/adm_program/modules/preferences/preferences.php?show_option=lists', $gL10n->get('SYS_MODULE_PREFERENCES'), 'options.png', 'right');
}
$previousCategoryId = 0;
// Get Lists
$getStart = $lists->getStartElement();
$listsResult = $lists->getDataSet($getStart);
$numberOfRoles = $lists->getDataSetCount();
if ($numberOfRoles == 0) {
    if ($gValidLogin) {
        // If login valid, than show message for non available roles
        if ($getActiveRole == 0) {
            $gMessage->show($gL10n->get('LST_NO_ROLES_REMOVED'));
        } else {
            $gMessage->show($gL10n->get('LST_NO_RIGHTS_VIEW_LIST'));
        }
    } else {
        // forward to login page
        require_once '../../system/login_valid.php';
    }
}
// Get list configurations