本文整理汇总了PHP中html_build_select_box_from_arrays函数的典型用法代码示例。如果您正苦于以下问题:PHP html_build_select_box_from_arrays函数的具体用法?PHP html_build_select_box_from_arrays怎么用?PHP html_build_select_box_from_arrays使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了html_build_select_box_from_arrays函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getRankField
function getRankField($value = 'end')
{
$html = '';
$html .= '<tr>';
$html .= '<td>' . $GLOBALS['Language']->getText('plugin_docman', 'admin_md_detail_val_create_rank') . '</td>';
$vals = array('beg', 'end', '--');
$texts = array($GLOBALS['Language']->getText('plugin_docman', 'admin_md_detail_val_create_rank_beg'), $GLOBALS['Language']->getText('plugin_docman', 'admin_md_detail_val_create_rank_end'), '----');
$i = 3;
$vIter =& $this->md->getListOfValueIterator();
$vIter->rewind();
while ($vIter->valid()) {
$e =& $vIter->current();
if ($e->getStatus() == 'A' || $e->getStatus() == 'P') {
$vals[$i] = $e->getRank() + 1;
$texts[$i] = $GLOBALS['Language']->getText('plugin_docman', 'admin_md_detail_val_create_rank_after') . ' ' . Docman_MetadataHtmlList::_getElementName($e);
$i++;
}
$vIter->next();
}
$html .= '<td>';
$html .= html_build_select_box_from_arrays($vals, $texts, 'rank', $value, false, '');
$html .= '</td>';
$html .= '</tr>';
return $html;
}
示例2: showTypeBox
function showTypeBox($name = 'group_type', $checked_val = 'xzxz')
{
$localizedTypes = array();
foreach (array_keys($this->data_array) as $type_id) {
$localizedTypes[] = $this->getLabel($type_id);
}
return html_build_select_box_from_arrays(array_keys($this->data_array), $localizedTypes, $name, $checked_val, false);
}
示例3: get_canned_responses
function get_canned_responses()
{
$result = db_query("SELECT response_id, response_title FROM canned_responses");
while ($res_array = db_fetch_array($result)) {
$ids[] = $res_array["response_id"];
$texts[] = $res_array["response_title"];
}
return html_build_select_box_from_arrays($ids, $texts, "response_id");
}
示例4: showTypeBox
function showTypeBox($name = 'question_type', $checked_val = 'xzxz')
{
$ranked_ids = array();
$localizedTypes = array();
foreach ($this->ranked_array as $val) {
$ranked_ids[] = $val;
$localizedTypes[] = $this->getLabel($val);
}
return html_build_select_box_from_arrays($ranked_ids, $localizedTypes, $name, $checked_val, false);
}
示例5: showSelectNestedGroups
/**
* showSelectNestedGroups - Display the tree of document groups inside a <select> tag
*
* @param array Array of groups.
* @param string The name that will be assigned to the input
* @param bool Allow selection of "None"
* @param int The ID of the group that should be selected by default (if any)
* @param array Array of IDs of groups that should not be displayed
*/
function showSelectNestedGroups(&$group_arr, $select_name, $allow_none = true, $selected_id = 0, $dont_display = array())
{
// Build arrays for calling html_build_select_box_from_arrays()
$id_array = array();
$text_array = array();
if ($allow_none) {
// First option to be displayed
$id_array[] = 0;
$text_array[] = "(None)";
}
// Recursively build the document group tree
$this->buildArrays($group_arr, $id_array, $text_array, $dont_display);
echo html_build_select_box_from_arrays($id_array, $text_array, $select_name, $selected_id, false);
}
示例6: bug_user_project_box
function bug_user_project_box($name = 'project_id', $user_id = false, $checked = 'xyxy', $text_100 = 'None')
{
/*
Returns a select box populated with projects that the user is bug admin of
*/
if (!$user_id) {
return 'ERROR - no user_id';
} else {
$result = bug_data_get_user_projects($user_id);
if (!db_numrows($result)) {
return html_build_select_box_from_arrays($group_id, $checked, $name, $checked, false);
} else {
return html_build_select_box($result, $name, $checked, false, $text_100);
}
}
}
示例7: reports_header
function reports_header($group_id, $vals, $titles)
{
global $what;
global $period;
global $span;
print "<form method=\"GET\" action=\"{$PHP_SELF}#b\">";
print html_build_select_box_from_arrays($vals, $titles, 'what', $what, false);
$periods = array('day' => 'Last day', 'week' => 'Last week');
$vals = array('day', 'week', 'month', 'year', 'lifespan');
$texts = array('Last day(s)', 'Last week(s)', 'Last month(s)', 'Last year(s)', 'Project lifespan');
if (!$period) {
$period = "lifespan";
}
print " for ";
print html_build_select_box_from_arrays(array('', '1', '4', '7', '12', '14', '30', '52'), array('', '1', '4', '7', '12', '14', '30', '52'), 'span', $span, false);
print html_build_select_box_from_arrays($vals, $texts, 'period', $period, false);
print "<input type=\"hidden\" name=\"group_id\" value=\"{$group_id}\">";
print ' <input type="submit" value="Show">';
print "</form>\n";
}
示例8: reports_header
/**
* reports_header() - Show the reports header
*
* @param int The group ID
* @param array Array of select box values
* @param string The select box title
* @param string Any additional HTML
*/
function reports_header($group_id, $vals, $titles, $html = '')
{
global $what;
global $period;
global $span;
print '<form method="get" action="' . getStringFromServer('PHP_SELF') . '#b">';
print $html;
print html_build_select_box_from_arrays($vals, $titles, 'what', $what, false);
$periods = array('day' => 'Last day', 'week' => 'Last week');
$vals = array('day', 'week', 'month', 'year', 'lifespan');
$texts = array(_('Last day(s)'), _('Last week(s)'), _('Last month(s)'), _('Last year(s)'), _('Project lifespan'));
if (!$period) {
$period = "lifespan";
}
print _('for');
print html_build_select_box_from_arrays(array('', '1', '4', '7', '12', '14', '30', '52'), array('', '1', '4', '7', '12', '14', '30', '52'), 'span', $span, false);
print html_build_select_box_from_arrays($vals, $texts, 'period', $period, false);
print "<input type=\"hidden\" name=\"group_id\" value=\"{$group_id}\" />";
print ' <input type="submit" value="' . _('Show') . '" />';
print "</form>\n";
}
示例9: _
echo $typ;
?>
">
<table><tr>
<td><strong><?php
echo _('Project');
?>
:</strong><br /><?php
echo report_group_box('g_id', $g_id);
?>
</td>
<td><strong><?php
echo _('Type');
?>
:</strong><br /><?php
echo html_build_select_box_from_arrays($a2, $a, 'type', $type, false);
?>
</td>
<td><strong><?php
echo _('Start');
?>
:</strong><br /><?php
echo report_months_box($report, 'start', $start);
?>
</td>
<td><strong><?php
echo _('End');
?>
:</strong><br /><?php
echo report_months_box($report, 'end', $end);
?>
示例10: _getReviewerTable
function _getReviewerTable()
{
$html = '';
$uh = UserHelper::instance();
$html .= '<h3>' . $GLOBALS['Language']->getText('plugin_docman', 'details_approval_table_title') . '</h3>';
$html .= '<div id="docman_approval_table_create_table">';
if (!$this->table->isClosed()) {
$html .= '<div class="docman_help">' . $GLOBALS['Language']->getText('plugin_docman', 'details_approval_table_help') . '</div>';
}
$rIter = $this->table->getReviewerIterator();
if ($rIter !== null) {
$docmanIcons =& $this->_getDocmanIcons();
$html .= html_build_list_table_top(array($GLOBALS['Language']->getText('plugin_docman', 'details_approval_select'), $GLOBALS['Language']->getText('plugin_docman', 'details_approval_reviewer'), $GLOBALS['Language']->getText('plugin_docman', 'details_approval_review'), $GLOBALS['Language']->getText('plugin_docman', 'details_approval_rank')), false, false, false);
$isFirst = true;
$isLast = false;
$nbReviewers = $rIter->count();
$i = 0;
$rIter->rewind();
while ($rIter->valid()) {
$isLast = $i == $nbReviewers - 1;
$reviewer = $rIter->current();
// i+1 to start with 'white'
$html .= '<tr class="' . html_get_alt_row_color($i + 1) . '">';
// Select
if (!$this->table->isClosed()) {
$checkbox = '<input type="checkbox" name="sel_user[]" value="' . $reviewer->getId() . '" />';
} else {
$checkbox = ' ';
}
$html .= '<td align="center">' . $checkbox . '</td>';
// Username
$html .= '<td>' . $this->hp->purify($uh->getDisplayNameFromUserId($reviewer->getId())) . '</td>';
// Review
$html .= '<td>' . $this->atf->getReviewStateName($reviewer->getState()) . '</td>';
// Rank
if (!$this->table->isClosed()) {
$rank = $reviewer->getRank();
$baseUrl = '?group_id=' . $this->item->getGroupId() . '&action=approval_upd_user&id=' . $this->item->getId() . '&user_id=' . $reviewer->getId() . '&rank=';
$begLink = '';
$upLink = '';
if (!$isFirst) {
$begIcon = '<img src="' . $docmanIcons->getIcon('move-beginning') . '" alt="Beginning" />';
$begLink = '<a href="' . $baseUrl . 'beginning">' . $begIcon . '</a>';
$upIcon = '<img src="' . $docmanIcons->getIcon('move-up') . '" alt="Up" />';
$upLink = '<a href="' . $baseUrl . 'up">' . $upIcon . '</a>';
}
$endLink = '';
$downLink = '';
if (!$isLast) {
$endIcon = '<img src="' . $docmanIcons->getIcon('move-end') . '" alt="End" />';
$endLink = '<a href="' . $baseUrl . 'end">' . $endIcon . '</a>';
$downIcon = '<img src="' . $docmanIcons->getIcon('move-down') . '" alt="Down" />';
$downLink = '<a href="' . $baseUrl . 'down">' . $downIcon . '</a>';
}
$rankHtml = $upLink . ' ' . $downLink . ' ' . $begLink . ' ' . $endLink;
} else {
$rankHtml = ' ';
}
$html .= '<td align="center">' . $rankHtml . '</td>';
$html .= '</tr>';
$isFirst = false;
$i++;
$rIter->next();
}
$html .= '</table>';
// Action with selected reviewers
if (!$this->table->isClosed()) {
$html .= '<p>';
$html .= $GLOBALS['Language']->getText('plugin_docman', 'details_approval_create_table_act');
$vals = array('del', 'mail');
$txts = array($GLOBALS['Language']->getText('plugin_docman', 'details_approval_create_table_act_rm'), $GLOBALS['Language']->getText('plugin_docman', 'details_approval_create_table_act_mail'));
$html .= html_build_select_box_from_arrays($vals, $txts, 'sel_user_act', 100, true);
$html .= '</p>';
}
}
$html .= '</div>';
return $html;
}
示例11: frs_show_release_popup
function frs_show_release_popup($group_id, $name = 'release_id', $checked_val = "xzxz")
{
/*
return a pop-up select box of releases for the project
*/
global $FRS_RELEASE_ID_RES, $FRS_RELEASE_NAME_RES, $Language;
$frsrf = new FRSReleaseFactory();
if (!$group_id) {
return $Language->getText('file_file_utils', 'g_id_err');
} else {
if (!isset($FRS_RELEASE_ID_RES)) {
$res = $frsrf->getFRSReleasesInfoListFromDb($group_id);
$FRS_RELEASE_ID_RES = array();
$FRS_RELEASE_NAME_RES = array();
foreach ($res as $release) {
$FRS_RELEASE_ID_RES[] = $release['release_id'];
$FRS_RELEASE_NAME_RES[] = $release['package_name'] . ':' . $release['release_name'];
}
}
return html_build_select_box_from_arrays($FRS_RELEASE_ID_RES, $FRS_RELEASE_NAME_RES, $name, $checked_val, false);
}
}
示例12: handle_multi_edit
function handle_multi_edit($skill_ids)
{
global $HTML;
$numSkills = count($skill_ids);
$SQL = "select * from skills_data where skills_data_id in(" . (int) $skill_ids[0];
for ($i = 1; $i < $numSkills; $i++) {
$SQL .= ", " . (int) $skill_ids[$i];
}
$SQL .= ")";
$result = db_query($SQL);
$rows = db_numrows($result);
if (!$result || $rows < 1) {
echo db_error();
} else {
$sql = "SELECT * FROM skills_data_types WHERE type_id > 0";
$skills = db_query($sql);
if (!$skills || db_numrows($skills) < 1) {
echo db_error();
$feedback .= _('User fetch FAILED');
echo '<h2>' . _('No Such User') . '<h2>';
}
$yearArray = array();
for ($years = date("Y"); $years >= 1980; $years--) {
array_push($yearArray, $years);
}
$monthArray = array();
$monthArrayVals = array();
for ($i = 1; $i <= 12; $i++) {
array_push($monthArrayVals, $i < 10 ? "0" . $i : $i);
array_push($monthArray, date("M", mktime(0, 0, 0, $i, 1, 1980)));
}
for ($i = 0; $i < $rows; $i++) {
$start = db_result($result, $i, 'start');
$finish = db_result($result, $i, 'finish');
$startY = substr($start, 0, 4);
$startM = substr($start, 4, 2);
$finishY = substr($finish, 0, 4);
$finishM = substr($finish, 4, 2);
echo '<table border="0">' . '<tr ' . $HTML->boxGetAltRowStyle($i + 1) . '>' . '<td><h3>' . db_result($result, $i, 'title') . '</h3></td></tr>' . '<tr><td>' . '<table border="0" >' . '<tr class="tableheading">' . '<td >' . _('Type') . '</td>' . '<td >' . _('Start Date') . '</td>' . '<td >' . _('End Date') . '</td>' . '</tr>';
echo '<tr ' . $HTML->boxGetAltRowStyle($i + 1) . '>' . '<td>' . html_build_select_box($skills, 'type[]', db_result($result, $i, 'type'), false, '') . '</td>' . '<td>' . html_build_select_box_from_arrays($monthArrayVals, $monthArray, 'startM[]', $startM, false, '') . html_build_select_box_from_arrays($yearArray, $yearArray, 'startY[]', $startY, false, '') . '</td>' . '<td>' . html_build_select_box_from_arrays($monthArrayVals, $monthArray, 'endM[]', $finishM, false, '') . html_build_select_box_from_arrays($yearArray, $yearArray, 'endY[]', $finishY, false, '') . '</td>' . '</tr>' . '</table>' . '</td></tr>' . '<tr ' . $HTML->boxGetAltRowStyle($i + 1) . '><td>' . '<table border="0">' . '<tr class="tableheading">' . '<td>' . _('Title (max 100 characters)') . '</td>' . '</tr>' . '<tr>' . '<td><input type="hidden" name="skill_edit[]" value="' . db_result($result, $i, 'skills_data_id') . '" />' . '<input type="text" name="title[]" size="100" value="' . db_result($result, $i, 'title') . '" /></td>' . '</tr>' . '<tr>' . '<td class="tableheading">' . _('Keywords (max 255 characters)') . '</td>' . '</tr>' . '<tr>' . '<td><textarea name="keywords[]" rows="3" cols="85" wrap="soft">' . db_result($result, $i, 'keywords') . '</textarea></td>' . '</tr>' . '</table>';
'</td></tr>';
echo '</table><br />';
}
}
}
示例13: getReviewForm
function getReviewForm($user)
{
$html = '';
$uh = UserHelper::instance();
// Values
$itemCurrentVersion = $this->_getReviewCurrentVersion();
$reviewer = $this->table->getReviewer($user->getId());
$reviewVersion = $reviewer->getVersion();
// Output
$html .= '<h3>' . $GLOBALS['Language']->getText('plugin_docman', 'details_approval_doc_review_title') . '</h3>';
$html .= '<table>';
// Doc title
$html .= '<tr>';
$html .= '<td>' . $GLOBALS['Language']->getText('plugin_docman', 'details_approval_doc_review_name') . '</td>';
$html .= '<td>';
$html .= $this->hp->purify($this->item->getTitle(), CODENDI_PURIFIER_CONVERT_HTML);
if ($itemCurrentVersion == null) {
$url = Docman_View_View::buildUrl($this->url, array('action' => 'show', 'id' => $this->item->getId()));
$html .= ' - ';
$html .= '<a href="' . $url . '">' . $GLOBALS['Language']->getText('plugin_docman', 'details_approval_doc_review_link') . '</a>';
}
$html .= '</td>';
$html .= '</tr>';
// Doc version
$html .= '<tr>';
$html .= '<td>' . $GLOBALS['Language']->getText('plugin_docman', 'details_approval_doc_review_version') . '</td>';
$html .= '<td>';
if ($itemCurrentVersion !== null) {
$html .= $this->_getItemVersionLink($itemCurrentVersion);
if (!$this->atf->userAccessedSinceLastUpdate($user)) {
// Warn user if he didn't access the last version of document
$html .= '<span style="margin-left: 2em;">' . $GLOBALS['Language']->getText('plugin_docman', 'details_approval_review_wo_access') . '</span>';
}
} else {
$html .= $GLOBALS['Language']->getText('plugin_docman', 'details_approval_doc_review_version_na');
}
$html .= '</td>';
$html .= '</tr>';
$html .= '</table>';
$html .= '<h3>' . $GLOBALS['Language']->getText('plugin_docman', 'details_approval_approval_title') . '</h3>';
$html .= '<table>';
// Requester name
$html .= '<tr>';
$html .= '<td>' . $GLOBALS['Language']->getText('plugin_docman', 'details_approval_requester') . '</td>';
$html .= '<td>';
$html .= $this->hp->purify($uh->getDisplayNameFromUserId($this->table->getOwner()));
$html .= '</td>';
$html .= '</tr>';
// Notification type
$html .= '<tr>';
$html .= '<td>' . $GLOBALS['Language']->getText('plugin_docman', 'details_approval_notif_type') . '</td>';
$html .= '<td>';
$html .= $this->atf->getNotificationTypeName($this->table->getNotification());
$html .= '</td>';
$html .= '</tr>';
// Cycle start date
$html .= '<tr>';
$html .= '<td>' . $GLOBALS['Language']->getText('plugin_docman', 'details_approval_cycle_start_date') . '</td>';
$html .= '<td>';
$html .= util_timestamp_to_userdateformat($this->table->getDate(), true);
$html .= '</td>';
$html .= '</tr>';
// Owner comment
$html .= '<tr>';
$html .= '<td>' . $GLOBALS['Language']->getText('plugin_docman', 'details_approval_owner_comment') . '</td>';
$html .= '<td>';
$html .= $this->hp->purify($this->table->getDescription(), CODENDI_PURIFIER_BASIC, $this->item->getGroupId());
$html .= '</td>';
$html .= '</tr>';
$html .= '</table>';
$html .= '<h3>' . $GLOBALS['Language']->getText('plugin_docman', 'details_approval_review_title') . '</h3>';
$html .= '<div class="docman_help">' . $GLOBALS['Language']->getText('plugin_docman', 'details_approval_review_help') . '</div>';
$html .= '<form name="docman_approval_review" method="post" action="?" class="docman_form">';
$html .= '<input type="hidden" name="group_id" value="' . $this->item->getGroupId() . '" />';
$html .= '<input type="hidden" name="id" value="' . $this->item->getId() . '" />';
$html .= '<input type="hidden" name="action" value="approval_user_commit" />';
if ($itemCurrentVersion !== null) {
// Add version here because someone can submit a new version while
// current user is reviewing.
$html .= '<input type="hidden" name="version" value="' . $itemCurrentVersion . '" />';
}
$html .= '<table>';
$html .= '<tr>';
$html .= '<td>' . $GLOBALS['Language']->getText('plugin_docman', 'details_approval_review_table') . '</td>';
$url = $this->buildUrl($this->url, array('action' => 'details', 'section' => 'approval', 'id' => $this->item->getId()));
$html .= '<td>';
$html .= '<a href="' . $url . '">' . $GLOBALS['Language']->getText('plugin_docman', 'details_approval_review_table_link') . '</a>';
$html .= '</td>';
$html .= '</tr>';
$html .= '<tr>';
$html .= '<td>' . $GLOBALS['Language']->getText('plugin_docman', 'details_approval_review_review') . '</td>';
$vals = array(PLUGIN_DOCMAN_APPROVAL_STATE_NOTYET, PLUGIN_DOCMAN_APPROVAL_STATE_APPROVED, PLUGIN_DOCMAN_APPROVAL_STATE_REJECTED, PLUGIN_DOCMAN_APPROVAL_STATE_COMMENTED, PLUGIN_DOCMAN_APPROVAL_STATE_DECLINED);
$txts = array($GLOBALS['Language']->getText('plugin_docman', 'approval_review_state_' . PLUGIN_DOCMAN_APPROVAL_STATE_NOTYET), $GLOBALS['Language']->getText('plugin_docman', 'approval_review_state_' . PLUGIN_DOCMAN_APPROVAL_STATE_APPROVED), $GLOBALS['Language']->getText('plugin_docman', 'approval_review_state_' . PLUGIN_DOCMAN_APPROVAL_STATE_REJECTED), $GLOBALS['Language']->getText('plugin_docman', 'approval_review_state_' . PLUGIN_DOCMAN_APPROVAL_STATE_COMMENTED), $GLOBALS['Language']->getText('plugin_docman', 'approval_review_state_' . PLUGIN_DOCMAN_APPROVAL_STATE_DECLINED));
$html .= '<td>';
$html .= html_build_select_box_from_arrays($vals, $txts, 'state', $reviewer->getState(), false);
$html .= '</td>';
$html .= '</tr>';
// If reviewer already approved or reject, display date
if ($reviewer->getReviewDate()) {
$html .= '<tr>';
//.........这里部分代码省略.........
示例14: report_tracker_box
function report_tracker_box($name = 'datatype', $selected = '1')
{
$arr[] = _('Bugs');
$arr[] = _('Support');
$arr[] = _('Patches');
$arr[] = _('Feature Requests');
$arr[] = _('Other Trackers');
$arr[] = _('Forum Messages');
$arr[] = _('Tasks');
$arr[] = _('Downloads');
$arr2[] = '1';
$arr2[] = '2';
$arr2[] = '3';
$arr2[] = '4';
$arr2[] = '0';
$arr2[] = '5';
$arr2[] = '6';
$arr2[] = '7';
return html_build_select_box_from_arrays($arr2, $arr, $name, $selected, false);
}
示例15: html_build_multiple_select_box_from_arrays
echo $id;
?>
">
<?php
echo html_build_multiple_select_box_from_arrays($field_id_arr, $field_arr, 'copyid[]', array(), 10, false);
echo '</td><td><strong><center>';
//get a list of all extra fields in trackers and groups that you have perms to admin
$sql = "SELECT DISTINCT g.unix_group_name, agl.name AS tracker_name, aefl.field_name, aefl.extra_field_id\n\t\t\tFROM groups g, \n\t\t\tartifact_group_list agl, \n\t\t\tartifact_extra_field_list aefl,\n\t\t\tuser_group ug,\n role_setting rs\n\t\t\tWHERE\n (\n (rs.section_name = 'projectadmin' AND rs.value = 'A')\n OR (rs.section_name = 'trackeradmin' AND rs.value = '2')\n OR (rs.section_name = 'tracker' AND rs.value::integer >= 2 AND rs.ref_id = agl.group_artifact_id)\n )\n\t\t\tAND ug.user_id='" . user_getid() . "'\n\t\t\tAND ug.group_id=g.group_id\n\t\t\tAND g.group_id=agl.group_id \n\t\t\tAND rs.role_id=ug.role_id\n\t\t\tAND aefl.group_artifact_id=agl.group_artifact_id\n\t\t\tAND aefl.field_type IN (1,2,3,5)";
$res = db_query($sql);
// echo db_error().$sql;
while ($arr = db_fetch_array($res)) {
$name_arr[] = $arr['unix_group_name'] . '::' . $arr['tracker_name'] . '::' . $arr['field_name'];
$id_arr[] = $arr['extra_field_id'];
}
echo '<td valign=top>';
echo html_build_select_box_from_arrays($id_arr, $name_arr, 'selectid', $selectid, false);
echo '</td></tr>';
echo '<tr><td>';
?>
<br />
<input type="submit" name="post_changes" value="<?php
echo _('Submit');
?>
" />
</td></tr></table></form>
<?php
$ath->footer(array());
// Local Variables:
// mode: php
// c-file-style: "bsd"