当前位置: 首页>>代码示例>>PHP>>正文


PHP form_input_list函数代码示例

本文整理汇总了PHP中form_input_list函数的典型用法代码示例。如果您正苦于以下问题:PHP form_input_list函数的具体用法?PHP form_input_list怎么用?PHP form_input_list使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了form_input_list函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: ajax_tree

 /**
  * Get details for an ajax-tree-list of entries for the content covered by this search hook.
  *
  * @return array			A pair: the hook, and the options
  */
 function ajax_tree()
 {
     $catalogue_name = get_param('catalogue_name', '');
     if ($catalogue_name == '') {
         @ob_end_clean();
         $tree = nice_get_catalogues(NULL, true);
         if ($tree->is_empty()) {
             inform_exit(do_lang_tempcode('NO_ENTRIES'));
         }
         require_code('form_templates');
         $fields = form_input_list(do_lang_tempcode('NAME'), '', 'catalogue_name', $tree, NULL, true);
         if (running_script('iframe')) {
             $post_url = get_self_url_easy();
         } else {
             $post_url = get_self_url(false, false, NULL, false, true);
         }
         $submit_name = do_lang_tempcode('PROCEED');
         $hidden = build_keep_post_fields();
         $title = get_page_title('SEARCH');
         $tpl = do_template('FORM_SCREEN', array('_GUID' => 'a2812ac8056903811f444682d45ee448', 'TARGET' => '_self', 'GET' => true, 'SKIP_VALIDATION' => true, 'HIDDEN' => $hidden, 'TITLE' => $title, 'TEXT' => '', 'URL' => $post_url, 'FIELDS' => $fields, 'SUBMIT_NAME' => $submit_name));
         $echo = globalise($tpl, NULL, '', true);
         $echo->evaluate_echo();
         exit;
     }
     return array('choose_catalogue_category', array('catalogue_name' => $catalogue_name));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:31,代码来源:catalogue_entries.php

示例2: get_banner_form_fields

/**
 * Get the tempcode for the form to add a banner, with the information passed along to it via the parameters already added in.
 *
 * @param  boolean			Whether to simplify the banner interface (for the point-store buy process)
 * @param  ID_TEXT			The name of the banner
 * @param  URLPATH			The URL to the banner image
 * @param  URLPATH			The URL to the site the banner leads to
 * @param  SHORT_TEXT		The caption of the banner
 * @param  LONG_TEXT			Any notes associated with the banner
 * @param  integer			The banners "importance modulus"
 * @range  1 max
 * @param  ?integer			The number of hits the banner may have (NULL: not applicable for this banner type)
 * @range  0 max
 * @param  SHORT_INTEGER	The type of banner (0=permanent, 1=campaign, 2=default)
 * @set    0 1 2
 * @param  ?TIME				The banner expiry date (NULL: never expires)
 * @param  ?ID_TEXT			The username of the banners submitter (NULL: current member)
 * @param  BINARY				Whether the banner has been validated
 * @param  ID_TEXT			The banner type (can be anything, where blank means 'normal')
 * @param  SHORT_TEXT		The title text for the banner (only used for text banners, and functions as the 'trigger text' if the banner type is shown inline)
 * @return tempcode			The input field tempcode
 */
function get_banner_form_fields($simplified = false, $name = '', $image_url = '', $site_url = '', $caption = '', $notes = '', $importancemodulus = 3, $campaignremaining = 50, $the_type = 1, $expiry_date = NULL, $submitter = NULL, $validated = 1, $b_type = '', $title_text = '')
{
    require_code('images');
    $fields = new ocp_tempcode();
    require_code('form_templates');
    $fields->attach(form_input_codename(do_lang_tempcode('CODENAME'), do_lang_tempcode('DESCRIPTION_BANNER_NAME'), 'name', $name, true));
    $fields->attach(form_input_line(do_lang_tempcode('DESTINATION_URL'), do_lang_tempcode('DESCRIPTION_BANNER_URL'), 'site_url', $site_url, false));
    // Blank implies iframe
    if (!$simplified) {
        $types = nice_get_banner_types($b_type);
        if ($types->is_empty()) {
            warn_exit(do_lang_tempcode('NO_CATEGORIES'));
        }
        $fields->attach(form_input_list(do_lang_tempcode('_BANNER_TYPE'), do_lang_tempcode('_DESCRIPTION_BANNER_TYPE'), 'b_type', $types, NULL, false, false));
    } else {
        $fields->attach(form_input_hidden('b_type', $b_type));
    }
    if (has_specific_permission(get_member(), 'full_banner_setup')) {
        $fields->attach(form_input_username(do_lang_tempcode('OWNER'), do_lang_tempcode('DESCRIPTION_SUBMITTER'), 'submitter', is_null($submitter) ? $GLOBALS['FORUM_DRIVER']->get_username(get_member()) : $submitter, false));
    }
    if (get_value('disable_staff_notes') !== '1') {
        $fields->attach(form_input_text(do_lang_tempcode('NOTES'), do_lang_tempcode('DESCRIPTION_NOTES'), 'notes', $notes, false));
    }
    if (has_specific_permission(get_member(), 'bypass_validation_midrange_content', 'cms_banners')) {
        if ($validated == 0) {
            $validated = get_param_integer('validated', 0);
            if ($validated == 1) {
                attach_message(do_lang_tempcode('WILL_BE_VALIDATED_WHEN_SAVING'));
            }
        }
        if (addon_installed('unvalidated')) {
            $fields->attach(form_input_tick(do_lang_tempcode('VALIDATED'), do_lang_tempcode('DESCRIPTION_VALIDATED'), 'validated', $validated == 1));
        }
    }
    $fields->attach(do_template('FORM_SCREEN_FIELD_SPACER', array('TITLE' => do_lang_tempcode('SOURCE_MEDIA'))));
    $fields->attach(form_input_upload(do_lang_tempcode('UPLOAD'), do_lang_tempcode('DESCRIPTION_UPLOAD_BANNER'), 'file', false, NULL, NULL, true, str_replace(' ', '', get_option('valid_images') . ',swf')));
    $fields->attach(form_input_line(do_lang_tempcode('ALT_FIELD', do_lang_tempcode('IMAGE_URL')), do_lang_tempcode('DESCRIPTION_URL_BANNER'), 'image_url', $image_url, false));
    $fields->attach(form_input_line_comcode(do_lang_tempcode('BANNER_TITLE_TEXT'), do_lang_tempcode('DESCRIPTION_BANNER_TITLE_TEXT'), 'title_text', $title_text, false));
    $fields->attach(form_input_line_comcode(do_lang_tempcode('DESCRIPTION'), do_lang_tempcode('DESCRIPTION_BANNER_DESCRIPTION'), 'caption', $caption, false));
    $fields->attach(do_template('FORM_SCREEN_FIELD_SPACER', array('TITLE' => do_lang_tempcode('DEPLOYMENT_DETERMINATION'))));
    if (has_specific_permission(get_member(), 'full_banner_setup')) {
        $radios = new ocp_tempcode();
        $radios->attach(form_input_radio_entry('the_type', strval(BANNER_PERMANENT), $the_type == BANNER_PERMANENT, do_lang_tempcode('BANNER_PERMANENT')));
        $radios->attach(form_input_radio_entry('the_type', strval(BANNER_CAMPAIGN), $the_type == BANNER_CAMPAIGN, do_lang_tempcode('BANNER_CAMPAIGN')));
        $radios->attach(form_input_radio_entry('the_type', strval(BANNER_DEFAULT), $the_type == BANNER_DEFAULT, do_lang_tempcode('BANNER_DEFAULT')));
        $fields->attach(form_input_radio(do_lang_tempcode('DEPLOYMENT_AGREEMENT'), do_lang_tempcode('DESCRIPTION_BANNER_TYPE'), 'the_type', $radios));
        $fields->attach(form_input_integer(do_lang_tempcode('HITS_ALLOCATED'), do_lang_tempcode('DESCRIPTION_HITS_ALLOCATED'), 'campaignremaining', $campaignremaining, false));
        $total_importance = $GLOBALS['SITE_DB']->query_value_null_ok_full('SELECT SUM(importance_modulus) FROM ' . get_table_prefix() . 'banners WHERE ' . db_string_not_equal_to('name', $name));
        if (is_null($total_importance)) {
            $total_importance = 0;
        }
        $fields->attach(form_input_integer(do_lang_tempcode('IMPORTANCE_MODULUS'), do_lang_tempcode('DESCRIPTION_IMPORTANCE_MODULUS', strval($total_importance), strval($importancemodulus)), 'importancemodulus', $importancemodulus, true));
    }
    $fields->attach(form_input_date(do_lang_tempcode('EXPIRY_DATE'), do_lang_tempcode('DESCRIPTION_EXPIRY_DATE'), 'expiry_date', true, is_null($expiry_date), true, $expiry_date, 2));
    return $fields;
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:78,代码来源:banners2.php

示例3: 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

示例4: 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

示例5: 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

示例6: archive

 /**
  * The UI to select to view a past newsletter.
  *
  * @return tempcode		The UI
  */
 function archive()
 {
     $title = get_page_title('NEWSLETTER_ARCHIVE');
     $lang = choose_language($title);
     if (is_object($lang)) {
         return $lang;
     }
     $newsletters = new ocp_tempcode();
     $where = multi_lang() ? array('language' => $lang) : NULL;
     $rows = $GLOBALS['SITE_DB']->query_select('newsletter_archive', array('id', 'subject', 'date_and_time'), $where, 'ORDER BY date_and_time DESC');
     foreach ($rows as $newsletter) {
         $newsletters->attach(form_input_list_entry(strval($newsletter['id']), false, $newsletter['subject']));
     }
     if ($newsletters->is_empty()) {
         inform_exit(do_lang_tempcode('NO_ENTRIES'));
     }
     require_code('form_templates');
     $fields = form_input_list(do_lang_tempcode('NEWSLETTER'), '', 'id', $newsletters, NULL, true);
     $hidden = form_input_hidden('lang', $lang);
     $submit_name = do_lang_tempcode('VIEW');
     $post_url = build_url(array('page' => '_SELF', 'type' => 'view'), '_SELF', NULL, false, true);
     return do_template('FORM_SCREEN', array('_GUID' => 'ee295e41dc86c4583c123e6e0e445380', 'GET' => true, 'SKIP_VALIDATION' => true, 'HIDDEN' => $hidden, 'TITLE' => $title, 'TEXT' => '', 'FIELDS' => $fields, 'SUBMIT_NAME' => $submit_name, 'URL' => $post_url));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:28,代码来源:admin_newsletter.php

示例7: run

 /**
  * Standard modular run function.
  *
  * @return tempcode	The result of execution.
  */
 function run()
 {
     require_lang('unvalidated');
     $GLOBALS['HELPER_PANEL_PIC'] = 'pagepics/unvalidated';
     $GLOBALS['HELPER_PANEL_TUTORIAL'] = 'tut_censor';
     $_title = get_page_title('UNVALIDATED_RESOURCES');
     $out = new ocp_tempcode();
     require_code('form_templates');
     $_hooks = find_all_hooks('modules', 'admin_unvalidated');
     foreach (array_keys($_hooks) as $hook) {
         require_code('hooks/modules/admin_unvalidated/' . filter_naughty_harsh($hook));
         $object = object_factory('Hook_unvalidated_' . filter_naughty_harsh($hook), true);
         if (is_null($object)) {
             continue;
         }
         $info = $object->info();
         if (is_null($info)) {
             continue;
         }
         $identifier_select = is_array($info['db_identifier']) ? implode(',', $info['db_identifier']) : $info['db_identifier'];
         $db = array_key_exists('db', $info) ? $info['db'] : $GLOBALS['SITE_DB'];
         $rows = $db->query('SELECT ' . $identifier_select . (array_key_exists('db_title', $info) ? ',' . $info['db_title'] : '') . ' FROM ' . $db->get_table_prefix() . $info['db_table'] . ' WHERE ' . $info['db_validated'] . '=0', 100);
         $content = new ocp_tempcode();
         foreach ($rows as $row) {
             if (is_array($info['db_identifier'])) {
                 $id = '';
                 foreach ($info['db_identifier'] as $_id) {
                     if ($id != '') {
                         $id .= ':';
                     }
                     $id .= $row[$_id];
                 }
             } else {
                 $id = $row[$info['db_identifier']];
             }
             if (array_key_exists('db_title', $info)) {
                 $title = $row[$info['db_title']];
                 if ($info['db_title_dereference']) {
                     $title = get_translated_text($title, $db);
                 }
                 // May actually be comcode (can't be certain), but in which case it will be shown as source
             } else {
                 $title = '#' . (is_integer($id) ? strval($id) : $id);
             }
             if ($title == '') {
                 $title = '#' . strval($id);
             }
             $content->attach(form_input_list_entry(is_integer($id) ? strval($id) : $id, false, strip_comcode($title)));
         }
         if (array_key_exists('uses_workflow', $info) && $info['uses_workflow']) {
             // Content that uses a workflow is validated via its view screen
             $post_url = build_url(array('page' => $info['view_module'], 'type' => $info['view_type'], 'validated' => 1), get_module_zone($info['view_module']), NULL, false, true);
         } else {
             // Content which isn't in a workflow is validated via its edit screen
             $post_url = build_url(array('page' => $info['edit_module'], 'type' => $info['edit_type'], 'validated' => 1), get_module_zone($info['edit_module']), NULL, false, true);
         }
         $fields = form_input_list(do_lang_tempcode('EDIT'), do_lang_tempcode('DESCRIPTION_EDIT'), $info['edit_identifier'], $content);
         if (!$content->is_empty()) {
             // Could debate whether to include "'TARGET'=>'_blank',". However it does redirect back, so it's a nice linear process like this. If it was new window it could be more efficient, but also would confuse people with a lot of new windows opening and not closing.
             $content = do_template('FORM', array('_GUID' => '51dcee39273a0fee29569190344f2e41', 'GET' => true, 'HIDDEN' => '', 'SUBMIT_NAME' => do_lang_tempcode('EDIT'), 'FIELDS' => $fields, 'URL' => $post_url, 'TEXT' => ''));
         }
         $out->attach(do_template('UNVALIDATED_SECTION', array('_GUID' => '838240008e190b9cbaa0280fbddd6baf', 'TITLE' => $info['title'], 'CONTENT' => $content)));
     }
     return do_template('UNVALIDATED_SCREEN', array('_GUID' => '4e971f1c8851b821af030b5c7bbcb3fb', 'TITLE' => $_title, 'SECTIONS' => $out));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:70,代码来源:admin_unvalidated.php

示例8: config_category


//.........这里部分代码省略.........
         if (is_null($_explanation)) {
             $_explanation = do_lang('CONFIG_GROUP_DEFAULT_DESCRIP_' . $myrow['section'], NULL, NULL, NULL, NULL, false);
             if (is_null($_explanation)) {
                 $explanation = new ocp_tempcode();
             } else {
                 $explanation = do_lang_tempcode('CONFIG_GROUP_DEFAULT_DESCRIP_' . $myrow['section']);
             }
         } else {
             $explanation = do_lang_tempcode($exp_string);
         }
         if ($myrow['shared_hosting_restricted'] == 1 && !is_null($GLOBALS['CURRENT_SHARE_USER'])) {
             continue;
         }
         if ($myrow['section'] != $current_group && $current_group != '') {
             $_current_group = do_lang_tempcode($current_group);
             $_group_description = do_lang('CONFIG_GROUP_DESCRIP_' . $current_group, escape_html($post_max_size), escape_html($upload_max_filesize), NULL, NULL, false);
             if (is_null($_group_description)) {
                 $group_description = new ocp_tempcode();
             } else {
                 $group_description = do_lang_tempcode('CONFIG_GROUP_DESCRIP_' . $current_group, escape_html($post_max_size), escape_html($upload_max_filesize));
             }
             $group = do_template('CONFIG_GROUP', array('_GUID' => 'af4c31daa1bc39714ab83b11bd6d3e51', 'GROUP_DESCRIPTION' => $group_description, 'GROUP_NAME' => $current_group, 'GROUP' => $out, 'CURRENT_GROUP' => $_current_group));
             $groups->attach($group->evaluate());
             $out = '';
         }
         $_groups[$myrow['section']] = $_group_tempcode;
         switch ($myrow['the_type']) {
             case 'special':
                 switch ($myrow['the_name']) {
                     case 'timezone':
                         $list = '';
                         $timezone = get_site_timezone();
                         foreach (get_timezone_list() as $_timezone => $timezone_nice) {
                             $list .= static_evaluate_tempcode(form_input_list_entry($_timezone, $_timezone == $timezone, $timezone_nice));
                         }
                         $out .= static_evaluate_tempcode(form_input_list(do_lang_tempcode('TIME_ZONE'), do_lang_tempcode('DESCRIPTION_TIMEZONE_SITE'), 'timezone', make_string_tempcode($list)));
                         break;
                     default:
                         require_code('hooks/modules/admin_config/' . filter_naughty_harsh($myrow['the_name']));
                         $hook_ob = object_factory('Hook_admin_config_' . filter_naughty_harsh($myrow['the_name']));
                         $out .= static_evaluate_tempcode($hook_ob->run($myrow));
                         break;
                 }
                 break;
             case 'integer':
                 $out .= static_evaluate_tempcode(form_input_integer($name_tempcode, $explanation, $myrow['the_name'], intval(get_option($myrow['the_name'])), false));
                 break;
             case 'line':
                 if (strpos($myrow['the_name'], 'colour') !== false && substr(get_option($myrow['the_name']), 0, 1) == '#') {
                     $out .= static_evaluate_tempcode(form_input_colour($name_tempcode, $explanation, $myrow['the_name'], get_option($myrow['the_name']), false, NULL, true));
                 } elseif ($myrow['the_name'] == 'currency') {
                     $list = '';
                     require_code('currency');
                     $currencies = array_keys(get_currency_map());
                     foreach ($currencies as $currency) {
                         $list .= static_evaluate_tempcode(form_input_list_entry($currency, $currency == get_option($myrow['the_name'])));
                     }
                     $out .= static_evaluate_tempcode(form_input_list($name_tempcode, $explanation, $myrow['the_name'], make_string_tempcode($list)));
                 } elseif ($myrow['the_name'] == 'payment_gateway') {
                     $list = '';
                     $all_via = find_all_hooks('systems', 'ecommerce_via');
                     foreach (array_keys($all_via) as $via) {
                         $list .= static_evaluate_tempcode(form_input_list_entry($via, $via == get_option($myrow['the_name'])));
                     }
                     $out .= static_evaluate_tempcode(form_input_list($name_tempcode, $explanation, $myrow['the_name'], make_string_tempcode($list)));
                 } else {
开发者ID:erico-deh,项目名称:ocPortal,代码行数:67,代码来源:admin_config.php

示例9: choose

 /**
  * Choose product step.
  *
  * @param  tempcode	The page title.
  * @return tempcode	The result of execution.
  */
 function choose($title)
 {
     breadcrumb_set_self(do_lang_tempcode('PURCHASING'));
     /*if (is_guest())
     		{
     			$register=$GLOBALS['FORUM_DRIVER']->join_url();
     			if (is_object($register)) $register=$register->evaluate();
     			$_redirect=build_url(array('page'=>'_SELF','type'=>'misc'),'_SELF');
     			$redirect=$_redirect->evaluate();
     			$_login=build_url(array('page'=>'login','redirect'=>$redirect));
     			$login=$_login->evaluate();
     			return $this->wrap(do_template('PURCHASE_WIZARD_STAGE_GUEST',array('_GUID'=>'accf475a1457f73d7280b14d774acc6e','TITLE'=>$title,'TEXT'=>do_lang_tempcode('PURCHASE_NOT_LOGGED_IN_2',escape_html($register),escape_html($login)))),$title,NULL);
     		}*/
     $url = build_url(array('page' => '_SELF', 'type' => 'message', 'id' => get_param_integer('id', -1)), '_SELF', NULL, true, true);
     require_code('form_templates');
     $list = new ocp_tempcode();
     $filter = get_param('filter', '');
     $products = find_all_products();
     foreach ($products as $product => $details) {
         if ($filter != '') {
             if (!is_string($product) || substr($product, 0, strlen($filter)) != $filter) {
                 continue;
             }
         }
         if (($details[0] == PRODUCT_PURCHASE_WIZARD || $details[0] == PRODUCT_SUBSCRIPTION || $details[0] == PRODUCT_CATALOGUE) && method_exists($details[count($details) - 1], 'is_available') && $details[count($details) - 1]->is_available($product, get_member())) {
             require_code('currency');
             $currency = get_option('currency');
             $price = currency_convert(floatval($details[1]), $currency, NULL, true);
             $description = $details[4];
             if (strpos($details[4], strpos($details[4], '.') === false ? preg_replace('#\\.00($|[^\\d])#', '', $price) : $price) === false) {
                 $description .= ' (' . $price . ')';
             }
             $list->attach(form_input_list_entry($product, false, protect_from_escaping($description)));
         }
     }
     if ($list->is_empty()) {
         inform_exit(do_lang_tempcode('NO_CATEGORIES'));
     }
     $fields = form_input_list(do_lang_tempcode('PRODUCT'), '', 'product', $list, NULL, true);
     return $this->wrap(do_template('PURCHASE_WIZARD_STAGE_CHOOSE', array('_GUID' => '47c22d48313ff50e6323f05a78342eae', 'FIELDS' => $fields, 'TITLE' => $title)), $title, $url, true);
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:47,代码来源:purchase.php

示例10: fill_in_edit_form

 /**
  * Standard aed_module edit form filler.
  *
  * @param  ID_TEXT		The entry being edited
  * @return array			A triple: fields, hidden-fields, delete-fields
  */
 function fill_in_edit_form($_id)
 {
     $id = intval($_id);
     $m = $GLOBALS['FORUM_DB']->query_select('f_categories', array('*'), array('id' => $id), '', 1);
     if (!array_key_exists(0, $m)) {
         warn_exit(do_lang_tempcode('MISSING_RESOURCE'));
     }
     $r = $m[0];
     $delete_fields = new ocp_tempcode();
     $fields = $this->get_form_fields($r['c_title'], $r['c_description'], $r['c_expanded_by_default']);
     $list = ocf_nice_get_categories($id);
     if (!$list->is_empty()) {
         $delete_fields->attach(form_input_list(do_lang_tempcode('TARGET'), do_lang_tempcode('DESCRIPTION_FORUM_MOVE_TARGET'), 'target_category', $list));
     }
     return array($fields, new ocp_tempcode(), $delete_fields);
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:22,代码来源:admin_ocf_categories.php

示例11: 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

示例12: ed

 /**
  * Choose a test section to edit.
  *
  * @return tempcode	The result of execution.
  */
 function ed()
 {
     $title = get_page_title('EDIT_TEST_SECTION');
     check_specific_permission('edit_own_tests');
     if (!$GLOBALS['FORUM_DRIVER']->is_staff(get_member())) {
         access_denied('STAFF_ONLY');
     }
     $list = $this->get_section_list();
     if ($list->is_empty()) {
         inform_exit(do_lang_tempcode('NO_ENTRIES'));
     }
     $text = paragraph(do_lang_tempcode('CHOOSE_EDIT_LIST'));
     $post_url = build_url(array('page' => '_SELF', 'type' => '_ed'), '_SELF', NULL, false, true);
     require_code('form_templates');
     $fields = form_input_list(do_lang_tempcode('NAME'), '', 'id', $list, NULL, true);
     $submit_name = do_lang_tempcode('PROCEED');
     return do_template('FORM_SCREEN', array('_GUID' => '37f70ba9d23204bceda6e84375b52270', 'GET' => true, 'SKIP_VALIDATION' => true, 'HIDDEN' => '', 'TITLE' => $title, 'TEXT' => $text, 'URL' => $post_url, 'FIELDS' => $fields, 'SUBMIT_NAME' => $submit_name));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:23,代码来源:tester.php

示例13: search

 /**
  * The UI to choose filter parameters.
  *
  * @return tempcode		The UI
  */
 function search()
 {
     $title = get_page_title('VIEW_ACTION_LOGS');
     $GLOBALS['HELPER_PANEL_PIC'] = 'pagepics/actionlog';
     $GLOBALS['HELPER_PANEL_TUTORIAL'] = 'tut_trace';
     require_code('form_templates');
     $fields = new ocp_tempcode();
     // Possible selections for member filter
     $_member_choice_list = array();
     if (get_forum_type() == 'ocf') {
         if ($GLOBALS['FORUM_DB']->query_value('f_moderator_logs', 'COUNT(DISTINCT l_by)') < 5000) {
             $members = list_to_map('l_by', $GLOBALS['FORUM_DB']->query_select('f_moderator_logs', array('l_by', 'COUNT(*) AS cnt'), NULL, 'GROUP BY l_by ORDER BY cnt DESC'));
             foreach ($members as $member) {
                 $username = $GLOBALS['FORUM_DRIVER']->get_username($member['l_by']);
                 if (is_null($username)) {
                     $username = strval($member['l_by']);
                 }
                 $_member_choice_list[$member['l_by']] = array($username, $member['cnt']);
             }
         }
     }
     if ($GLOBALS['SITE_DB']->query_value('adminlogs', 'COUNT(DISTINCT the_user)') < 5000) {
         $_staff = list_to_map('the_user', $GLOBALS['SITE_DB']->query_select('adminlogs', array('the_user', 'COUNT(*) AS cnt'), NULL, 'GROUP BY the_user ORDER BY cnt DESC'));
         foreach ($_staff as $staff) {
             $username = $GLOBALS['FORUM_DRIVER']->get_username($staff['the_user']);
             if (is_null($username)) {
                 $username = strval($staff['the_user']);
             }
             if (!array_key_exists($staff['the_user'], $_member_choice_list)) {
                 $_member_choice_list[$staff['the_user']] = array($username, $staff['cnt']);
             } else {
                 $_member_choice_list[$staff['the_user']][1] += $staff['cnt'];
             }
         }
     }
     $member_choice_list = new ocp_tempcode();
     $member_choice_list->attach(form_input_list_entry('-1', true, do_lang_tempcode('_ALL')));
     foreach ($_member_choice_list as $id => $user_actions) {
         list($username, $action_count) = $user_actions;
         $member_choice_list->attach(form_input_list_entry(strval($id), false, do_lang($action_count == 1 ? 'ACTIONLOG_USERCOUNT_UNI' : 'ACTIONLOG_USERCOUNT', $username, integer_format($action_count))));
     }
     $fields->attach(form_input_list(do_lang_tempcode('USERNAME'), '', 'id', $member_choice_list, NULL, true));
     // Possible selections for action type filter
     $_action_type_list = array();
     $rows1 = get_forum_type() == 'ocf' ? $GLOBALS['FORUM_DB']->query_select('f_moderator_logs', array('DISTINCT l_the_type')) : array();
     $rows2 = $GLOBALS['SITE_DB']->query_select('adminlogs', array('DISTINCT the_type'));
     foreach ($rows1 as $row) {
         $lang = do_lang($row['l_the_type'], NULL, NULL, NULL, NULL, false);
         if (!is_null($lang)) {
             $_action_type_list[$row['l_the_type']] = $lang;
         }
     }
     foreach ($rows2 as $row) {
         $lang = do_lang($row['the_type'], NULL, NULL, NULL, NULL, false);
         if (!is_null($lang)) {
             $_action_type_list[$row['the_type']] = $lang;
         }
     }
     asort($_action_type_list);
     $action_type_list = new ocp_tempcode();
     $action_type_list->attach(form_input_list_entry('', true, do_lang_tempcode('_ALL')));
     foreach ($_action_type_list as $lang_id => $lang) {
         $action_type_list->attach(form_input_list_entry($lang_id, false, $lang));
     }
     $fields->attach(form_input_list(do_lang_tempcode('ACTION'), '', 'to_type', $action_type_list, NULL, false, false));
     // Filters
     $fields->attach(form_input_line(do_lang_tempcode('PARAMETER_A'), '', 'param_a', '', false));
     $fields->attach(form_input_line(do_lang_tempcode('PARAMETER_B'), '', 'param_b', '', false));
     $post_url = build_url(array('page' => '_SELF', 'type' => 'list'), '_SELF', NULL, false, true);
     $submit_name = do_lang_tempcode('VIEW_ACTION_LOGS');
     breadcrumb_set_self(do_lang_tempcode('VIEW_ACTION_LOGS'));
     return do_template('FORM_SCREEN', array('_GUID' => 'f2c6eda24e0e973aa7e253054f6683a5', 'GET' => true, 'SKIP_VALIDATION' => true, 'HIDDEN' => '', 'TITLE' => $title, 'TEXT' => '', 'URL' => $post_url, 'FIELDS' => $fields, 'SUBMIT_NAME' => $submit_name));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:78,代码来源:admin_actionlog.php

示例14: manage_bookmarks

 /**
  * The UI to manage bookmarks.
  *
  * @return tempcode		The UI
  */
 function manage_bookmarks()
 {
     $title = get_page_title('MANAGE_BOOKMARKS');
     require_code('form_templates');
     require_lang('zones');
     $fields = new ocp_tempcode();
     $fields->attach(do_template('FORM_SCREEN_FIELD_SPACER', array('TITLE' => do_lang_tempcode('MOVE'))));
     $rows = $GLOBALS['SITE_DB']->query_select('bookmarks', array('DISTINCT b_folder'), array('b_owner' => get_member()), 'ORDER BY b_folder');
     $list = form_input_list_entry('', false, do_lang_tempcode('NA_EM'));
     $list->attach(form_input_list_entry('!', false, do_lang_tempcode('ROOT_EM')));
     foreach ($rows as $row) {
         if ($row['b_folder'] != '') {
             $list->attach(form_input_list_entry($row['b_folder']));
         }
     }
     $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('NEW_BOOKMARK_FOLDER'), do_lang_tempcode('DESCRIPTION_NEW_BOOKMARK_FOLDER'), 'folder_new', '', false));
     $fields->attach(do_template('FORM_SCREEN_FIELD_SPACER', array('TITLE' => do_lang_tempcode('ACTIONS'))));
     $fields->attach(form_input_tick(do_lang_tempcode('DELETE'), do_lang_tempcode('DESCRIPTION_DELETE'), 'delete', false));
     $post_url = build_url(array('page' => '_SELF', 'type' => '_manage'), '_SELF');
     $form = do_template('FORM', array('HIDDEN' => '', 'FIELDS' => $fields, 'TEXT' => '', 'URL' => $post_url, 'SUBMIT_NAME' => do_lang_tempcode('MOVE_OR_DELETE_BOOKMARKS'), 'JAVASCRIPT' => 'standardAlternateFields(\'folder\',\'folder_new\');'));
     $bookmarks = array();
     $_bookmarks = $GLOBALS['SITE_DB']->query_select('bookmarks', array('*'), array('b_owner' => get_member()), 'ORDER BY b_folder');
     foreach ($_bookmarks as $bookmark) {
         $bookmarks[] = array('ID' => strval($bookmark['id']), 'CAPTION' => $bookmark['b_title'], 'FOLDER' => $bookmark['b_folder'], 'PAGE_LINK' => $bookmark['b_page_link']);
     }
     return do_template('BOOKMARKS_SCREEN', array('_GUID' => '685f020d6407543271ce99b5775bb357', 'TITLE' => $title, 'FORM_URL' => $post_url, 'FORM' => $form, 'BOOKMARKS' => $bookmarks));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:33,代码来源:bookmarks.php

示例15: get_form_fields

 /**
  * Get tempcode for adding/editing form.
  *
  * @param  SHORT_TEXT	A name for the Welcome E-mail
  * @param  SHORT_TEXT	The subject of the Welcome E-mail
  * @param  LONG_TEXT		The message body of the Welcome E-mail
  * @param  integer		The number of hours before sending the e-mail
  * @param  ?AUTO_LINK	What newsletter to send out to instead of members (NULL: none)
  * @return tempcode		The input fields
  */
 function get_form_fields($name = '', $subject = '', $text = '', $send_time = 0, $newsletter = 0)
 {
     $fields = new ocp_tempcode();
     $fields->attach(form_input_line(do_lang_tempcode('NAME'), do_lang_tempcode('DESCRIPTION_NAME_REFERENCE'), 'name', $name, true));
     $fields->attach(form_input_line(do_lang_tempcode('SUBJECT'), do_lang_tempcode('DESCRIPTION_WELCOME_EMAIL_SUBJECT'), 'subject', $subject, true));
     $fields->attach(form_input_huge_comcode(do_lang_tempcode('TEXT'), do_lang_tempcode('DESCRIPTION_WELCOME_EMAIL_TEXT'), 'text', $text, true));
     $fields->attach(form_input_integer(do_lang_tempcode('SEND_TIME'), do_lang_tempcode('DESCRIPTION_SEND_TIME'), 'send_time', $send_time, true));
     if (addon_installed('newsletter')) {
         require_lang('newsletter');
         if (get_value('welcome_nw_choice') === '1') {
             $newsletters = new ocp_tempcode();
             $rows = $GLOBALS['SITE_DB']->query_select('newsletters', array('id', 'title'));
             if (get_forum_type() == 'ocf') {
                 $newsletters->attach(form_input_list_entry('', is_null($newsletter), do_lang_tempcode('NEWSLETTER_OCF')));
             }
             foreach ($rows as $_newsletter) {
                 $newsletters->attach(form_input_list_entry(strval($_newsletter['id']), $_newsletter['id'] === $newsletter, get_translated_text($_newsletter['title'])));
             }
             if (!$newsletters->is_empty()) {
                 $fields->attach(form_input_list(do_lang_tempcode('NEWSLETTER'), '', 'newsletter', $newsletters, NULL, false, false));
             }
         } else {
             if (get_forum_type() == 'ocf') {
                 require_lang('newsletter');
                 $fields->attach(form_input_tick(do_lang_tempcode('NEWSLETTER'), do_lang_tempcode('DESCRIPTION_NEWSLETTER_INSTEAD'), 'newsletter', $newsletter == 1));
             }
         }
     }
     return $fields;
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:40,代码来源:admin_ocf_welcome_emails.php


注:本文中的form_input_list函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。