当前位置: 首页>>代码示例>>PHP>>正文


PHP get_enumerated_param函数代码示例

本文整理汇总了PHP中get_enumerated_param函数的典型用法代码示例。如果您正苦于以下问题:PHP get_enumerated_param函数的具体用法?PHP get_enumerated_param怎么用?PHP get_enumerated_param使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get_enumerated_param函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array_keys

<?php

$relPath = "./../../pinc/";
include_once $relPath . 'base.inc';
include_once $relPath . 'dpsql.inc';
include_once $relPath . 'TallyBoard.inc';
include_once $relPath . 'page_tally.inc';
include_once 'common.inc';
$valid_tally_names = array_keys($page_tally_names);
$tally_name = get_enumerated_param($_GET, 'tally_name', null, $valid_tally_names);
$timeframe = get_enumerated_param($_GET, 'timeframe', null, array('curr_month', 'prev_month', 'all_time'));
$c_or_i = get_enumerated_param($_GET, 'cori', null, array('cumulative', 'increments'));
// Initialize the graph before anything else.
// This makes use of the jpgraph cache if enabled.
// Argument to init_pages_graph is the cache timeout in minutes.
$graph = init_pages_graph(60);
$site_tallyboard = new TallyBoard($tally_name, 'S');
$now_timestamp = time();
$now_assoc = getdate($now_timestamp);
$curr_y = $now_assoc['year'];
$curr_m = $now_assoc['mon'];
switch ($timeframe) {
    case 'curr_month':
        $start_timestamp = mktime(0, 0, 0, $curr_m, 1, $curr_y);
        $end_timestamp = mktime(0, 0, 0, $curr_m + 1, 1, $curr_y);
        $year_month = strftime('%Y-%m', $start_timestamp);
        $where_clause = "WHERE {year_month} = '{$year_month}'";
        $title_timeframe = strftime(_('%B %Y'), $now_timestamp);
        break;
    case 'prev_month':
        $start_timestamp = mktime(0, 0, 0, $curr_m - 1, 1, $curr_y);
开发者ID:cpeel,项目名称:dproofreaders-shadow,代码行数:31,代码来源:pages_daily.php

示例2: get_integer_param

} else {
    if ($default_layout === LAYOUT_HORIZ || $default_layout === LAYOUT_VERT) {
        // The normal case for the session's subsequent visits.
    } else {
        // I don't know how this could happen.
        $default_layout = LAYOUT_HORIZ;
        // Alternatively, we could raise an error or warning.
    }
}
$layout = get_integer_param($_GET, 'layout', $default_layout, LAYOUT_HORIZ, LAYOUT_VERT);
$_SESSION["show_good_word_suggestions_detail"]["layout"] = $layout;
// $frame determines which frame we're operating from
// 'master' - we're the master frame
//   'left' - we're the left frame with the text
//  'right' - we're the right frame for the image
$frame = get_enumerated_param($_GET, 'frame', 'master', array('master', 'left', 'right'));
if ($frame == "master") {
    slim_header_frameset(_("Suggestion Detail"));
    if ($layout == LAYOUT_HORIZ) {
        $frameSpec = 'rows="30%,70%"';
    } else {
        $frameSpec = 'cols="30%,70%"';
    }
    ?>
<frameset <?php 
    echo $frameSpec;
    ?>
>
<frame name="worddetailframe" src="show_good_word_suggestions_detail.php?projectid=<?php 
    echo $projectid;
    ?>
开发者ID:cpeel,项目名称:dproofreaders-shadow,代码行数:31,代码来源:show_good_word_suggestions_detail.php

示例3: validate_projectID

$projectid = validate_projectID('projectid', @$_REQUEST['projectid']);
$fileObject = get_project_word_file($projectid, "good");
$timeCutoff = get_integer_param($_REQUEST, 'timeCutoff', $fileObject->mod_time, 0, null);
$freqCutoff = get_integer_param($_REQUEST, 'freqCutoff', 5, 0, null);
enforce_edit_authorization($projectid);
if ($timeCutoff == 0) {
    $time_cutoff_text = _("<b>All proofreader suggestions</b> are included in the results.");
} else {
    $time_cutoff_text = sprintf(_("Only proofreader suggestions made <b>after %s</b> are included in the results."), strftime($datetime_format, $timeCutoff));
}
// $format determines what is presented from this page:
//   'html' - page is rendered with frequencies included
//   'file' - all words and frequencies are presented as a
//            downloaded file
// 'update' - update the list
$format = get_enumerated_param($_REQUEST, 'format', 'html', array('html', 'file', 'update'));
if ($format == "update") {
    $postedWords = parse_posted_words($_POST);
    $words = load_project_good_words($projectid);
    $words = array_merge($words, $postedWords);
    save_project_good_words($projectid, $words);
    $format = "html";
}
list($all_suggestions_w_freq, $all_suggestions_w_occurrences, $round_suggestions_w_freq, $round_suggestions_w_occurrences, $rounds, $round_page_count, $messages) = _get_word_list($projectid, $timeCutoff);
$title = _("Candidates for Good Words List from Proofreaders");
$page_text = sprintf(_("Displayed below are the words that proofreaders have suggested (via the %s button) in the WordCheck interface that have not been already included in the project's Good Words List."), "<img src='{$code_url}/graphics/Book-Plus-Small.gif'>");
$page_text .= " ";
$page_text .= _("The results list also shows how many times each word occurs in the project text and how many times each word was suggested by proofreaders.");
if ($format == "file") {
    $filename = "{$projectid}_proofer_suggestions.txt";
    header("Content-type: text/plain");
开发者ID:cpeel,项目名称:dproofreaders-shadow,代码行数:31,代码来源:show_good_word_suggestions.php

示例4: require_login

<?php

$relPath = "../pinc/";
include_once $relPath . 'base.inc';
include_once $relPath . 'project_states.inc';
include_once $relPath . 'project_trans.inc';
include_once $relPath . 'metarefresh.inc';
include_once $relPath . 'Project.inc';
include_once $relPath . 'ProjectTransition.inc';
require_login();
header("Content-Type: text/html; charset={$charset}");
// Get Passed parameters to code
$projectid = validate_projectID('projectid', @$_POST['projectid']);
$curr_state = get_enumerated_param($_POST, 'curr_state', null, $PROJECT_STATES_IN_ORDER);
$next_state = get_enumerated_param($_POST, 'next_state', null, array_merge($PROJECT_STATES_IN_ORDER, array('automodify')));
$confirmed = get_enumerated_param($_POST, 'confirmed', null, array('yes'), true);
$return_uri = @$_POST['return_uri'];
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
$project = new Project($projectid);
if ($project->state != $curr_state) {
    fatal_error(sprintf(_("Your request appears to be out-of-date. The project's current state is now '%s'."), $project->state));
}
$transition = get_transition($curr_state, $next_state);
if (is_null($transition)) {
    fatal_error(_("This transition is not recognized."));
}
if (!$transition->is_valid_for($project, $pguser)) {
    fatal_error(_("You are not permitted to perform this action."));
}
function fatal_error($msg)
{
开发者ID:cpeel,项目名称:dproofreaders-shadow,代码行数:31,代码来源:changestate.php

示例5: undo_all_magic_quotes

<?php

$relPath = "./../pinc/";
include_once $relPath . 'base.inc';
include_once $relPath . 'misc.inc';
// xmlencode()
undo_all_magic_quotes();
$content = get_enumerated_param($_GET, 'content', 'posted', array('posted', 'postprocessing', 'proofing', 'news'));
// Which feed the user wants
$refreshDelay = 30 * 60;
// Time in seconds for how often the feeds get refreshed
$refreshAge = time() - $refreshDelay;
// How long ago $refreshDelay was in UNIX time
// Determine if we should display a 0.91 compliant RSS feed or our own feed
$intlang = get_desired_language();
if (isset($_GET['type'])) {
    $xmlfile = "{$xmlfeeds_dir}/{$content}_rss.{$intlang}.xml";
} else {
    $xmlfile = "{$xmlfeeds_dir}/{$content}.{$intlang}.xml";
}
// If the file does not exist or is stale, let's (re)create it
if (!file_exists($xmlfile) || filemtime($xmlfile) < $refreshAge) {
    $relPath = "./../pinc/";
    include_once $relPath . 'pg.inc';
    include_once $relPath . 'project_states.inc';
    $absolute_url = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://';
    $absolute_url .= $_SERVER['HTTP_HOST'];
    $absolute_url .= $_SERVER['REQUEST_URI'];
    $encoded_url = xmlencode($absolute_url);
    if ($content == "posted" || $content == "postprocessing" || $content == "proofing") {
        switch ($content) {
开发者ID:cpeel,项目名称:dproofreaders-shadow,代码行数:31,代码来源:backend.php

示例6: array

<?php

$relPath = "./pinc/";
include_once $relPath . 'base.inc';
include_once $relPath . 'misc.inc';
include_once $relPath . 'slim_header.inc';
include_once 'faq/pophelp/prefs/prefs_pophelp.inc';
include_once 'faq/pophelp/teams/teams_pophelp.inc';
$pophelp = array('prefs' => $prefs_pophelp, 'teams' => $teams_pophelp);
undo_all_magic_quotes();
$category = get_enumerated_param($_GET, 'category', null, array_keys($pophelp));
$name = get_enumerated_param($_GET, 'name', null, array_keys($pophelp[$category]));
$title = $pophelp[$category][$name]['title'];
$content = $pophelp[$category][$name]['content'];
slim_header($title);
echo "<div align='center'>\n";
echo "<table border='1' width='360' cellpadding='6'>\n";
echo "<tr><td align='center' bgcolor='#cccccc'><b>{$title}</b></td></tr>\n";
echo "<tr><td>{$content}</td></tr>\n";
echo "<tr><td align='center' bgcolor='#cccccc'><b><a href='javascript:window.close();'>" . _("Close Window") . "</a></b></td></tr>\n";
echo "</table></div>\n";
// vim: sw=4 ts=4 expandtab
开发者ID:cpeel,项目名称:dproofreaders-shadow,代码行数:22,代码来源:pophelp.php

示例7: get_enumerated_param

<?php

$relPath = "./../../pinc/";
include_once $relPath . 'base.inc';
include_once $relPath . 'misc.inc';
include_once $relPath . 'privacy.inc';
include_once $relPath . 'theme.inc';
include_once $relPath . 'metarefresh.inc';
include_once $relPath . 'forum_interface.inc';
include_once '../includes/team.inc';
include_once '../includes/member.inc';
$order = get_enumerated_param($_GET, 'order', 'u_id', array('u_id', 'username', 'date_created'));
$direction = get_enumerated_param($_GET, 'direction', 'asc', array('asc', 'desc'));
$mstart = get_integer_param($_GET, 'mstart', 0, 0, null);
$uname = @$_REQUEST['uname'];
$uexact = @$_REQUEST['uexact'];
if (!empty($uname)) {
    if ($uexact == 'yes') {
        $where_clause = "WHERE username='" . $uname . "'";
    } else {
        $where_clause = "WHERE username LIKE '%" . addcslashes($uname, "%_") . "%'";
    }
    $mResult = mysql_query("\n        SELECT u_id, username, date_created, u_privacy\n        FROM users\n        {$where_clause}\n        ORDER BY {$order} {$direction}\n        LIMIT {$mstart},20\n    ");
    $mRows = mysql_num_rows($mResult);
    if ($mRows == 1) {
        metarefresh(0, "mdetail.php?id=" . mysql_result($mResult, 0, "u_id") . "", '', '');
        exit;
    }
    $uname = "uname=" . $uname . "&";
} else {
    $mResult = mysql_query("\n        SELECT u_id, username, date_created, u_privacy\n        FROM users\n        ORDER BY {$order} {$direction}\n        LIMIT {$mstart},20\n    ");
开发者ID:cpeel,项目名称:dproofreaders-shadow,代码行数:31,代码来源:mbr_list.php

示例8: get_search_title

?>

<a name="results"></a><h2 align="center"><?php 
echo get_search_title();
?>
</h2>

<form name="adminform" action="?<?php 
echo $query . $sortby;
?>
" method="POST" onSubmit="return evaluateForm(this);">

<?php 
// argument 'view': 'enabled'(default), 'disabled', 'all'
// provide links for those and also buttons for submitting/resetting form.
$view = get_enumerated_param($_REQUEST, 'view', 'enabled', array('enabled', 'disabled', 'all'));
$links_and_buttons = _('View:') . ' ';
if ($view != 'disabled' && $view != 'all') {
    $links_and_buttons .= _('Enabled');
} else {
    $links_and_buttons .= "<a href='?{$query_without_view}{$sortby}&view=enabled#results'>" . _('Enabled') . '</a>';
}
$links_and_buttons .= " | ";
if ($view == 'disabled') {
    $links_and_buttons .= _('Disabled');
} else {
    $links_and_buttons .= "<a href='?{$query_without_view}{$sortby}&view=disabled#results'>" . _('Disabled') . '</a>';
}
$links_and_buttons .= " | ";
if ($view == 'all') {
    $links_and_buttons .= _('All');
开发者ID:cpeel,项目名称:dproofreaders-shadow,代码行数:31,代码来源:manage.php

示例9: require_login

<?php

$relPath = "../pinc/";
include_once $relPath . 'base.inc';
include_once $relPath . 'project_states.inc';
include_once $relPath . 'theme.inc';
require_login();
$clausemap = array('nameofwork' => 'nameofwork ASC', 'modifieddate' => 'modifieddate ASC', 'PPer' => 'postproofer ASC', 'PM' => 'username ASC');
$order = get_enumerated_param($_GET, 'order', 'nameofwork', array_keys($clausemap));
$orderclause = $clausemap[$order];
// ------------------
$title = _("Books Available for PPV");
output_header($title);
echo "<br><h2>{$title}</h2>\n";
// ------------------
// Header row
$colspecs = array('bogus' => _('#'), 'nameofwork' => _('Name of Work'), 'PM' => _('Project Manager'), 'PPer' => _('Post-Processed By'), 'modifieddate' => _('Date Last Modified'));
echo "<table border='1' cellspacing='0' cellpadding='2' style='border: 1px solid #111; border-collapse: collapse' width='99%'>\n";
echo "<tr><td colspan='5' bgcolor='" . $theme['color_headerbar_bg'] . "'><center><font color='" . $theme['color_headerbar_font'] . "'><b>{$title}</b></font></center></td></tr>";
echo "<tr bgcolor='" . $theme['color_navbar_bg'] . "'>";
foreach ($colspecs as $col_order => $col_header) {
    $s = $col_header;
    // Make each column-header a link that will sort on that column,
    // except for the header of the column that we're already sorting on.
    if ($col_order != $order && $col_order != 'bogus') {
        $s = "<a href='PPV_avail.php?order={$col_order}'>{$s}</a>";
    }
    $s = "<th><center>" . $s . "</center></th>";
    echo "{$s}\n";
}
echo "</tr>\n";
开发者ID:cpeel,项目名称:dproofreaders-shadow,代码行数:31,代码来源:PPV_avail.php

示例10: require_login

$relPath = './../../pinc/';
include_once $relPath . 'base.inc';
include_once $relPath . 'metarefresh.inc';
include_once $relPath . 'theme.inc';
include_once $relPath . 'misc.inc';
// undo_all_magic_quotes(), attr_safe(), html_safe()
include_once $relPath . 'user_is.inc';
require_login();
if (!user_is_a_sitemanager()) {
    die("You are not allowed to run this script.");
}
undo_all_magic_quotes();
$theme_args['css_data'] = "\ntable.listing { border-collapse: collapse; width: 80%; margin: auto; }\ntable.listing td { border: 1px solid #999; padding: 5px; }\ntable.listing tr.e { background-color: #eee; }\ntable.listing tr.o { background-color: #ddd; }\ntable.listing td.enabled { background-color: #9f9; text-align: center; }\ntable.listing td.disabled { background-color: #ddd; text-align: center; }\ntable.listing td.center { text-align: center; }\ntable.listing tr.month > * { border: none; border-bottom: solid 2px black; }\ntable.listing td.right,th.right { text-align: right; font-weight: normal; border: 1px solid #999; }\ntable.listing h2 { margin: 1em auto auto auto; text-align: left; }\nform { padding-top: 10px; margin: 0; }\n\ntable.source { border-collapse: collapse; width: 80%; margin: auto; margin-bottom: 1em; }\ntable.source td { border: 1px solid black; padding: 5px; background-color: #eeeeee; }\ntable.source td.pa { width: 30%; font-weight: bold; }\nh2.source { margin: 1em auto 1em auto; text-align: center; }";
$page_url = "{$code_url}/tools/site_admin/manage_special_days.php";
$action = get_enumerated_param($_REQUEST, 'action', 'show_specials', array('show_specials', 'add_special', 'update_oneshot'));
// Action 'update_oneshot' is used as a target for form submit buttons. The
// desired action is based on the submit button's name. Here we do the action
// and set $action to 'show_specials' to display the list all in one page load.
if ($action == 'update_oneshot') {
    global $page_url;
    if (isset($_POST['edit'])) {
        $action = 'edit_source';
    } elseif (isset($_POST['save_edits'])) {
        // This handles both edits to existing special days, and the creation of new ones
        $errmsgs = '';
        $spec_code = trim($_POST['spec_code']);
        $source = new SpecialDay($spec_code);
        if (!isset($_POST['editing']) && !$source->new_source) {
            $errmsgs .= _('A Special Day with this ID already exists. Please choose a different ID for this event.') . "<br>";
        }
开发者ID:cpeel,项目名称:dproofreaders-shadow,代码行数:30,代码来源:manage_special_days.php

示例11: handle_any_requested_db_updates

function handle_any_requested_db_updates($news_page_id)
{
    $allowed_tags = '<a><b><i><u><font><img><p><div><br>';
    $action = get_enumerated_param($_GET, 'action', null, array('add', 'delete', 'display', 'hide', 'archive', 'unarchive', 'moveup', 'movedown', 'edit', 'edit_update'), true);
    switch ($action) {
        case 'add':
            // Save a new site news item
            $content = strip_tags($_POST['content'], $allowed_tags);
            $date_posted = time();
            $insert_news = mysql_query("\n                INSERT INTO news_items\n                SET\n                    id           = NULL,\n                    news_page_id = '{$news_page_id}',\n                    status       = 'current',\n                    date_posted  = '{$date_posted}',\n                    content      = '{$content}'\n            ");
            // by default, new items go at the top
            $update_news = mysql_query("\n                UPDATE news_items SET ordering = id WHERE id = LAST_INSERT_ID()\n            ");
            news_change_made($news_page_id);
            break;
        case 'delete':
            // Delete a specific site news item
            $item_id = get_integer_param($_GET, 'item_id', null, null, null);
            $result = mysql_query("DELETE FROM news_items WHERE id={$item_id}");
            break;
        case 'display':
            // Display a specific site news item
            $item_id = get_integer_param($_GET, 'item_id', null, null, null);
            $result = mysql_query("UPDATE news_items SET status = 'current' WHERE id={$item_id}");
            news_change_made($news_page_id);
            break;
        case 'hide':
            // Hide a specific site news item
            $item_id = get_integer_param($_GET, 'item_id', null, null, null);
            $result = mysql_query("UPDATE news_items SET status = 'recent' WHERE id={$item_id}");
            news_change_made($news_page_id);
            break;
        case 'archive':
            // Archive a specific site news item
            $item_id = get_integer_param($_GET, 'item_id', null, null, null);
            $result = mysql_query("UPDATE news_items SET status = 'archived' WHERE id={$item_id}");
            break;
        case 'unarchive':
            // Unarchive a specific site news item
            $item_id = get_integer_param($_GET, 'item_id', null, null, null);
            $result = mysql_query("UPDATE news_items SET status = 'recent' WHERE id={$item_id}");
            break;
        case 'moveup':
            // Move a specific site news item higher in the display list
            $item_id = get_integer_param($_GET, 'item_id', null, null, null);
            move_news_item($news_page_id, $item_id, 'up');
            news_change_made($news_page_id);
            break;
        case 'movedown':
            // Move a specific site news item lower in the display list
            $item_id = get_integer_param($_GET, 'item_id', null, null, null);
            move_news_item($news_page_id, $item_id, 'down');
            news_change_made($news_page_id);
            break;
        case 'edit_update':
            // Save an update to a specific site news item
            $content = strip_tags($_POST['content'], $allowed_tags);
            $item_id = get_integer_param($_POST, 'item_id', null, null, null);
            $result = mysql_query("UPDATE news_items SET content='{$content}' WHERE id={$item_id}");
            $result = mysql_query("SELECT status FROM news_items WHERE id={$item_id}");
            $row = mysql_fetch_assoc($result);
            $visible_change_made = $row['status'] == 'current';
            if ($visible_change_made) {
                news_change_made($news_page_id);
            }
            break;
    }
}
开发者ID:cpeel,项目名称:dproofreaders-shadow,代码行数:67,代码来源:sitenews.php

示例12: select_and_list_tasks

function select_and_list_tasks($sql_condition)
{
    global $tasks_url;
    $columns = array('task_id' => " style='text-align: center;'", 'task_type' => "", 'task_severity' => "", 'task_summary' => " class='wrap'", 'task_priority' => "", 'date_edited' => " style='text-align: center;'", 'task_status' => "", 'votes' => "", 'percent_complete' => "");
    $curr_sort_dir = get_enumerated_param($_GET, 'direction', 'desc', array('asc', 'desc'));
    $curr_sort_col = get_enumerated_param($_GET, 'orderby', 'date_edited', array_keys($columns));
    $sql_query = "\n        SELECT tasks.task_id,\n          task_type,\n          task_severity,\n          task_summary,\n          task_priority,\n          date_edited,\n          task_status,\n          percent_complete,\n          CASE WHEN\n             vote_os IS NULL THEN NULL\n             ELSE COUNT(*) END AS votes\n        FROM tasks\n          LEFT OUTER JOIN tasks_votes USING (task_id)\n        WHERE {$sql_condition}\n        GROUP BY task_id\n        ORDER BY {$curr_sort_col} {$curr_sort_dir}\n    ";
    $sql_result = wrapped_mysql_query($sql_query);
    $t = SearchParams_get_url_query_string();
    echo "<table class='taskslist'><tr>\n";
    foreach ($columns as $property_id => $attrs) {
        // Each column-header is a link; clicking on it will cause
        // the resulting listing to be sorted on that column.
        $orderby_for_link = $property_id;
        // But sorted in which direction?
        if ($property_id == $curr_sort_col) {
            // This column is the one that the current listing is sorted on.
            // A header-click will just reverse the direction of the sort.
            if ($curr_sort_dir == "asc") {
                $direction_for_link = "desc";
            } else {
                $direction_for_link = "asc";
            }
        } else {
            // This column is not the current sort-column.
            // A header-click will sort by that column in descending order.
            // (Might be better for each column to have its own default direction.)
            $direction_for_link = "desc";
        }
        $url = "{$tasks_url}?{$t}orderby={$orderby_for_link}&direction={$direction_for_link}";
        $label = property_get_label($property_id, TRUE);
        echo "<th{$attrs}><a href='{$url}'>{$label}</a></th>\n";
    }
    echo "</tr>\n";
    if (@mysql_num_rows($sql_result) >= 1) {
        while ($row = mysql_fetch_assoc($sql_result)) {
            echo "<tr bgcolor='#ffffff'>\n";
            foreach ($columns as $property_id => $attrs) {
                $formatted_value = property_format_value($property_id, $row, TRUE);
                echo "<td{$attrs}>{$formatted_value}</td>\n";
            }
            echo "</tr>\n";
        }
    } else {
        echo "<tr bgcolor='#ffffff'><td colspan='7'><center>No tasks found!</center></td></tr>";
    }
    echo "</table><br />\n";
    // if 2 tasks or more found, display the number of reported tasks
    if (@mysql_num_rows($sql_result) > 1) {
        echo "<p>" . @mysql_num_rows($sql_result) . " tasks listed.</p>";
    }
}
开发者ID:cpeel,项目名称:dproofreaders-shadow,代码行数:52,代码来源:tasks.php

示例13: require_login

<?php

$relPath = '../../pinc/';
include_once $relPath . 'base.inc';
include_once $relPath . 'project_edit.inc';
include_once $relPath . 'project_trans.inc';
include_once $relPath . 'Project.inc';
include_once 'projectmgr.inc';
require_login();
abort_if_not_manager();
$curr_state = get_enumerated_param($_GET, 'curr_state', null, $PROJECT_STATES_IN_ORDER);
$new_state = get_enumerated_param($_GET, 'new_state', null, $PROJECT_STATES_IN_ORDER);
$projectids = array();
foreach (explode(',', @$_GET['projects']) as $projectid) {
    $projectids[] = validate_projectID('projects', $projectid);
}
echo "<pre>\n";
echo sprintf(_("Moving projects from '%1\$s' to '%2\$s'..."), $curr_state, $new_state);
echo "\n\n";
foreach ($projectids as $projectid) {
    echo "\n";
    echo "{$projectid} ...\n";
    try {
        $project = new Project($projectid);
    } catch (NonexistentProjectException $exception) {
        echo "    " . _("does not exist.") . "\n";
        continue;
    }
    $result = user_can_edit_project($projectid);
    if ($result == USER_CANNOT_EDIT_PROJECT) {
        echo "    " . _("You are not authorize to manage this project.") . "\n";
开发者ID:cpeel,项目名称:dproofreaders-shadow,代码行数:31,代码来源:move_projects.php

示例14: require_login

<?php

$relPath = "../pinc/";
include_once $relPath . 'base.inc';
include_once $relPath . 'project_states.inc';
include_once $relPath . 'theme.inc';
require_login();
$ordermap = array('nameofwork' => 'nameofwork ASC', 'checkedoutby' => 'checkedoutby ASC, modifieddate ASC', 'postproofer' => 'postproofer ASC, modifieddate ASC', 'modifieddate' => 'modifieddate ASC', 'holder_t_last_activity' => 'holder_t_last_activity ASC');
$order = get_enumerated_param($_GET, 'order', 'checkedoutby', array_keys($ordermap));
$state = get_enumerated_param($_GET, 'state', PROJ_POST_FIRST_CHECKED_OUT, array(PROJ_POST_FIRST_CHECKED_OUT, PROJ_POST_SECOND_CHECKED_OUT));
if ($state == PROJ_POST_FIRST_CHECKED_OUT) {
    $title = _('Books Checked Out for Post Processing');
}
if ($state == PROJ_POST_SECOND_CHECKED_OUT) {
    $title = _('Books Checked Out for Post Processing Verification');
    $inPPV = 1;
}
$orderclause = $ordermap[$order];
// ------------------
output_header($title);
echo "<br><h2>{$title}</h2>\n";
// ------------------
// Header row
if (isset($inPPV)) {
    $colspecs = array('bogus' => _('#'), 'nameofwork' => _('Name of Work'), 'postproofer' => _('PPer'), 'checkedoutby' => _('Checked Out By'), 'modifieddate' => _('Date Last Modified'), 'holder_t_last_activity' => _('User Last on Site'));
} else {
    $colspecs = array('bogus' => _('#'), 'nameofwork' => _('Name of Work'), 'checkedoutby' => _('Checked Out By'), 'modifieddate' => _('Date Last Modified'), 'holder_t_last_activity' => _('User Last on Site'));
}
echo "<table border='1' cellspacing='0' cellpadding='2' style='border: 1px solid #111; border-collapse: collapse' width='99%'>\n";
echo "<tr><td colspan='" . count($colspecs) . "' bgcolor='" . $theme['color_headerbar_bg'] . "'><center><font color='" . $theme['color_headerbar_font'] . "'><b>{$title}</b></font></center></td></tr>";
echo "<tr bgcolor='" . $theme['color_navbar_bg'] . "'>";
开发者ID:cpeel,项目名称:dproofreaders-shadow,代码行数:31,代码来源:checkedout.php

示例15: elseif

        echo "<br><center><font size='+1' color='#ff0000'><b>{$errors}</b></font></center>";
    }
    $pih->show_form();
    if (isset($_POST['saveAndPreview'])) {
        $pih->preview();
    }
} elseif (isset($_POST['quit'])) {
    // if return is empty for whatever reason take them to
    // the PM page
    if (empty($return)) {
        $return = "{$code_url}/tools/project_manager/projectmgr.php";
    }
    // do the redirect
    metarefresh(0, $return, _("Quit Without Saving"), "");
} else {
    $requested_action = get_enumerated_param($_REQUEST, 'action', null, array('createnew', 'clone', 'createnewfromuber', 'create_from_marc_record', 'edit'));
    if (in_array($requested_action, array('createnew', 'clone', 'createnewfromuber', 'create_from_marc_record'))) {
        check_user_can_load_projects(true);
        // exit if they can't
    }
    switch ($requested_action) {
        case 'createnew':
            $page_title = _("Create a Project");
            $fatal_error = $pih->set_from_nothing();
            break;
        case 'clone':
            $page_title = _("Clone a Project");
            $fatal_error = $pih->set_from_db(FALSE);
            break;
        case 'createnewfromuber':
            $page_title = _("Create a Project from an Uber Project");
开发者ID:cpeel,项目名称:dproofreaders-shadow,代码行数:31,代码来源:editproject.php


注:本文中的get_enumerated_param函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。