本文整理汇总了PHP中page::select_options方法的典型用法代码示例。如果您正苦于以下问题:PHP page::select_options方法的具体用法?PHP page::select_options怎么用?PHP page::select_options使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类page
的用法示例。
在下文中一共展示了page::select_options方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: load_filter
function load_filter($defaults)
{
$current_user =& singleton("current_user");
// display the list of project name.
$db = new db_alloc();
$page_vars = array_keys(timeSheetGraph::get_list_vars());
$_FORM = get_all_form_data($page_vars, $defaults);
if ($_FORM["applyFilter"] && is_object($current_user)) {
// we have a new filter configuration from the user, and must save it
if (!$_FORM["dontSave"]) {
$url = $_FORM["url_form_action"];
unset($_FORM["url_form_action"]);
$current_user->prefs[$_FORM["form_name"]] = $_FORM;
$_FORM["url_form_action"] = $url;
}
} else {
// we haven't been given a filter configuration, so load it from user preferences
$_FORM = $current_user->prefs[$_FORM["form_name"]];
}
$rtn["personOptions"] = page::select_options(person::get_username_list($_FORM["personID"]), $_FORM["personID"]);
$rtn["dateFrom"] = $_FORM["dateFrom"];
$rtn["dateTo"] = $_FORM["dateTo"];
$rtn["personID"] = $_FORM["personID"];
$rtn["groupBy"] = $_FORM["groupBy"];
// GET
$rtn["FORM"] = "FORM=" . urlencode(serialize($_FORM));
return $rtn;
}
示例2: tf_list
function tf_list($selected = "", $remove_these = array())
{
global $tflist;
$temp = $tflist;
foreach ($remove_these as $dud) {
unset($temp[$dud]);
}
echo page::select_options($temp, $selected);
return;
}
示例3: show_transaction_new
function show_transaction_new($template)
{
global $TPL;
global $tflist;
$transaction = new transaction();
$transaction->set_values();
// wipe clean
$TPL["display"] = "display:none";
$TPL["tfList_dropdown"] = page::select_options($tflist, NULL, 500);
$TPL["fromTfList_dropdown"] = page::select_options($tflist, NULL, 500);
$TPL["transactionType_dropdown"] = page::select_options(transaction::get_transactionTypes());
$TPL["status_dropdown"] = page::select_options(transaction::get_transactionStatii());
$TPL["link"] = "";
include_template($template);
}
示例4: show_reminder_filter
function show_reminder_filter($template)
{
$current_user =& singleton("current_user");
global $TPL;
if ($current_user->have_role("admin") || $current_user->have_role("manage")) {
$TPL["reminderActiveOptions"] = page::select_options(array("1" => "Active", "0" => "Inactive"), $_REQUEST["filter_reminderActive"]);
$db = new db_alloc();
$db->query("SELECT username,personID FROM person WHERE personActive = 1 ORDER BY username");
while ($db->next_record()) {
$recipientOptions[$db->f("personID")] = $db->f("username");
}
$TPL["recipientOptions"] = page::select_options($recipientOptions, $_REQUEST["filter_recipient"]);
include_template($template);
}
}
示例5: show_skills
function show_skills()
{
global $TPL;
global $talent;
global $skills;
global $skill_class;
global $db;
$skills = array("" => "Any skill");
$query = "SELECT * FROM skill";
if ($skill_class != "") {
$query .= prepare(" WHERE skillClass='%s'", $skill_class);
}
$query .= " ORDER BY skillClass,skillName";
$db->query($query);
while ($db->next_record()) {
$skill = new skill();
$skill->read_db_record($db);
$skills[$skill->get_id()] = sprintf("%s - %s", $skill->get_value('skillClass'), $skill->get_value('skillName'));
}
if ($skill_class != "" && !in_array($skills[$talent], $skills)) {
$talent = "";
}
$TPL["skills"] = page::select_options($skills, $talent);
}
示例6: get_person_list
$peeps[$p["personID"]] = $p["name"];
}
// get the default time sheet manager/admin options
$TPL["defaultTimeSheetManagerListText"] = get_person_list(config::get_config_item("defaultTimeSheetManagerList"));
$TPL["defaultTimeSheetAdminListText"] = get_person_list(config::get_config_item("defaultTimeSheetAdminList"));
$days = array("Sun" => "Sun", "Mon" => "Mon", "Tue" => "Tue", "Wed" => "Wed", "Thu" => "Thu", "Fri" => "Fri", "Sat" => "Sat");
$TPL["calendarFirstDayOptions"] = page::select_options($days, config::get_config_item("calendarFirstDay"));
$TPL["timeSheetPrintOptions"] = page::select_options($TPL["timeSheetPrintOptions"], $TPL["timeSheetPrint"]);
$commentTemplate = new commentTemplate();
$ops = $commentTemplate->get_assoc_array("commentTemplateID", "commentTemplateName");
$TPL["rssStatusFilterOptions"] = page::select_options(task::get_task_statii_array(true), config::get_config_item("rssStatusFilter"));
if (has("timeUnit")) {
$timeUnit = new timeUnit();
$rate_type_array = $timeUnit->get_assoc_array("timeUnitID", "timeUnitLabelB");
}
$TPL["timesheetRate_options"] = page::select_options($rate_type_array, config::get_config_item("defaultTimeSheetUnit"));
$TPL["main_alloc_title"] = "Setup - " . APPLICATION_NAME;
include_template("templates/configM.tpl");
function get_person_list($personID_array)
{
global $peeps;
$people = array();
foreach ($personID_array as $personID) {
$people[] = $peeps[$personID];
}
if (count($people) > 0) {
return implode(", ", $people);
} else {
return "<i>none</i>";
}
}
示例7: show_comments
function show_comments()
{
global $clientID;
global $TPL;
global $client;
$TPL["commentsR"] = comment::util_get_comments("client", $clientID);
$TPL["commentsR"] and $TPL["class_new_comment"] = "hidden";
$interestedPartyOptions = $client->get_all_parties();
$interestedPartyOptions = interestedParty::get_interested_parties("client", $client->get_id(), $interestedPartyOptions);
$TPL["allParties"] = $interestedPartyOptions or $TPL["allParties"] = array();
$TPL["entity"] = "client";
$TPL["entityID"] = $client->get_id();
$TPL["clientID"] = $client->get_id();
$commentTemplate = new commentTemplate();
$ops = $commentTemplate->get_assoc_array("commentTemplateID", "commentTemplateName", "", array("commentTemplateType" => "client"));
$TPL["commentTemplateOptions"] = "<option value=\"\">Comment Templates</option>" . page::select_options($ops);
include_template("../comment/templates/commentM.tpl");
}
示例8: get_one_comment_array
function get_one_comment_array($v = array(), $all_parties = array())
{
global $TPL;
$current_user =& singleton("current_user");
$new = $v;
$token = new token();
if ($token->select_token_by_entity_and_action("comment", $new["commentID"], "add_comment_from_email")) {
if ($token->get_value("tokenHash")) {
$new["hash"] = $token->get_value("tokenHash");
$new["hashKey"] = "{Key:" . $new["hash"] . "}";
$new["hashHTML"] = " <em class=\"faint\">" . $new["hashKey"] . "</em>";
}
$ip = interestedParty::get_interested_parties("comment", $new["commentID"]);
foreach ((array) $ip as $email => $info) {
$all_parties += $ip;
if ($info["selected"]) {
$sel[] = $email;
}
}
foreach ($all_parties as $email => $i) {
in_array($email, (array) $sel) and $recipient_selected[] = $i["identifier"];
}
if (interestedParty::is_external("comment", $new["commentID"])) {
$new["external"] = " loud";
$label = "<em class='faint warn'>[ External Conversation ]</em>";
} else {
$label = "<em class='faint'>[ Internal Conversation ]</em>";
}
foreach ((array) $all_parties as $email => $info) {
$recipient_ops[$info["identifier"]] = $info["name"] . " <" . $email . ">";
}
$new["recipient_editor"] = "<span class='nobr' style='width:100%;display:inline;' class='recipient_editor'>";
$new["recipient_editor"] .= "<span class='noprint hidden' id='recipient_dropdown_" . $new["commentID"] . "'>\n <form action='" . $TPL["url_alloc_updateRecipients"] . "' method='post'>\n <select name='comment_recipients[]' multiple='true' data-callback='save_recipients'>\n " . page::select_options($recipient_ops, $recipient_selected) . "\n </select>\n <input type='hidden' name='commentID' value='" . $new["commentID"] . "'>\n <input type='submit' value='Go' style='display:none'>\n </form>\n </span>";
$new["recipient_editor"] .= "<a class='magic recipient_editor_link' id='r_e_" . $new["commentID"] . "' style='text-decoration:none' href='#x'>" . $label . "</a>";
$new["recipient_editor"] .= "</span>";
$new["reply"] = '<a href="" class="noprint commentreply">reply</a>';
}
if ($v["timeSheetID"]) {
$timeSheet = new timeSheet();
$timeSheet->set_id($v["timeSheetID"]);
$v["ts_label"] = " (Time Sheet #" . $timeSheet->get_id() . ")";
}
$new["attribution"] = comment::get_comment_attribution($v);
$new["commentCreatedUserEmail"] = comment::get_comment_author_email($v);
$s = commentTemplate::populate_string(config::get_config_item("emailSubject_taskComment"), $entity, $id);
$new["commentEmailSubject"] = $s . " " . $new["hashKey"];
if (!$_GET["commentID"] || $_GET["commentID"] != $v["commentID"]) {
if ($options["showEditButtons"] && $new["comment_buttons"]) {
$new["form"] = '<form action="' . $TPL["url_alloc_comment"] . '" method="post">';
$new["form"] .= '<input type="hidden" name="entity" value="' . $v["commentType"] . '">';
$new["form"] .= '<input type="hidden" name="entityID" value="' . $v["commentLinkID"] . '">';
$new["form"] .= '<input type="hidden" name="commentID" value="' . $v["commentID"] . '">';
$new["form"] .= '<input type="hidden" name="comment_id" value="' . $v["commentID"] . '">';
$new["form"] .= $new["comment_buttons"];
$new["form"] .= '<input type="hidden" name="sessID" value="' . $TPL["sessID"] . '">';
$new["form"] .= '</form>';
}
$v["commentMimeParts"] and $files = unserialize($v["commentMimeParts"]);
if (is_array($files)) {
foreach ($files as $file) {
$new["files"] .= '<div align="center" style="float:left; display:inline; margin-right:14px;">';
$new["files"] .= "<a href=\"" . $TPL["url_alloc_getMimePart"] . "part=" . $file["part"] . "&entity=comment&id=" . $v["commentID"] . "\">";
$new["files"] .= get_file_type_image($file["name"]) . "<br>" . page::htmlentities($file["name"]);
$new["files"] .= " (" . get_size_label($file["size"]) . ")</a>";
$new["files"] .= '</div>';
}
}
$v["commentEmailRecipients"] and $new["emailed"] = 'Emailed to ' . page::htmlentities($v["commentEmailRecipients"]);
}
return (array) $new;
}
示例9: show_comments
function show_comments()
{
global $taskID;
global $TPL;
global $task;
if ($_REQUEST["commentSummary"]) {
$_REQUEST["showTaskHeader"] = true;
$_REQUEST["clients"] = true;
$TPL["commentsR"] = comment::get_list_summary($_REQUEST);
$TPL["extra_page_links"] = '<a href="' . $TPL["url_alloc_task"] . 'taskID=' . $TPL["task_taskID"] . '&sbs_link=comments">Full</a>';
} else {
$TPL["commentsR"] = comment::util_get_comments("task", $taskID);
$TPL["extra_page_links"] = '<a href="' . $TPL["url_alloc_task"] . 'taskID=' . $TPL["task_taskID"];
$TPL["extra_page_links"] .= '&sbs_link=comments&commentSummary=true&maxCommentLength=50000000">Summary</a>';
}
$TPL["commentsR"] and $TPL["class_new_comment"] = "hidden";
$TPL["allParties"] = $task->get_all_parties($task->get_value("projectID")) or $TPL["allParties"] = array();
$TPL["entity"] = "task";
$TPL["entityID"] = $task->get_id();
if (has("project")) {
$project = $task->get_foreign_object("project");
$TPL["clientID"] = $project->get_value("clientID");
}
$commentTemplate = new commentTemplate();
$ops = $commentTemplate->get_assoc_array("commentTemplateID", "commentTemplateName", "", array("commentTemplateType" => "task"));
$TPL["commentTemplateOptions"] = "<option value=\"\">Comment Templates</option>" . page::select_options($ops);
include_template("../comment/templates/commentM.tpl");
}
示例10: prepare
} else {
$query = prepare("SELECT * FROM task WHERE personID=%d ORDER BY taskName", $personID);
}
$db->query($query);
while ($db->next_record()) {
$task = new task();
$task->read_db_record($db);
if (substr($task->get_value("taskStatus"), 0, 6) != "closed") {
$parent_names[$task->get_id()] = $task->get_value('taskName');
}
}
}
}
}
$TPL["parentType"] = $parentType;
$TPL["parentNameOptions"] = page::select_options($parent_names);
include_template("templates/reminderSelectParentM.tpl");
break;
case 3:
// reminder entry form
$reminder = new reminder();
if (isset($reminderID)) {
$reminder->set_id($reminderID);
$reminder->select();
$parentType = $reminder->get_value('reminderType');
$parentID = $reminder->get_value('reminderLinkID');
$TPL["reminder_title"] = "Edit Reminder";
$TPL["reminder_buttons"] = <<<EOD
<input type="hidden" name="reminder_id" value="{$reminderID}">
<button type="submit" name="reminder_delete" value="1" class="delete_button">Delete<i class="icon-trash"></i></button>
<button type="submit" name="reminder_update" value="1" class="save_button default">Save<i class="icon-ok-sign"></i></button>
示例11: load_task_filter
function load_task_filter($_FORM)
{
$current_user =& singleton("current_user");
$db = new db_alloc();
// Load up the forms action url
$rtn["url_form_action"] = $_FORM["url_form_action"];
$rtn["hide_field_options"] = $_FORM["hide_field_options"];
//time Load up the filter bits
has("project") and $rtn["projectOptions"] = project::get_list_dropdown($_FORM["projectType"], $_FORM["projectID"]);
$_FORM["projectType"] and $rtn["projectType_checked"][$_FORM["projectType"]] = " checked";
$ops = array("0" => "Nobody");
$rtn["personOptions"] = page::select_options($ops + person::get_username_list($_FORM["personID"]), $_FORM["personID"]);
$rtn["managerPersonOptions"] = page::select_options($ops + person::get_username_list($_FORM["managerID"]), $_FORM["managerID"]);
$rtn["creatorPersonOptions"] = page::select_options(person::get_username_list($_FORM["creatorID"]), $_FORM["creatorID"]);
$rtn["all_tags"] = task::get_tags(true);
$rtn["tags"] = $_FORM["tags"];
$taskType = new meta("taskType");
$taskType_array = $taskType->get_assoc_array("taskTypeID", "taskTypeID");
$rtn["taskTypeOptions"] = page::select_options($taskType_array, $_FORM["taskTypeID"]);
$_FORM["taskView"] and $rtn["taskView_checked_" . $_FORM["taskView"]] = " checked";
$taskStatii = task::get_task_statii_array();
$rtn["taskStatusOptions"] = page::select_options($taskStatii, $_FORM["taskStatus"]);
$_FORM["showDescription"] and $rtn["showDescription_checked"] = " checked";
$_FORM["showDates"] and $rtn["showDates_checked"] = " checked";
$_FORM["showCreator"] and $rtn["showCreator_checked"] = " checked";
$_FORM["showAssigned"] and $rtn["showAssigned_checked"] = " checked";
$_FORM["showTimes"] and $rtn["showTimes_checked"] = " checked";
$_FORM["showPercent"] and $rtn["showPercent_checked"] = " checked";
$_FORM["showPriority"] and $rtn["showPriority_checked"] = " checked";
$_FORM["showTaskID"] and $rtn["showTaskID_checked"] = " checked";
$_FORM["showManager"] and $rtn["showManager_checked"] = " checked";
$_FORM["showProject"] and $rtn["showProject_checked"] = " checked";
$_FORM["showTags"] and $rtn["showTags_checked"] = " checked";
$_FORM["showParentID"] and $rtn["showParentID_checked"] = " checked";
$arrow = " -->";
$taskDateOps = array("" => "", "new" => "New Tasks", "due_today" => "Due Today", "overdue" => "Overdue", "d_created" => "Date Created" . $arrow, "d_assigned" => "Date Assigned" . $arrow, "d_targetStart" => "Estimated Start" . $arrow, "d_targetCompletion" => "Estimated Completion" . $arrow, "d_actualStart" => "Date Started" . $arrow, "d_actualCompletion" => "Date Completed" . $arrow);
$rtn["taskDateOptions"] = page::select_options($taskDateOps, $_FORM["taskDate"], 45, false);
if (!in_array($_FORM["taskDate"], array("new", "due_today", "overdue"))) {
$rtn["dateOne"] = $_FORM["dateOne"];
$rtn["dateTwo"] = $_FORM["dateTwo"];
}
$task_num_ops = array("" => "All results", 1 => "1 result", 2 => "2 results", 3 => "3 results", 4 => "4 results", 5 => "5 results", 10 => "10 results", 15 => "15 results", 20 => "20 results", 30 => "30 results", 40 => "40 results", 50 => "50 results", 100 => "100 results", 150 => "150 results", 200 => "200 results", 300 => "300 results", 400 => "400 results", 500 => "500 results", 1000 => "1000 results", 2000 => "2000 results", 3000 => "3000 results", 4000 => "4000 results", 5000 => "5000 results", 10000 => "10000 results");
$rtn["limitOptions"] = page::select_options($task_num_ops, $_FORM["limit"]);
// unset vars that aren't necessary
foreach ((array) $_FORM as $k => $v) {
if (!$v) {
unset($_FORM[$k]);
}
}
// Get
$rtn["FORM"] = "FORM=" . urlencode(serialize($_FORM));
return $rtn;
}
示例12: commentTemplate
// Create an object to hold a commentTemplate
$commentTemplate = new commentTemplate();
// Load the commentTemplate from the database
$commentTemplateID = $_POST["commentTemplateID"] or $commentTemplateID = $_GET["commentTemplateID"];
if ($commentTemplateID) {
$commentTemplate->set_id($commentTemplateID);
$commentTemplate->select();
}
// Process submission of the form using the save button
if ($_POST["save"]) {
$commentTemplate->read_globals();
$commentTemplate->save();
alloc_redirect($TPL["url_alloc_commentTemplateList"]);
// Process submission of the form using the delete button
} else {
if ($_POST["delete"]) {
$commentTemplate->delete();
alloc_redirect($TPL["url_alloc_commentTemplateList"]);
exit;
}
}
// Load data for display in the template
$commentTemplate->set_values();
$ops = array("" => "Comment Template Type", "task" => "Task", "timeSheet" => "Time Sheet", "project" => "Project", "client" => "Client", "invoice" => "Invoice", "productSale" => "Sale");
$TPL["commentTemplateTypeOptions"] = page::select_options($ops, $commentTemplate->get_value("commentTemplateType"));
$TPL["main_alloc_title"] = "Edit Comment Template - " . APPLICATION_NAME;
// Invoke the page's main template
include_template("templates/commentTemplateM.tpl");
?>
示例13: db_alloc
$db = new db_alloc();
$db->query("select * from item where itemID=%d", $itemID);
$db->next_record();
$item->read_db_record($db);
$item->set_values();
// new crap
if ($current_user->have_role("admin") || $current_user->have_role("manage")) {
$users = array();
$_db = new db_alloc();
$_db->query("SELECT * FROM person ORDER BY username");
while ($_db->next_record()) {
$person = new person();
$person->read_db_record($_db);
$users[$person->get_id()] = $person->get_value('username');
}
$TPL["userSelect"] = "<select name=\"userID\">" . page::select_options($users, $current_user->get_id()) . "</select><br>\n";
} else {
$TPL["userSelect"] = "";
}
$temp = mktime(0, 0, 0, date("m") + $_POST["timePeriod"], date("d"), date("Y"));
$whenToReturn = date("Y", $temp) . "-" . date("m", $temp) . "-" . date("d", $temp);
$today = date("Y") . "-" . date("m") . "-" . date("d");
if ($loanID) {
$loan->set_id($loanID);
$loan->select();
}
if ($_POST["borrowItem"]) {
$db->query("select * from loan where itemID=%d and dateReturned='0000-00-00'", $itemID);
if ($db->next_record()) {
// if the item is already borrowed
alloc_redirect($TPL["url_alloc_item"] . "itemID={$itemID}&badBorrow=true&error=already_borrowed");
示例14: meta
}
//so that the user can edit the item later
$TPL["personID"] = $current_user->get_id();
// item types
$itemType = new meta("itemType");
$TPL["itemTypes"] = page::select_options($itemType->get_assoc_array("itemTypeID", "itemTypeID"), $item->get_value("itemType"));
// setup item list (for removals)
$item_list = array();
$db = new db_alloc();
$db->query("SELECT * FROM item ORDER BY itemName");
while ($db->next_record()) {
$item = new item();
$item->read_db_record($db);
$item_list[$item->get_id()] = $item->get_value('itemName');
}
$TPL["item_list"] = page::select_options($item_list, "");
if ($_POST["edit_items"]) {
$item = new item();
$item->set_id($_POST["itemID"][0]);
$item->select();
if (count($_POST["itemID"]) < 1) {
alloc_error("You Must Select An Item");
} else {
if (count($_POST["itemID"]) > 1) {
alloc_error("Can Only Edit 1 Item At A Time");
}
$TPL["edit_options"] = "<table><tr>\n" . " <td>Name: </td>\n" . " <td colspan=\"2\"><input size=\"40\" type=\"text\" name=\"update_itemName\" value=\"" . $item->get_value("itemName") . "\"></td>\n" . "</tr><tr>\n" . " <td>Notes: </td>\n" . " <td colspan=\"2\"><input size=\"40\" type=\"text\" name=\"update_itemNotes\" value=\"" . $item->get_value("itemNotes") . "\"></td>\n" . "</tr><tr>\n" . " <td>Type: </td>\n" . " <td><select name=\"update_itemType\" value=\"" . $item->get_value("itemType") . "\">" . page::select_options($itemType->get_assoc_array("itemTypeID", "itemTypeID"), $item->get_value("itemType")) . " </select>" . " <input type=\"hidden\" name=\"update_itemID\" value=\"" . $item->get_id() . "\"></td>" . " <td align=\"right\">" . ' <button type="submit" name="update_item" value="1" class="save_button">Save Changes<i class="icon-ok-sign"></i></button>' . " </td>\n" . "</tr><td colspan=\"3\"><hr></td></tr>\n" . "</tr></table>\n";
}
}
$TPL["main_alloc_title"] = "Edit Items - " . APPLICATION_NAME;
include_template("templates/addItemM.tpl");
示例15: show_skills_list
function show_skills_list()
{
global $TPL;
global $personID;
global $skills;
$db = new db_alloc();
$query = prepare("SELECT * FROM proficiency WHERE personID=%d", $personID);
$db->query($query);
$skills_got = array();
while ($db->next_record()) {
$skill = new skill();
$skill->read_db_record($db);
array_push($skills_got, $skill->get_id());
}
$query = "SELECT * FROM skill ORDER BY skillClass";
$db->query($query);
while ($db->next_record()) {
$skill = new skill();
$skill->read_db_record($db);
if (in_array($skill->get_id(), $skills_got)) {
// dont show this item
} else {
$skills[$skill->get_id()] = sprintf("%s - %s", $skill->get_value('skillClass'), $skill->get_value('skillName'));
}
}
if (count($skills) > 0) {
$TPL["skills"] = page::select_options($skills, "");
}
}