/** * 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; }
/** * 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; }
function form_input_text_search($name, $value = false, $width = false, $maxchars = false, $type = SEARCH_LOGON, $allow_multi = false, $custom_html = false, $class = '') { $type = $type == SEARCH_LOGON ? 'search_logon' : 'search_thread'; $classes = array($class, $type, 'search_input'); if ($allow_multi) { $classes[] = 'allow_multi'; } if (!in_array($type, array(SEARCH_LOGON, SEARCH_THREAD))) { $type = SEARCH_LOGON; } return form_input_text($name, $value, $width, $maxchars, $custom_html, implode(' ', $classes)); }
/** * 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)); }
echo " <table class=\"posthead\" width=\"95%\">\n"; echo " <tr>\n"; echo " <td align=\"left\" style=\"white-space: nowrap\">", gettext("Move to"), ":</td>\n"; echo " <td align=\"left\">", links_folder_dropdown($link['FID'], $folders), "</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\" style=\"white-space: nowrap\">", gettext("Edit name"), ":</td>\n"; echo " <td align=\"left\">", form_input_text("title", htmlentities_array($link['TITLE']), 40, 64), "</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\" style=\"white-space: nowrap\">", gettext("Edit address"), ":</td>\n"; echo " <td align=\"left\">", form_input_text("uri", htmlentities_array($link['URI']), 45, 255), "</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\" style=\"white-space: nowrap\">", gettext("Edit description"), ":</td>\n"; echo " <td align=\"left\">", form_input_text("description", htmlentities_array($link['DESCRIPTION']), 60), "</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\"> </td>\n"; echo " <td align=\"left\">", form_checkbox("delete", "confirm", gettext("Delete")), " ", form_checkbox("hide", "confirm", gettext("hide"), isset($link['VISIBLE']) && $link['VISIBLE'] == 'N'), "</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\" colspan=\"2\"> </td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " </td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " </td>\n"; echo " </tr>\n"; echo " </table>\n";
form_input_text('Min seconds between submissions', $challenge['min_seconds_between_submissions']); $opts = db_query_fetch_all('SELECT * FROM categories ORDER BY title'); form_select($opts, 'Category', 'id', $challenge['category'], 'title'); $opts = db_query_fetch_all(' SELECT ch.id, ch.title, ca.title AS category FROM challenges AS ch LEFT JOIN categories AS ca ON ca.id = ch.category ORDER BY ca.title, ch.title'); array_unshift($opts, array('id' => 0, 'title' => '-- User must solve selected challenge before revealing this one --')); form_select($opts, 'Relies on', 'id', $challenge['relies_on'], 'title', 'category'); form_input_checkbox('Exposed', $challenge['exposed']); form_input_text('Available from', date_time($challenge['available_from'])); form_input_text('Available until', date_time($challenge['available_until'])); form_hidden('action', 'edit'); form_hidden('id', $_GET['id']); form_button_submit('Save changes'); form_end(); section_subhead('Files'); echo ' <table id="files" class="table table-striped table-hover"> <thead> <tr> <th>Filename</th> <th>Size</th> <th>Added</th> <th>Manage</th> </tr> </thead>
<?php require '../../include/ctf.inc.php'; enforce_authentication(CONST_USER_CLASS_MODERATOR); validate_id($_GET['id']); $category = db_select_one('categories', array('*'), array('id' => $_GET['id'])); head('Site management'); menu_management(); section_subhead('Edit category: ' . $category['title']); form_start(CONFIG_SITE_ADMIN_RELPATH . 'actions/edit_category'); form_input_text('Title', $category['title']); form_textarea('Description', $category['description']); form_input_checkbox('Exposed', $category['exposed']); form_input_text('Available from', date_time($category['available_from'])); form_input_text('Available until', date_time($category['available_until'])); form_hidden('action', 'edit'); form_hidden('id', $_GET['id']); form_button_submit('Save changes'); form_end(); section_subhead('Delete category: ' . $category['title']); form_start(CONFIG_SITE_ADMIN_RELPATH . 'actions/edit_category'); form_input_checkbox('Delete confirmation'); form_hidden('action', 'delete'); form_hidden('id', $_GET['id']); message_inline_red('Warning! This will delete all challenges under this category, as well as all submissions, files, and hints related those challenges!'); form_button_submit('Delete category', 'danger'); form_end(); foot();
<?php require '../../include/mellivora.inc.php'; enforce_authentication(CONST_USER_CLASS_MODERATOR); head('Site management'); menu_management(); section_subhead('Search'); form_start(CONFIG_SITE_ADMIN_RELPATH . 'actions/search'); form_input_text('Search for'); $opts[] = array('id' => 'users', 'name' => 'Users'); $opts[] = array('id' => 'ip_log', 'name' => 'IP log'); form_select($opts, 'Search in', 'id', 'users', 'name'); form_button_submit('Search'); form_xsrf_token(); form_end(); foot();
echo " <td align=\"left\">", form_dropdown_array('attachment_thumbnail_method', $attachment_thumbnail_methods, isset($forum_global_settings['attachment_thumbnail_method']) ? $forum_global_settings['attachment_thumbnail_method'] : ATTACHMENT_THUMBNAIL_PHPGD), "</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\" width=\"270\">", gettext("Path to Imagemagick convert binary"), ":</td>\n"; echo " <td align=\"left\">", form_input_text("attachment_imagemagick_path", isset($forum_global_settings['attachment_imagemagick_path']) ? htmlentities_array($forum_global_settings['attachment_imagemagick_path']) : '', 35, 255), "</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\" colspan=\"2\"> </td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\" width=\"270\">", gettext("Attachment space per user"), ":</td>\n"; echo " <td align=\"left\">", form_input_text("attachments_max_user_space", isset($forum_global_settings['attachments_max_user_space']) ? htmlentities_array($forum_global_settings['attachments_max_user_space'] / 1024 / 1024) : "1", 10, 32), " (MB)</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\" width=\"270\">", gettext("Attachment space per post"), ":</td>\n"; echo " <td align=\"left\">", form_input_text("attachments_max_post_space", isset($forum_global_settings['attachments_max_post_space']) ? htmlentities_array($forum_global_settings['attachments_max_post_space'] / 1024 / 1024) : "1", 10, 32), " (MB)</td>\n"; echo " </tr>\n"; if (isset($forum_global_settings['attachments_enabled']) && $forum_global_settings['attachments_enabled'] == "Y") { if (!attachments_check_dir()) { echo " <tr>\n"; echo " <td align=\"left\" colspan=\"2\"> </td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td colspan=\"2\">\n"; html_display_error_msg(gettext("Attachment directory and system temporary directory / php.ini 'upload_tmp_dir' must be writable by the web server / PHP process!"), '95%', 'center'); echo " </td>\n"; echo " </tr>\n"; } } echo " <tr>\n"; echo " <td align=\"left\" colspan=\"2\"> </td>\n";
<?php require '../include/mellivora.inc.php'; prefer_ssl(); head('Two-factor authentication required'); section_head('Two-factor authentication required'); form_start('actions/two_factor_auth'); form_input_text('Code', false, array('autocomplete' => 'off', 'autofocus' => true)); form_hidden('action', 'authenticate'); form_button_submit('Authenticate'); form_end(); foot();
echo " <tr>\n"; echo " <td align=\"left\" class=\"posthead\">\n"; echo " <table class=\"posthead\" width=\"100%\">\n"; echo " <tr>\n"; echo " <td align=\"left\" class=\"subhead\">", gettext("Prune Log"), "</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"center\">\n"; echo " <table class=\"posthead\" width=\"95%\">\n"; echo " <tr>\n"; echo " <td align=\"left\" width=\"250\" style=\"white-space: nowrap\">", gettext("Remove Entries Relating to Action"), ":</td>\n"; echo " <td align=\"left\">", form_dropdown_array('remove_type', $admin_log_type_array), "</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\" width=\"250\" style=\"white-space: nowrap\">", gettext("Remove Entries Older Than (Days)"), ":</td>\n"; echo " <td align=\"left\">", form_input_text('remove_days', '30', 15, 4), " ", form_submit("prune_log", gettext("Prune Log")), "</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\"> </td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " </td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " </td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " </td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td> </td>\n";
echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\" width=\"200\" class=\"posthead\">", gettext("Thread Title Prefix"), ":</td>\n"; echo " <td align=\"left\">", form_input_text("t_prefix", isset($_POST['t_prefix']) ? htmlentities_array($_POST['t_prefix']) : (isset($rss_feed['PREFIX']) ? htmlentities_array($rss_feed['PREFIX']) : ""), 29, 16), form_input_hidden("t_prefix_old", isset($rss_feed['PREFIX']) ? htmlentities_array($rss_feed['PREFIX']) : ""), "</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\" width=\"200\" class=\"posthead\">", gettext("Feed Folder Name"), ":</td>\n"; echo " <td align=\"left\">", folder_draw_dropdown_all(isset($_POST['t_fid']) ? htmlentities_array($_POST['t_fid']) : (isset($rss_feed['FID']) ? $rss_feed['FID'] : 0), "t_fid", "", "", "post_folder_dropdown"), form_input_hidden("t_fid_old", isset($rss_feed['FID']) ? htmlentities_array($rss_feed['FID']) : ""), "</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\" width=\"200\" class=\"posthead\">", gettext("Update Frequency"), ":</td>\n"; echo " <td align=\"left\">", form_dropdown_array("t_frequency", $update_frequencies_array, isset($_POST['t_frequency']) ? htmlentities_array($_POST['t_frequency']) : (isset($rss_feed['FREQUENCY']) ? $rss_feed['FREQUENCY'] : 1440), "", "post_folder_dropdown"), form_input_hidden("t_frequency_old", isset($rss_feed['FREQUENCY']) ? htmlentities_array($rss_feed['FREQUENCY']) : ""), "</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\" width=\"200\" class=\"posthead\">", gettext("Max Item Count"), ":</td>\n"; echo " <td align=\"left\">", form_input_text("t_max_item_count", isset($_POST['t_max_item_count']) ? htmlentities_array($_POST['t_max_item_count']) : (isset($rss_feed['MAX_ITEM_COUNT']) ? $rss_feed['MAX_ITEM_COUNT'] : 10), 6, 4), form_input_hidden("t_max_item_count_old", isset($rss_feed['MAX_ITEM_COUNT']) ? htmlentities_array($rss_feed['MAX_ITEM_COUNT']) : 10), " <span class=\"smalltext\">", gettext("Min: 1, Max: 10"), "</span></td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\"> </td>\n"; echo " <td align=\"left\"> </td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " </td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " </td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " </td>\n"; echo " </tr>\n"; echo " <tr>\n";
<?php require '../../include/ctf.inc.php'; enforce_authentication(CONST_USER_CLASS_MODERATOR); validate_id($_GET['id']); $user = db_select_one('users', array('team_name', 'email', 'enabled', 'competing', 'country_id'), array('id' => $_GET['id'])); head('Site management'); menu_management(); section_subhead('Edit user: '******'team_name']); form_start(CONFIG_SITE_ADMIN_RELPATH . 'actions/edit_user'); form_input_text('Email', $user['email']); form_input_text('Team name', $user['team_name']); $opts = db_query_fetch_all('SELECT * FROM countries ORDER BY country_name ASC'); form_select($opts, 'Country', 'id', $user['country_id'], 'country_name'); form_input_checkbox('Enabled', $user['enabled']); form_input_checkbox('Competing', $user['competing']); form_hidden('action', 'edit'); form_hidden('id', $_GET['id']); form_button_submit('Save changes'); form_end(); section_subhead('Reset password'); form_start(CONFIG_SITE_ADMIN_RELPATH . 'actions/edit_user'); form_input_checkbox('Reset confirmation'); form_hidden('action', 'reset_password'); form_hidden('id', $_GET['id']); form_button_submit('Reset password', 'warning'); form_end(); section_subhead('Delete user'); form_start(CONFIG_SITE_ADMIN_RELPATH . 'actions/edit_user'); form_input_checkbox('Delete confirmation'); form_hidden('action', 'delete');
echo " <table cellpadding=\"0\" cellspacing=\"0\" width=\"600\">\n"; echo " <tr>\n"; echo " <td align=\"left\">\n"; echo " <table class=\"box\" width=\"100%\">\n"; echo " <tr>\n"; echo " <td align=\"left\" class=\"posthead\">\n"; echo " <table class=\"posthead\" width=\"100%\">\n"; echo " <tr>\n"; echo " <td align=\"left\" class=\"subhead\" colspan=\"1\">", gettext("Post Count"), "</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"center\">\n"; echo " <table width=\"90%\" class=\"posthead\">\n"; echo " <tr>\n"; echo " <td align=\"left\" width=\"150\">", gettext("Post Count"), ":</td>\n"; echo " <td align=\"left\">", form_input_text("t_post_count", isset($_POST['t_post_count']) ? htmlentities_array($_POST['t_post_count']) : htmlentities_array($user['POST_COUNT']), 10), " ", form_checkbox("t_reset_post_count", "Y", gettext("Reset Post Count"), false), "</td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " </td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\"> </td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " </td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " </td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\"> </td>\n";
echo " ", form_input_hidden("search_page", htmlentities_array($search_page)), "\n"; echo " <table cellpadding=\"0\" cellspacing=\"0\" width=\"500\">\n"; echo " <tr>\n"; echo " <td align=\"left\">\n"; echo " <table class=\"box\" width=\"100%\">\n"; echo " <tr>\n"; echo " <td align=\"left\" class=\"posthead\">\n"; echo " <table class=\"posthead\" width=\"100%\">\n"; echo " <tr>\n"; echo " <td class=\"subhead\" align=\"left\">", gettext("Search For User"), "</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"center\">\n"; echo " <table class=\"posthead\" width=\"95%\">\n"; echo " <tr>\n"; echo " <td align=\"left\">", gettext("Search"), ": ", form_input_text('user_search', htmlentities_array($user_search), 32, 15), " ", form_submit('search', gettext("Search")), " ", form_submit('clear', gettext("Clear")), "</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\"> </td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " </td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " </td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " </td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\"> </td>\n";
<?php require '../../include/mellivora.inc.php'; enforce_authentication(CONFIG_UC_MODERATOR); validate_id($_GET['id']); head('Site management'); menu_management(); section_subhead('Edit user type'); $user_type = db_select_one('user_types', array('*'), array('id' => $_GET['id'])); form_start(CONFIG_SITE_ADMIN_RELPATH . 'actions/edit_user_type'); form_input_text('Title', $user_type['title']); form_textarea('Description', $user_type['description']); form_hidden('action', 'edit'); form_hidden('id', $_GET['id']); form_button_submit('Save changes'); form_end(); section_subhead('Delete user type'); form_start(CONFIG_SITE_ADMIN_RELPATH . 'actions/edit_user_type'); form_input_checkbox('Delete confirmation'); form_hidden('action', 'delete'); form_hidden('id', $_GET['id']); message_inline_red('Warning! Any users of this type will be without a type. You must manually give them a type in the DB. If no types will exist after this action, you must set their type to 0.'); form_button_submit('Delete user type', 'danger'); form_end(); foot();
if ($admin_edit === false) { echo " <td align=\"right\" valign=\"top\">", form_checkbox("t_entry_private[{$profile_item['PIID']}]", "Y", '', isset($profile_item['PRIVACY']) && $profile_item['PRIVACY'] == PROFILE_ITEM_PRIVATE, sprintf("title=%s", gettext("Friends only?"))), "</td>\n"; } else { echo " <td align=\"left\" valign=\"top\"> </td>\n"; } } else { if ($profile_item['TYPE'] == PROFILE_ITEM_MULTI_TEXT) { echo " <td align=\"left\" valign=\"top\">", form_textarea("t_entry[{$profile_item['PIID']}]", isset($t_entry_array[$profile_item['PIID']]) ? htmlentities_array($t_entry_array[$profile_item['PIID']]) : htmlentities_array($profile_item['ENTRY']), false, false, false, 'bhinputprofileitem'), "</td>\n"; if ($admin_edit === false) { echo " <td align=\"right\" valign=\"top\">", form_checkbox("t_entry_private[{$profile_item['PIID']}]", "Y", '', isset($profile_item['PRIVACY']) && $profile_item['PRIVACY'] == PROFILE_ITEM_PRIVATE, sprintf("title=%s", gettext("Friends only?"))), "</td>\n"; } else { echo " <td align=\"left\" valign=\"top\"> </td>\n"; } echo " </tr>\n"; } else { echo " <td align=\"left\" valign=\"top\">", form_input_text("t_entry[{$profile_item['PIID']}]", isset($t_entry_array[$profile_item['PIID']]) ? htmlentities_array($t_entry_array[$profile_item['PIID']]) : htmlentities_array($profile_item['ENTRY']), false, false, false, 'bhinputprofileitem'), "</td>\n"; if ($admin_edit === false) { echo " <td align=\"right\" valign=\"top\">", form_checkbox("t_entry_private[{$profile_item['PIID']}]", "Y", '', isset($profile_item['PRIVACY']) && $profile_item['PRIVACY'] == PROFILE_ITEM_PRIVATE, sprintf("title=%s", gettext("Friends only?"))), "</td>\n"; } else { echo " <td align=\"left\" valign=\"top\"> </td>\n"; } } } echo " </tr>\n"; } echo " <tr>\n"; echo " <td align=\"left\"> </td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " </td>\n"; echo " </tr>\n";
echo " <td align=\"left\" class=\"subhead\">", gettext("Edit Word Filter"), "</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"center\">\n"; echo " <table class=\"posthead\" width=\"95%\">\n"; echo " <tr>\n"; echo " <td align=\"left\" width=\"200\">", gettext("Filter Name"), ":</td>\n"; echo " <td align=\"left\">", form_input_text("filter_name", htmlentities_array($word_filter_array['FILTER_NAME']), 40, 255), "</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\" width=\"200\">", gettext("Matched Text"), ":</td>\n"; echo " <td align=\"left\">", form_input_text("match_text", htmlentities_array($word_filter_array['MATCH_TEXT']), 40), "</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\" width=\"200\">", gettext("Replacement Text"), ":</td>\n"; echo " <td align=\"left\">", form_input_text("replace_text", htmlentities_array($word_filter_array['REPLACE_TEXT']), 40), "</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\" valign=\"top\" width=\"200\">", gettext("Filter Type"), ":</td>\n"; echo " <td align=\"left\">", form_dropdown_array("filter_option", array(gettext("All"), gettext("Whole Word"), gettext("PREG")), $word_filter_array['FILTER_TYPE']), "</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\" valign=\"top\" width=\"200\">", gettext("Filter Enabled"), ":</td>\n"; echo " <td align=\"left\">", form_dropdown_array("filter_enabled", array(WORD_FILTER_ENABLED => gettext("Yes"), WORD_FILTER_DISABLED => gettext("No")), $word_filter_array['FILTER_ENABLED']), "</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\"> </td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " </td>\n"; echo " </tr>\n";
echo " <div>\n"; echo " <h2>", gettext("Poll Question"), "</h2>\n"; echo " <div class=\"poll_question_input\">\n"; echo " ", form_input_text("poll_questions[{$question_id}][question]", htmlentities_array($question['QUESTION']), 40, 255), " ", form_button_html("delete_question[{$question_id}]", 'submit', 'button_image delete_question', sprintf("<img src=\"%s\" alt=\"\" />", html_style_image('delete.png')), sprintf('title="%s"', gettext("Delete question"))), "\n"; echo " </div>\n"; echo " <div class=\"poll_question_checkbox\">\n"; echo " ", form_checkbox("poll_questions[{$question_id}][allow_multi]", "Y", gettext("Allow multiple options to be selected"), isset($question['ALLOW_MULTI']) && $question['ALLOW_MULTI'] == 'Y'), "\n"; echo " </div>\n"; echo " <div class=\"poll_options_list\">\n"; echo " <ol>\n"; if (isset($question['OPTIONS_ARRAY']) && is_array($question['OPTIONS_ARRAY'])) { foreach ($question['OPTIONS_ARRAY'] as $option_id => $option) { echo " <li>", form_input_text("poll_questions[{$question_id}][options][{$option_id}]", htmlentities_array($option['OPTION_NAME']), 45, 255), " ", form_button_html("delete_option[{$question_id}][{$option_id}]", 'submit', 'button_image delete_option', sprintf("<img src=\"%s\" alt=\"\"/>", html_style_image('delete.png')), sprintf('title="%s"', gettext("Delete option"))), "</li>\n"; } } else { echo " <li>", form_input_text("poll_questions[{$question_id}][options][0]", '', 45, 255), " ", form_button_html("delete_option[{$question_id}][0]", 'submit', 'button_image delete_option', sprintf("<img src=\"%s\" alt=\"\"/>", html_style_image('delete.png')), sprintf('title="%s"', gettext("Delete option"))), "</li>\n"; if (isset($_POST['add_option'][$question_id])) { echo poll_get_option_html($question_id, 1); } } echo " </ol>\n"; echo " </div>\n"; echo " </div>\n"; echo " ", form_button_html("add_option[{$question_id}]", 'submit', 'button_image add_option', sprintf("<img src=\"%s\" alt=\"\" /> %s", html_style_image('add.png'), gettext("Add new option"))), "\n"; echo " </fieldset>\n"; } echo " </div>\n"; echo " <table width=\"100%\">\n"; echo " <tr>\n"; echo " <td>", form_button_html('add_question', 'submit', 'button_image add_question', sprintf("<img src=\"%s\" alt=\"\" /> %s", html_style_image('add.png'), gettext("Add new question"))), "</td>\n"; echo " </tr>\n";
<?php require '../../include/mellivora.inc.php'; enforce_authentication(CONST_USER_CLASS_MODERATOR); head('Site management'); menu_management(); section_subhead('New dynamic menu item'); form_start(CONFIG_SITE_ADMIN_RELPATH . 'actions/new_dynamic_menu_item'); form_input_text('Title'); form_input_text('Permalink'); dynamic_visibility_select(); $pages = db_select_all('dynamic_pages', array('id', 'title')); array_unshift($pages, array('id' => 0, 'title' => '--- No internal link ---')); form_select($pages, 'Internal page', 'id', null, 'title'); user_class_select(); form_input_text('URL'); form_input_text('Priority'); form_hidden('action', 'new'); form_button_submit('Create'); form_end(); foot();
echo " <td align=\"left\" class=\"posthead\">\n"; echo " <table class=\"box\" width=\"100%\">\n"; echo " <tr>\n"; echo " <td align=\"left\" class=\"posthead\">\n"; echo " <table class=\"posthead\" width=\"100%\">\n"; echo " <tr>\n"; echo " <td class=\"subhead\" align=\"left\">", gettext("Search"), "</td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " <table class=\"posthead\" width=\"100%\">\n"; echo " <tr>\n"; echo " <td align=\"center\">\n"; echo " <table class=\"posthead\" width=\"95%\">\n"; echo " <tr>\n"; echo " <td class=\"posthead\" align=\"left\">\n"; echo " ", gettext("Folder title"), ": ", form_input_text("search_keyword", isset($search_keyword) ? htmlentities_array($search_keyword) : "", 30, 64), " ", form_submit('search', gettext("Search")), " ", form_submit('clear', gettext("Clear")), "\n"; echo " </td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\"> </td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " </td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " </td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " </td>\n"; echo " </tr>\n"; echo " </table>\n";
/** * UI to add an invoice. * * @return tempcode The interface. */ function ad() { $title = get_page_title('CREATE_INVOICE'); breadcrumb_set_parents(array(array('_SEARCH:admin_ecommerce:ecom_usage', do_lang_tempcode('ECOMMERCE')), array('_SELF:_SELF:misc', do_lang_tempcode('INVOICES')))); require_code('form_templates'); $to = get_param('to', ''); $products = find_all_products(); $list = new ocp_tempcode(); foreach ($products as $product => $details) { if ($details[0] == PRODUCT_INVOICE) { $text = do_lang_tempcode('CUSTOM_PRODUCT_' . $product); if ($details[1] != '?') { $text->attach(escape_html(' (' . $details[1] . ' ' . get_option('currency') . ')')); } $list->attach(form_input_list_entry($product, false, $text)); } } if ($list->is_empty()) { inform_exit(do_lang_tempcode('NOTHING_TO_INVOICE_FOR')); } $fields = new ocp_tempcode(); $fields->attach(form_input_list(do_lang_tempcode('PRODUCT'), '', 'product', $list)); $fields->attach(form_input_username(do_lang_tempcode('USERNAME'), do_lang_tempcode('DESCRIPTION_INVOICE_FOR'), 'to', $to, true)); $fields->attach(form_input_float(do_lang_tempcode('AMOUNT'), do_lang_tempcode('INVOICE_AMOUNT_TEXT', escape_html(get_option('currency'))), 'amount', NULL, false)); $fields->attach(form_input_line(do_lang_tempcode('INVOICE_SPECIAL'), do_lang_tempcode('DESCRIPTION_INVOICE_SPECIAL'), 'special', '', false)); $fields->attach(form_input_text(do_lang_tempcode('INVOICE_NOTE'), do_lang_tempcode('DESCRIPTION_INVOICE_NOTE'), 'note', '', false)); $post_url = build_url(array('page' => '_SELF', 'type' => '_ad'), '_SELF'); $submit_name = do_lang_tempcode('CREATE_INVOICE'); return do_template('FORM_SCREEN', array('HIDDEN' => '', 'TITLE' => $title, 'URL' => $post_url, 'FIELDS' => $fields, 'SUBMIT_NAME' => $submit_name, 'TEXT' => do_lang_tempcode('DESCRIPTION_INVOICE_PAGE'))); }
<?php require '../../include/mellivora.inc.php'; enforce_authentication(CONFIG_UC_MODERATOR); head('Site management'); menu_management(); section_subhead('New news post'); form_start(CONFIG_SITE_ADMIN_RELPATH . 'actions/new_news'); form_input_text('Title'); form_textarea('Body'); echo '<script> window.onload = function(){CKEDITOR.replace("body", { filebrowserUploadUrl: "actions/upload.php" });}</script>'; form_hidden('action', 'new'); form_button_submit('Publish news item'); form_bbcode_manual(); form_end(); foot();
echo " ", form_input_hidden("filter", htmlentities_array($filter)), "\n"; echo " <table cellpadding=\"0\" cellspacing=\"0\" width=\"86%\">\n"; echo " <tr>\n"; echo " <td align=\"left\">\n"; echo " <table class=\"box\" width=\"100%\">\n"; echo " <tr>\n"; echo " <td align=\"left\" class=\"posthead\">\n"; echo " <table width=\"100%\">\n"; echo " <tr>\n"; echo " <td class=\"subhead\" align=\"left\">", gettext("Search for a user not in list"), "</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"center\">\n"; echo " <table class=\"posthead\" width=\"95%\">\n"; echo " <tr>\n"; echo " <td class=\"posthead\" align=\"left\">", gettext("Username"), ": ", form_input_text('user_search', htmlentities_array($user_search), 25, 64), " ", form_submit('search', gettext("Search")), " ", form_submit('reset', gettext("Clear")), "</td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " </td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\" colspan=\"6\"> </td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " </td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " </td>\n"; echo " </tr>\n"; echo " </table>\n"; echo "</form>\n";
<?php require '../../include/mellivora.inc.php'; enforce_authentication(CONFIG_UC_MODERATOR); validate_id($_GET['id']); $rule = db_select_one('restrict_email', array('rule', 'enabled', 'white', 'priority'), array('id' => $_GET['id'])); head('Site management'); menu_management(); section_subhead('Edit signup rule'); form_start(CONFIG_SITE_ADMIN_RELPATH . 'actions/edit_restrict_email'); form_input_text('Rule', $rule['rule']); form_input_text('Priority', $rule['priority']); form_input_checkbox('Whitelist', $rule['white']); form_input_checkbox('Enabled', $rule['enabled']); form_hidden('action', 'edit'); form_hidden('id', $_GET['id']); form_button_submit('Save changes'); form_end(); section_subhead('Delete rule'); form_start(CONFIG_SITE_ADMIN_RELPATH . 'actions/edit_restrict_email'); form_input_checkbox('Delete confirmation'); form_hidden('action', 'delete'); form_hidden('id', $_GET['id']); form_button_submit('Delete rule', 'danger'); form_end(); foot();
} echo " <tr>\n"; echo " <td align=\"left\" valign=\"top\" width=\"210\">\n"; echo " <table class=\"posthead\" width=\"100%\" cellpadding=\"0\">\n"; if ($new_thread) { echo " <tr>\n"; echo " <td align=\"left\"><h2>", gettext("Folder"), "</h2></td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\">{$folder_dropdown}</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\"><h2>", gettext("Thread title"), "</h2></td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\">", form_input_text("t_threadtitle", htmlentities_array($t_threadtitle), 0, 0, false, "thread_title"), form_input_hidden("t_newthread", "Y"), "</td>\n"; echo " </tr>\n"; } else { echo " <tr>\n"; echo " <td align=\"left\"><h2>", gettext("Folder"), "</h2></td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\">", word_filter_add_ob_tags($thread_data['FOLDER_TITLE'], true), "</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\"><h2>", gettext("Thread title"), "</h2></td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\">", word_filter_add_ob_tags($thread_data['TITLE'], true), form_input_hidden("t_tid", htmlentities_array($reply_to_tid)), form_input_hidden("t_rpid", htmlentities_array($reply_to_pid)), "</td>\n"; echo " </tr>\n"; }
echo " <table cellpadding=\"0\" cellspacing=\"0\" width=\"450\">\n"; echo " <tr>\n"; echo " <td align=\"center\">\n"; echo " <table class=\"box\" width=\"450\">\n"; echo " <tr>\n"; echo " <td align=\"left\" class=\"posthead\">\n"; echo " <table class=\"posthead\" width=\"100%\">\n"; echo " <tr>\n"; echo " <td align=\"left\" class=\"subhead\" colspan=\"2\">", gettext("Forgot password"), "</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"center\">\n"; echo " <table class=\"posthead\" width=\"95%\">\n"; echo " <tr>\n"; echo " <td align=\"left\">", gettext("Username"), ":</td>\n"; echo " <td align=\"left\">", form_input_text("logon", isset($logon) ? htmlentities_array($logon) : '', 37, 15), "</td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " </td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\"> </td>\n"; echo " <td align=\"left\"> </td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " </td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " </td>\n"; echo " </tr>\n"; echo " <tr>\n";
<?php require '../../include/mellivora.inc.php'; enforce_authentication(CONST_USER_CLASS_MODERATOR); validate_id($_GET['id']); head('Site management'); menu_management(); section_subhead('Edit dynamic menu item'); $menu_item = db_select_one('dynamic_menu', array('*'), array('id' => $_GET['id'])); form_start(CONFIG_SITE_ADMIN_RELPATH . 'actions/edit_dynamic_menu_item'); form_input_text('Title', $menu_item['title']); form_input_text('Permalink', $menu_item['permalink']); dynamic_visibility_select($menu_item['visibility']); $pages = db_select_all('dynamic_pages', array('id', 'title')); array_unshift($pages, array('id' => 0, 'title' => '--- No internal link ---')); form_select($pages, 'Internal page', 'id', $menu_item['internal_page'], 'title'); user_class_select($menu_item['min_user_class']); form_input_text('URL', $menu_item['url']); form_input_text('Priority', $menu_item['priority']); form_hidden('action', 'edit'); form_hidden('id', $_GET['id']); form_button_submit('Save changes'); form_end(); section_subhead('Delete menu item'); form_start(CONFIG_SITE_ADMIN_RELPATH . 'actions/edit_dynamic_menu_item'); form_input_checkbox('Delete confirmation'); form_hidden('action', 'delete'); form_hidden('id', $_GET['id']); form_button_submit('Delete menu item', 'danger'); form_end(); foot();
// Display form profile if (trim($profileText) != '') { $out .= '<div class="info profileEdit">' . $profileText . '</div>'; } $out .= user_html_form($userId); break; case DISP_MOREINFO_FORM: // Display request course creator form $out .= '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">' . "\n" . '<input type="hidden" name="cmd" value="exMoreInfo" />' . "\n" . '<table>' . "\n"; foreach ($extraInfoDefList as $extraInfoDef) { $currentValue = array_key_exists($extraInfoDef['propertyId'], $userInfo) ? $userInfo[$extraInfoDef['propertyId']] : $extraInfoDef['defaultValue']; $requirement = (bool) (true == $extraInfoDef['required']); $labelExtraInfoDef = $extraInfoDef['label']; $out .= form_input_text('extraInfoList[' . claro_htmlentities($extraInfoDef['propertyId']) . ']', $currentValue, get_lang($labelExtraInfoDef), $requirement); } $out .= '<tr valign="top">' . "\n" . '<td>' . get_lang('Submit') . ': </td>' . "\n" . '<td>' . '<input type="submit" value="' . get_lang('Ok') . '" /> ' . "\n" . claro_html_button($_SERVER['PHP_SELF'], get_lang('Cancel')) . "\n" . '</td>' . '</tr>' . "\n" . form_row(' ', '<small>' . get_lang('<span class="required">*</span> denotes required field') . '</small>') . '</table>' . "\n" . '</form>' . "\n"; break; case DISP_REQUEST_COURSE_CREATOR_STATUS: $out .= '<p>' . get_lang('Fill in the text area to motivate your request and then submit the form to send it to platform administrators') . '</p>'; // Display request course creator form $out .= '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">' . "\n" . '<input type="hidden" name="cmd" value="exCCstatus" />' . "\n" . '<table>' . "\n" . form_input_textarea('explanation', '', get_lang('Comment'), true, 6) . '<tr valign="top">' . "\n" . '<td>' . get_lang('Submit') . ': </td>' . "\n" . '<td><input type="submit" value="' . get_lang('Ok') . '" /> ' . "\n" . claro_html_button($_SERVER['PHP_SELF'], get_lang('Cancel')) . "\n" . '</td></tr>' . "\n" . '</table>' . "\n" . '</form>' . "\n"; break; case DISP_REQUEST_REVOQUATION: if (get_conf('can_request_revoquation')) { $out .= '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">' . "\n" . '<input type="hidden" name="cmd" value="exRevoquation" />' . "\n" . '<table>' . "\n" . form_input_text('loginToDelete', '', get_lang('Username'), true) . form_input_password('passwordToDelete', '', get_lang('Password'), true) . form_input_textarea('explanation', '', get_lang('Comment'), true, 6) . '<tr valign="top">' . "\n" . '<td>' . get_lang('Delete my account') . ': </td>' . "\n" . '<td>' . '<input type="submit" value="' . get_lang('Ok') . '" /> ' . "\n" . claro_html_button($_SERVER['PHP_SELF'], get_lang('Cancel')) . "\n" . '</td></tr>' . "\n" . '</table>' . "\n" . '</form>' . "\n"; } break; } // end switch display $claroline->display->body->appendContent($out); echo $claroline->display->render();
/** * UI to add note to an order * * @return tempcode The interface. */ function add_note() { require_code('form_templates'); $id = get_param_integer('id'); $redirect_url = get_param('redirect', NULL); $last_action = get_param('last_act', NULL); breadcrumb_set_parents(array(array('_SEARCH:admin_ecommerce:ecom_usage', do_lang_tempcode('ECOMMERCE')), array('_SELF:_SELF:misc', do_lang_tempcode('ORDERS')), array('_SELF:_SELF:show_orders', do_lang_tempcode('ORDER_LIST')))); $update_url = build_url(array('page' => '_SELF', 'type' => '_add_note', 'redirect' => $redirect_url), '_SELF'); $fields = new ocp_tempcode(); $note = $GLOBALS['SITE_DB']->query_value('shopping_order', 'notes', array('id' => $id)); if (!is_null($last_action)) { $note .= do_lang('ADD_NOTE_UPPEND_TEXT', get_timezoned_date(time(), true, false, true, true), do_lang('ORDER_STATUS_' . $last_action)); } $fields->attach(form_input_text(do_lang_tempcode('NOTE'), do_lang_tempcode('NOTE_DESCRIPTION'), 'note', $note, true)); $fields->attach(form_input_hidden('order_id', strval($id))); $title = get_page_title('ADD_NOTE_TITLE', true, array(strval($id))); if ($last_action == 'dispatched') { //Display dispatch mail preview $res = $GLOBALS['SITE_DB']->query_select('shopping_order', array('*'), array('id' => $id), '', 1); $order_det = $res[0]; $member_name = $GLOBALS['FORUM_DRIVER']->get_username($order_det['c_member']); $message = do_lang('ORDER_DISPATCHED_MAIL_MESSAGE', comcode_escape(get_site_name()), comcode_escape($member_name), array(strval($id)), get_lang($order_det['c_member'])); $fields->attach(form_input_text(do_lang_tempcode('DISPATCH_MAIL_PREVIEW'), do_lang_tempcode('DISPATCH_MAIL_PREVIEW_DESCRIPTION'), 'dispatch_mail_content', $message, true)); } return do_template('FORM_SCREEN', array('TITLE' => $title, 'TEXT' => do_lang_tempcode('NOTE_DESCRIPTION'), 'HIDDEN' => '', 'FIELDS' => $fields, 'URL' => $update_url, 'SUBMIT_NAME' => do_lang_tempcode('ADD_NOTE'))); }