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


PHP form_input_tick函数代码示例

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


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

示例1: get_fields

 /**
  * 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 (!addon_installed('catalogues')) {
         return new ocp_tempcode();
     }
     require_lang('catalogues');
     $fields = new ocp_tempcode();
     $test = $GLOBALS['SITE_DB']->query_value_null_ok('catalogues', 'c_name', array('c_name' => 'hosted'));
     if (!is_null($test)) {
         $fields->attach(form_input_tick(do_lang_tempcode('HAVE_DEFAULT_CATALOGUES_HOSTING'), do_lang_tempcode('DESCRIPTION_HAVE_DEFAULT_CATALOGUES_HOSTING'), 'have_default_catalogues_hosting', array_key_exists('have_default_catalogues_hosting', $field_defaults) ? $field_defaults['have_default_catalogues_hosting'] == '1' : false));
     }
     $test = $GLOBALS['SITE_DB']->query_value_null_ok('catalogues', 'c_name', array('c_name' => 'projects'));
     if (!is_null($test)) {
         $fields->attach(form_input_tick(do_lang_tempcode('HAVE_DEFAULT_CATALOGUES_PROJECTS'), do_lang_tempcode('DESCRIPTION_HAVE_DEFAULT_CATALOGUES_PROJECTS'), 'have_default_catalogues_projects', array_key_exists('have_default_catalogues_projects', $field_defaults) ? $field_defaults['have_default_catalogues_projects'] == '1' : false));
     }
     $test = $GLOBALS['SITE_DB']->query_value_null_ok('catalogues', 'c_name', array('c_name' => 'faqs'));
     if (!is_null($test)) {
         $fields->attach(form_input_tick(do_lang_tempcode('HAVE_DEFAULT_CATALOGUES_FAQS'), do_lang_tempcode('DESCRIPTION_HAVE_DEFAULT_CATALOGUES_FAQS'), 'have_default_catalogues_faqs', array_key_exists('have_default_catalogues_faqs', $field_defaults) ? $field_defaults['have_default_catalogues_faqs'] == '1' : true));
     }
     $test = $GLOBALS['SITE_DB']->query_value_null_ok('catalogues', 'c_name', array('c_name' => 'links'));
     if (!is_null($test)) {
         $fields->attach(form_input_tick(do_lang_tempcode('HAVE_DEFAULT_CATALOGUES_LINKS'), do_lang_tempcode('DESCRIPTION_HAVE_DEFAULT_CATALOGUES_LINKS'), 'have_default_catalogues_links', array_key_exists('have_default_catalogues_links', $field_defaults) ? $field_defaults['have_default_catalogues_links'] == '1' : true));
     }
     $test = $GLOBALS['SITE_DB']->query_value_null_ok('catalogues', 'c_name', array('c_name' => 'modifications'));
     if (!is_null($test)) {
         $fields->attach(form_input_tick(do_lang_tempcode('HAVE_DEFAULT_CATALOGUES_MODIFICATIONS'), do_lang_tempcode('DESCRIPTION_HAVE_DEFAULT_CATALOGUES_MODIFICATIONS'), 'have_default_catalogues_modifications', array_key_exists('have_default_catalogues_modifications', $field_defaults) ? $field_defaults['have_default_catalogues_modifications'] == '1' : false));
     }
     $test = $GLOBALS['SITE_DB']->query_value_null_ok('catalogues', 'c_name', array('c_name' => 'contacts'));
     if (!is_null($test)) {
         $fields->attach(form_input_tick(do_lang_tempcode('HAVE_DEFAULT_CATALOGUES_CONTACTS'), do_lang_tempcode('DESCRIPTION_HAVE_DEFAULT_CATALOGUES_CONTACTS'), 'have_default_catalogues_contacts', array_key_exists('have_default_catalogues_contacts', $field_defaults) ? $field_defaults['have_default_catalogues_contacts'] == '1' : true));
     }
     return $fields;
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:39,代码来源:catalogues.php

示例2: render_tab

 /**
  * Standard modular render function for profile tabs edit hooks.
  *
  * @param  MEMBER			The ID of the member who is being viewed
  * @param  MEMBER			The ID of the member who is doing the viewing
  * @param  boolean		Whether to leave the tab contents NULL, if tis hook supports it, so that AJAX can load it later
  * @return ?array			A tuple: The tab title, the tab body text (may be blank), the tab fields, extra Javascript (may be blank) the suggested tab order, hidden fields (optional) (NULL: if $leave_to_ajax_if_possible was set)
  */
 function render_tab($member_id_of, $member_id_viewing, $leave_to_ajax_if_possible = false)
 {
     $title = do_lang_tempcode('DELETE_MEMBER');
     $order = 200;
     // Actualiser
     $delete_account = post_param_integer('delete', 0);
     if ($delete_account == 1) {
         if (is_guest($member_id_of)) {
             warn_exit(do_lang_tempcode('INTERNAL_ERROR'));
         }
         ocf_delete_member($member_id_of);
         inform_exit(do_lang_tempcode('SUCCESS'));
     }
     if ($leave_to_ajax_if_possible) {
         return NULL;
     }
     // UI fields
     $username = $GLOBALS['FORUM_DRIVER']->get_username($member_id_of);
     $text = do_lang_tempcode('_DELETE_MEMBER' . ($member_id_of == get_member() ? '_SUICIDAL' : ''), escape_html($username));
     $fields = new ocp_tempcode();
     require_code('form_templates');
     $fields->attach(form_input_tick(do_lang_tempcode('DELETE'), do_lang_tempcode('DESCRIPTION_DELETE'), 'delete', false));
     $javascript = '';
     return array($title, $fields, $text, $javascript, $order);
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:33,代码来源:delete.php

示例3: get_fields

 /**
  * 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;
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:34,代码来源:ocf_forum.php

示例4: get_fields

 /**
  * Standard modular run function for features in the setup wizard.
  *
  * @return tempcode	An input field.
  */
 function get_fields()
 {
     require_lang('wordfilter');
     $fields = new ocp_tempcode();
     $fields->attach(form_input_tick(do_lang_tempcode('KEEP_WORD_FILTER'), do_lang_tempcode('DESCRIPTION_HAVE_DEFAULT_WORDFILTER'), 'have_default_wordfilter', true));
     return $fields;
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:12,代码来源:wordfilter.php

示例5: get_fields

 /**
  * 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 (!addon_installed('galleries')) {
         return new ocp_tempcode();
     }
     require_lang('galleries');
     return form_input_tick(do_lang_tempcode('KEEP_PERSONAL_GALLERIES'), do_lang_tempcode('DESCRIPTION_KEEP_PERSONAL_GALLERIES'), 'keep_personal_galleries', array_key_exists('keep_personal_galleries', $field_defaults) ? $field_defaults['keep_personal_galleries'] == '1' : false);
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:14,代码来源:galleries.php

示例6: get_form_fields

 /**
  * Get tempcode for a forum category template adding/editing form.
  *
  * @param  SHORT_TEXT	The title (name) of the forum category
  * @param  LONG_TEXT		The description for the category
  * @param  BINARY			Whether the category is expanded by default when shown in the forum view
  * @return tempcode		The input fields
  */
 function get_form_fields($title = '', $description = '', $expanded_by_default = 1)
 {
     $fields = new ocp_tempcode();
     $fields->attach(form_input_line(do_lang_tempcode('TITLE'), do_lang_tempcode('DESCRIPTION_TITLE'), 'title', $title, true));
     $fields->attach(form_input_line(do_lang_tempcode('DESCRIPTION'), do_lang_tempcode('DESCRIPTION_DESCRIPTION'), 'description', $description, false));
     $fields->attach(form_input_tick(do_lang_tempcode('EXPANDED_BY_DEFAULT'), do_lang_tempcode('DESCRIPTION_EXPANDED_BY_DEFAULT'), 'expanded_by_default', $expanded_by_default == 1));
     return $fields;
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:16,代码来源:admin_ocf_categories.php

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

示例8: get_syndication_option_fields

 /**
  * 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;
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:15,代码来源:activities.php

示例9: action_done

 /**
  * 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));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:19,代码来源:ocgifts.php

示例10: config

 /**
  * Standard pointstore item configuration function.
  *
  * @return ?array		A tuple: list of [fields to shown, hidden fields], title for add form, add form (NULL: disabled)
  */
 function config()
 {
     $rows = $GLOBALS['SITE_DB']->query_select('pstore_customs', array('*'), NULL, 'ORDER BY id');
     $out = array();
     foreach ($rows as $i => $row) {
         $fields = new ocp_tempcode();
         $hidden = new ocp_tempcode();
         $fields->attach($this->get_fields('_' . strval($i), get_translated_text($row['c_title']), get_translated_text($row['c_description']), $row['c_enabled'], $row['c_cost'], $row['c_one_per_member']));
         $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_custom_' . strval($i), false));
         $hidden->attach(form_input_hidden('custom_' . strval($i), strval($row['id'])));
         $out[] = array($fields, $hidden, do_lang_tempcode('EDIT_CUSTOM_PRODUCT'));
     }
     return array($out, do_lang_tempcode('ADD_NEW_CUSTOM_PRODUCT'), $this->get_fields());
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:20,代码来源:custom.php

示例11: get_fields

 /**
  * 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 (!addon_installed('news')) {
         return new ocp_tempcode();
     }
     require_lang('news');
     $fields = new ocp_tempcode();
     $fields->attach(form_input_tick(do_lang_tempcode('KEEP_BLOGS'), do_lang_tempcode('DESCRIPTION_KEEP_BLOGS'), 'keep_blogs', false));
     $news_cats = $GLOBALS['SITE_DB']->query_select('news_categories', array('id'), array('nc_owner' => NULL));
     foreach ($news_cats as $news_cat) {
         if ($news_cat['id'] > db_get_first_id() && $news_cat['id'] < db_get_first_id() + 7) {
             $fields->attach(form_input_tick(do_lang_tempcode('EXTENDED_NEWS_CATEGORIES_SET'), do_lang_tempcode('DESCRIPTION_KEEP_DEFAULT_NEWS_CATEGORIES'), 'keep_news_categories', array_key_exists('keep_news_categories', $field_defaults) ? $field_defaults['keep_news_categories'] == '1' : false));
             break;
         }
     }
     return $fields;
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:23,代码来源:news.php

示例12: get_fields

 /**
  * 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 (!addon_installed('banners')) {
         return new ocp_tempcode();
     }
     require_lang('banners');
     $fields = new ocp_tempcode();
     $test = $GLOBALS['SITE_DB']->query_value_null_ok('banners', 'name', array('name' => 'donate'));
     if (!is_null($test)) {
         $fields->attach(form_input_tick(do_lang_tempcode('HAVE_DEFAULT_BANNERS_DONATION'), do_lang_tempcode('DESCRIPTION_HAVE_DEFAULT_BANNERS_DONATION'), 'have_default_banners_donation', array_key_exists('have_default_banners_donation', $field_defaults) ? $field_defaults['have_default_banners_donation'] == '1' : false));
     }
     $test = $GLOBALS['SITE_DB']->query_value_null_ok('banners', 'name', array('name' => 'advertise_here'));
     if (!is_null($test)) {
         $fields->attach(form_input_tick(do_lang_tempcode('HAVE_DEFAULT_BANNERS_ADVERTISING'), do_lang_tempcode('DESCRIPTION_HAVE_DEFAULT_BANNERS_ADVERTISING'), 'have_default_banners_advertising', array_key_exists('have_default_banners_advertising', $field_defaults) ? $field_defaults['have_default_banners_advertising'] == '1' : false));
     }
     return $fields;
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:23,代码来源:banners.php

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

示例14: get_form_fields

 /**
  * Get tempcode for adding/editing form.
  *
  * @param  SHORT_TEXT	The name of the custom profile field
  * @param  LONG_TEXT		The description of the field
  * @param  LONG_TEXT		The default value of the field
  * @param  BINARY			Whether the field is publicly viewable
  * @param  BINARY			Whether the field may be viewed by the owner
  * @param  BINARY			Whether the owner may set the value of the field
  * @param  BINARY			Whether the field is encrypted
  * @param  ID_TEXT		The type of the field
  * @set    short_text long_text short_trans long_trans integer upload picture url list tick
  * @param  BINARY			Whether the field is required to be filled in
  * @param  BINARY			Whether the field is to be shown on the join form
  * @param  BINARY			Whether the field is shown in posts
  * @param  BINARY			Whether the field is shown in post previews
  * @param  ?integer		The order the field is given relative to the order of the other custom profile fields (NULL: last)
  * @param  LONG_TEXT  	The usergroups that this field is confined to (comma-separated list).
  * @param  BINARY			Whether the field is locked
  * @return array			A pair: the tempcode for the visible fields, and the tempcode for the hidden fields
  */
 function get_form_fields($name = '', $description = '', $default = '', $public_view = 1, $owner_view = 1, $owner_set = 1, $encrypted = 0, $type = 'long_text', $required = 0, $show_on_join_form = 0, $show_in_posts = 0, $show_in_post_previews = 0, $order = NULL, $only_group = '', $locked = 0)
 {
     $fields = new ocp_tempcode();
     $hidden = new ocp_tempcode();
     require_code('form_templates');
     require_code('encryption');
     require_lang('fields');
     if ($locked == 0) {
         $fields->attach(form_input_line(do_lang_tempcode('NAME'), do_lang_tempcode('DESCRIPTION_NAME'), 'name', $name, true));
     } else {
         $hidden->attach(form_input_hidden('name', $name));
     }
     $fields->attach(form_input_line_comcode(do_lang_tempcode('DESCRIPTION'), do_lang_tempcode('DESCRIPTION_DESCRIPTION'), 'description', $description, false));
     $fields->attach(form_input_line(do_lang_tempcode('DEFAULT_VALUE'), do_lang_tempcode('DESCRIPTION_DEFAULT_VALUE_CPF'), 'default', $default, false, NULL, 10000));
     $fields->attach(form_input_tick(do_lang_tempcode('OWNER_VIEW'), do_lang_tempcode('DESCRIPTION_OWNER_VIEW'), 'owner_view', $owner_view == 1));
     $fields->attach(form_input_tick(do_lang_tempcode('OWNER_SET'), do_lang_tempcode('DESCRIPTION_OWNER_SET'), 'owner_set', $owner_set == 1));
     $fields->attach(form_input_tick(do_lang_tempcode('PUBLIC_VIEW'), do_lang_tempcode('DESCRIPTION_PUBLIC_VIEW'), 'public_view', $public_view == 1));
     if (is_encryption_enabled() && $name == '') {
         $fields->attach(form_input_tick(do_lang_tempcode('ENCRYPTED'), do_lang_tempcode('DESCRIPTION_ENCRYPTED'), 'encrypted', $encrypted == 1));
     }
     require_code('fields');
     $type_list = nice_get_field_type($type, $name != '');
     $fields->attach(form_input_list(do_lang_tempcode('TYPE'), do_lang_tempcode('DESCRIPTION_FIELD_TYPE'), 'type', $type_list));
     $fields->attach(form_input_tick(do_lang_tempcode('REQUIRED'), do_lang_tempcode('DESCRIPTION_REQUIRED'), 'required', $required == 1));
     $fields->attach(form_input_tick(do_lang_tempcode('SHOW_ON_JOIN_FORM'), do_lang_tempcode('DESCRIPTION_SHOW_ON_JOIN_FORM'), 'show_on_join_form', $show_on_join_form == 1));
     $orderlist = new ocp_tempcode();
     $num_cpfs = $GLOBALS['FORUM_DB']->query_value('f_custom_fields', 'COUNT(*)');
     if ($name == '') {
         $num_cpfs++;
     }
     $selected_one = false;
     for ($i = 0; $i < (is_null($order) ? $num_cpfs : max($num_cpfs, $order)); $i++) {
         $selected = $i === $order || $name == '' && $i == $num_cpfs - 1;
         if ($selected) {
             $selected_one = true;
         }
         $orderlist->attach(form_input_list_entry(strval($i), $selected, integer_format($i + 1)));
     }
     if (!$selected_one) {
         $orderlist->attach(form_input_list_entry(strval($order), true, integer_format($order + 1)));
     }
     $fields->attach(form_input_list(do_lang_tempcode('ORDER'), do_lang_tempcode('DESCRIPTION_FIELD_ORDER'), 'order', $orderlist));
     $fields->attach(form_input_tick(do_lang_tempcode('SHOW_IN_POSTS'), do_lang_tempcode('DESCRIPTION_SHOW_IN_POSTS'), 'show_in_posts', $show_in_posts == 1));
     $fields->attach(form_input_tick(do_lang_tempcode('SHOW_IN_POST_PREVIEWS'), do_lang_tempcode('DESCRIPTION_SHOW_IN_POST_PREVIEWS'), 'show_in_post_previews', $show_in_post_previews == 1));
     $rows = $GLOBALS['FORUM_DB']->query_select('f_groups', array('id', 'g_name', 'g_is_super_admin'), array('g_is_private_club' => 0));
     if ($locked == 0) {
         $groups = new ocp_tempcode();
         //$groups=form_input_list_entry('-1',false,do_lang_tempcode('_ALL'));
         foreach ($rows as $group) {
             if ($group['id'] != db_get_first_id()) {
                 $groups->attach(form_input_list_entry(strval($group['id']), count(array_intersect(array($group['id']), explode(',', $only_group))) != 0, get_translated_text($group['g_name'], $GLOBALS['FORUM_DB'])));
             }
         }
         $fields->attach(form_input_multi_list(do_lang_tempcode('GROUP'), do_lang_tempcode('DESCRIPTION_FIELD_ONLY_GROUP'), 'only_group', $groups));
     } else {
         $hidden->attach(form_input_hidden('only_group', ''));
     }
     return array($fields, $hidden);
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:80,代码来源:admin_ocf_customprofilefields.php

示例15: _ed

 /**
  * Interface to edit a test section.
  *
  * @return tempcode	The result of execution.
  */
 function _ed()
 {
     $title = get_page_title('EDIT_TEST_SECTION');
     check_specific_permission('edit_own_tests');
     $id = get_param_integer('id');
     $rows = $GLOBALS['SITE_DB']->query_select('test_sections', array('*'), array('id' => $id), '', 1);
     if (!array_key_exists(0, $rows)) {
         warn_exit('MISSING_RESOURCE');
     }
     $section = $rows[0];
     if (!(has_specific_permission(get_member(), 'edit_own_tests') && ($section['s_assigned_to'] == get_member() || $GLOBALS['FORUM_DRIVER']->is_staff(get_member())))) {
         access_denied('ACCESS_DENIED');
     }
     $fields = $this->get_test_section_form_fields($section['s_section'], $section['s_notes'], $section['s_assigned_to'], $section['s_inheritable']);
     $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));
     $add_template = do_template('TESTER_TEST_GROUP_NEW', array('_GUID' => '3d0e12fdff0aef8f8aa5818e441238ee', 'ID' => 'add_-REPLACEME-', 'FIELDS' => $this->get_test_form_fields('add_-REPLACEME-')));
     $_tests = $GLOBALS['SITE_DB']->query_select('tests', array('*'), array('t_section' => $id));
     $tests = new ocp_tempcode();
     foreach ($_tests as $test) {
         $_fields = $this->get_test_form_fields('edit_' . strval($test['id']), $test['t_test'], $test['t_assigned_to'], $test['t_enabled'], $test['t_inherit_section']);
         $_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'), 'edit_' . strval($test['id']) . '_delete', false));
         $_test = do_template('TESTER_TEST_GROUP', array('_GUID' => '620b45c5ff5bf26417442865e6bcb045', 'ID' => 'edit_' . strval($test['id']), 'FIELDS' => $_fields));
         $tests->attach($_test);
     }
     $post_url = build_url(array('page' => '_SELF', 'type' => '__ed', 'id' => $id), '_SELF');
     return do_template('TESTER_ADD_SECTION_SCREEN', array('_GUID' => 'ee10a568b6dacd8baf1efeac3e7bcb40', 'TITLE' => $title, 'SUBMIT_NAME' => do_lang_tempcode('SAVE'), 'TESTS' => $tests, 'URL' => $post_url, 'FIELDS' => $fields, 'ADD_TEMPLATE' => $add_template));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:34,代码来源:tester.php


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