';
// 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 '
';
echo '
';
// If the user is replying to a topic show the previous posts.
if (isset($context['previous_posts']) && count($context['previous_posts']) > 0)
{
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'], '
';
}
/**
* 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 '
';
}
/**
* 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 '
';
}
/**
* 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 '
';
// 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 '
';
}
// Select menus are more complicated
elseif ($pf['input']['type'] === 'select' && is_array($pf['input']['options']))
{
// The select element itself
echo '
';
}
// Radio_select makes a div with some radio buttons in it
elseif ($pf['input']['type'] === 'radio_select' && is_array($pf['input']['options']))
{
echo '