'; // When using Go Back due to fatal_error, allow the form to be re-submitted with changes. if (isBrowser('is_firefox')) echo ' window.addEventListener("pageshow", reActivate, false);'; // Start with message icons - and any missing from this theme. echo ' var icon_urls = {'; foreach ($context['icons'] as $icon) echo ' \'', $icon['value'], '\': \'', $icon['url'], '\'', $icon['is_last'] ? '' : ','; echo ' };'; // If this is a poll - use some javascript to ensure the user doesn't create a poll with illegal option combinations. if ($context['make_poll']) echo ' var pollOptionNum = 0, pollTabIndex; var pollOptionId = ', $context['last_choice_id'], '; function addPollOption() { if (pollOptionNum == 0) { for (var i = 0, n = document.forms.postmodify.elements.length; i < n; i++) if (document.forms.postmodify.elements[i].id.substr(0, 8) == \'options-\') { pollOptionNum++; pollTabIndex = document.forms.postmodify.elements[i].tabIndex; } } pollOptionNum++ pollOptionId++ setOuterHTML(document.getElementById(\'pollMoreOptions\'), ', JavaScriptEscape('
:

'), '); }'; // If we are making a calendar event we want to ensure we show the current days in a month etc... this is done here. if ($context['make_event']) echo ' var monthLength = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];'; // End of the javascript, start the form and display the link tree. echo '
'; // If the user wants to see how their message looks - the preview section is where it's at! echo '
'; if ($context['make_event'] && (!$context['event']['new'] || !empty($context['current_board']))) echo ' '; // Start the main table. echo '

', $context['page_title'], '

', isset($context['current_topic']) ? ' ' : ''; // If an error occurred, explain what happened. echo ' '; // If this won't be approved let them know! if (!$context['becomes_approved']) echo '
', $txt['wait_for_approval'], '
'; // If it's locked, show a message to warn the replier. if (!empty($context['locked'])) echo '
', $txt['topic_locked_no_reply'], '
'; if (!empty($modSettings['drafts_post_enabled'])) echo ' '; // The post header... important stuff template_post_header(); // Are you posting a calendar event? if ($context['make_event']) { // Note to theme writers: The JavaScripts expect the input fields for the start and end dates & times to be contained in a wrapper element with the id "event_time_input" echo '
', $txt['calendar_event_options'], '
', $txt['calendar_event_title'], '
', $txt['start'], '
', $txt['end'], '
', $txt['calendar_timezone'], '
', $txt['location'], '
'; } // If this is a poll then display all the poll options! if ($context['make_poll']) { echo '
', $txt['poll_question'], '
', $txt['poll_question'], '
'; // Loop through all the choices and print them out. foreach ($context['choices'] as $choice) echo '
:
'; echo '

(', $txt['poll_add_option'], ')
', $txt['poll_options'], '

', $txt['poll_run_limit'], '
', $txt['days_word'], '
'; if ($context['poll_options']['guest_vote_enabled']) echo '
'; echo '
', $txt['poll_results_visibility'], ':


'; } // Show the actual posting area... echo ' ', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message'); // Show attachments. if (!empty($context['current_attachments']) || $context['can_post_attachment']) { echo '
'; // The non-JavaScript UI. echo '
', $txt['attachments'], ':'; if ($context['can_post_attachment']) echo ' (', $txt['clean_attach'], ')'; if (!empty($modSettings['attachmentSizeLimit'])) echo ' '; echo '
'; if (!empty($context['attachment_restrictions'])) echo '
', $txt['attach_restrictions'], ' ', implode(', ', $context['attachment_restrictions']), '
'; echo '
', $txt['uncheck_unwatchd_attach'], '
'; // If this post already has attachments on it - give information about them. if (!empty($context['current_attachments'])) { foreach ($context['current_attachments'] as $attachment) { echo '
'; if (!empty($modSettings['attachmentShowImages'])) { if (strpos($attachment['mime_type'], 'image') === 0) $src = $scripturl . '?action=dlattach;attach=' . (!empty($attachment['thumb']) ? $attachment['thumb'] : $attachment['attachID']) . ';preview;image'; else $src = $settings['images_url'] . '/generic_attach.png'; echo '
'; } echo '
' . $attachment['name'] . '', (empty($attachment['approved']) ? '
(' . $txt['awaiting_approval'] . ')' : ''), '
', $attachment['size'] < 1024000 ? round($attachment['size'] / 1024, 2) . ' ' . $txt['kilobyte'] : round($attachment['size'] / 1024 / 1024, 2) . ' ' . $txt['megabyte'], '
'; } } echo '
'; if (!empty($context['files_in_session_warning'])) echo '
', $context['files_in_session_warning'], '
'; // Is the user allowed to post any additional ones? If so give them the boxes to do it! if ($context['can_post_attachment']) { // Print dropzone UI. echo '
', $context['num_allowed_attachments'] <= count($context['current_attachments']) ? $txt['attach_limit_nag'] : $txt['attach_drop_zone'], '
(', $txt['clean_attach'], ')'; if (!empty($modSettings['attachmentSizeLimit'])) echo ' '; echo '
'; } echo '
'; } // If the admin has enabled the hiding of the additional options - show a link and image for it. if (!empty($modSettings['additional_options_collapsable'])) echo '
', $txt['post_additionalopt'], '
'; echo '
'; // Display the checkboxes for all the standard options - if they are available to the user! echo '
    ', $context['can_notify'] ? '
  • ' : '', ' ', $context['can_lock'] ? '
  • ' : '', '
  • ', $context['can_sticky'] ? '
  • ' : '', '
  • ', ' ', $context['can_move'] ? '
  • ' : '', ' ', $context['can_announce'] && $context['is_first_post'] ? '
  • ' : '', ' ', $context['show_approval'] ? '
  • ' : '', '
'; echo '
'; // If the admin enabled the drafts feature, show a draft selection box if (!empty($modSettings['drafts_post_enabled']) && !empty($context['drafts']) && !empty($modSettings['drafts_show_saved_enabled']) && !empty($options['drafts_show_saved_enabled'])) { echo '

', $txt['drafts_show'], '

', $txt['subject'], '
', $txt['draft_saved_on'], '
'; foreach ($context['drafts'] as $draft) echo '
', $draft['link'], '
', $draft['poster_time'], '
'; echo '
'; } // Is visual verification enabled? if ($context['require_verification']) echo '
', $txt['verification'], ': ', template_control_verification($context['visual_verification_id'], 'all'), '
'; // Finally, the submit buttons. echo ' ', template_control_richedit_buttons($context['post_box_name']); // Option to delete an event if user is editing one. if ($context['make_event'] && !$context['event']['new']) echo ' '; echo '

'; // Assuming this isn't a new topic pass across the last message id. if (isset($context['topic_last_message'])) echo ' '; echo '
'; echo ' '; // If the user is replying to a topic show the previous posts. if (isset($context['previous_posts']) && count($context['previous_posts']) > 0) { echo '

', $txt['topic_summary'], '

'; $ignored_posts = array(); foreach ($context['previous_posts'] as $post) { $ignoring = false; if (!empty($post['is_ignored'])) $ignored_posts[] = $ignoring = $post['id']; echo '
', $txt['posted_by'], ' ', $post['poster'], '
 - ', $post['time'], '
'; if ($ignoring) echo '
', $txt['ignoring_user'], '
'; echo '
', $post['message'], '
'; if ($context['can_quote']) echo ' '; echo '
'; } echo '
'; } } /** * The template for the spellchecker. */ function template_spellcheck() { global $context, $settings, $txt, $modSettings; // The style information that makes the spellchecker look... like the forum hopefully! echo ' ', $txt['spell_check'], '
 
', $txt['spellcheck_change_to'], '
', $txt['spellcheck_suggest'], '
'; } /** * The template for the AJAX quote feature */ function template_quotefast() { global $context, $settings, $txt, $modSettings; echo ' ', $txt['retrieving_quote'], ' ', $txt['retrieving_quote'], ' '; } /** * The form for sending out an announcement */ function template_announce() { global $context, $txt, $scripturl; echo '

', $txt['announce_title'], '

', $txt['announce_desc'], '

', $txt['announce_this_topic'], ' ', $context['topic_subject'], '

    '; foreach ($context['groups'] as $group) echo '
  • (', $group['member_count'], ')
  • '; echo '



'; } /** * The confirmation/progress page, displayed after the admin has clicked the button to send the announcement. */ function template_announcement_send() { global $context, $txt, $scripturl; echo '

', $txt['announce_sending'], ' ', $context['topic_subject'], '

', $context['percentage_done'], '% ', $txt['announce_done'], '



'; } /** * Prints the input fields in the form's header (subject, message icon, guest name & email, etc.) * * Mod authors can use the 'integrate_post_end' hook to modify or add to these (see Post.php). * * Theme authors can customize the output in a couple different ways: * 1. Change specific values in the $context['posting_fields'] array. * 2. Add an 'html' element to the 'label' and/or 'input' elements of the field they want to * change. This should contain the literal HTML string to be printed. * * See the documentation in Post.php for more info on the $context['posting_fields'] array. */ function template_post_header() { global $context, $txt; // Sanity check: submitting the form won't work without at least a subject field if (empty($context['posting_fields']['subject']) || !is_array($context['posting_fields']['subject'])) { $context['posting_fields']['subject'] = array( 'label' => array('html' => ''), 'input' => array('html' => '') ); } // THEME AUTHORS: Above this line is a great place to make customizations to the posting_fields array // Start printing the header echo '
'; foreach ($context['posting_fields'] as $pfid => $pf) { // We need both a label and an input if (empty($pf['label']) || empty($pf['input'])) continue; // The labels are pretty simple... echo '
'; // Any leading HTML before the label if (!empty($pf['label']['before'])) echo ' ', $pf['label']['before']; if (!empty($pf['label']['html'])) echo $pf['label']['html']; else echo ' ', $pf['label']['text'], ''; // Any trailing HTML after the label if (!empty($pf['label']['after'])) echo ' ', $pf['label']['after']; echo '
'; // Here's where the fun begins... echo '
'; // Any leading HTML before the main input if (!empty($pf['input']['before'])) echo ' ', $pf['input']['before']; // If there is a literal HTML string already defined, just print it. if (!empty($pf['input']['html'])) { echo $pf['input']['html']; } // Simple text inputs and checkboxes elseif (in_array($pf['input']['type'], array('text', 'password', 'color', 'date', 'datetime-local', 'email', 'month', 'number', 'range', 'tel', 'time', 'url', 'week', 'checkbox'))) { echo ' $value) { if (is_bool($value)) echo $value ? ' ' . $attribute : ''; else echo ' ', $attribute, '="', $value, '"'; } } echo ' tabindex="', $context['tabindex']++, '">'; } // textarea elseif ($pf['input']['type'] === 'textarea') { echo ' $value) { if ($attribute === 'value') continue; elseif (is_bool($value)) echo $value ? ' ' . $attribute : ''; else echo ' ', $attribute, '="', $value, '"'; } } echo ' tabindex="', $context['tabindex']++, '">', !empty($pf['input']['attributes']['value']) ? $pf['input']['attributes']['value'] : '', ''; } // Select menus are more complicated elseif ($pf['input']['type'] === 'select' && is_array($pf['input']['options'])) { // The select element itself echo ' $value) { if (is_bool($value)) echo $value ? ' ' . $attribute : ''; else echo ' ', $attribute, '="', $value, '"'; } } echo ' tabindex="', $context['tabindex']++, '">'; // The options foreach ($pf['input']['options'] as $optlabel => $option) { // An option containing options is an optgroup if (!empty($option['options']) && is_array($option['options'])) { echo ' $value) { if ($attribute === 'options') continue; elseif (is_bool($value)) echo $value ? ' ' . $attribute : ''; else echo ' ', $attribute, '="', $value, '"'; } } echo '>'; foreach ($option['options'] as $grouped_optlabel => $grouped_option) { echo ' $value) { if (is_bool($value)) echo $value ? ' ' . $attribute : ''; else echo ' ', $attribute, '="', $value, '"'; } echo '>', $grouped_option['label'], ''; } echo ' '; } // Simple option else { echo ' $value) { if (is_bool($value)) echo $value ? ' ' . $attribute : ''; else echo ' ', $attribute, '="', $value, '"'; } echo '>', $optlabel, ''; } } // Close the select element echo ' '; } // Radio_select makes a div with some radio buttons in it elseif ($pf['input']['type'] === 'radio_select' && is_array($pf['input']['options'])) { echo ' $value) { if ($attribute === 'name') continue; elseif (is_bool($value)) echo $value ? ' ' . $attribute : ''; else echo ' ', $attribute, '="', $value, '"'; } } echo '>'; foreach ($pf['input']['options'] as $optlabel => $option) { echo ' '; } echo ' '; } // Any trailing HTML after the main input if (!empty($pf['input']['after'])) echo ' ', $pf['input']['after']; echo '
'; } echo '
'; } ?>