本文整理汇总了PHP中form_input_tick函数的典型用法代码示例。如果您正苦于以下问题:PHP form_input_tick函数的具体用法?PHP form_input_tick怎么用?PHP form_input_tick使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了form_input_tick函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: _ed
//.........这里部分代码省略.........
}
} else {
$fields = $bits;
$hidden = new ocp_tempcode();
}
// Add in custom fields
if ($this->has_tied_catalogue()) {
require_code('fields');
$fields->attach(do_template('FORM_SCREEN_FIELD_SPACER', array('TITLE' => do_lang_tempcode('MORE'))));
append_form_custom_fields($this->award_type, $id, $fields, $hidden);
}
// SEO?
if (!is_null($this->seo_type)) {
require_code('seo2');
$fields2->attach(seo_get_fields($this->seo_type, $id));
}
// Awards?
if (addon_installed('awards')) {
if (!is_null($this->award_type)) {
require_code('awards');
$fields2->attach(get_award_fields($this->award_type, $id));
}
}
// Action fields / deletion options
$delete_permission = true;
if (!is_null($this->permissions_require)) {
$delete_permission = has_delete_permission($this->permissions_require, get_member(), $submitter, is_null($this->permission_page_name) ? get_page_name() : $this->permission_page_name, array($this->permissions_cat_require, is_null($this->permissions_cat_name) ? NULL : $this->get_cat($id), $this->permissions_cat_require_b, is_null($this->permissions_cat_name_b) ? NULL : $this->get_cat_b($id)));
}
$may_delete = (!method_exists($this, 'may_delete_this') || $this->may_delete_this($id)) && (!is_numeric($id) || intval($id) >= db_get_first_id() + $this->protect_first) && $delete_permission;
// Deletion options
$action_fields = new ocp_tempcode();
if ($may_delete) {
if (!$all_delete_fields_given) {
$action_fields->attach(form_input_tick(do_lang_tempcode('DELETE'), do_lang_tempcode('DESCRIPTION_DELETE'), 'delete', false));
}
if (addon_installed('points') && !is_null($submitter) && !is_null($date_and_time)) {
$points_test = $GLOBALS['SITE_DB']->query_value_null_ok('gifts', 'id', array('date_and_time' => $date_and_time, 'gift_to' => $submitter, 'gift_from' => $GLOBALS['FORUM_DRIVER']->get_guest_id()));
if (!is_null($points_test)) {
require_lang('points');
$action_fields->attach(form_input_tick(do_lang_tempcode('REVERSE_TITLE'), do_lang_tempcode('REVERSE_TITLE_DESCRIPTION'), 'reverse_point_transaction', false));
}
}
$action_fields->attach($delete_fields);
}
if (!$this->appended_actions_already && !$action_fields->is_empty()) {
$fields2->attach(do_template('FORM_SCREEN_FIELD_SPACER', array('TITLE' => do_lang_tempcode('ACTIONS'))));
}
$fields2->attach($action_fields);
if (!is_object($this->edit_text)) {
$this->edit_text = make_string_tempcode(is_null($this->edit_text) ? '' : $this->edit_text);
}
if (!is_null($this->upload)) {
if ($this->upload == 'image') {
require_code('images');
$max = floatval(get_max_image_size()) / floatval(1024 * 1024);
if ($max < 3.0) {
require_code('files2');
$config_url = get_upload_limit_config_url();
$this->edit_text->attach(paragraph(do_lang_tempcode(is_null($config_url) ? 'MAXIMUM_UPLOAD' : 'MAXIMUM_UPLOAD_STAFF', escape_html($max > 10.0 ? integer_format(intval($max)) : float_format($max)), escape_html(is_null($config_url) ? '' : $config_url))));
}
} else {
require_code('files2');
$max = floatval(get_max_file_size()) / floatval(1024 * 1024);
if ($max < 30.0) {
$config_url = get_upload_limit_config_url();
$this->edit_text->attach(paragraph(do_lang_tempcode(is_null($config_url) ? 'MAXIMUM_UPLOAD' : 'MAXIMUM_UPLOAD_STAFF', escape_html($max > 10.0 ? integer_format(intval($max)) : float_format($max)), escape_html(is_null($config_url) ? '' : $config_url))));
开发者ID:erico-deh,项目名称:ocPortal,代码行数:67,代码来源:aed_module.php
示例17: send_gui
//.........这里部分代码省略.........
if (strpos($default->evaluate(), '<html') !== false) {
if ($comcode_given) {
$default = do_template('NEWSLETTER_DEFAULT', array('_GUID' => '53c02947915806e519fe14c318813f46', 'CONTENT' => comcode_to_tempcode($_existing), 'LANG' => $lang));
}
$existing = $default;
} else {
$existing = make_string_tempcode($_existing);
}
}
$post_url = build_url(array('page' => '_SELF', 'type' => 'confirm', 'old_type' => get_param('type', '')), '_SELF');
$submit_name = do_lang_tempcode('PREVIEW');
$hidden = new ocp_tempcode();
$hidden->attach(form_input_hidden('lang', $lang));
// Build up form
$fields = new ocp_tempcode();
require_code('form_templates');
$default_subject = get_option('newsletter_title');
if (!is_null($defaults)) {
$default_subject = $defaults['np_subject'];
}
if ($periodic_action != 'make' && $periodic_action != 'replace') {
$default_subject .= ' - ' . get_timezoned_date(time(), false, false, false, true);
}
$default_subject = post_param('subject', $default_subject);
$fields->attach(form_input_line_comcode(do_lang_tempcode('SUBJECT'), do_lang_tempcode('NEWSLETTER_DESCRIPTION_TITLE', $periodic_subject), 'subject', $default_subject, true));
$in_full = post_param_integer('in_full', 0);
$chosen_categories = post_param('chosen_categories', '');
if ($periodic_action == 'make' || $periodic_action == 'replace') {
// We are making a periodic newsletter. This means we need to pass
// through the chosen categories
if (!is_null($defaults)) {
$chosen_categories = $defaults['np_message'];
$in_full = $defaults['np_in_full'];
$fields->attach(form_input_tick(do_lang_tempcode('EMBED_FULL_ARTICLES'), do_lang_tempcode('DESCRIPTION_EMBED_FULL_ARTICLES'), 'in_full', $in_full == 1));
$fields->attach(form_input_huge(do_lang_tempcode('NEWSLETTER_CONTENT'), do_lang('NEWSLETTER_CONTENT_SELECT'), 'chosen_categories', $chosen_categories, true));
} else {
$hidden->attach(form_input_hidden('chosen_categories', $chosen_categories));
$hidden->attach(form_input_hidden('in_full', strval($in_full)));
}
$hidden->attach(form_input_hidden('cutoff_day', post_param('cutoff_day')));
$hidden->attach(form_input_hidden('cutoff_month', post_param('cutoff_month')));
$hidden->attach(form_input_hidden('cutoff_year', post_param('cutoff_year')));
$hidden->attach(form_input_hidden('cutoff_hour', post_param('cutoff_hour')));
$hidden->attach(form_input_hidden('cutoff_minute', post_param('cutoff_minute')));
$hidden->attach(form_input_hidden('message', $existing->evaluate()));
} else {
$hidden->attach(form_input_hidden('in_full', strval($in_full)));
if (strpos($existing->evaluate(), '<html') === false) {
$fields->attach(form_input_huge_comcode(do_lang_tempcode('MESSAGE'), do_lang_tempcode('DESCRIPTION_MESSAGE_NEWSLETTER'), 'message', $existing->evaluate(), true));
} else {
$fields->attach(form_input_huge(do_lang_tempcode('MESSAGE'), do_lang_tempcode('DESCRIPTION_MESSAGE_NEWSLETTER'), 'message', $existing->evaluate(), true));
}
}
if (addon_installed('calendar') && $periodic_action == 'none' && cron_installed()) {
$fields->attach(form_input_date__scheduler(do_lang_tempcode('DEFER_TIME'), do_lang_tempcode('DESCRIPTION_DEFER_TIME'), 'schedule', true, true, true));
}
$from_email = post_param('from_email', get_option('staff_address'));
if (!is_null($defaults)) {
$from_email = post_param('from_email', $defaults['np_from_email']);
}
$fields->attach(form_input_email(do_lang_tempcode('FROM_EMAIL'), do_lang_tempcode('DESCRIPTION_NEWSLETTER_FROM_EMAIL'), 'from_email', $from_email, true));
$from_name = post_param('from_name', get_site_name());
if (!is_null($defaults)) {
$from_name = post_param('from_name', $defaults['np_from_name']);
}
$fields->attach(form_input_line(do_lang_tempcode('FROM_NAME'), do_lang_tempcode('DESCRIPTION_NEWSLETTER_FROM_NAME'), 'from_name', $from_name, true));
开发者ID:erico-deh,项目名称:ocPortal,代码行数:67,代码来源:admin_newsletter.php
示例18: gui2
//.........这里部分代码省略.........
//test string just for Apple mail detection
$test_unicode = utf8_decode(mb_convert_encoding($csv_header_line_fields[0], "UTF-
|
请发表评论