本文整理汇总了PHP中form_input_line函数的典型用法代码示例。如果您正苦于以下问题:PHP form_input_line函数的具体用法?PHP form_input_line怎么用?PHP form_input_line使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了form_input_line函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
/**
* Standard modular run function.
*
* @return tempcode The result of execution.
*/
function run()
{
require_lang('bulkupload');
$GLOBALS['HELPER_PANEL_PIC'] = 'pagepics/bulkuploadassistant';
$GLOBALS['HELPER_PANEL_TUTORIAL'] = 'tut_adv_comcode';
$GLOBALS['HELPER_PANEL_TEXT'] = comcode_lang_string('DOC_BULK_UPLOAD');
$title = get_page_title('BULK_UPLOAD');
$parameter = post_param('parameter', '');
require_code('form_templates');
if ($parameter == '') {
$post_url = build_url(array('page' => '_SELF'), '_SELF');
$text = paragraph(do_lang_tempcode('BULK_UPLOAD_HELP'));
$submit_name = do_lang_tempcode('BULK_UPLOAD');
$fields = form_input_line(do_lang_tempcode('DIRECTORY'), do_lang_tempcode('DIRECTORY_BULK'), 'parameter', 'uploads/attachments/' . date('Y-m-d', utctime_to_usertime()), true);
return do_template('FORM_SCREEN', array('_GUID' => '77a2ca460745145d8a1d18cf24971fea', 'SKIP_VALIDATION' => true, 'HIDDEN' => '', 'FIELDS' => $fields, 'URL' => $post_url, 'TITLE' => $title, 'TEXT' => $text, 'SUBMIT_NAME' => $submit_name));
} else {
breadcrumb_set_parents(array(array('_SELF:_SELF:misc', do_lang_tempcode('BULK_UPLOAD'))));
breadcrumb_set_self(do_lang_tempcode('_RESULTS'));
$out = $this->do_dir(get_custom_file_base() . '/' . filter_naughty($parameter, true));
if ($out->is_empty()) {
inform_exit(do_lang_tempcode('NO_FILES'));
}
return do_template('BULK_HELPER_RESULTS_SCREEN', array('_GUID' => '5d373553cf21a58f15006bd4e600a9ee', 'TITLE' => $title, 'RESULTS' => $out));
}
}
示例2: 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;
}
示例3: 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;
}
示例4: get_fields
/**
* Get fields for adding/editing one of these.
*
* @param string What to place onto the end of the field name
* @param SHORT_TEXT Title
* @param LONG_TEXT Description
* @param BINARY Whether it is enabled
* @param ?integer The cost in points (NULL: not set)
* @param BINARY Whether it is restricted to one per member
* @return tempcode The fields
*/
function get_fields($name_suffix = '', $title = '', $description = '', $enabled = 1, $cost = NULL, $one_per_member = 0)
{
require_lang('points');
$fields = new ocp_tempcode();
$fields->attach(form_input_line(do_lang_tempcode('TITLE'), do_lang_tempcode('DESCRIPTION_TITLE'), 'custom_title' . $name_suffix, $title, true));
$fields->attach(form_input_text(do_lang_tempcode('DESCRIPTION'), do_lang_tempcode('DESCRIPTION_DESCRIPTION'), 'custom_description' . $name_suffix, $description, true));
$fields->attach(form_input_integer(do_lang_tempcode('COST'), do_lang_tempcode('HOW_MUCH_THIS_COSTS'), 'custom_cost' . $name_suffix, $cost, true));
$fields->attach(form_input_tick(do_lang_tempcode('ONE_PER_MEMBER'), do_lang_tempcode('DESCRIPTION_ONE_PER_MEMBER'), 'custom_one_per_member' . $name_suffix, $one_per_member == 1));
$fields->attach(form_input_tick(do_lang_tempcode('ENABLED'), '', 'custom_enabled' . $name_suffix, $enabled == 1));
return $fields;
}
示例5: seo_get_fields
/**
* Get template fields to insert into a form page, for manipulation of seo fields.
*
* @param ID_TEXT The type of resource (e.g. download)
* @param ?ID_TEXT The ID of the resource (NULL: adding)
* @return tempcode Form page tempcode fragment
*/
function seo_get_fields($type, $id = NULL)
{
require_code('form_templates');
if (is_null($id)) {
list($keywords, $description) = array('', '');
} else {
list($keywords, $description) = seo_meta_get_for($type, $id);
}
$fields = new ocp_tempcode();
if (get_value('disable_seo') !== '1' && (get_value('disable_seo') !== '2' || !is_null($id))) {
$fields->attach(do_template('FORM_SCREEN_FIELD_SPACER', array('SECTION_HIDDEN' => $keywords == '' && $description == '', 'TITLE' => do_lang_tempcode('SEO'), 'HELP' => get_option('show_docs') === '0' ? NULL : protect_from_escaping(symbol_tempcode('URLISE_LANG', array(do_lang('TUTORIAL_ON_THIS'), brand_base_url() . '/docs' . strval(ocp_version()) . '/pg/tut_seo', 'tut_seo', '1'))))));
$fields->attach(form_input_line_multi(do_lang_tempcode('KEYWORDS'), do_lang_tempcode('DESCRIPTION_META_KEYWORDS'), 'meta_keywords[]', array_map('trim', explode(',', preg_replace('#,+#', ',', $keywords))), 0));
$fields->attach(form_input_line(do_lang_tempcode('META_DESCRIPTION'), do_lang_tempcode('DESCRIPTION_META_DESCRIPTION'), 'meta_description', $description, false));
}
return $fields;
}
示例6: feedback_fields
/**
* Get the tempcode for the manipulation of the feedback fields for some content, if they are enabled in the Admin Zone.
*
* @param boolean Whether rating is currently/by-default allowed for this resource
* @param boolean Whether comments are currently/by-default allowed for this resource
* @param ?boolean Whether trackbacks are currently/by-default allowed for this resource (NULL: this resource does not support trackbacks regardless)
* @param boolean Whether we're allowed to send trackbacks for this resource
* @param LONG_TEXT The current/by-default notes for this content
* @param ?boolean Whether reviews are currently/by-default allowed for this resource (NULL: no reviews allowed here)
* @param boolean Whether the default values for the allow options is actually off (this determines how the tray auto-hides itself)
* @return tempcode The feedback editing fields
*/
function feedback_fields($allow_rating, $allow_comments, $allow_trackbacks, $send_trackbacks, $notes, $allow_reviews = NULL, $default_off = false)
{
if (get_value('disable_feedback') === '1') {
return new ocp_tempcode();
}
require_code('feedback');
require_code('form_templates');
$fields = new ocp_tempcode();
if ($send_trackbacks && get_option('is_on_trackbacks') == '1') {
require_lang('trackbacks');
$fields->attach(form_input_line(do_lang_tempcode('SEND_TRACKBACKS'), do_lang_tempcode('DESCRIPTION_SEND_TRACKBACKS'), 'send_trackbacks', get_param('trackback', ''), false));
}
if (get_option('is_on_rating') == '1') {
$fields->attach(form_input_tick(do_lang_tempcode('ALLOW_RATING'), do_lang_tempcode('DESCRIPTION_ALLOW_RATING'), 'allow_rating', $allow_rating));
}
if (get_option('is_on_comments') == '1') {
if (!is_null($allow_reviews)) {
$choices = new ocp_tempcode();
$choices->attach(form_input_list_entry('0', !$allow_comments && !$allow_reviews, do_lang('NO')));
$choices->attach(form_input_list_entry('1', $allow_comments && !$allow_reviews, do_lang('ALLOW_COMMENTS_ONLY')));
$choices->attach(form_input_list_entry('2', $allow_reviews, do_lang('ALLOW_REVIEWS')));
$fields->attach(form_input_list(do_lang_tempcode('ALLOW_COMMENTS'), do_lang_tempcode('DESCRIPTION_ALLOW_COMMENTS'), 'allow_comments', $choices, NULL, false, false));
} else {
$fields->attach(form_input_tick(do_lang_tempcode('ALLOW_COMMENTS'), do_lang_tempcode('DESCRIPTION_ALLOW_COMMENTS'), 'allow_comments', $allow_comments));
}
}
if (get_option('is_on_trackbacks') == '1' && !is_null($allow_trackbacks)) {
require_lang('trackbacks');
$fields->attach(form_input_tick(do_lang_tempcode('ALLOW_TRACKBACKS'), do_lang_tempcode('DESCRIPTION_ALLOW_TRACKBACKS'), 'allow_trackbacks', $allow_trackbacks));
}
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 (!$fields->is_empty()) {
if ($default_off) {
$section_hidden = $notes == '' && !$allow_comments && (is_null($allow_trackbacks) || !$allow_trackbacks) && !$allow_rating;
} else {
$section_hidden = $notes == '' && $allow_comments && (is_null($allow_trackbacks) || $allow_trackbacks || get_option('is_on_trackbacks') == '0') && $allow_rating;
}
$_fields = do_template('FORM_SCREEN_FIELD_SPACER', array('SECTION_HIDDEN' => $section_hidden, 'TITLE' => do_lang_tempcode(get_value('disable_staff_notes') !== '1' ? 'FEEDBACK_AND_NOTES' : '_FEEDBACK')));
$_fields->attach($fields);
$fields = $_fields;
}
return $fields;
}
示例7: 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('PHOTO');
$order = 30;
// Actualiser
if (post_param_integer('submitting_photo_tab', 0) == 1) {
require_code('ocf_members_action');
require_code('ocf_members_action2');
ocf_member_choose_photo('photo_url', 'photo_file', $member_id_of);
attach_message(do_lang_tempcode('SUCCESS_SAVE'), 'inform');
}
if ($leave_to_ajax_if_possible) {
return NULL;
}
$photo_url = $GLOBALS['FORUM_DRIVER']->get_member_row_field($member_id_of, 'm_photo_url');
$thumb_url = $GLOBALS['FORUM_DRIVER']->get_member_row_field($member_id_of, 'm_photo_thumb_url');
// UI fields
$fields = new ocp_tempcode();
require_code('form_templates');
$fields->attach(form_input_upload(do_lang_tempcode('UPLOAD'), do_lang_tempcode('DESCRIPTION_UPLOAD'), 'photo_file', false, NULL, NULL, true, str_replace(' ', '', get_option('valid_images'))));
$fields->attach(form_input_line(do_lang_tempcode('ALT_FIELD', do_lang_tempcode('URL')), do_lang_tempcode('DESCRIPTION_ALTERNATE_URL'), 'photo_url', $photo_url, false));
if (get_option('is_on_gd') == '0' || !function_exists('imagetypes')) {
$thumb_width = get_option('thumb_width');
$fields->attach(form_input_upload(do_lang_tempcode('THUMBNAIL'), do_lang_tempcode('DESCRIPTION_THUMBNAIL', escape_html($thumb_width)), 'photo_file2', false, NULL, NULL, true, str_replace(' ', '', get_option('valid_images'))));
$fields->attach(form_input_line(do_lang_tempcode('ALT_FIELD', do_lang_tempcode('URL')), do_lang_tempcode('DESCRIPTION_ALTERNATE_URL'), 'photo_thumb_url', $thumb_url, false));
}
$hidden = new ocp_tempcode();
handle_max_file_size($hidden, 'image');
$hidden->attach(form_input_hidden('submitting_photo_tab', '1'));
$text = new ocp_tempcode();
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();
$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)), is_null($config_url) ? '' : escape_html($config_url))));
}
$text = do_template('OCF_EDIT_PHOTO_TAB', array('TEXT' => $text, 'MEMBER_ID' => strval($member_id_of), 'USERNAME' => $GLOBALS['FORUM_DRIVER']->get_username($member_id_of), 'PHOTO' => $GLOBALS['FORUM_DRIVER']->get_member_photo_url($member_id_of)));
$javascript = '';
return array($title, $fields, $text, $javascript, $order, $hidden);
}
示例8: 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('MEMBER_TITLE');
$order = 50;
// Actualiser
$_title = post_param('member_title', NULL);
if ($_title !== NULL) {
require_code('ocf_members_action');
require_code('ocf_members_action2');
ocf_member_choose_title($_title, $member_id_of);
attach_message(do_lang_tempcode('SUCCESS_SAVE'), 'inform');
}
if ($leave_to_ajax_if_possible) {
return NULL;
}
// UI fields
$fields = new ocp_tempcode();
$_title = $GLOBALS['FORUM_DRIVER']->get_member_row_field($member_id_of, 'm_title');
require_code('form_templates');
$fields->attach(form_input_line(do_lang_tempcode('MEMBER_TITLE'), '', 'member_title', $_title, false, NULL, intval(get_option('max_member_title_length'))));
$text = do_lang_tempcode('DESCRIPTION_MEMBER_TITLE', escape_html($GLOBALS['FORUM_DRIVER']->get_username($member_id_of)));
$javascript = '';
return array($title, $fields, $text, $javascript, $order);
}
示例9: choose_lang
/**
* The UI to choose a language.
*
* @param tempcode The title to show when choosing a language
* @param boolean Whether to also choose a language file
* @param boolean Whether the user may add a language
* @param mixed Text message to show (Tempcode or string)
* @param boolean Whether to provide an N/A choice
* @param ID_TEXT The name of the parameter for specifying language
* @return tempcode The UI
*/
function choose_lang($title, $choose_lang_file = false, $add_lang = false, $text = '', $provide_na = true, $param_name = 'lang')
{
$GLOBALS['HELPER_PANEL_PIC'] = 'pagepics/language';
$GLOBALS['HELPER_PANEL_TUTORIAL'] = 'tut_intl';
require_code('form_templates');
$langs = new ocp_tempcode();
if ($provide_na) {
$langs->attach(form_input_list_entry('', false, do_lang_tempcode('NA')));
}
$langs->attach(nice_get_langs(NULL, $add_lang));
$fields = form_input_list(do_lang_tempcode('LANGUAGE'), do_lang_tempcode('DESCRIPTION_LANGUAGE'), $param_name, $langs, NULL, false, false);
$javascript = '';
if ($add_lang) {
$fields->attach(form_input_codename(do_lang_tempcode('ALT_FIELD', do_lang_tempcode('LANGUAGE')), do_lang_tempcode('DESCRIPTION_NEW_LANG'), 'lang_new', '', false));
$javascript .= 'standardAlternateFields(\'lang\',\'lang_new\');';
}
if ($choose_lang_file) {
$lang_files = new ocp_tempcode();
$lang_files->attach(form_input_list_entry('', false, do_lang_tempcode('NA_EM')));
$lang_files->attach(nice_get_lang_files());
$fields->attach(form_input_list(do_lang_tempcode('LANGUAGE_FILE'), do_lang_tempcode('DESCRIPTION_LANGUAGE_FILE'), 'lang_file', $lang_files, NULL, true));
$fields->attach(form_input_line(do_lang_tempcode('ALT_FIELD', do_lang('SEARCH')), '', 'search', '', false));
$javascript .= 'standardAlternateFields(\'lang_file\',\'search\');';
}
$post_url = get_self_url(false, false, NULL, false, true);
return do_template('FORM_SCREEN', array('_GUID' => 'ee6bdea3661cb4736173cac818a769e5', 'GET' => true, 'SKIP_VALIDATION' => true, 'HIDDEN' => '', 'SUBMIT_NAME' => do_lang_tempcode('CHOOSE'), 'TITLE' => $title, 'FIELDS' => $fields, 'URL' => $post_url, 'TEXT' => $text, 'JAVASCRIPT' => $javascript));
}
示例10: get_form_fields
/**
* Get tempcode for adding/editing form.
*
* @param SHORT_TEXT The title
* @param LONG_TEXT The description
* @return tempcode The input fields
*/
function get_form_fields($title = '', $description = '')
{
$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_text(do_lang_tempcode('DESCRIPTION'), do_lang_tempcode('DESCRIPTION_DESCRIPTION'), 'description', $description, true));
return $fields;
}
示例11: module_do_gui
//.........这里部分代码省略.........
}
// Find all files in the incoming directory
$handle = opendir(get_custom_file_base() . '/uploads/filedump' . $place);
$i = 0;
$filename = array();
$description = array();
$filesize = array();
$filetime = array();
$directory = array();
$deletable = array();
while (false !== ($file = readdir($handle))) {
if (!should_ignore_file('uploads/filedump' . $place . $file, IGNORE_ACCESS_CONTROLLERS | IGNORE_HIDDEN_FILES)) {
$directory[$i] = !is_file(get_custom_file_base() . '/uploads/filedump' . $place . $file);
$filename[$i] = $directory[$i] ? $file . '/' : $file;
if ($directory[$i]) {
$filesize[$i] = do_lang_tempcode('NA_EM');
}
$dbrows = $GLOBALS['SITE_DB']->query_select('filedump', array('description', 'the_member'), array('name' => $file, 'path' => $place));
if (!array_key_exists(0, $dbrows)) {
$description[$i] = $directory[$i] ? do_lang_tempcode('NA_EM') : do_lang_tempcode('NONE_EM');
} else {
$description[$i] = make_string_tempcode(escape_html(get_translated_text($dbrows[0]['description'])));
}
if ($description[$i]->is_empty()) {
$description[$i] = do_lang_tempcode('NONE_EM');
}
$deletable[$i] = array_key_exists(0, $dbrows) && $dbrows[0]['the_member'] == get_member() || has_specific_permission(get_member(), 'delete_anything_filedump');
if ($directory[$i]) {
$size = get_directory_size(get_custom_file_base() . '/uploads/filedump' . $place . $file);
$timestamp = NULL;
} else {
$size = filesize(get_custom_file_base() . '/uploads/filedump' . $place . $file);
$timestamp = filemtime(get_custom_file_base() . '/uploads/filedump' . $place . $file);
}
$filesize[$i] = clean_file_size($size);
$filetime[$i] = is_null($timestamp) ? NULL : get_timezoned_date($timestamp);
$i++;
}
}
closedir($handle);
if ($i != 0) {
require_code('templates_table_table');
$header_row = table_table_header_row(array(do_lang_tempcode('FILENAME'), do_lang_tempcode('DESCRIPTION'), do_lang_tempcode('SIZE'), do_lang_tempcode('DATE_TIME'), do_lang_tempcode('ACTIONS')));
$rows = new ocp_tempcode();
for ($a = 0; $a < $i; $a++) {
if ($directory[$a]) {
$link = build_url(array('page' => '_SELF', 'place' => $place . $filename[$a]), '_SELF');
} else {
$link = make_string_tempcode(get_custom_base_url() . '/uploads/filedump' . str_replace('%2F', '/', rawurlencode($place . $filename[$a])));
}
if (!$directory[$a]) {
if ($deletable[$a]) {
$delete_url = build_url(array('page' => '_SELF', 'type' => 'ed', 'file' => $filename[$a], 'place' => $place), '_SELF');
$actions = do_template('TABLE_TABLE_ACTION_DELETE_ENTRY', array('_GUID' => '9b91e485d80417b1664145f9bca5a2f5', 'NAME' => $filename[$a], 'URL' => $delete_url));
} else {
$actions = new ocp_tempcode();
}
} else {
$delete_url = build_url(array('page' => '_SELF', 'type' => 'ec', 'file' => $filename[$a], 'place' => $place), '_SELF');
$actions = do_template('TABLE_TABLE_ACTION_DELETE_CATEGORY', array('_GUID' => '0fa7d4090c6195328191399a14799169', 'NAME' => $filename[$a], 'URL' => $delete_url));
}
$rows->attach(table_table_row(array(hyperlink($link, escape_html($filename[$a]), !$directory[$a]), escape_html($description[$a]), escape_html($filesize[$a]), is_null($filetime[$a]) ? do_lang_tempcode('NA') : make_string_tempcode(escape_html($filetime[$a])), $actions)));
}
$files = do_template('TABLE_TABLE', array('_GUID' => '1c0a91d47c5fc8a7c2b35c7d9b36132f', 'HEADER_ROW' => $header_row, 'ROWS' => $rows));
} else {
$files = new ocp_tempcode();
}
// Do a form so people can upload their own stuff
if (has_specific_permission(get_member(), 'upload_filedump')) {
$post_url = build_url(array('page' => '_SELF', 'type' => 'ad', 'uploading' => 1), '_SELF');
$submit_name = do_lang_tempcode('FILEDUMP_UPLOAD');
$max = floatval(get_max_file_size());
$text = new ocp_tempcode();
if ($max < 30.0) {
$config_url = get_upload_limit_config_url();
$text->attach(do_lang_tempcode(is_null($config_url) ? 'MAXIMUM_UPLOAD' : 'MAXIMUM_UPLOAD_STAFF', escape_html($max > 10.0 ? integer_format(intval($max)) : float_format($max / 1024.0 / 1024.0)), escape_html(is_null($config_url) ? '' : $config_url)));
}
require_code('form_templates');
$fields = form_input_upload(do_lang_tempcode('UPLOAD'), do_lang_tempcode('_DESCRIPTION_UPLOAD'), 'file', true);
$fields->attach(form_input_line(do_lang_tempcode('DESCRIPTION'), do_lang_tempcode('DESCRIPTION_DESCRIPTION'), 'description', '', false));
$hidden = new ocp_tempcode();
$hidden->attach(form_input_hidden('place', $place));
handle_max_file_size($hidden);
$upload_form = do_template('FORM', array('TABINDEX' => strval(get_form_field_tabindex()), 'SKIP_REQUIRED' => true, 'HIDDEN' => $hidden, 'TEXT' => $text, 'FIELDS' => $fields, 'SUBMIT_NAME' => $submit_name, 'URL' => $post_url));
} else {
$upload_form = new ocp_tempcode();
}
// Do a form so people can make folders
if (get_option('is_on_folder_create') == '1') {
$post_url = build_url(array('page' => '_SELF', 'type' => 'ac'), '_SELF');
require_code('form_templates');
$fields = form_input_line(do_lang_tempcode('NAME'), do_lang_tempcode('DESCRIPTION_NAME'), 'name', '', true);
$hidden = form_input_hidden('place', $place);
$submit_name = do_lang_tempcode('FILEDUMP_CREATE_FOLDER');
$create_folder_form = do_template('FORM', array('_GUID' => '043f9b595d3699b7d8cd7f2284cdaf98', 'TABINDEX' => strval(get_form_field_tabindex()), 'SKIP_REQUIRED' => true, 'SECONDARY_FORM' => true, 'HIDDEN' => $hidden, 'TEXT' => '', 'FIELDS' => $fields, 'SUBMIT_NAME' => $submit_name, 'URL' => $post_url));
} else {
$create_folder_form = new ocp_tempcode();
}
return do_template('FILE_DUMP_SCREEN', array('_GUID' => '3f49a8277a11f543eff6488622949c84', 'TITLE' => $title, 'PLACE' => $place, 'FILES' => $files, 'UPLOAD_FORM' => $upload_form, 'CREATE_FOLDER_FORM' => $create_folder_form));
}
示例12: get_form_fields
function get_form_fields($id = NULL, $name = '', $category = '', $image = '', $price = 10, $enabled = 1)
{
$fields = new ocp_tempcode();
$hidden = new ocp_tempcode();
require_code('form_templates');
$fields->attach(form_input_line(do_lang_tempcode('GIFT'), do_lang_tempcode('DESCRIPTION_GIFT'), 'name', $name, true));
$fields->attach(form_input_line(do_lang_tempcode('CATEGORY'), do_lang_tempcode('DESCRIPTION_GIFT_CATEGORY'), 'category', $category, true));
$fields->attach(form_input_upload(do_lang_tempcode('IMAGE'), do_lang_tempcode('DESCRIPTION_UPLOAD'), 'image', false, NULL, NULL, true, str_replace(' ', '', get_option('valid_images'))));
$fields->attach(form_input_line(do_lang_tempcode('ALT_FIELD', do_lang_tempcode('URL')), do_lang_tempcode('DESCRIPTION_ALTERNATE_URL'), 'url', $image, false));
handle_max_file_size($hidden, 'image');
$fields->attach(form_input_line(do_lang_tempcode('PRICE'), '', 'price', strval($price), true));
$fields->attach(form_input_tick(do_lang_tempcode('GIFT_ENABLED'), do_lang_tempcode('DESCRIPTION_GIFT_ENABLED'), 'enabled', $enabled == 1));
return array($fields, $hidden);
}
示例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));
}
示例14: decline
/**
* The actualiser to decline a members joining of a usergroup.
*
* @return tempcode The UI
*/
function decline()
{
$title = get_page_title('DECLINE_FROM_GROUP');
$id = post_param_integer('id', NULL);
if (is_null($id)) {
$id = get_param_integer('id');
require_code('form_templates');
$text = paragraph(do_lang_tempcode('OPTIONAL_REASON'));
$submit_name = do_lang_tempcode('DECLINE_FROM_GROUP');
$post_url = build_url(array('page' => '_SELF', 'type' => get_param('type')), '_SELF', NULL, true);
$fields = new ocp_tempcode();
$hidden = form_input_hidden('id', strval($id));
$fields->attach(form_input_line(do_lang_tempcode('REASON'), '', 'reason', '', false));
return do_template('FORM_SCREEN', array('SKIP_VALIDATION' => true, 'HIDDEN' => $hidden, 'TITLE' => $title, 'TEXT' => $text, 'URL' => $post_url, 'FIELDS' => $fields, 'SUBMIT_NAME' => $submit_name));
}
if (!ocf_may_control_group($id, get_member())) {
access_denied('I_ERROR');
}
$member_id = get_param_integer('member_id');
ocf_member_validate_into_group($id, $member_id, true, post_param('reason'));
$url = build_url(array('page' => '_SELF', 'type' => 'view', 'id' => $id), '_SELF');
return redirect_screen($title, $url, do_lang_tempcode('SUCCESS'));
}
示例15: misc
/**
* The UI for managing super debranding.
*
* @return tempcode The UI
*/
function misc()
{
$title = get_page_title('SUPER_DEBRAND');
require_code('form_templates');
$rebrand_name = get_value('rebrand_name');
if (is_null($rebrand_name)) {
$rebrand_name = 'ocPortal';
}
$rebrand_base_url = get_value('rebrand_base_url');
if (is_null($rebrand_base_url)) {
$rebrand_base_url = 'http://ocportal.com';
}
$company_name = get_value('company_name');
if (is_null($company_name)) {
$company_name = 'ocProducts';
}
$keyboard_map = file_exists(get_file_base() . '/pages/comcode/' . get_site_default_lang() . '/keymap.txt') ? file_get_contents(get_file_base() . '/pages/comcode/' . get_site_default_lang() . '/keymap.txt') : file_get_contents(get_file_base() . '/pages/comcode/' . fallback_lang() . '/keymap.txt');
if (file_exists(get_file_base() . '/pages/comcode_custom/' . get_site_default_lang() . '/keymap.txt')) {
$keyboard_map = file_get_contents(get_file_base() . '/pages/comcode_custom/' . get_site_default_lang() . '/keymap.txt');
}
if (file_exists(get_file_base() . '/adminzone/pages/comcode_custom/' . get_site_default_lang() . '/website.txt')) {
$adminguide = file_get_contents(get_file_base() . '/adminzone/pages/comcode_custom/' . get_site_default_lang() . '/website.txt');
} else {
$adminguide = do_lang('ADMINGUIDE_DEFAULT_TRAINING');
}
if (file_exists(get_file_base() . '/adminzone/pages/comcode_custom/' . get_site_default_lang() . '/start.txt')) {
$start_page = file_get_contents(get_file_base() . '/adminzone/pages/comcode_custom/' . get_site_default_lang() . '/start.txt');
} elseif (file_exists(get_file_base() . '/adminzone/pages/comcode/' . get_site_default_lang() . '/start.txt')) {
$start_page = file_exists(get_file_base() . '/adminzone/pages/comcode/' . get_site_default_lang() . '/start.txt') ? file_get_contents(get_file_base() . '/adminzone/pages/comcode/' . get_site_default_lang() . '/start.txt') : file_get_contents(get_file_base() . '/adminzone/pages/comcode/' . fallback_lang() . '/start.txt');
} else {
$start_page = do_lang('REBRAND_FRONT_PAGE');
}
$fields = new ocp_tempcode();
$fields->attach(form_input_line(do_lang_tempcode('REBRAND_NAME'), do_lang_tempcode('DESCRIPTION_REBRAND_NAME'), 'rebrand_name', $rebrand_name, true));
$fields->attach(form_input_line(do_lang_tempcode('REBRAND_BASE_URL'), do_lang_tempcode('DESCRIPTION_BRAND_BASE_URL', escape_html('docs' . strval(ocp_version()))), 'rebrand_base_url', $rebrand_base_url, true));
$fields->attach(form_input_line(do_lang_tempcode('COMPANY_NAME'), '', 'company_name', $company_name, true));
$fields->attach(form_input_text_comcode(do_lang_tempcode('ADMINGUIDE'), do_lang_tempcode('DESCRIPTION_ADMINGUIDE'), 'adminguide', $adminguide, true));
$fields->attach(form_input_text_comcode(do_lang_tempcode('ADMINSTART_PAGE'), do_lang_tempcode('DESCRIPTION_ADMINSTART_PAGE'), 'start_page', $start_page, true));
$fields->attach(form_input_text_comcode(do_lang_tempcode('KEYBOARD_MAP'), '', 'keyboard_map', $keyboard_map, true));
$fields->attach(form_input_tick(do_lang_tempcode('DELETE_UN_PC'), do_lang_tempcode('DESCRIPTION_DELETE_UN_PC'), 'churchy', false));
$fields->attach(form_input_tick(do_lang_tempcode('SHOW_DOCS'), do_lang_tempcode('DESCRIPTION_SHOW_DOCS'), 'show_docs', get_option('show_docs') == '1'));
$fields->attach(form_input_upload(do_lang_tempcode('FAVICON'), do_lang_tempcode('DESCRIPTION_FAVICON'), 'favicon', false, find_theme_image('favicon'), NULL, true, str_replace(' ', '', get_option('valid_images'))));
$fields->attach(form_input_upload(do_lang_tempcode('APPLEICON'), do_lang_tempcode('DESCRIPTION_APPLEICON'), 'appleicon', false, find_theme_image('appleicon'), NULL, true, str_replace(' ', '', get_option('valid_images'))));
if (addon_installed('ocf_avatars')) {
$fields->attach(form_input_upload(do_lang_tempcode('SYSTEM_AVATAR'), do_lang_tempcode('DESCRIPTION_SYSTEM_AVATAR'), 'system_avatar', false, find_theme_image('ocf_default_avatars/default_set/ocp_fanatic'), NULL, true, str_replace(' ', '', get_option('valid_images'))));
}
$post_url = build_url(array('page' => '_SELF', 'type' => 'actual'), '_SELF');
$submit_name = do_lang_tempcode('SUPER_DEBRAND');
return do_template('FORM_SCREEN', array('HIDDEN' => '', 'TITLE' => $title, 'URL' => $post_url, 'FIELDS' => $fields, 'TEXT' => do_lang_tempcode('WARNING_SUPER_DEBRAND_MAJOR_CHANGES'), 'SUBMIT_NAME' => $submit_name));
}