Exemplo n.º 1
0
    } elseif ($configuration['lst_global'] == 0 && !$yourConfigurationsGroup && strlen($configuration['lst_name']) > 0) {
        $actualGroup = $gL10n->get('LST_YOUR_CONFIGURATION');
        $yourConfigurationsGroup = true;
    } elseif ($configuration['lst_global'] == 1 && !$presetConfigurationsGroup) {
        $actualGroup = $gL10n->get('LST_PRESET_CONFIGURATION');
        $presetConfigurationsGroup = true;
    }
    // if its a temporary saved configuration than show timestamp of creating as name
    if (strlen($configuration['lst_name']) === 0) {
        $objListTimestamp = new DateTime($configuration['lst_timestamp']);
        ++$numberLastConfigurations;
        // only 5 configurations without a name should be saved for each user
        if ($numberLastConfigurations > 5) {
            // delete all other configurations
            $del_list = new ListConfiguration($gDb, $configuration['lst_id']);
            $del_list->delete();
        } else {
            // now add configuration to array
            $configurationsArray[] = array($configuration['lst_id'], $objListTimestamp->format($gPreferences['system_date'] . ' ' . $gPreferences['system_time']), $actualGroup);
        }
    } else {
        // now add configuration to array
        $configurationsArray[] = array($configuration['lst_id'], $configuration['lst_name'], $actualGroup);
    }
}
$form->addSelectBox('sel_select_configuation', $gL10n->get('LST_SELECT_CONFIGURATION'), $configurationsArray, array('defaultValue' => $formValues['sel_select_configuation'], 'showContextDependentFirstEntry' => false));
// Webmasters could upgrade a configuration to a global configuration that is visible to all users
if ($gCurrentUser->isWebmaster()) {
    $form->addCheckbox('cbx_global_configuration', $gL10n->get('LST_CONFIGURATION_ALL_USERS'), $list->getValue('lst_global'), array('defaultValue' => $formValues['cbx_global_configuration'], 'helpTextIdLabel' => 'LST_PRESET_CONFIGURATION_DESC'));
}
$form->addDescription($gL10n->get('LST_ADD_COLUMNS_DESC'));
Exemplo n.º 2
0
        $list->setValue('lst_name', $getName);
    }
    // set list global only in save mode
    if ($getMode === 1 && $gCurrentUser->isWebmaster() && isset($_POST['cbx_global_configuration'])) {
        $list->setValue('lst_global', $_POST['cbx_global_configuration']);
    } else {
        $list->setValue('lst_global', 0);
    }
    $list->save();
    if ($getMode === 1) {
        // save new id to session so that we can restore the configuration with new list name
        $_SESSION['mylist_request']['sel_select_configuation'] = $list->getValue('lst_id');
        // go back to mylist configuration
        header('Location: ' . $g_root_path . '/adm_program/modules/lists/mylist.php?lst_id=' . $list->getValue('lst_id'));
        exit;
    }
    // weiterleiten zur allgemeinen Listeseite
    header('Location: ' . $g_root_path . '/adm_program/modules/lists/lists_show.php?lst_id=' . $list->getValue('lst_id') . '&mode=html&show_members=' . $_POST['sel_show_members'] . '&rol_ids=' . implode(',', $_POST['sel_roles_ids']));
    exit;
} elseif ($getMode === 3) {
    try {
        // delete list configuration
        $list->delete();
        unset($_SESSION['mylist_request']);
    } catch (AdmException $e) {
        $e->showHtml();
    }
    // go back to list configuration
    header('Location: ' . $g_root_path . '/adm_program/modules/lists/mylist.php');
    exit;
}