本文整理汇总了PHP中form_input_list_entry函数的典型用法代码示例。如果您正苦于以下问题:PHP form_input_list_entry函数的具体用法?PHP form_input_list_entry怎么用?PHP form_input_list_entry使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了form_input_list_entry函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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));
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:39,代码来源:multi_site_networks.php
示例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;
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:16,代码来源:ocf_groups.php
示例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;
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:18,代码来源:ocf_forums2.php
示例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;
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:20,代码来源:pointstore.php
示例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);
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:19,代码来源:work.php
示例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;
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:21,代码来源:tick_multi.php
示例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);
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:23,代码来源:classifieds.php
示例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));
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:25,代码来源:admin_xml_storage.php
示例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;
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:29,代码来源:choose_ocportalcom_addon.php
示例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));
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:47,代码来源:bookmarks.php
示例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;
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:27,代码来源:html_site.php
示例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);
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:22,代码来源:list.php
示例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;
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:23,代码来源:tester.php
示例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;
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:15,代码来源:aed_module.php
示例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));
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:38,代码来源:admin_lang.php
示例16: nice_get_entries
/**
* Standard aed_module list function.
*
* @return tempcode The selection list
*/
function nice_get_entries()
{
$_m = $GLOBALS['SITE_DB']->query_select('newsletters', array('id', 'title'));
$entries = new ocp_tempcode();
foreach ($_m as $m) {
$entries->attach(form_input_list_entry(strval($m['id']), false, get_translated_text($m['title'], $GLOBALS['SITE_DB'])));
}
return $entries;
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:14,代码来源:admin_newsletter.php
示例17: tpl_preview__block_side_personal_stats
/**
* Get a preview(s) of a (group of) template(s), as a full standalone piece of HTML in Tempcode format.
* Uses sources/lorem.php functions to place appropriate stock-text. Should not hard-code things, as the code is intended to be declaritive.
* Assumptions: You can assume all Lang/CSS/Javascript files in this addon have been pre-required.
*
* @return array Array of previews, each is Tempcode. Normally we have just one preview, but occasionally it is good to test templates are flexible (e.g. if they use IF_EMPTY, we can test with and without blank data).
*/
function tpl_preview__block_side_personal_stats()
{
$content = new ocp_tempcode();
$links = new ocp_tempcode();
$content->attach(do_lorem_template('BLOCK_SIDE_PERSONAL_STATS_LINE', array('KEY' => lorem_word(), 'VALUE' => placeholder_number())));
$links->attach(do_lorem_template('BLOCK_SIDE_PERSONAL_STATS_LINK_2', array('NAME' => lorem_word_2(), 'DESCRIPTION' => lorem_phrase(), 'URL' => placeholder_url())));
$links->attach(do_lorem_template('BLOCK_SIDE_PERSONAL_STATS_LINK', array('NAME' => lorem_word(), 'URL' => placeholder_url(), 'REL' => 'me')));
$links->attach(do_lorem_template('BLOCK_SIDE_PERSONAL_STATS_LOGOUT', array('NAME' => do_lang_tempcode('LOGOUT'), 'URL' => placeholder_url())));
$content->attach(do_lorem_template('BLOCK_SIDE_PERSONAL_STATS_LINE_COMPLEX', array('KEY' => do_lang_tempcode('GROUP'), 'VALUE' => placeholder_link())));
$staff_actions = new ocp_tempcode();
$staff_actions->attach(form_input_list_entry(lorem_word(), true, lorem_phrase()));
return array(lorem_globalise(do_lorem_template('BLOCK_SIDE_PERSONAL_STATS', array('AVATAR_URL' => placeholder_avatar(), 'LINKS' => $links, 'HAS_SU' => true, 'CONTENT' => $content, 'USERNAME' => lorem_word(), 'STAFF_ACTIONS' => $staff_actions)), NULL, '', true));
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:20,代码来源:core.php
示例18: stats
/**
* Show value statistics for a custom profile field (choose).
*
* @return tempcode The UI
*/
function stats()
{
$title = get_page_title('CUSTOM_PROFILE_FIELD_STATS');
breadcrumb_set_parents(array());
$fields = new ocp_tempcode();
$rows = $GLOBALS['FORUM_DB']->query_select('f_custom_fields', array('id', 'cf_name', 'cf_type'));
require_code('form_templates');
require_code('fields');
$list = new ocp_tempcode();
$_list = array();
foreach ($rows as $row) {
$ob = get_fields_hook($row['cf_type']);
list(, , $storage_type) = $ob->get_field_value_row_bits(NULL);
if (strpos($storage_type, '_trans') === false) {
$id = $row['id'];
$text = get_translated_text($row['cf_name'], $GLOBALS['FORUM_DB']);
$_list[$id] = $text;
}
}
asort($_list);
foreach ($_list as $id => $text) {
$list->attach(form_input_list_entry(strval($id), false, $text));
}
if ($list->is_empty()) {
return inform_screen($title, do_lang_tempcode('NO_ENTRIES'));
}
require_lang('dates');
$fields->attach(form_input_list(do_lang_tempcode('NAME'), '', 'id', $list));
$fields->attach(form_input_date(do_lang_tempcode('FROM'), do_lang_tempcode('DESCRIPTION_MEMBERS_JOINED_FROM'), 'start', true, false, false, time() - 60 * 60 * 24 * 30, 10, intval(date('Y')) - 10));
$fields->attach(form_input_date(do_lang_tempcode('TO'), do_lang_tempcode('DESCRIPTION_MEMBERS_JOINED_TO'), 'end', true, false, false, time(), 10, intval(date('Y')) - 10));
$post_url = build_url(array('page' => '_SELF', 'type' => '_stats'), '_SELF', NULL, false, true);
$submit_name = do_lang_tempcode('CUSTOM_PROFILE_FIELD_STATS');
return do_template('FORM_SCREEN', array('_GUID' => '393bac2180c9e135ae9c31565ddf7761', 'GET' => true, 'SKIP_VALIDATION' => true, 'TITLE' => $title, 'HIDDEN' => '', 'FIELDS' => $fields, 'TEXT' => '', 'URL' => $post_url, 'SUBMIT_NAME' => $submit_name));
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:39,代码来源:admin_ocf_customprofilefields.php
示例19: survey_results
/**
* Choose survey to view results of.
*
* @return tempcode The result of execution.
*/
function survey_results()
{
$title = get_page_title('SURVEY_RESULTS');
$GLOBALS['HELPER_PANEL_PIC'] = 'pagepics/survey_results';
require_code('form_templates');
$_m = $GLOBALS['SITE_DB']->query_select('quizzes', array('*'), array('q_type' => 'SURVEY'), 'ORDER BY q_validated DESC,q_add_date DESC', 300);
$entries = new ocp_tempcode();
foreach ($_m as $m) {
$entries->attach(form_input_list_entry(strval($m['id']), false, get_translated_text($m['q_name'])));
}
if ($entries->is_empty()) {
warn_exit(do_lang_tempcode('NO_ENTRIES'));
}
$fields = new ocp_tempcode();
$fields->attach(form_input_list(do_lang_tempcode('SURVEY'), '', 'id', $entries, NULL, true));
$post_url = build_url(array('page' => '_SELF', 'type' => '_survey_results'), '_SELF', NULL, false, true);
$submit_name = do_lang_tempcode('SURVEY_RESULTS');
breadcrumb_set_self(do_lang_tempcode('CHOOSE'));
return do_template('FORM_SCREEN', array('SKIP_VALIDATION' => true, 'HIDDEN' => '', 'GET' => true, 'TITLE' => $title, 'TEXT' => '', 'URL' => $post_url, 'FIELDS' => $fields, 'SUBMIT_NAME' => $submit_name));
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:25,代码来源:admin_quiz.php
示例20: ad
/**
* UI to add an invoice.
*
* @return tempcode The interface.
*/
function ad()
{
$title = get_page_title('CREATE_INVOICE');
breadcrumb_set_parents(array(array('_SEARCH:admin_ecommerce:ecom_usage', do_lang_tempcode('ECOMMERCE')), array('_SELF:_SELF:misc', do_lang_tempcode('INVOICES'))));
require_code('form_templates');
$to = get_param('to', '');
$products = find_all_products();
$list = new ocp_tempcode();
foreach ($products as $product => $details) {
if ($details[0] == PRODUCT_INVOICE) {
$text = do_lang_tempcode('CUSTOM_PRODUCT_' . $product);
if ($details[1] != '?') {
$text->attach(escape_html(' (' . $details[1] . ' ' . get_option('currency') . ')'));
}
$list->attach(form_input_list_entry($product, false, $text));
}
}
if ($list->is_empty()) {
inform_exit(do_lang_tempcode('NOTHING_TO_INVOICE_FOR'));
}
$fields = new ocp_tempcode();
$fields->attach(form_input_list(do_lang_tempcode('PRODUCT'), '', 'product', $list));
$fields->attach(form_input_username(do_lang_tempcode('USERNAME'), do_lang_tempcode('DESCRIPTION_INVOICE_FOR'), 'to', $to, true));
$fields->attach(form_input_float(do_lang_tempcode('AMOUNT'), do_lang_tempcode('INVOICE_AMOUNT_TEXT', escape_html(get_option('currency'))), 'amount', NULL, false));
$fields->attach(form_input_line(do_lang_tempcode('INVOICE_SPECIAL'), do_lang_tempcode('DESCRIPTION_INVOICE_SPECIAL'), 'special', '', false));
$fields->attach(form_input_text(do_lang_tempcode('INVOICE_NOTE'), do_lang_tempcode('DESCRIPTION_INVOICE_NOTE'), 'note', '', false));
$post_url = build_url(array('page' => '_SELF', 'type' => '_ad'), '_SELF');
$submit_name = do_lang_tempcode('CREATE_INVOICE');
return do_template('FORM_SCREEN', array('HIDDEN' => '', 'TITLE' => $title, 'URL' => $post_url, 'FIELDS' => $fields, 'SUBMIT_NAME' => $submit_name, 'TEXT' => do_lang_tempcode('DESCRIPTION_INVOICE_PAGE')));
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:35,代码来源:admin_invoices.php
注:本文中的form_input_list_entry函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论