本文整理汇总了PHP中form_input_list_entry函数的典型用法代码示例。如果您正苦于以下问题:PHP form_input_list_entry函数的具体用法?PHP form_input_list_entry怎么用?PHP form_input_list_entry使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了form_input_list_entry函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: do_netlink
/**
* Get a netlink block / direct to a netlink site.
*
* @param URLPATH The URL we grab our netlink from. If this is not blank, instead of getting a netlink block, we direct to a netlink site.
* @return tempcode The netlink block
*/
function do_netlink($redir_url = '')
{
header('Content-type: text/plain; charset=' . get_charset());
// If we are redirecting
if ($redir_url != '') {
if (strpos($redir_url, chr(10)) !== false || strpos($redir_url, chr(13)) !== false) {
log_hack_attack_and_exit('HEADER_SPLIT_HACK');
}
header('Location: ' . $redir_url);
exit;
}
// Ok we're displaying a netlink, which will be dumped right into the body of the reading site
// - this isn't actually a weburl that is actually displayed, its loaded by ocPortal and embedded-inline
// For all the names in our network
require_code('textfiles');
$lines = explode(chr(10), read_text_file('netlink', NULL, true));
if (count($lines) == 0) {
return new ocp_tempcode();
}
$content = new ocp_tempcode();
foreach ($lines as $line) {
$parts = explode('=', $line, 2);
if (count($parts) != 2) {
continue;
}
$name = rtrim($parts[0]);
$url = trim($parts[1]);
// Are we looking at the source site in the network?
$selected = strtolower($url) == strtolower(get_param('source', ''));
$content->attach(form_input_list_entry(base64_encode($url), $selected, $name));
}
return do_template('NETLINK', array('_GUID' => '180321222dc5dc99a231597c803f0726', 'CONTENT' => $content));
}
示例2: ocf_nice_get_usergroups
/**
* Get a nice list for selection from the usergroups. Suitable for admin use only (does not check hidden status).
*
* @param ?AUTO_LINK Usergroup selected by default (NULL: no specific default).
* @return tempcode The list.
*/
function ocf_nice_get_usergroups($it = NULL)
{
$group_count = $GLOBALS['FORUM_DB']->query_value('f_groups', 'COUNT(*)');
$_m = $GLOBALS['FORUM_DB']->query_select('f_groups', array('id', 'g_name'), $group_count > 200 ? array('g_is_private_club' => 0) : NULL, 'ORDER BY g_order');
$entries = new ocp_tempcode();
foreach ($_m as $m) {
$entries->attach(form_input_list_entry(strval($m['id']), $it === $m['id'], get_translated_text($m['g_name'], $GLOBALS['FORUM_DB'])));
}
return $entries;
}
示例3: ocf_nice_get_categories
/**
* Get a nice list for selection from the forum categories.
*
* @param ?AUTO_LINK Category to avoid putting in the list (NULL: don't avoid any).
* @param ?AUTO_LINK Category selected by default (NULL: no specific default).
* @return tempcode The list.
*/
function ocf_nice_get_categories($avoid = NULL, $it = NULL)
{
$_m = $GLOBALS['FORUM_DB']->query_select('f_categories', array('*'));
$entries = new ocp_tempcode();
foreach ($_m as $m) {
if ($m['id'] !== $avoid) {
$entries->attach(form_input_list_entry(strval($m['id']), $it === $m['id'], $m['c_title']));
}
}
return $entries;
}
示例4: get_mail_domains
/**
* Get a tempcode list of the available mail domains.
*
* @param ID_TEXT The type of mail domain
* @set pop3 forw
* @param integer Description
* @return tempcode The tempcode list of available domains
*/
function get_mail_domains($type, $points_left)
{
$rows = $GLOBALS['SITE_DB']->query('SELECT * FROM ' . get_table_prefix() . 'prices WHERE name LIKE \'' . db_encode_like($type . '%') . '\'');
$list = new ocp_tempcode();
foreach ($rows as $row) {
$address = substr($row['name'], strlen($type));
//If we can't afford the mail, turn the text red
$red = $points_left < $row['price'];
$list->attach(form_input_list_entry($address, false, '@' . $address . ' ' . do_lang('PRICE_GIVE', integer_format($row['price'])), $red));
}
return $list;
}
示例5: get_identifier_manual_field_inputter
/**
* Function for administrators to pick an identifier (only used by admins, usually the identifier would be picked via some other means in the wider ocPortal codebase).
*
* @param ID_TEXT Product type code.
* @return ?tempcode Input field in standard Tempcode format for fields (NULL: no identifier).
*/
function get_identifier_manual_field_inputter($type_code)
{
$list = new ocp_tempcode();
$rows = $GLOBALS['SITE_DB']->query_select('invoices', array('*'), array('i_type_code' => $type_code), 'ORDER BY id DESC');
foreach ($rows as $row) {
$username = $GLOBALS['FORUM_DRIVER']->get_username($row['i_member_id']);
if (is_null($username)) {
$username = do_lang('UNKNOWN');
}
$list->attach(form_input_list_entry(strval($row['id']), false, do_lang('INVOICE_OF', strval($row['id']), $username)));
}
return form_input_list(do_lang_tempcode('INVOICE'), '', 'purchase_id', $list);
}
示例6: get_search_inputter
/**
* Get special Tempcode for inputting this field.
*
* @param array The row for the field to input
* @return ?array List of specially encoded input detail rows (NULL: nothing special)
*/
function get_search_inputter($row)
{
$fields = array();
$type = '_LIST';
$special = new ocp_tempcode();
$special->attach(form_input_list_entry('', get_param('option_' . strval($row['id']), '') == '', '---'));
$list = explode('|', $row['cf_default']);
$display = array_key_exists('trans_name', $row) ? $row['trans_name'] : get_translated_text($row['cf_name']);
// 'trans_name' may have been set in CPF retrieval API, might not correspond to DB lookup if is an internal field
foreach ($list as $l) {
$special->attach(form_input_list_entry($l, get_param('option_' . strval($row['id']), '') == $l));
}
$fields[] = array('NAME' => strval($row['id']), 'DISPLAY' => $display, 'TYPE' => $type, 'SPECIAL' => $special);
return $fields;
}
示例7: get_identifier_manual_field_inputter
/**
* Function for administrators to pick an identifier (only used by admins, usually the identifier would be picked via some other means in the wider ocPortal codebase).
*
* @param ID_TEXT Product type code.
* @return ?tempcode Input field in standard Tempcode format for fields (NULL: no identifier).
*/
function get_identifier_manual_field_inputter($type_code)
{
require_code('catalogues');
require_lang('classifieds');
$list = new ocp_tempcode();
$rows = $GLOBALS['SITE_DB']->query_select('catalogue_entries e JOIN ' . get_table_prefix() . 'classifieds_prices c ON c.c_catalogue_name=e.c_name', array('e.*'), NULL, 'GROUP BY e.id ORDER BY ce_add_date DESC');
foreach ($rows as $row) {
$data_map = get_catalogue_entry_map($row, NULL, 'CATEGORY', 'DEFAULT', NULL, NULL, array(0));
$ad_title = $data_map['FIELD_0'];
$username = $GLOBALS['FORUM_DRIVER']->get_username($row['ce_submitter']);
if (is_null($username)) {
$username = do_lang('UNKNOWN');
}
$list->attach(form_input_list_entry(strval($row['id']), get_param_integer('id', NULL) === $row['id'], do_lang('CLASSIFIED_OF', strval($row['id']), $username, $ad_title)));
}
return form_input_list(do_lang_tempcode('ENTRY'), '', 'purchase_id', $list);
}
示例8: ui
/**
* Interface to import/export.
*
* @return tempcode The interface.
*/
function ui()
{
$title = get_page_title('XML_DATA_MANAGEMENT');
require_code('form_templates');
$import_url = build_url(array('page' => '_SELF', 'type' => '_import'), '_SELF');
$import_fields = new ocp_tempcode();
$import_fields->attach(form_input_huge(do_lang_tempcode('XML_DATA'), '', 'xml', '', true));
$import_form = do_template('FORM', array('TABINDEX' => strval(get_form_field_tabindex()), 'URL' => $import_url, 'HIDDEN' => '', 'TEXT' => do_lang_tempcode('XML_IMPORT_TEXT'), 'FIELDS' => $import_fields, 'SUBMIT_NAME' => do_lang_tempcode('IMPORT')));
$all_tables = find_all_xml_tables();
$export_url = build_url(array('page' => '_SELF', 'type' => '_export'), '_SELF');
$export_fields = new ocp_tempcode();
$nice_tables = new ocp_tempcode();
foreach ($all_tables as $table) {
$nice_tables->attach(form_input_list_entry($table));
}
$export_fields->attach(form_input_multi_list(do_lang_tempcode('TABLES'), do_lang_tempcode('DESCRIPTION_TABLES'), 'tables', $nice_tables, NULL, 15));
$export_fields->attach(form_input_tick(do_lang_tempcode('EXPORT_WITH_COMCODE_XML'), do_lang_tempcode('DESCRIPTION_EXPORT_WITH_COMCODE_XML'), 'comcode_xml', false));
$export_form = do_template('FORM', array('TABINDEX' => strval(get_form_field_tabindex()), 'URL' => $export_url, 'HIDDEN' => '', 'TEXT' => do_lang_tempcode('XML_EXPORT_TEXT'), 'FIELDS' => $export_fields, 'SUBMIT_NAME' => do_lang_tempcode('EXPORT')));
return do_template('XML_STORAGE_SCREEN', array('TITLE' => $title, 'IMPORT_FORM' => $import_form, 'EXPORT_FORM' => $export_form));
}
示例9: simple
/**
* Standard modular simple function for ajax-tree hooks. Returns a normal <select> style <option>-list, for fallback purposes
*
* @param ?ID_TEXT The ID to do under (NULL: root) - not always supported
* @param array Options being passed through
* @param ?ID_TEXT The ID to select by default (NULL: none)
* @param string Prefix titles with this
* @return tempcode The nice list
*/
function simple($id, $options, $it = NULL, $prefix = '')
{
$file = $this->get_file($id);
$list = new ocp_tempcode();
if (is_null($id)) {
// Root, needs an NA option
$list->attach(form_input_list_entry('', false, do_lang_tempcode('NA_EM')));
}
$matches = array();
$num_matches = preg_match_all('#<entry id="(\\d+)"[^<>]* title="([^"]+)"#', $file, $matches);
for ($i = 0; $i < $num_matches; $i++) {
$list->attach(form_input_list_entry('http://ocportal.com/site/dload.php?id=' . $matches[1][$i], $matches[1][$i] === $it, $prefix . $matches[2][$i]));
}
$num_matches = preg_match_all('#<category id="(\\d+)" title="([^"]+)"#', $file, $matches);
for ($i = 0; $i < $num_matches; $i++) {
$list2 = $this->simple($matches[1][$i], $options, $it, $matches[2][$i] . ' > ');
$list->attach($list2);
}
return $list;
}
示例10: add_bookmark_form
/**
* Get the form to add a bookmark / set breadcrumbs.
*
* @param mixed Where the form should go to
* @return tempcode The form
*/
function add_bookmark_form($post_url)
{
$title = get_page_title('ADD_BOOKMARK');
require_lang('zones');
require_code('character_sets');
$url = base64_decode(get_param('url', '', true));
$url = convert_to_internal_encoding($url, 'UTF-8');
// Note that this is intentionally passed in to not be a short URL
$page_link = convert_to_internal_encoding(url_to_pagelink($url, false, false), 'UTF-8');
$default_title = get_param('title', '', true);
$default_title = convert_to_internal_encoding($default_title, 'UTF-8');
$default_title = preg_replace('#\\s.\\s' . str_replace('#', '\\#', preg_quote(get_site_name())) . '$#s', '', $default_title);
$default_title = preg_replace('#^' . str_replace('#', '\\#', preg_quote(get_site_name())) . '\\s.\\s#s', '', $default_title);
$default_title_2 = @preg_replace('#\\s.\\s' . str_replace('#', '\\#', preg_quote(get_site_name())) . '$#su', '', $default_title);
$default_title_2 = @preg_replace('#^' . str_replace('#', '\\#', preg_quote(get_site_name())) . '\\s.\\s#su', '', $default_title_2);
if ($default_title_2 !== false) {
$default_title = $default_title_2;
}
if (!is_string($default_title)) {
$default_title = '';
}
require_code('form_templates');
$rows = $GLOBALS['SITE_DB']->query_select('bookmarks', array('DISTINCT b_folder'), array('b_owner' => get_member()), 'ORDER BY b_folder');
$list = new ocp_tempcode();
$list->attach(form_input_list_entry('', false, do_lang_tempcode('NA_EM')));
$list->attach(form_input_list_entry('!', true, do_lang_tempcode('ROOT_EM')));
foreach ($rows as $row) {
if ($row['b_folder'] != '') {
$list->attach(form_input_list_entry($row['b_folder']));
}
}
$fields = new ocp_tempcode();
$fields->attach(form_input_list(do_lang_tempcode('OLD_BOOKMARK_FOLDER'), do_lang_tempcode('DESCRIPTION_OLD_BOOKMARK_FOLDER'), 'folder', $list, NULL, false, false));
$fields->attach(form_input_line(do_lang_tempcode('ALT_FIELD', do_lang_tempcode('NEW_BOOKMARK_FOLDER')), do_lang_tempcode('DESCRIPTION_NEW_BOOKMARK_FOLDER'), 'folder_new', '', false));
$fields->attach(form_input_line(do_lang_tempcode('TITLE'), do_lang_tempcode('DESCRIPTION_TITLE'), 'title', $default_title == '' ? '' : substr($default_title, 0, 200), true));
$fields->attach(form_input_line(do_lang_tempcode('PAGE_LINK'), do_lang_tempcode('DESCRIPTION_PAGE_LINK_BOOKMARK'), 'page_link', $page_link, true));
$submit_name = do_lang_tempcode('ADD_BOOKMARK');
breadcrumb_set_parents(array(array('_SELF:_SELF:misc', do_lang_tempcode('MANAGE_BOOKMARKS'))));
$javascript = 'standardAlternateFields(\'folder\',\'folder_new\'); var title=document.getElementById(\'title\'); if (((title.value==\'\') || (title.value==\'0\')) && (window.opener)) title.value=getInnerHTML(window.opener.document.getElementsByTagName(\'title\')[0]); ';
return do_template('FORM_SCREEN', array('_GUID' => '7e94bb97008de4fa0fffa2b5f91c95eb', 'TITLE' => $title, 'HIDDEN' => '', 'TEXT' => '', 'FIELDS' => $fields, 'URL' => $post_url, 'SUBMIT_NAME' => $submit_name, 'JAVASCRIPT' => $javascript));
}
示例11: get_extra_fields
/**
* Standard import function to get extra fields to ask for when starting the import.
*
* @return tempcode Extra fields
*/
function get_extra_fields()
{
// Give user options
// - where to copy files from [actually this field is in admin_import.php]
// - theme to save into (advise they should use Theme Wizard to create a theme with similar colour first)
// - whether to Comcode-convert
// - whether to fix invalid XHTML
// - the base URL to use to turn absolute URLs into relative URLs
$fields = new ocp_tempcode();
$themes = new ocp_tempcode();
require_code('themes2');
$_themes = find_all_themes();
require_code('form_templates');
foreach ($_themes as $theme => $theme_title) {
$themes->attach(form_input_list_entry($theme, $theme == $GLOBALS['FORUM_DRIVER']->get_theme(), $theme_title));
}
$fields = form_input_list(do_lang_tempcode('THEME'), do_lang_tempcode('THEME_TO_SAVE_INTO'), 'theme', $themes, NULL, true);
$fields->attach(form_input_tick(do_lang_tempcode('WHETHER_CONVERT_COMCODE'), do_lang_tempcode('DESCRIPTION_WHETHER_CONVERT_COMCODE'), 'convert_to_comcode', false));
$fields->attach(form_input_tick(do_lang_tempcode('FIX_INVALID_HTML'), do_lang_tempcode('DESCRIPTION_FIX_INVALID_HTML'), 'fix_html', true));
$fields->attach(form_input_line(do_lang_tempcode('BASE_URL'), do_lang_tempcode('DESCRIPTION_IMPORT_BASE_URL'), 'base_url', get_base_url(), true));
return $fields;
}
示例12: get_field_inputter
/**
* Get form inputter.
*
* @param string The field name
* @param string The field description
* @param array The field details
* @param ?string The actual current value of the field (NULL: none)
* @return ?tempcode The Tempcode for the input field (NULL: skip the field - it's not input)
*/
function get_field_inputter($_cf_name, $_cf_description, $field, $actual_value)
{
$default = $field['cf_default'];
$list = $default == '' ? array() : explode('|', $default);
$_list = new ocp_tempcode();
if ($field['cf_required'] == 0 || $actual_value == '' || is_null($actual_value)) {
$_list->attach(form_input_list_entry('', true, do_lang_tempcode('NA_EM')));
}
foreach ($list as $l) {
$_list->attach(form_input_list_entry($l, $l == $actual_value));
}
return form_input_list($_cf_name, $_cf_description, 'field_' . strval($field['id']), $_list, NULL, false, $field['cf_required'] == 1);
}
示例13: get_test_form_fields
/**
* Get tempcode for a test adding/editing form.
*
* @param string A short stub to prefix the field name
* @param SHORT_TEXT The text of the test
* @param ?MEMBER The member the test is assigned to (NULL: test section member)
* @param BINARY Whether the test is enabled
* @param string The section this test inherits from (blank: none)
* @return tempcode The tempcode for the visible fields
*/
function get_test_form_fields($stub, $test = '', $assigned_to = NULL, $enabled = 1, $inherit_from = '')
{
require_code('form_templates');
$fields = new ocp_tempcode();
$fields->attach(form_input_line(do_lang_tempcode('DESCRIPTION'), do_lang_tempcode('DESCRIPTION_DESCRIPTION'), $stub . '_test', $test, true));
$list = $this->get_tester_list($assigned_to);
$fields->attach(form_input_list(do_lang_tempcode('TESTER'), do_lang_tempcode('DESCRIPTION_TESTER_2'), $stub . '_assigned_to', $list));
$fields->attach(form_input_tick(do_lang_tempcode('ENABLED'), do_lang_tempcode('DESCRIPTION_ENABLED'), $stub . '_enabled', $enabled == 1));
$list2 = form_input_list_entry('-1', is_null($inherit_from), do_lang_tempcode('NA_EM'));
$list2->attach($this->get_section_list($inherit_from, true));
$fields->attach(form_input_list(do_lang_tempcode('INHERIT_FROM'), do_lang_tempcode('DESCRIPTION_INHERIT_FROM'), $stub . '_inherit_section', $list2));
return $fields;
}
示例14: nice_get_entries
/**
* Standard modular entry list fetcher.
*
* @return tempcode The selection list
*/
function nice_get_entries()
{
list($_entries, ) = $this->get_entry_rows();
$entries = new ocp_tempcode();
foreach ($_entries as $key => $row) {
$readable = $row['_readable'];
$entries->attach(form_input_list_entry($key, $key === get_param('id', NULL, true), $readable));
}
return $entries;
}
示例15: choose_lang
/**
* The UI to choose a language.
*
* @param tempcode The title to show when choosing a language
* @param boolean Whether to also choose a language file
* @param boolean Whether the user may add a language
* @param mixed Text message to show (Tempcode or string)
* @param boolean Whether to provide an N/A choice
* @param ID_TEXT The name of the parameter for specifying language
* @return tempcode The UI
*/
function choose_lang($title, $choose_lang_file = false, $add_lang = false, $text = '', $provide_na = true, $param_name = 'lang')
{
$GLOBALS['HELPER_PANEL_PIC'] = 'pagepics/language';
$GLOBALS['HELPER_PANEL_TUTORIAL'] = 'tut_intl';
require_code('form_templates');
$langs = new ocp_tempcode();
if ($provide_na) {
$langs->attach(form_input_list_entry('', false, do_lang_tempcode('NA')));
}
$langs->attach(nice_get_langs(NULL, $add_lang));
$fields = form_input_list(do_lang_tempcode('LANGUAGE'), do_lang_tempcode('DESCRIPTION_LANGUAGE'), $param_name, $langs, NULL, false, false);
$javascript = '';
if ($add_lang) {
$fields->attach(form_input_codename(do_lang_tempcode('ALT_FIELD', do_lang_tempcode('LANGUAGE')), do_lang_tempcode('DESCRIPTION_NEW_LANG'), 'lang_new', '', false));
$javascript .= 'standardAlternateFields(\'lang\',\'lang_new\');';
}
if ($choose_lang_file) {
$lang_files = new ocp_tempcode();
$lang_files->attach(form_input_list_entry('', false, do_lang_tempcode('NA_EM')));
$lang_files->attach(nice_get_lang_files());
$fields->attach(form_input_list(do_lang_tempcode('LANGUAGE_FILE'), do_lang_tempcode('DESCRIPTION_LANGUAGE_FILE'), 'lang_file', $lang_files, NULL, true));
$fields->attach(form_input_line(do_lang_tempcode('ALT_FIELD', do_lang('SEARCH')), '', 'search', '', false));
$javascript .= 'standardAlternateFields(\'lang_file\',\'search\');';
}
$post_url = get_self_url(false, false, NULL, false, true);
return do_template('FORM_SCREEN', array('_GUID' => 'ee6bdea3661cb4736173cac818a769e5', 'GET' => true, 'SKIP_VALIDATION' => true, 'HIDDEN' => '', 'SUBMIT_NAME' => do_lang_tempcode('CHOOSE'), 'TITLE' => $title, 'FIELDS' => $fields, 'URL' => $post_url, 'TEXT' => $text, 'JAVASCRIPT' => $javascript));
}