|
@@ -178,13 +178,13 @@ function template_main()
|
|
|
</select>
|
|
|
<img src="', $context['icon_url'], '" name="icons" hspace="15" alt="" />
|
|
|
</dd>
|
|
|
- </dl>
|
|
|
- <hr class="clear" />';
|
|
|
+ </dl>';
|
|
|
|
|
|
// Are you posting a calendar event?
|
|
|
if ($context['make_event'])
|
|
|
{
|
|
|
echo '
|
|
|
+ <hr class="clear" />
|
|
|
<div id="post_event">
|
|
|
<fieldset id="event_main">
|
|
|
<legend><span', isset($context['post_error']['no_event']) ? ' class="error"' : '', ' id="caption_evtitle">', $txt['calendar_event_title'], '</span></legend>
|
|
@@ -284,6 +284,7 @@ function template_main()
|
|
|
if ($context['make_poll'])
|
|
|
{
|
|
|
echo '
|
|
|
+ <hr class="clear" />
|
|
|
<div id="edit_poll">
|
|
|
<fieldset id="poll_main">
|
|
|
<legend><span ', (isset($context['poll_error']['no_question']) ? ' class="error"' : ''), '>', $txt['poll_question'], '</span></legend>
|
|
@@ -369,143 +370,145 @@ function template_main()
|
|
|
<h4 class="titlebg">
|
|
|
<img id="postMoreExpand" class="panel_toggle" style="display: none;" src="', $settings['images_url'], '/collapse.png" alt="-" /> <strong><a href="#" id="postMoreExpandLink">', $context['can_post_attachment'] ? $txt['post_additionalopt_attach'] : $txt['post_additionalopt'], '</a></strong>
|
|
|
</h4>
|
|
|
- </div>';
|
|
|
+ </div>
|
|
|
+ <div id="postAdditionalOptions">';
|
|
|
|
|
|
// Display the check boxes for all the standard options - if they are available to the user!
|
|
|
echo '
|
|
|
- <div id="postMoreOptions" class="smalltext">
|
|
|
- <ul class="post_options">
|
|
|
- ', $context['can_notify'] ? '<li><input type="hidden" name="notify" value="0" /><label for="check_notify"><input type="checkbox" name="notify" id="check_notify"' . ($context['notify'] || !empty($options['auto_notify']) ? ' checked="checked"' : '') . ' value="1" class="input_check" /> ' . $txt['notify_replies'] . '</label></li>' : '', '
|
|
|
- ', $context['can_lock'] ? '<li><input type="hidden" name="lock" value="0" /><label for="check_lock"><input type="checkbox" name="lock" id="check_lock"' . ($context['locked'] ? ' checked="checked"' : '') . ' value="1" class="input_check" /> ' . $txt['lock_topic'] . '</label></li>' : '', '
|
|
|
- <li><label for="check_back"><input type="checkbox" name="goback" id="check_back"' . ($context['back_to_topic'] || !empty($options['return_to_post']) ? ' checked="checked"' : '') . ' value="1" class="input_check" /> ' . $txt['back_to_topic'] . '</label></li>
|
|
|
- ', $context['can_sticky'] ? '<li><input type="hidden" name="sticky" value="0" /><label for="check_sticky"><input type="checkbox" name="sticky" id="check_sticky"' . ($context['sticky'] ? ' checked="checked"' : '') . ' value="1" class="input_check" /> ' . $txt['sticky_after'] . '</label></li>' : '', '
|
|
|
- <li><label for="check_smileys"><input type="checkbox" name="ns" id="check_smileys"', $context['use_smileys'] ? '' : ' checked="checked"', ' value="NS" class="input_check" /> ', $txt['dont_use_smileys'], '</label></li>', '
|
|
|
- ', $context['can_move'] ? '<li><input type="hidden" name="move" value="0" /><label for="check_move"><input type="checkbox" name="move" id="check_move" value="1" class="input_check" ' . (!empty($context['move']) ? 'checked="checked" ' : '') . '/> ' . $txt['move_after2'] . '</label></li>' : '', '
|
|
|
- ', $context['can_announce'] && $context['is_first_post'] ? '<li><label for="check_announce"><input type="checkbox" name="announce_topic" id="check_announce" value="1" class="input_check" ' . (!empty($context['announce']) ? 'checked="checked" ' : '') . '/> ' . $txt['announce_topic'] . '</label></li>' : '', '
|
|
|
- ', $context['show_approval'] ? '<li><label for="approve"><input type="checkbox" name="approve" id="approve" value="2" class="input_check" ' . ($context['show_approval'] === 2 ? 'checked="checked"' : '') . ' /> ' . $txt['approve_this_post'] . '</label></li>' : '', '
|
|
|
- </ul>
|
|
|
- </div>';
|
|
|
+ <div id="postMoreOptions" class="smalltext">
|
|
|
+ <ul class="post_options">
|
|
|
+ ', $context['can_notify'] ? '<li><input type="hidden" name="notify" value="0" /><label for="check_notify"><input type="checkbox" name="notify" id="check_notify"' . ($context['notify'] || !empty($options['auto_notify']) ? ' checked="checked"' : '') . ' value="1" class="input_check" /> ' . $txt['notify_replies'] . '</label></li>' : '', '
|
|
|
+ ', $context['can_lock'] ? '<li><input type="hidden" name="lock" value="0" /><label for="check_lock"><input type="checkbox" name="lock" id="check_lock"' . ($context['locked'] ? ' checked="checked"' : '') . ' value="1" class="input_check" /> ' . $txt['lock_topic'] . '</label></li>' : '', '
|
|
|
+ <li><label for="check_back"><input type="checkbox" name="goback" id="check_back"' . ($context['back_to_topic'] || !empty($options['return_to_post']) ? ' checked="checked"' : '') . ' value="1" class="input_check" /> ' . $txt['back_to_topic'] . '</label></li>
|
|
|
+ ', $context['can_sticky'] ? '<li><input type="hidden" name="sticky" value="0" /><label for="check_sticky"><input type="checkbox" name="sticky" id="check_sticky"' . ($context['sticky'] ? ' checked="checked"' : '') . ' value="1" class="input_check" /> ' . $txt['sticky_after'] . '</label></li>' : '', '
|
|
|
+ <li><label for="check_smileys"><input type="checkbox" name="ns" id="check_smileys"', $context['use_smileys'] ? '' : ' checked="checked"', ' value="NS" class="input_check" /> ', $txt['dont_use_smileys'], '</label></li>', '
|
|
|
+ ', $context['can_move'] ? '<li><input type="hidden" name="move" value="0" /><label for="check_move"><input type="checkbox" name="move" id="check_move" value="1" class="input_check" ' . (!empty($context['move']) ? 'checked="checked" ' : '') . '/> ' . $txt['move_after2'] . '</label></li>' : '', '
|
|
|
+ ', $context['can_announce'] && $context['is_first_post'] ? '<li><label for="check_announce"><input type="checkbox" name="announce_topic" id="check_announce" value="1" class="input_check" ' . (!empty($context['announce']) ? 'checked="checked" ' : '') . '/> ' . $txt['announce_topic'] . '</label></li>' : '', '
|
|
|
+ ', $context['show_approval'] ? '<li><label for="approve"><input type="checkbox" name="approve" id="approve" value="2" class="input_check" ' . ($context['show_approval'] === 2 ? 'checked="checked"' : '') . ' /> ' . $txt['approve_this_post'] . '</label></li>' : '', '
|
|
|
+ </ul>
|
|
|
+ </div>';
|
|
|
|
|
|
// If this post already has attachments on it - give information about them.
|
|
|
if (!empty($context['current_attachments']))
|
|
|
{
|
|
|
echo '
|
|
|
- <dl id="postAttachment">
|
|
|
- <dt>
|
|
|
- ', $txt['attached'], ':
|
|
|
- </dt>
|
|
|
- <dd class="smalltext" style="width: 100%;">
|
|
|
- <input type="hidden" name="attach_del[]" value="0" />
|
|
|
- ', $txt['uncheck_unwatchd_attach'], ':
|
|
|
- </dd>';
|
|
|
+ <dl id="postAttachment">
|
|
|
+ <dt>
|
|
|
+ ', $txt['attached'], ':
|
|
|
+ </dt>
|
|
|
+ <dd class="smalltext" style="width: 100%;">
|
|
|
+ <input type="hidden" name="attach_del[]" value="0" />
|
|
|
+ ', $txt['uncheck_unwatchd_attach'], ':
|
|
|
+ </dd>';
|
|
|
foreach ($context['current_attachments'] as $attachment)
|
|
|
echo '
|
|
|
- <dd class="smalltext">
|
|
|
- <label for="attachment_', $attachment['id'], '"><input type="checkbox" id="attachment_', $attachment['id'], '" name="attach_del[]" value="', $attachment['id'], '"', empty($attachment['unchecked']) ? ' checked="checked"' : '', ' class="input_check" /> ', $attachment['name'], (empty($attachment['approved']) ? ' (' . $txt['awaiting_approval'] . ')' : ''),
|
|
|
- !empty($modSettings['attachmentPostLimit']) || !empty($modSettings['attachmentSizeLimit']) ? sprintf($txt['attach_kb'], comma_format(round(max($attachment['size'], 1028) / 1028), 0)) : '', '</label>
|
|
|
- </dd>';
|
|
|
+ <dd class="smalltext">
|
|
|
+ <label for="attachment_', $attachment['id'], '"><input type="checkbox" id="attachment_', $attachment['id'], '" name="attach_del[]" value="', $attachment['id'], '"', empty($attachment['unchecked']) ? ' checked="checked"' : '', ' class="input_check" /> ', $attachment['name'], (empty($attachment['approved']) ? ' (' . $txt['awaiting_approval'] . ')' : ''),
|
|
|
+ !empty($modSettings['attachmentPostLimit']) || !empty($modSettings['attachmentSizeLimit']) ? sprintf($txt['attach_kb'], comma_format(round(max($attachment['size'], 1028) / 1028), 0)) : '', '</label>
|
|
|
+ </dd>';
|
|
|
|
|
|
echo '
|
|
|
- </dl>';
|
|
|
+ </dl>';
|
|
|
|
|
|
if (!empty($context['files_in_session_warning']))
|
|
|
echo '
|
|
|
- <div class="smalltext">', $context['files_in_session_warning'], '</div>';
|
|
|
+ <div class="smalltext">', $context['files_in_session_warning'], '</div>';
|
|
|
}
|
|
|
|
|
|
// Is the user allowed to post any additional ones? If so give them the boxes to do it!
|
|
|
if ($context['can_post_attachment'])
|
|
|
{
|
|
|
echo '
|
|
|
- <dl id="postAttachment2">';
|
|
|
+ <dl id="postAttachment2">';
|
|
|
|
|
|
// But, only show them if they haven't reached a limit. Or a mod author hasn't hidden them.
|
|
|
if ($context['num_allowed_attachments'] > 0 || !empty($context['dont_show_them']))
|
|
|
{
|
|
|
echo '
|
|
|
- <dt>
|
|
|
- ', $txt['attach'], ':
|
|
|
- </dt>
|
|
|
- <dd class="smalltext">
|
|
|
- ', empty($modSettings['attachmentSizeLimit']) ? '' : ('<input type="hidden" name="MAX_FILE_SIZE" value="' . $modSettings['attachmentSizeLimit'] * 1028 . '" />'), '
|
|
|
- <input type="file" size="60" multiple="multiple" name="attachment[]" id="attachment1" class="input_file" /> (<a href="javascript:void(0);" onclick="cleanFileInput(\'attachment1\');">', $txt['clean_attach'], '</a>)';
|
|
|
+ <dt>
|
|
|
+ ', $txt['attach'], ':
|
|
|
+ </dt>
|
|
|
+ <dd class="smalltext">
|
|
|
+ ', empty($modSettings['attachmentSizeLimit']) ? '' : ('<input type="hidden" name="MAX_FILE_SIZE" value="' . $modSettings['attachmentSizeLimit'] * 1028 . '" />'), '
|
|
|
+ <input type="file" size="60" multiple="multiple" name="attachment[]" id="attachment1" class="input_file" /> (<a href="javascript:void(0);" onclick="cleanFileInput(\'attachment1\');">', $txt['clean_attach'], '</a>)';
|
|
|
|
|
|
// Show more boxes if they aren't approaching that limit.
|
|
|
if ($context['num_allowed_attachments'] > 1)
|
|
|
echo '
|
|
|
- <script type="text/javascript"><!-- // --><![CDATA[
|
|
|
- var allowed_attachments = ', $context['num_allowed_attachments'], ';
|
|
|
- var current_attachment = 1;
|
|
|
-
|
|
|
- function addAttachment()
|
|
|
- {
|
|
|
- allowed_attachments = allowed_attachments - 1;
|
|
|
- current_attachment = current_attachment + 1;
|
|
|
- if (allowed_attachments <= 0)
|
|
|
- return alert("', $txt['more_attachments_error'], '");
|
|
|
-
|
|
|
- setOuterHTML(document.getElementById("moreAttachments"), \'<dd class="smalltext"><input type="file" size="60" name="attachment[]" id="attachment\' + current_attachment + \'" class="input_file" /> (<a href="javascript:void(0);" onclick="cleanFileInput(\\\'attachment\' + current_attachment + \'\\\');">', $txt['clean_attach'], '<\/a>)\' + \'<\/dd><dd class="smalltext" id="moreAttachments"><a href="#" onclick="addAttachment(); return false;">(', $txt['more_attachments'], ')<\' + \'/a><\' + \'/dd>\');
|
|
|
-
|
|
|
- return true;
|
|
|
- }
|
|
|
- // ]]></script>
|
|
|
- </dd>
|
|
|
- <dd class="smalltext" id="moreAttachments"><a href="#" onclick="addAttachment(); return false;">(', $txt['more_attachments'], ')</a></dd>';
|
|
|
+ <script type="text/javascript"><!-- // --><![CDATA[
|
|
|
+ var allowed_attachments = ', $context['num_allowed_attachments'], ';
|
|
|
+ var current_attachment = 1;
|
|
|
+
|
|
|
+ function addAttachment()
|
|
|
+ {
|
|
|
+ allowed_attachments = allowed_attachments - 1;
|
|
|
+ current_attachment = current_attachment + 1;
|
|
|
+ if (allowed_attachments <= 0)
|
|
|
+ return alert("', $txt['more_attachments_error'], '");
|
|
|
+
|
|
|
+ setOuterHTML(document.getElementById("moreAttachments"), \'<dd class="smalltext"><input type="file" size="60" name="attachment[]" id="attachment\' + current_attachment + \'" class="input_file" /> (<a href="javascript:void(0);" onclick="cleanFileInput(\\\'attachment\' + current_attachment + \'\\\');">', $txt['clean_attach'], '<\/a>)\' + \'<\/dd><dd class="smalltext" id="moreAttachments"><a href="#" onclick="addAttachment(); return false;">(', $txt['more_attachments'], ')<\' + \'/a><\' + \'/dd>\');
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ // ]]></script>
|
|
|
+ </dd>
|
|
|
+ <dd class="smalltext" id="moreAttachments"><a href="#" onclick="addAttachment(); return false;">(', $txt['more_attachments'], ')</a></dd>';
|
|
|
else
|
|
|
echo '
|
|
|
- </dd>';
|
|
|
+ </dd>';
|
|
|
}
|
|
|
|
|
|
// Add any template changes for an alternative upload system here.
|
|
|
call_integration_hook('integrate_upload_template');
|
|
|
|
|
|
echo '
|
|
|
- <dd class="smalltext">';
|
|
|
+ <dd class="smalltext">';
|
|
|
|
|
|
// Show some useful information such as allowed extensions, maximum size and amount of attachments allowed.
|
|
|
if (!empty($modSettings['attachmentCheckExtensions']))
|
|
|
echo '
|
|
|
- ', $txt['allowed_types'], ': ', $context['allowed_extensions'], '<br />';
|
|
|
+ ', $txt['allowed_types'], ': ', $context['allowed_extensions'], '<br />';
|
|
|
|
|
|
if (!empty($context['attachment_restrictions']))
|
|
|
echo '
|
|
|
- ', $txt['attach_restrictions'], ' ', implode(', ', $context['attachment_restrictions']), '<br />';
|
|
|
+ ', $txt['attach_restrictions'], ' ', implode(', ', $context['attachment_restrictions']), '<br />';
|
|
|
|
|
|
if ($context['num_allowed_attachments'] == 0)
|
|
|
echo '
|
|
|
- ', $txt['attach_limit_nag'], '<br />';
|
|
|
+ ', $txt['attach_limit_nag'], '<br />';
|
|
|
|
|
|
if (!$context['can_post_attachment_unapproved'])
|
|
|
echo '
|
|
|
- <span class="alert">', $txt['attachment_requires_approval'], '</span>', '<br />';
|
|
|
+ <span class="alert">', $txt['attachment_requires_approval'], '</span>', '<br />';
|
|
|
|
|
|
echo '
|
|
|
- </dd>
|
|
|
- </dl>';
|
|
|
+ </dd>
|
|
|
+ </dl>';
|
|
|
}
|
|
|
|
|
|
+ echo '
|
|
|
+ </div>';
|
|
|
// If the admin enabled the drafts feature, show a draft selection box
|
|
|
if (!empty($modSettings['drafts_enabled']) && !empty($context['drafts']) && !empty($options['drafts_show_saved_enabled']))
|
|
|
{
|
|
|
echo '
|
|
|
- <br />
|
|
|
- <div id="postDraftOptionsHeader" class="title_bar">
|
|
|
- <h4 class="titlebg">
|
|
|
- <img id="postDraftExpand" class="panel_toggle" style="display: none;" src="', $settings['images_url'], '/collapse.png" alt="-" /> <strong><a href="#" id="postDraftExpandLink">', $txt['draft_load'], '</a></strong>
|
|
|
- </h4>
|
|
|
- </div>
|
|
|
- <div id="postDraftOptions" class="load_drafts padding">
|
|
|
- <dl class="settings">
|
|
|
- <dt><strong>', $txt['subject'], '</strong></dt>
|
|
|
- <dd><strong>', $txt['draft_saved_on'], '</strong></dd>';
|
|
|
+ <div id="postDraftOptionsHeader" class="title_bar">
|
|
|
+ <h4 class="titlebg">
|
|
|
+ <img id="postDraftExpand" class="panel_toggle" style="display: none;" src="', $settings['images_url'], '/collapse.png" alt="-" /> <strong><a href="#" id="postDraftExpandLink">', $txt['draft_load'], '</a></strong>
|
|
|
+ </h4>
|
|
|
+ </div>
|
|
|
+ <div id="postDraftOptions">
|
|
|
+ <dl class="settings">
|
|
|
+ <dt><strong>', $txt['subject'], '</strong></dt>
|
|
|
+ <dd><strong>', $txt['draft_saved_on'], '</strong></dd>';
|
|
|
|
|
|
foreach ($context['drafts'] as $draft)
|
|
|
echo '
|
|
|
- <dt>', $draft['link'], '</dt>
|
|
|
- <dd>', $draft['poster_time'], '</dd>';
|
|
|
+ <dt>', $draft['link'], '</dt>
|
|
|
+ <dd>', $draft['poster_time'], '</dd>';
|
|
|
echo '
|
|
|
- </dl>
|
|
|
- </div>';
|
|
|
+ </dl>
|
|
|
+ </div>';
|
|
|
}
|
|
|
|
|
|
// Is visual verification enabled?
|
|
@@ -750,10 +753,7 @@ function template_main()
|
|
|
document.getElementById(\'additional_options\').value = \'1\';
|
|
|
},
|
|
|
aSwappableContainers: [
|
|
|
- \'postMoreOptions\',
|
|
|
- \'postAttachment\',
|
|
|
- \'postAttachment2\',
|
|
|
- \'postAttachment3\'
|
|
|
+ \'postAdditionalOptions\',
|
|
|
],
|
|
|
aSwapImages: [
|
|
|
{
|