annotate forum/Themes/default/SendTopic.template.php @ 82:6dd719d7c78b website

Add Sonic Annotator pages (probably best to host it here in future rather than with the omras2 site)
author Chris Cannam
date Mon, 20 Jan 2014 10:48:02 +0000
parents e3e11437ecea
children
rev   line source
Chris@76 1 <?php
Chris@76 2 /**
Chris@76 3 * Simple Machines Forum (SMF)
Chris@76 4 *
Chris@76 5 * @package SMF
Chris@76 6 * @author Simple Machines
Chris@76 7 * @copyright 2011 Simple Machines
Chris@76 8 * @license http://www.simplemachines.org/about/smf/license.php BSD
Chris@76 9 *
Chris@76 10 * @version 2.0
Chris@76 11 */
Chris@76 12
Chris@76 13 //------------------------------------------------------------------------------
Chris@76 14 /* This template contains two humble sub templates - main. Its job is pretty
Chris@76 15 simple: it collects the information we need to actually send the topic.
Chris@76 16
Chris@76 17 The main sub template gets shown from:
Chris@76 18 '?action=emailuser;sa=sendtopic;topic=##.##'
Chris@76 19 And should submit to:
Chris@76 20 '?action=emailuser;sa=sendtopic;topic=' . $context['current_topic'] . '.' . $context['start']
Chris@76 21 It should send the following fields:
Chris@76 22 y_name: sender's name.
Chris@76 23 y_email: sender's email.
Chris@76 24 comment: any additional comment.
Chris@76 25 r_name: receiver's name.
Chris@76 26 r_email: receiver's email address.
Chris@76 27 send: this just needs to be set, as by the submit button.
Chris@76 28 sc: the session id, or $context['session_id'].
Chris@76 29
Chris@76 30 The report sub template gets shown from:
Chris@76 31 '?action=reporttm;topic=##.##;msg=##'
Chris@76 32 It should submit to:
Chris@76 33 '?action=reporttm;topic=' . $context['current_topic'] . '.' . $context['start']
Chris@76 34 It only needs to send the following fields:
Chris@76 35 comment: an additional comment to give the moderator.
Chris@76 36 sc: the session id, or $context['session_id'].
Chris@76 37 */
Chris@76 38
Chris@76 39 // This is where we get information about who they want to send the topic to, etc.
Chris@76 40 function template_main()
Chris@76 41 {
Chris@76 42 global $context, $settings, $options, $txt, $scripturl;
Chris@76 43
Chris@76 44 echo '
Chris@76 45 <div id="send_topic">
Chris@76 46 <form action="', $scripturl, '?action=emailuser;sa=sendtopic;topic=', $context['current_topic'], '.', $context['start'], '" method="post" accept-charset="', $context['character_set'], '">
Chris@76 47 <div class="cat_bar">
Chris@76 48 <h3 class="catbg">
Chris@76 49 <span class="ie6_header floatleft"><img src="', $settings['images_url'], '/email_sm.gif" alt="" class="icon" />', $context['page_title'], '</span>
Chris@76 50 </h3>
Chris@76 51 </div>
Chris@76 52 <div class="windowbg2">
Chris@76 53 <span class="topslice"><span></span></span>
Chris@76 54 <div class="content">
Chris@76 55 <fieldset id="sender" class="send_topic">
Chris@76 56 <dl class="settings send_topic">
Chris@76 57 <dt>
Chris@76 58 <label for="y_name"><strong>', $txt['sendtopic_sender_name'], ':</strong></label>
Chris@76 59 </dt>
Chris@76 60 <dd>
Chris@76 61 <input type="text" id="y_name" name="y_name" size="30" maxlength="40" value="', $context['user']['name'], '" class="input_text" />
Chris@76 62 </dd>
Chris@76 63 <dt>
Chris@76 64 <label for="y_email"><strong>', $txt['sendtopic_sender_email'], ':</strong></label>
Chris@76 65 </dt>
Chris@76 66 <dd>
Chris@76 67 <input type="text" id="y_email" name="y_email" size="30" maxlength="50" value="', $context['user']['email'], '" class="input_text" />
Chris@76 68 </dd>
Chris@76 69 <dt>
Chris@76 70 <label for="comment"><strong>', $txt['sendtopic_comment'], ':</strong></label>
Chris@76 71 </dt>
Chris@76 72 <dd>
Chris@76 73 <input type="text" id="comment" name="comment" size="30" maxlength="100" class="input_text" />
Chris@76 74 </dd>
Chris@76 75 </dl>
Chris@76 76 </fieldset>
Chris@76 77 <fieldset id="recipient" class="send_topic">
Chris@76 78 <dl class="settings send_topic">
Chris@76 79 <dt>
Chris@76 80 <label for="r_name"><strong>', $txt['sendtopic_receiver_name'], ':</strong></label>
Chris@76 81 </dt>
Chris@76 82 <dd>
Chris@76 83 <input type="text" id="r_name" name="r_name" size="30" maxlength="40" class="input_text" />
Chris@76 84 </dd>
Chris@76 85 <dt>
Chris@76 86 <label for="r_email"><strong>', $txt['sendtopic_receiver_email'], ':</strong></label>
Chris@76 87 </dt>
Chris@76 88 <dd>
Chris@76 89 <input type="text" id="r_email" name="r_email" size="30" maxlength="50" class="input_text" />
Chris@76 90 </dd>
Chris@76 91 </dl>
Chris@76 92 </fieldset>
Chris@76 93 <div class="righttext">
Chris@76 94 <input type="submit" name="send" value="', $txt['sendtopic_send'], '" class="button_submit" />
Chris@76 95 </div>
Chris@76 96 </div>
Chris@76 97 <span class="botslice"><span></span></span>
Chris@76 98 </div>
Chris@76 99 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
Chris@76 100 </form>
Chris@76 101 </div>
Chris@76 102 <br class="clear" />';
Chris@76 103 }
Chris@76 104
Chris@76 105 // Send an email to a user!
Chris@76 106 function template_custom_email()
Chris@76 107 {
Chris@76 108 global $context, $settings, $options, $txt, $scripturl;
Chris@76 109
Chris@76 110 echo '
Chris@76 111 <div id="send_topic">
Chris@76 112 <form action="', $scripturl, '?action=emailuser;sa=email" method="post" accept-charset="', $context['character_set'], '">
Chris@76 113 <div class="cat_bar">
Chris@76 114 <h3 class="catbg">
Chris@76 115 <span class="ie6_header floatleft"><img src="', $settings['images_url'], '/email_sm.gif" alt="" class="icon" />', $context['page_title'], '</span>
Chris@76 116 </h3>
Chris@76 117 </div>
Chris@76 118 <div class="windowbg">
Chris@76 119 <span class="topslice"><span></span></span>
Chris@76 120 <div class="content">
Chris@76 121 <dl class="settings send_mail">
Chris@76 122 <dt>
Chris@76 123 <strong>', $txt['sendtopic_receiver_name'], ':</strong>
Chris@76 124 </dt>
Chris@76 125 <dd>
Chris@76 126 ', $context['recipient']['link'], '
Chris@76 127 </dd>';
Chris@76 128
Chris@76 129 // Can the user see the persons email?
Chris@76 130 if ($context['can_view_receipient_email'])
Chris@76 131 echo '
Chris@76 132 <dt>
Chris@76 133 <strong>', $txt['sendtopic_receiver_email'], ':</strong>
Chris@76 134 </dt>
Chris@76 135 <dd>
Chris@76 136 ', $context['recipient']['email_link'], '
Chris@76 137 </dd>
Chris@76 138 </dl>
Chris@76 139 <hr />
Chris@76 140 <dl class="settings send_mail">';
Chris@76 141
Chris@76 142 // If it's a guest we need their details.
Chris@76 143 if ($context['user']['is_guest'])
Chris@76 144 echo '
Chris@76 145 <dt>
Chris@76 146 <label for="y_name"><strong>', $txt['sendtopic_sender_name'], ':</strong></label>
Chris@76 147 </dt>
Chris@76 148 <dd>
Chris@76 149 <input type="text" id="y_name" name="y_name" size="24" maxlength="40" value="', $context['user']['name'], '" class="input_text" />
Chris@76 150 </dd>
Chris@76 151 <dt>
Chris@76 152 <label for="y_email"><strong>', $txt['sendtopic_sender_email'], ':</strong></label><br />
Chris@76 153 <span class="smalltext">', $txt['send_email_disclosed'], '</span>
Chris@76 154 </dt>
Chris@76 155 <dd>
Chris@76 156 <input type="text" id="y_mail" name="y_email" size="24" maxlength="50" value="', $context['user']['email'], '" class="input_text" />
Chris@76 157 </dt>';
Chris@76 158 // Otherwise show the user that we know their email.
Chris@76 159 else
Chris@76 160 echo '
Chris@76 161 <dt>
Chris@76 162 <strong>', $txt['sendtopic_sender_email'], ':</strong><br />
Chris@76 163 <span class="smalltext">', $txt['send_email_disclosed'], '</span>
Chris@76 164 </dt>
Chris@76 165 <dd>
Chris@76 166 <em>', $context['user']['email'], '</em>
Chris@76 167 </dd>';
Chris@76 168
Chris@76 169 echo '
Chris@76 170 <dt>
Chris@76 171 <label for="email_subject"><strong>', $txt['send_email_subject'], ':</strong></label>
Chris@76 172 </dt>
Chris@76 173 <dd>
Chris@76 174 <input type="text" id="email_subject" name="email_subject" size="50" maxlength="100" class="input_text" />
Chris@76 175 </dd>
Chris@76 176 <dt>
Chris@76 177 <label for="email_body"><strong>', $txt['message'], ':</strong></label>
Chris@76 178 </dt>
Chris@76 179 <dd>
Chris@76 180 <textarea id="email_body" name="email_body" rows="10" cols="20" style="' . ($context['browser']['is_ie8'] ? 'width: 635px; max-width: 90%; min-width: 90%' : 'width: 90%') . ';"></textarea>
Chris@76 181 </dd>
Chris@76 182 </dl>
Chris@76 183 <div class="righttext">
Chris@76 184 <input type="submit" name="send" value="', $txt['sendtopic_send'], '" class="button_submit" />
Chris@76 185 </div>
Chris@76 186 </div>
Chris@76 187 <span class="botslice"><span></span></span>
Chris@76 188 </div>';
Chris@76 189
Chris@76 190 foreach ($context['form_hidden_vars'] as $key => $value)
Chris@76 191 echo '
Chris@76 192 <input type="hidden" name="', $key, '" value="', $value, '" />';
Chris@76 193
Chris@76 194 echo '
Chris@76 195 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
Chris@76 196 </form>
Chris@76 197 </div>
Chris@76 198 <br class="clear" />';
Chris@76 199 }
Chris@76 200
Chris@76 201 function template_report()
Chris@76 202 {
Chris@76 203 global $context, $settings, $options, $txt, $scripturl;
Chris@76 204
Chris@76 205 echo '
Chris@76 206 <div id="report_topic">
Chris@76 207 <form action="', $scripturl, '?action=reporttm;topic=', $context['current_topic'], '.', $context['start'], '" method="post" accept-charset="', $context['character_set'], '">
Chris@76 208 <input type="hidden" name="msg" value="' . $context['message_id'] . '" />
Chris@76 209 <div class="cat_bar">
Chris@76 210 <h3 class="catbg">', $txt['report_to_mod'], '</h3>
Chris@76 211 </div>
Chris@76 212 <div class="windowbg">
Chris@76 213 <span class="topslice"><span></span></span>
Chris@76 214 <div class="content">';
Chris@76 215
Chris@76 216 if (!empty($context['post_errors']))
Chris@76 217 {
Chris@76 218 echo '
Chris@76 219 <div class="errorbox">
Chris@76 220 <ul>';
Chris@76 221
Chris@76 222 foreach ($context['post_errors'] as $error)
Chris@76 223 echo '
Chris@76 224 <li class="error">', $error, '</li>';
Chris@76 225
Chris@76 226 echo '
Chris@76 227 </ul>
Chris@76 228 </div>';
Chris@76 229 }
Chris@76 230
Chris@76 231 echo '
Chris@76 232 <p>', $txt['report_to_mod_func'], '</p>
Chris@76 233 <br />
Chris@76 234 <dl class="settings" id="report_post">';
Chris@76 235
Chris@76 236 if ($context['user']['is_guest'])
Chris@76 237 {
Chris@76 238 echo '
Chris@76 239 <dt>
Chris@76 240 <label for="email_address">', $txt['email'], '</label>:
Chris@76 241 </dt>
Chris@76 242 <dd>
Chris@76 243 <input type="text" id="email_address" name="email" value="', $context['email_address'], '" size="25" maxlength="255" />
Chris@76 244 </dd>';
Chris@76 245 }
Chris@76 246
Chris@76 247 echo '
Chris@76 248 <dt>
Chris@76 249 <label for="report_comment">', $txt['enter_comment'], '</label>:
Chris@76 250 </dt>
Chris@76 251 <dd>
Chris@76 252 <input type="text" id="report_comment" name="comment" size="50" value="', $context['comment_body'], '" maxlength="255" />
Chris@76 253 </dd>';
Chris@76 254
Chris@76 255 if ($context['require_verification'])
Chris@76 256 {
Chris@76 257 echo '
Chris@76 258 <dt>
Chris@76 259 ', $txt['verification'], ':
Chris@76 260 </dt>
Chris@76 261 <dd>
Chris@76 262 ', template_control_verification($context['visual_verification_id'], 'all'), '
Chris@76 263 </dd>';
Chris@76 264 }
Chris@76 265
Chris@76 266 echo '
Chris@76 267 </dl>
Chris@76 268 <div class="righttext">
Chris@76 269 <input type="submit" name="submit" value="', $txt['rtm10'], '" style="margin-left: 1ex;" class="button_submit" />
Chris@76 270 </div>
Chris@76 271 </div>
Chris@76 272 <span class="botslice"><span></span></span>
Chris@76 273 </div>
Chris@76 274 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
Chris@76 275 </form>
Chris@76 276 </div>
Chris@76 277 <br class="clear" />';
Chris@76 278 }
Chris@76 279
Chris@76 280 ?>