GenericControls.template.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553
  1. <?php
  2. /**
  3. * Simple Machines Forum (SMF)
  4. *
  5. * @package SMF
  6. * @author Simple Machines
  7. * @copyright 2011 Simple Machines
  8. * @license http://www.simplemachines.org/about/smf/license.php BSD
  9. *
  10. * @version 2.1 Alpha 1
  11. */
  12. // This function displays all the stuff you get with a richedit box - BBC, smileys etc.
  13. function template_control_richedit($editor_id, $smileyContainer = null, $bbcContainer = null)
  14. {
  15. global $context, $settings, $options, $txt, $modSettings, $scripturl, $boardurl;
  16. $editor_context = &$context['controls']['richedit'][$editor_id];
  17. echo '
  18. <div>
  19. <div style="width: 98.8%;">
  20. <div>
  21. <textarea class="editor" name="', $editor_id, '" id="', $editor_id, '" rows="', $editor_context['rows'], '" cols="600" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onchange="storeCaret(this);" tabindex="', $context['tabindex']++, '" style="height: ', $editor_context['height'], '; ', isset($context['post_error']['no_message']) || isset($context['post_error']['long_message']) ? 'border: 1px solid red;' : '', '">', $editor_context['value'], '</textarea>
  22. </div>
  23. <div id="', $editor_id, '_resizer" class="richedit_resize"></div>
  24. </div>
  25. </div>
  26. <input type="hidden" name="', $editor_id, '_mode" id="', $editor_id, '_mode" value="0" />
  27. <script type="text/javascript"><!-- // --><![CDATA[
  28. var bbc_quote_from = \'', $txt['quote_from'], '\'
  29. var bbc_quote = \'', $txt['quote'], '\'
  30. var bbc_search_on = \'', $txt['search_on'], '\';
  31. (function($) {
  32. var extensionMethods = {
  33. InsertText: function(text) {
  34. var bIsSource = this.inSourceMode();
  35. // @TODO make it put the quote close to the current selection
  36. if (!bIsSource)
  37. this.toggleTextMode();
  38. var current_value = this.getTextareaValue(false) + "\n" + text;
  39. this.setTextareaValue(current_value);
  40. if (!bIsSource)
  41. this.toggleTextMode();
  42. },
  43. getText: function() {
  44. if(this.inSourceMode())
  45. var current_value = this.getTextareaValue(false);
  46. else
  47. var current_value = this.getWysiwygEditorValue();
  48. },
  49. appendEmoticon: function (code, emoticon) {
  50. if (code == \'\')
  51. line.append($(\'<br />\'));
  52. else
  53. line.append($(\'<img />\')
  54. .attr({
  55. src: emoticon,
  56. alt: code,
  57. })
  58. .click(function (e) {
  59. var start = \'\', end = \'\';
  60. if (base.options.emoticonsCompat)
  61. {
  62. start = \'<span> \';
  63. end = \' </span>\';
  64. }
  65. if (base.inSourceMode())
  66. base.textEditorInsertText(start + + end);
  67. else
  68. base.wysiwygEditorInsertHtml(start + \'<img src="\' + $(this).attr("src") +
  69. \'" data-sceditor-emoticon="\' + $(this).attr(\'alt\') + \'" />\' + end);
  70. e.preventDefault();
  71. })
  72. );
  73. if (line.children().length > 0)
  74. content.append(line);
  75. $(".sceditor-toolbar").append(content);
  76. },
  77. createPermanentDropDown: function() {
  78. var emoticons = $.extend({}, this.options.emoticons.dropdown);
  79. content = $(\'<div />\').attr({class: "sceditor-insertemoticon"});
  80. line = $(\'<div />\');
  81. base = this;
  82. if (typeof this.options.emoticons.popup !== "undefined")
  83. {
  84. this.options.emoticons.more = this.options.emoticons.popup;
  85. moreButton = $(\'<div />\').attr({class: "sceditor-more"}).text(', JavaScriptEscape('[' . $txt['more'] . ']'), ').click(function () {
  86. if ($(".sceditor-smileyPopup").length > 0)
  87. {
  88. $(".sceditor-smileyPopup").fadeIn(\'fast\');
  89. }
  90. else
  91. {
  92. var emoticons = $.extend({}, base.options.emoticons.popup);
  93. var basement = $(\'<div />\').attr({class: "sceditor-popup"});
  94. allowHide = true;
  95. popupContent = $(\'<div />\');
  96. line = $(\'<div />\');
  97. closeButton = $(\'<span />\').text(', JavaScriptEscape('[' . $txt['find_close'] . ']'), ').click(function () {
  98. $(".sceditor-smileyPopup").fadeOut(\'fast\');
  99. });
  100. $.each(emoticons, base.appendEmoticon);
  101. if (line.children().length > 0)
  102. popupContent.append(line);
  103. if (typeof closeButton !== "undefined")
  104. popupContent.append(closeButton);
  105. // IE needs unselectable attr to stop it from unselecting the text in the editor.
  106. // The editor can cope if IE does unselect the text it\'s just not nice.
  107. if(base.ieUnselectable !== false) {
  108. content = $(content);
  109. content.find(\':not(input,textarea)\').filter(function() { return this.nodeType===1; }).attr(\'unselectable\', \'on\');
  110. }
  111. $dropdown = $(\'<div class="sceditor-dropdown sceditor-smileyPopup" />\').append(popupContent);
  112. $dropdown.appendTo($(\'body\'));
  113. dropdownIgnoreLastClick = true;
  114. $dropdown.css({
  115. position: "fixed",
  116. top: $(window).height() * 0.2,
  117. left: $(window).width() * 0.5 - ($dropdown.width() / 2),
  118. "max-width": "50%"
  119. });
  120. // stop clicks within the dropdown from being handled
  121. $dropdown.click(function (e) {
  122. e.stopPropagation();
  123. });
  124. }
  125. });
  126. }
  127. $.each(emoticons, base.appendEmoticon);
  128. if (typeof moreButton !== "undefined")
  129. content.append(moreButton);
  130. }
  131. };
  132. $.extend(true, $[\'sceditor\'].prototype, extensionMethods);
  133. })(jQuery);
  134. $(document).ready(function() {
  135. $("#', $editor_id, '").sceditorBBCodePlugin({
  136. style: "', $settings['default_theme_url'], '/css/jquery.sceditor.default.css",
  137. emoticonsCompat: true,
  138. colors: "black,red,yellow,pink,green,orange,purple,blue,beige,brown,teal,navy,maroon,limegreen,white"';
  139. // Show the smileys.
  140. if ((!empty($context['smileys']['postform']) || !empty($context['smileys']['popup'])) && !$editor_context['disable_smiley_box'] && $smileyContainer !== null)
  141. {
  142. echo ',
  143. emoticons:
  144. {';
  145. $countLocations = count($context['smileys']);
  146. foreach ($context['smileys'] as $location => $smileyRows)
  147. {
  148. $countLocations--;
  149. if ($location == 'postform')
  150. echo '
  151. dropdown:
  152. {';
  153. elseif ($location == 'popup')
  154. echo '
  155. popup:
  156. {';
  157. $numRows = count($smileyRows);
  158. foreach ($smileyRows as $smileyRow)
  159. {
  160. foreach ($smileyRow['smileys'] as $smiley)
  161. {
  162. echo '
  163. ', JavaScriptEscape($smiley['code']), ': ', JavaScriptEscape(str_replace($boardurl . '/', '', $settings['smileys_url'] . '/' . $smiley['filename'])), empty($smiley['isLast']) ? ',' : '';
  164. }
  165. if (empty($smileyRow['isLast']) && $numRows != 1)
  166. echo ',
  167. \'\': \'\',';
  168. }
  169. echo '
  170. }', $countLocations != 0 ? ',' : '';
  171. }
  172. echo '
  173. }';
  174. /*
  175. emoticons:
  176. {
  177. // emoticons to be included in the dropdown
  178. dropdown: {
  179. ":)": "emoticons/smile.png",
  180. ":angel:": "emoticons/angel.png"
  181. },
  182. // emoticons to be included in the more section
  183. more: {
  184. ":alien:": "emoticons/alien.png",
  185. ":blink:": "emoticons/blink.png"
  186. },
  187. // emoticons that are not shwon in the dropdown but will be converted ATY
  188. hidden: {
  189. ":aliasforalien:": "emoticons/alien.png",
  190. ":aliasforblink:": "emoticons/blink.png"
  191. }
  192. },*/
  193. }
  194. /*
  195. // Show the smileys.
  196. // if ((!empty($context['smileys']['postform']) || !empty($context['smileys']['popup'])) && !$editor_context['disable_smiley_box'] && $smileyContainer !== null)
  197. // {
  198. // echo '
  199. // var oSmileyBox_', $editor_id, ' = new smc_SmileyBox({
  200. // sUniqueId: ', JavaScriptEscape('smileyBox_' . $editor_id), ',
  201. // sContainerDiv: ', JavaScriptEscape($smileyContainer), ',
  202. // sClickHandler: ', JavaScriptEscape('oEditorHandle_' . $editor_id . '.insertSmiley'), ',
  203. // oSmileyLocations: {';
  204. //
  205. // foreach ($context['smileys'] as $location => $smileyRows)
  206. // {
  207. // echo '
  208. // ', $location, ': [';
  209. // foreach ($smileyRows as $smileyRow)
  210. // {
  211. // echo '
  212. // [';
  213. // foreach ($smileyRow['smileys'] as $smiley)
  214. // echo '
  215. // {
  216. // sCode: ', JavaScriptEscape($smiley['code']), ',
  217. // sSrc: ', JavaScriptEscape($settings['smileys_url'] . '/' . $smiley['filename']), ',
  218. // sDescription: ', JavaScriptEscape($smiley['description']), '
  219. // }', empty($smiley['isLast']) ? ',' : '';
  220. //
  221. // echo '
  222. // ]', empty($smileyRow['isLast']) ? ',' : '';
  223. // }
  224. // echo '
  225. // ]', $location === 'postform' ? ',' : '';
  226. // }
  227. // echo '
  228. // },
  229. // sSmileyBoxTemplate: ', JavaScriptEscape('
  230. // %smileyRows% %moreSmileys%
  231. // '), ',
  232. // sSmileyRowTemplate: ', JavaScriptEscape('
  233. // <div>%smileyRow%</div>
  234. // '), ',
  235. // sSmileyTemplate: ', JavaScriptEscape('
  236. // <img src="%smileySource%" align="bottom" alt="%smileyDescription%" title="%smileyDescription%" id="%smileyId%" />
  237. // '), ',
  238. // sMoreSmileysTemplate: ', JavaScriptEscape('
  239. // <a href="#" id="%moreSmileysId%">[' . (!empty($context['smileys']['postform']) ? $txt['more_smileys'] : $txt['more_smileys_pick']) . ']</a>
  240. // '), ',
  241. // sMoreSmileysLinkId: ', JavaScriptEscape('moreSmileys_' . $editor_id), ',
  242. // sMoreSmileysPopupTemplate: ', JavaScriptEscape('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  243. // <html>
  244. // <head>
  245. // <title>' . $txt['more_smileys_title'] . '</title>
  246. // <link rel="stylesheet" type="text/css" href="' . $settings['theme_url'] . '/css/index' . $context['theme_variant'] . '.css?alp21" />
  247. // </head>
  248. // <body id="help_popup">
  249. // <div class="padding windowbg">
  250. // <div class="cat_bar">
  251. // <h3 class="catbg">
  252. // ' . $txt['more_smileys_pick'] . '
  253. // </h3>
  254. // </div>
  255. // <div class="padding">
  256. // %smileyRows%
  257. // </div>
  258. // <div class="smalltext centertext">
  259. // <a href="#" id="%moreSmileysCloseLinkId%">' . $txt['more_smileys_close_window'] . '</a>
  260. // </div>
  261. // </div>
  262. // </body>
  263. // </html>'), '
  264. // });';
  265. // }
  266. */ /*
  267. // if ($context['show_bbc'] && $bbcContainer !== null)
  268. // {
  269. // echo '
  270. // var oBBCBox_', $editor_id, ' = new smc_BBCButtonBox({
  271. // sUniqueId: ', JavaScriptEscape('BBCBox_' . $editor_id), ',
  272. // sContainerDiv: ', JavaScriptEscape($bbcContainer), ',
  273. // sButtonClickHandler: ', JavaScriptEscape('oEditorHandle_' . $editor_id . '.handleButtonClick'), ',
  274. // sSelectChangeHandler: ', JavaScriptEscape('oEditorHandle_' . $editor_id . '.handleSelectChange'), ',
  275. // aButtonRows: [';
  276. //
  277. // // Here loop through the array, printing the images/rows/separators!
  278. // foreach ($context['bbc_tags'] as $i => $buttonRow)
  279. // {
  280. // echo '
  281. // [';
  282. // foreach ($buttonRow as $tag)
  283. // {
  284. // // Is there a "before" part for this bbc button? If not, it can't be a button!!
  285. // if (isset($tag['before']))
  286. // echo '
  287. // {
  288. // sType: \'button\',
  289. // bEnabled: ', empty($context['disabled_tags'][$tag['code']]) ? 'true' : 'false', ',
  290. // sImage: ', file_exists($settings['theme_dir'] . '/images/bbc/' . $tag['image'] . '.png') ? JavaScriptEscape($settings['images_url'] . '/bbc/' . $tag['image'] . '.png') : JavaScriptEscape($settings['images_url'] . '/bbc/' . $tag['image'] . '.gif'), ',
  291. // sCode: ', JavaScriptEscape($tag['code']), ',
  292. // sBefore: ', JavaScriptEscape($tag['before']), ',
  293. // sAfter: ', isset($tag['after']) ? JavaScriptEscape($tag['after']) : 'null', ',
  294. // sDescription: ', JavaScriptEscape($tag['description']), '
  295. // }', empty($tag['isLast']) ? ',' : '';
  296. //
  297. // // Must be a divider then.
  298. // else
  299. // echo '
  300. // {
  301. // sType: \'divider\'
  302. // }', empty($tag['isLast']) ? ',' : '';
  303. // }
  304. //
  305. // // Add the select boxes to the first row.
  306. // if ($i == 0)
  307. // {
  308. // // Show the font drop down...
  309. // if (!isset($context['disabled_tags']['font']))
  310. // echo ',
  311. // {
  312. // sType: \'select\',
  313. // sName: \'sel_face\',
  314. // oOptions: {
  315. // \'\': ', JavaScriptEscape($txt['font_face']), ',
  316. // \'courier\': \'Courier\',
  317. // \'arial\': \'Arial\',
  318. // \'arial black\': \'Arial Black\',
  319. // \'impact\': \'Impact\',
  320. // \'verdana\': \'Verdana\',
  321. // \'times new roman\': \'Times New Roman\',
  322. // \'georgia\': \'Georgia\',
  323. // \'andale mono\': \'Andale Mono\',
  324. // \'trebuchet ms\': \'Trebuchet MS\',
  325. // \'comic sans ms\': \'Comic Sans MS\'
  326. // }
  327. // }';
  328. //
  329. // // Font sizes anyone?
  330. // if (!isset($context['disabled_tags']['size']))
  331. // echo ',
  332. // {
  333. // sType: \'select\',
  334. // sName: \'sel_size\',
  335. // oOptions: {
  336. // \'\': ', JavaScriptEscape($txt['font_size']), ',
  337. // \'1\': \'8pt\',
  338. // \'2\': \'10pt\',
  339. // \'3\': \'12pt\',
  340. // \'4\': \'14pt\',
  341. // \'5\': \'18pt\',
  342. // \'6\': \'24pt\',
  343. // \'7\': \'36pt\'
  344. // }
  345. // }';
  346. //
  347. // // Print a drop down list for all the colors we allow!
  348. // if (!isset($context['disabled_tags']['color']))
  349. // echo ',
  350. // {
  351. // sType: \'select\',
  352. // sName: \'sel_color\',
  353. // oOptions: {
  354. // \'\': ', JavaScriptEscape($txt['change_color']), ',
  355. // \'black\': ', JavaScriptEscape($txt['black']), ',
  356. // \'red\': ', JavaScriptEscape($txt['red']), ',
  357. // \'yellow\': ', JavaScriptEscape($txt['yellow']), ',
  358. // \'pink\': ', JavaScriptEscape($txt['pink']), ',
  359. // \'green\': ', JavaScriptEscape($txt['green']), ',
  360. // \'orange\': ', JavaScriptEscape($txt['orange']), ',
  361. // \'purple\': ', JavaScriptEscape($txt['purple']), ',
  362. // \'blue\': ', JavaScriptEscape($txt['blue']), ',
  363. // \'beige\': ', JavaScriptEscape($txt['beige']), ',
  364. // \'brown\': ', JavaScriptEscape($txt['brown']), ',
  365. // \'teal\': ', JavaScriptEscape($txt['teal']), ',
  366. // \'navy\': ', JavaScriptEscape($txt['navy']), ',
  367. // \'maroon\': ', JavaScriptEscape($txt['maroon']), ',
  368. // \'limegreen\': ', JavaScriptEscape($txt['lime_green']), ',
  369. // \'white\': ', JavaScriptEscape($txt['white']), '
  370. // }
  371. // }';
  372. // }
  373. // echo '
  374. // ]', $i == count($context['bbc_tags']) - 1 ? '' : ',';
  375. // }
  376. // echo '
  377. // ],
  378. // sButtonTemplate: ', JavaScriptEscape('
  379. // <img id="%buttonId%" src="%buttonSrc%" align="bottom" width="23" height="22" alt="%buttonDescription%" title="%buttonDescription%" />
  380. // '), ',
  381. // sButtonBackgroundImage: ', JavaScriptEscape($settings['images_url'] . '/bbc/bbc_bg.png'), ',
  382. // sButtonBackgroundImageHover: ', JavaScriptEscape($settings['images_url'] . '/bbc/bbc_hoverbg.png'), ',
  383. // sActiveButtonBackgroundImage: ', JavaScriptEscape($settings['images_url'] . '/bbc/bbc_hoverbg.png'), ',
  384. // sDividerTemplate: ', JavaScriptEscape('
  385. // <img src="' . $settings['images_url'] . '/bbc/divider.png" alt="|" style="margin: 0 3px;" />
  386. // '), ',
  387. // sSelectTemplate: ', JavaScriptEscape('
  388. // <select name="%selectName%" id="%selectId%" style="margin-bottom: 1ex; font-size: x-small;">
  389. // %selectOptions%
  390. // </select>
  391. // '), ',
  392. // sButtonRowTemplate: ', JavaScriptEscape('
  393. // <div>%buttonRow%</div>
  394. // '), '
  395. // });';
  396. // }
  397. // // Now it's all drawn out we'll actually setup the box.
  398. // echo '
  399. // var oEditorHandle_', $editor_id, ' = new smc_Editor({
  400. // sSessionId: smf_session_id,
  401. // sSessionVar: smf_session_var,
  402. // sFormId: ', JavaScriptEscape($editor_context['form']), ',
  403. // sUniqueId: ', JavaScriptEscape($editor_id), ',
  404. // bRTL: ', $txt['lang_rtl'] ? 'true' : 'false', ',
  405. // bWysiwyg: ', $editor_context['rich_active'] ? 'true' : 'false', ',
  406. // sText: ', JavaScriptEscape($editor_context['rich_active'] ? $editor_context['rich_value'] : ''), ',
  407. // sEditWidth: ', JavaScriptEscape($editor_context['width']), ',
  408. // sEditHeight: ', JavaScriptEscape($editor_context['height']), ',
  409. // bRichEditOff: ', empty($modSettings['disable_wysiwyg']) ? 'false' : 'true', ',
  410. // oSmileyBox: ', !empty($context['smileys']['postform']) && !$editor_context['disable_smiley_box'] && $smileyContainer !== null ? 'oSmileyBox_' . $editor_id : 'null', ',
  411. // oBBCBox: ', $context['show_bbc'] && $bbcContainer !== null ? 'oBBCBox_' . $editor_id : 'null', '
  412. // });
  413. // smf_editorArray[smf_editorArray.length] = oEditorHandle_', $editor_id, ';';
  414. */
  415. echo '
  416. })
  417. $("#', $editor_id, '").data("sceditor").createPermanentDropDown();
  418. $(".sceditor-container").width("100%");
  419. });
  420. // ]]></script>';
  421. }
  422. function template_control_richedit_buttons($editor_id)
  423. {
  424. global $context, $settings, $options, $txt, $modSettings, $scripturl;
  425. $editor_context = &$context['controls']['richedit'][$editor_id];
  426. echo '
  427. <input type="submit" value="', isset($editor_context['labels']['post_button']) ? $editor_context['labels']['post_button'] : $txt['post'], '" tabindex="', $context['tabindex']++, '" onclick="return submitThisOnce(this);" accesskey="s" class="button_submit" />';
  428. if ($editor_context['preview_type'])
  429. echo '
  430. <input type="submit" name="preview" value="', isset($editor_context['labels']['preview_button']) ? $editor_context['labels']['preview_button'] : $txt['preview'], '" tabindex="', $context['tabindex']++, '" onclick="', $editor_context['preview_type'] == 2 ? 'return event.ctrlKey || previewPost();' : 'return submitThisOnce(this);', '" accesskey="p" class="button_submit" />';
  431. if ($context['show_spellchecking'])
  432. echo '
  433. <input type="button" value="', $txt['spell_check'], '" tabindex="', $context['tabindex']++, '" onclick="oEditorHandle_', $editor_id, '.spellCheckStart();" class="button_submit" />';
  434. }
  435. // What's this, verification?!
  436. function template_control_verification($verify_id, $display_type = 'all', $reset = false)
  437. {
  438. global $context, $settings, $options, $txt, $modSettings;
  439. $verify_context = &$context['controls']['verification'][$verify_id];
  440. // Keep track of where we are.
  441. if (empty($verify_context['tracking']) || $reset)
  442. $verify_context['tracking'] = 0;
  443. // How many items are there to display in total.
  444. $total_items = count($verify_context['questions']) + ($verify_context['show_visual'] ? 1 : 0);
  445. // If we've gone too far, stop.
  446. if ($verify_context['tracking'] > $total_items)
  447. return false;
  448. // Loop through each item to show them.
  449. for ($i = 0; $i < $total_items; $i++)
  450. {
  451. // If we're after a single item only show it if we're in the right place.
  452. if ($display_type == 'single' && $verify_context['tracking'] != $i)
  453. continue;
  454. if ($display_type != 'single')
  455. echo '
  456. <div id="verification_control_', $i, '" class="verification_control">';
  457. // Do the actual stuff - image first?
  458. if ($i == 0 && $verify_context['show_visual'])
  459. {
  460. if ($context['use_graphic_library'])
  461. echo '
  462. <img src="', $verify_context['image_href'], '" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '" />';
  463. else
  464. echo '
  465. <img src="', $verify_context['image_href'], ';letter=1" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_1" />
  466. <img src="', $verify_context['image_href'], ';letter=2" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_2" />
  467. <img src="', $verify_context['image_href'], ';letter=3" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_3" />
  468. <img src="', $verify_context['image_href'], ';letter=4" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_4" />
  469. <img src="', $verify_context['image_href'], ';letter=5" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_5" />
  470. <img src="', $verify_context['image_href'], ';letter=6" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_6" />';
  471. if (WIRELESS)
  472. echo '<br />
  473. <input type="text" name="', $verify_id, '_vv[code]" value="', !empty($verify_context['text_value']) ? $verify_context['text_value'] : '', '" size="30" tabindex="', $context['tabindex']++, '" class="input_text" />';
  474. else
  475. echo '
  476. <div class="smalltext" style="margin: 4px 0 8px 0;">
  477. <a href="', $verify_context['image_href'], ';sound" id="visual_verification_', $verify_id, '_sound" rel="nofollow">', $txt['visual_verification_sound'], '</a> / <a href="#visual_verification_', $verify_id, '_refresh" id="visual_verification_', $verify_id, '_refresh">', $txt['visual_verification_request_new'], '</a>', $display_type != 'quick_reply' ? '<br />' : '', '<br />
  478. ', $txt['visual_verification_description'], ':', $display_type != 'quick_reply' ? '<br />' : '', '
  479. <input type="text" name="', $verify_id, '_vv[code]" value="', !empty($verify_context['text_value']) ? $verify_context['text_value'] : '', '" size="30" tabindex="', $context['tabindex']++, '" class="input_text" />
  480. </div>';
  481. }
  482. else
  483. {
  484. // Where in the question array is this question?
  485. $qIndex = $verify_context['show_visual'] ? $i - 1 : $i;
  486. echo '
  487. <div class="smalltext">
  488. ', $verify_context['questions'][$qIndex]['q'], ':<br />
  489. <input type="text" name="', $verify_id, '_vv[q][', $verify_context['questions'][$qIndex]['id'], ']" size="30" value="', $verify_context['questions'][$qIndex]['a'], '" ', $verify_context['questions'][$qIndex]['is_error'] ? 'style="border: 1px red solid;"' : '', ' tabindex="', $context['tabindex']++, '" class="input_text" />
  490. </div>';
  491. }
  492. if ($display_type != 'single')
  493. echo '
  494. </div>';
  495. // If we were displaying just one and we did it, break.
  496. if ($display_type == 'single' && $verify_context['tracking'] == $i)
  497. break;
  498. }
  499. // Assume we found something, always,
  500. $verify_context['tracking']++;
  501. // Tell something displaying piecemeal to keep going.
  502. if ($display_type == 'single')
  503. return true;
  504. }
  505. ?>