Ejemplo n.º 1
0
    }
}
/****************************************************************************
**	Process Delete
****************************************************************************/
if ($submit == 'delete') {
    // Make the sure the right parameters are set
    if (!$list_id) {
        trigger_error('<strong>list</strong> is a required form post parameter ' . "for submit type 'delete'.", E_USER_ERROR);
    }
    // Throw error if deleting one of the restricted lists
    if ($restrict_editing) {
        trigger_error("Cannot delete restricted lists without admin privileges", E_USER_ERROR);
    }
    // Delete the list
    if (!$clf->deleteConceptList($list_id)) {
        trigger_error("Cannot delete concept_list_id: " . $list_id, E_USER_ERROR);
    }
    // Set the redirect url
    $url = 'list.php';
} elseif ($submit == 'create new') {
    // Make sure the right parameters are set
    // NOTE: 'concepts' is an optional parameter
    if (!$name || !$source) {
        trigger_error('<strong>name</strong> and <strong>source</strong> are ' . "required form post parameters for submit type 'create new'.", E_USER_ERROR);
    }
    // Add the list
    $new_concept_list_id = $clf->addConceptList($name, $source, $concepts);
    // Set the redirect url
    if ($new_concept_list_id) {
        $url = 'list.php?list=' . $new_concept_list_id;