本文整理汇总了PHP中ocp_tempcode::attach方法的典型用法代码示例。如果您正苦于以下问题:PHP ocp_tempcode::attach方法的具体用法?PHP ocp_tempcode::attach怎么用?PHP ocp_tempcode::attach使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ocp_tempcode
的用法示例。
在下文中一共展示了ocp_tempcode::attach方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
/**
* Standard modular run function for snippet hooks. Generates XHTML to insert into a page using AJAX.
*
* @return tempcode The snippet
*/
function run()
{
$sup = get_param('block_map_sup', '', true);
$_map = get_param('block_map', false, true);
if ($sup != '') {
$_map .= ',' . $sup;
}
require_code('blocks');
$map = block_params_str_to_arr($_map);
if (!array_key_exists('block', $map)) {
return new ocp_tempcode();
}
$auth_key = get_param_integer('auth_key');
// Check permissions
$test = $GLOBALS['SITE_DB']->query_value_null_ok('temp_block_permissions', 'p_block_constraints', array('p_session_id' => get_session_id(), 'id' => $auth_key));
if (is_null($test) || !block_signature_check(block_params_str_to_arr($test), $map)) {
require_lang('permissions');
return paragraph(do_lang_tempcode('ACCESS_DENIED__ACCESS_DENIED', escape_html($map['block'])));
}
// Cleanup
$GLOBALS['SITE_DB']->query('DELETE FROM ' . get_table_prefix() . 'temp_block_permissions WHERE p_time<' . strval(time() - 60 * 60 * intval(get_option('session_expiry_time'))));
// Return block snippet
global $CSSS, $JAVASCRIPTS;
$CSSS = array();
$JAVASCRIPTS = array();
$out = new ocp_tempcode();
$out->attach(symbol_tempcode('CSS_TEMPCODE'));
$out->attach(symbol_tempcode('JS_TEMPCODE'));
$out->attach(do_block($map['block'], $map));
return $out;
}
示例2: run
/**
* Standard modular run function.
*
* @return tempcode Results
*/
function run()
{
$out = new ocp_tempcode();
$tables = $GLOBALS['SITE_DB']->query_select('db_meta', array('DISTINCT m_table'));
if (count($GLOBALS['SITE_DB']->connection_write) > 4) {
$GLOBALS['SITE_DB']->connection_write = call_user_func_array(array($GLOBALS['SITE_DB']->static_ob, 'db_get_connection'), $GLOBALS['SITE_DB']->connection_write);
_general_db_init();
}
list($db, $db_name) = $GLOBALS['SITE_DB']->connection_write;
mysql_select_db($db_name, $db);
foreach ($tables as $table) {
if ($table['m_table'] == 'sessions') {
continue;
}
// HEAP, so can't be repaired
$table = get_table_prefix() . $table['m_table'];
// Check/Repair
$result = mysql_query('CHECK TABLE ' . $table . ' FAST', $db);
echo mysql_error($db);
mysql_data_seek($result, mysql_num_rows($result) - 1);
$status_row = mysql_fetch_assoc($result);
if ($status_row['Msg_type'] != 'status') {
$out->attach(paragraph(do_lang_tempcode('TABLE_ERROR', escape_html($table), escape_html($status_row['Msg_type']), array(escape_html($status_row['Msg_text']))), 'dfsdgdsgfgd'));
$result2 = mysql_query('REPAIR TABLE ' . $table, $db);
mysql_data_seek($result2, mysql_num_rows($result2) - 1);
$status_row_2 = mysql_fetch_assoc($result2);
$out->attach(paragraph(do_lang_tempcode('TABLE_FIXED', escape_html($table), escape_html($status_row_2['Msg_type']), array(escape_html($status_row_2['Msg_text']))), 'dfsdfgdst4'));
}
// Optimise
mysql_unbuffered_query('OPTIMIZE TABLE ' . $table, $db);
}
return $out;
}
示例3: run
/**
* Standard modular run function.
*
* @param array A map of parameters.
* @return tempcode The result of execution.
*/
function run($map)
{
unset($map);
$forum = get_forum_type();
$out = new ocp_tempcode();
if ($forum != 'none') {
// Standard welcome back vs into greeting
$member = get_member();
if (is_guest($member)) {
$redirect = get_self_url(true, true);
$login_url = build_url(array('page' => 'login', 'type' => 'misc', 'redirect' => $redirect), get_module_zone('login'));
$join_url = $GLOBALS['FORUM_DRIVER']->join_url();
$join_bits = do_template('JOIN_OR_LOGIN', array('LOGIN_URL' => $login_url, 'JOIN_URL' => $join_url));
$p = do_lang_tempcode('WELCOME', $join_bits);
$out->attach(paragraph($p, 'hhrt4dsgdsgd'));
} else {
$out->attach(paragraph(do_lang_tempcode('WELCOME_BACK', escape_html($GLOBALS['FORUM_DRIVER']->get_username($member))), 'gfgdf9gjd'));
}
}
$message = get_option('welcome_message');
if (has_actual_page_access(get_member(), 'admin_config')) {
if ($message != '') {
$message .= ' [[page="_SEARCH:admin_config:category:SITE#group_GENERAL"]' . do_lang('EDIT') . '[/page]]';
}
}
$out->attach(comcode_to_tempcode($message, NULL, true));
return $out;
}
示例4: run
/**
* Standard modular run function.
*
* @param array A map of parameters.
* @return tempcode The result of execution.
*/
function run($map)
{
require_code('downloads');
require_css('downloads');
require_lang('downloads');
require_code('ocfiltering');
$number = array_key_exists('param', $map) ? intval($map['param']) : 10;
$filter = array_key_exists('filter', $map) ? $map['filter'] : '*';
$zone = array_key_exists('zone', $map) ? $map['zone'] : get_module_zone('downloads');
$sql_filter = ocfilter_to_sqlfragment($filter, 'p.category_id', 'download_categories', 'parent_id', 'p.category_id', 'id');
// Note that the parameters are fiddled here so that category-set and record-set are the same, yet SQL is returned to deal in an entirely different record-set (entries' record-set)
$rows = $GLOBALS['SITE_DB']->query('SELECT * FROM ' . get_table_prefix() . 'download_downloads p WHERE validated=1 AND (' . $sql_filter . ') ORDER BY add_date DESC', $number);
$title = do_lang_tempcode('RECENT', make_string_tempcode(integer_format($number)), do_lang_tempcode('SECTION_DOWNLOADS'));
if (array_key_exists('title', $map) && $map['title'] != '') {
$title = protect_from_escaping(escape_html($map['title']));
}
$out = new ocp_tempcode();
foreach ($rows as $i => $row) {
if ($i != 0) {
$out->attach(do_template('BLOCK_SEPARATOR'));
}
$out->attach(get_download_html($row, true, true, $zone));
}
if ($out->is_empty()) {
if (has_actual_page_access(NULL, 'cms_downloads', NULL, NULL) && has_submit_permission('mid', get_member(), get_ip_address(), 'cms_downloads')) {
$submit_url = build_url(array('page' => 'cms_downloads', 'type' => 'ad', 'redirect' => SELF_REDIRECT), get_module_zone('cms_downloads'));
} else {
$submit_url = new ocp_tempcode();
}
return do_template('BLOCK_NO_ENTRIES', array('_GUID' => '74399763a51102bdd6e6d92c2c11354f', 'HIGH' => false, 'TITLE' => $title, 'MESSAGE' => do_lang_tempcode('NO_DOWNLOADS_YET'), 'ADD_NAME' => do_lang_tempcode('ADD_DOWNLOAD'), 'SUBMIT_URL' => $submit_url));
}
return do_template('BLOCK_MAIN_RECENT_DOWNLOADS', array('_GUID' => '257fa1b83d1b6fe3acbceb2b618e6d7f', 'TITLE' => $title, 'CONTENT' => $out, 'NUMBER' => integer_format($number)));
}
示例5: run
/**
* Standard modular run function.
*
* @return tempcode The result of execution.
*/
function run()
{
if (!addon_installed('calendar')) {
return new ocp_tempcode();
}
require_lang('calendar');
$bits = new ocp_tempcode();
if (get_option('calendar_show_stats_count_events', true) == '1') {
$bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('KEY' => do_lang_tempcode('EVENTS'), 'VALUE' => integer_format($GLOBALS['SITE_DB']->query_value('calendar_events', 'COUNT(*)')))));
}
if (get_option('calendar_show_stats_count_events_this_week', true) == '1') {
require_code('calendar');
$events = calendar_matches($GLOBALS['FORUM_DRIVER']->get_guest_id(), true, utctime_to_usertime(time()), utctime_to_usertime(time() + 60 * 60 * 24 * 7));
$bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('KEY' => do_lang_tempcode('EVENTS_THIS_WEEK'), 'VALUE' => integer_format(count($events)))));
}
if (get_option('calendar_show_stats_count_events_this_month', true) == '1') {
require_code('calendar');
$events = calendar_matches($GLOBALS['FORUM_DRIVER']->get_guest_id(), true, utctime_to_usertime(time()), utctime_to_usertime(time() + 60 * 60 * 24 * 31));
$bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('KEY' => do_lang_tempcode('EVENTS_THIS_MONTH'), 'VALUE' => integer_format(count($events)))));
}
if (get_option('calendar_show_stats_count_events_this_year', true) == '1') {
require_code('calendar');
$events = calendar_matches($GLOBALS['FORUM_DRIVER']->get_guest_id(), true, utctime_to_usertime(time()), utctime_to_usertime(time() + 60 * 60 * 24 * 365));
$bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('KEY' => do_lang_tempcode('EVENTS_THIS_YEAR'), 'VALUE' => integer_format(count($events)))));
}
if ($bits->is_empty()) {
return new ocp_tempcode();
}
$section = do_template('BLOCK_SIDE_STATS_SECTION', array('SECTION' => do_lang_tempcode('CALENDAR'), 'CONTENT' => $bits));
return $section;
}
示例6: _build_keep_form_fields
/**
* Get hidden fields for a form representing 'keep_x'. If we are having a GET form instead of a POST form, we need to do this. This function also encodes the page name, as we'll always want that.
*
* @param ID_TEXT The page for the form to go to (blank: don't attach)
* @param boolean Whether to keep all elements of the current URL represented in this form (rather than just the keep_ fields, and page)
* @param ?array A list of parameters to exclude (NULL: don't exclude any)
* @return tempcode The builtup hidden form fields
*/
function _build_keep_form_fields($page = '', $keep_all = false, $exclude = NULL)
{
if (is_null($exclude)) {
$exclude = array();
}
if ($page == '_SELF') {
$page = get_page_name();
}
$out = new ocp_tempcode();
if (count($_GET) > 0) {
foreach ($_GET as $key => $val) {
if (!is_string($val)) {
continue;
}
if (get_magic_quotes_gpc()) {
$val = stripslashes($val);
}
if ((substr($key, 0, 5) == 'keep_' || $keep_all) && !in_array($key, $exclude) && $key != 'page' && !skippable_keep($key, $val)) {
$out->attach(form_input_hidden($key, $val));
}
}
}
if ($page != '') {
$out->attach(form_input_hidden('page', $page));
}
return $out;
}
示例7: run
/**
* Standard modular run function.
*
* @return tempcode The result of execution.
*/
function run()
{
if (!addon_installed('downloads')) {
return new ocp_tempcode();
}
require_lang('downloads');
require_code('downloads_stats');
$bits = new ocp_tempcode();
if (get_option('downloads_show_stats_count_total', true) == '1') {
$bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('_GUID' => 'ff2bd884d88ddc8c5a81cff897f99a5a', 'KEY' => do_lang_tempcode('COUNT_TOTAL'), 'VALUE' => integer_format(get_num_archive_downloads()))));
}
if (get_option('downloads_show_stats_count_archive', true) == '1') {
$bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('_GUID' => '3d221f2145581a3af51c8948f28b7ac7', 'KEY' => do_lang_tempcode('COUNT_ARCHIVE'), 'VALUE' => get_download_archive_size())));
}
if (get_option('downloads_show_stats_count_downloads', true) == '1') {
$bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('_GUID' => '47c544ef053f9be47e2c48c3a694da1c', 'KEY' => do_lang_tempcode('COUNT_DOWNLOADS'), 'VALUE' => integer_format(get_num_downloads_downloaded()))));
}
if (get_option('downloads_show_stats_count_bandwidth', true) == '1') {
$bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('_GUID' => 'b2589ae83652953ece220267043d75c9', 'KEY' => do_lang_tempcode('COUNT_BANDWIDTH'), 'VALUE' => clean_file_size(get_download_bandwidth()))));
}
if ($bits->is_empty()) {
return new ocp_tempcode();
}
$files = do_template('BLOCK_SIDE_STATS_SECTION', array('_GUID' => '99ae3f35b3e5eda18901e97ac385d99c', 'SECTION' => do_lang_tempcode('SECTION_DOWNLOADS'), 'CONTENT' => $bits));
return $files;
}
示例8: action
/**
* Standard interface stage of pointstore item purchase.
*
* @return tempcode The UI
*/
function action()
{
$class = str_replace('hook_pointstore_', '', strtolower(get_class($this)));
if (get_option('is_on_' . $class . '_buy') == '0') {
return new ocp_tempcode();
}
$title = get_page_title('TOPIC_PINNING');
$cost = intval(get_option($class));
$next_url = build_url(array('page' => '_SELF', 'type' => 'action_done', 'id' => $class), '_SELF');
$points_left = available_points(get_member());
// Check points
if ($points_left < $cost && !has_specific_permission(get_member(), 'give_points_self')) {
return warn_screen($title, do_lang_tempcode('_CANT_AFFORD', integer_format($cost), integer_format($points_left)));
}
require_code('form_templates');
$fields = new ocp_tempcode();
if (get_forum_type() == 'ocf') {
$fields->attach(form_input_tree_list(do_lang_tempcode('FORUM_TOPIC'), '', 'select_topic_id', NULL, 'choose_forum_topic', array(), false));
$fields->attach(form_input_integer(do_lang_tempcode('ALT_FIELD', do_lang_tempcode('FORUM_TOPIC')), do_lang_tempcode('DESCRIPTION_FORUM_TOPIC_ID'), 'manual_topic_id', NULL, false));
} else {
$fields->attach(form_input_integer(do_lang_tempcode('FORUM_TOPIC'), do_lang_tempcode('ENTER_TOPIC_ID_MANUALLY'), 'manual_topic_id', NULL, false));
}
$text = do_lang_tempcode('PIN_TOPIC_A', integer_format($cost), integer_format($points_left - $cost));
return do_template('FORM_SCREEN', array('_GUID' => '8cabf882d5cbe4d354cc6efbcf92ebf9', 'TITLE' => $title, 'TEXT' => $text, 'URL' => $next_url, 'FIELDS' => $fields, 'HIDDEN' => '', 'SUBMIT_NAME' => do_lang_tempcode('PURCHASE'), 'JAVASCRIPT' => 'standardAlternateFields(\'select_topic_id\',\'manual_topic_id\');'));
}
示例9: array
/**
* Standard modular run function for features in the setup wizard.
*
* @param array Default values for the fields, from the install-profile.
* @return tempcode An input field.
*/
function get_fields($field_defaults)
{
if (get_forum_type() != 'ocf') {
return new ocp_tempcode();
}
require_lang('ocf');
$fields = new ocp_tempcode();
$dbs_back = $GLOBALS['NO_DB_SCOPE_CHECK'];
$GLOBALS['NO_DB_SCOPE_CHECK'] = true;
$test = $GLOBALS['SITE_DB']->query_value_null_ok('f_groups', 'id', array('id' => db_get_first_id() + 7));
if (!is_null($test)) {
$fields->attach(form_input_tick(do_lang_tempcode('HAVE_DEFAULT_RANK_SET'), do_lang_tempcode('DESCRIPTION_HAVE_DEFAULT_RANK_SET'), 'have_default_rank_set', array_key_exists('have_default_rank_set', $field_defaults) ? $field_defaults['have_default_rank_set'] == '1' : false));
}
$test = $GLOBALS['SITE_DB']->query('SELECT * FROM ' . get_table_prefix() . 'f_emoticons WHERE e_code<>\':P\' AND e_code<>\';)\' AND e_code<>\':)\' AND e_code<>\':)\' AND e_code<>\':\\\'(\'');
if (count($test) != 0) {
$fields->attach(form_input_tick(do_lang_tempcode('HAVE_DEFAULT_FULL_EMOTICON_SET'), do_lang_tempcode('DESCRIPTION_HAVE_DEFAULT_FULL_EMOTICON_SET'), 'have_default_full_emoticon_set', array_key_exists('have_default_full_emoticon_set', $field_defaults) ? $field_defaults['have_default_full_emoticon_set'] == '1' : true));
}
$fields_l = array('im_aim', 'im_msn', 'im_jabber', 'im_yahoo', 'im_skype', 'interests', 'location', 'occupation', 'sn_google', 'sn_facebook', 'sn_twitter');
foreach ($fields_l as $field) {
$test = $GLOBALS['SITE_DB']->query_value_null_ok('f_custom_fields f LEFT JOIN ' . get_table_prefix() . 'translate t ON t.id=f.cf_name', 'f.id', array('text_original' => do_lang('DEFAULT_CPF_' . $field . '_NAME')));
if (!is_null($test)) {
$fields->attach(form_input_tick(do_lang_tempcode('HAVE_DEFAULT_CPF_SET'), do_lang_tempcode('DESCRIPTION_HAVE_DEFAULT_CPF_SET'), 'have_default_cpf_set', array_key_exists('have_default_cpf_set', $field_defaults) ? $field_defaults['have_default_cpf_set'] == '1' : false));
break;
}
}
$GLOBALS['NO_DB_SCOPE_CHECK'] = $dbs_back;
return $fields;
}
示例10: _urlise_lang
/**
* URL'ise specially encoded text-acceptance language strings.
*
* @param string The language string
* @param mixed The URL (either tempcode or string)
* @param string The title of the hyperlink
* @param boolean Whether to use a new window
* @return tempcode The encoded version
*/
function _urlise_lang($string, $url, $title, $new_window)
{
$a = strpos($string, '<{');
$b = strpos($string, '}>');
if ($a === false || $b === false || $b < $a) {
return make_string_tempcode($string);
}
$section = substr($string, $a + 2, $b - $a - 2);
$prior = substr($string, 0, $a);
$after = substr($string, $b + 2);
if ($GLOBALS['XSS_DETECT']) {
ocp_mark_as_escaped($section);
ocp_mark_as_escaped($prior);
ocp_mark_as_escaped($after);
}
if (is_string($url)) {
if ($url == '') {
return protect_from_escaping($section);
}
} else {
if ($url->is_empty()) {
return protect_from_escaping($section);
}
}
$out = new ocp_tempcode();
$out->attach(protect_from_escaping($prior));
$out->attach(hyperlink($url, protect_from_escaping($section), $new_window, false, $title));
$out->attach(protect_from_escaping($after));
return $out;
}
示例11: run
/**
* Standard modular run function.
*
* @param array A map of parameters.
* @return tempcode The result of execution.
*/
function run($map)
{
require_code('downloads');
require_css('downloads');
require_lang('downloads');
$zone = array_key_exists('zone', $map) ? $map['zone'] : get_module_zone('downloads');
global $NON_CANONICAL_PARAMS;
$NON_CANONICAL_PARAMS[] = 'max';
$max = get_param_integer('max', 10);
if ($max < 1) {
$max = 1;
}
$start = get_param_integer('start', 0);
$rows = $GLOBALS['SITE_DB']->query_select('download_downloads', array('*'), array('validated' => 1), 'ORDER BY num_downloads DESC', $max, $start);
$content = new ocp_tempcode();
foreach ($rows as $i => $row) {
if ($i != 0) {
$content->attach(do_template('BLOCK_SEPARATOR'));
}
$content->attach(get_download_html($row, true, true, $zone));
}
$page_num = intval(floor(floatval($start) / floatval($max))) + 1;
$count = $GLOBALS['SITE_DB']->query_value('download_downloads', 'COUNT(*)', array('validated' => 1));
$num_pages = intval(ceil(floatval($count) / floatval($max)));
if ($num_pages == 0) {
$page_num = 0;
}
$previous_url = $start == 0 ? new ocp_tempcode() : build_url(array('page' => '_SELF', 'start' => $start - $max), '_SELF');
$next_url = $page_num == $num_pages ? new ocp_tempcode() : build_url(array('page' => '_SELF', 'start' => $start + $max), '_SELF');
$browse = do_template('NEXT_BROWSER_BROWSE_NEXT', array('_GUID' => '15ca70ec400629f67edefa869fb1f1a8', 'NEXT_LINK' => $next_url, 'PREVIOUS_LINK' => $previous_url, 'PAGE_NUM' => integer_format($page_num), 'NUM_PAGES' => integer_format($num_pages)));
return do_template('BLOCK_MAIN_DOWNLOAD_TEASE', array('_GUID' => 'a164e33c0b4ace4bae945c39f2f00ca9', 'CONTENT' => $content, 'BROWSE' => $browse));
}
示例12: array
/**
* Get syndication field UI.
*
* @return tempcode Syndication fields (or empty)
*/
function get_syndication_option_fields()
{
$fields = new ocp_tempcode();
if (has_specific_permission(get_member(), 'syndicate_site_activity') && has_external_site_wide_syndication()) {
require_lang('activities');
$fields->attach(do_template('FORM_SCREEN_FIELD_SPACER', array('TITLE' => do_lang_tempcode('SYNDICATION'))));
$fields->attach(form_input_tick(do_lang_tempcode('SYNDICATE_THIS'), do_lang_tempcode('DESCRIPTION_SYNDICATE_THIS'), 'syndicate_this', true));
}
return $fields;
}
示例13: gui
/**
* The UI for choosing members to merge.
*
* @return tempcode The UI
*/
function gui()
{
$title = get_page_title('MERGE_MEMBERS');
breadcrumb_set_parents(array(array('_SEARCH:admin_ocf_join:menu', do_lang_tempcode('MEMBERS'))));
$fields = new ocp_tempcode();
require_code('form_templates');
$fields->attach(form_input_username(do_lang_tempcode('FROM'), do_lang_tempcode('DESCRIPTION_MEMBER_FROM'), 'from', '', true));
$fields->attach(form_input_username(do_lang_tempcode('TO'), do_lang_tempcode('DESCRIPTION_MEMBER_TO'), 'to', '', true));
$submit_name = do_lang_tempcode('MERGE_MEMBERS');
$post_url = build_url(array('page' => '_SELF', 'type' => 'actual'), '_SELF');
$text = do_lang_tempcode('MERGE_MEMBERS_TEXT');
return do_template('FORM_SCREEN', array('_GUID' => '6f6b18d90bbe9550303ab41be0a26dcb', 'SKIP_VALIDATION' => true, 'TITLE' => $title, 'URL' => $post_url, 'FIELDS' => $fields, 'HIDDEN' => '', 'TEXT' => $text, 'SUBMIT_NAME' => $submit_name));
}
示例14: strtolower
/**
* Standard actualisation stage of pointstore item purchase.
*
* @return tempcode The UI
*/
function action_done()
{
$class = str_replace('hook_pointstore_', '', strtolower(get_class($this)));
$title = get_page_title('OCGIFTS_TITLE');
require_code('form_templates');
$fields = new ocp_tempcode();
$fields->attach(form_input_username(do_lang_tempcode('TO_USERNAME'), do_lang_tempcode('MEMBER_TO_GIVE'), 'username', get_param('username', ''), true));
$fields->attach(form_input_text(do_lang_tempcode('GIFT_MESSAGE'), do_lang_tempcode('DESCRIPTION_GIFT_MESSAGE'), 'gift_message', '', true));
$fields->attach(form_input_tick(do_lang_tempcode('ANONYMOUS'), do_lang_tempcode('DESCRIPTION_ANONYMOUS'), 'anonymous', false));
$submit_name = do_lang_tempcode('SEND_GIFT');
$text = paragraph(do_lang_tempcode('CHOOSE_MEMBER'));
$post_url = build_url(array('page' => 'pointstore', 'type' => 'action_done2', 'id' => 'ocgifts', 'gift' => get_param('gift', 0)), '_SEARCH');
return do_template('FORM_SCREEN', array('SKIP_VALIDATION' => true, 'STAFF_HELP_URL' => '', 'HIDDEN' => '', 'TITLE' => $title, 'FIELDS' => $fields, 'TEXT' => $text, 'SUBMIT_NAME' => $submit_name, 'URL' => $post_url));
}
示例15: array
/**
* 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;
}