', $editor_context['value'], '
'; } /** * This template shows the form buttons at the bottom of the editor * * @param string $editor_id The editor ID */ function template_control_richedit_buttons($editor_id) { global $context, $settings, $txt, $modSettings; $editor_context = &$context['controls']['richedit'][$editor_id]; echo ' ', $context['shortcuts_text'], ' '; $tempTab = $context['tabindex']; if (!empty($context['drafts_pm_save'])) $tempTab++; elseif (!empty($context['drafts_save'])) $tempTab++; elseif ($editor_context['preview_type']) $tempTab++; elseif ($context['show_spellchecking']) $tempTab++; $tempTab++; $context['tabindex'] = $tempTab; foreach ($context['richedit_buttons'] as $name => $button) { if ($name == 'spell_check') { $button['onclick'] = 'oEditorHandle_' . $editor_id . '.spellCheckStart();'; } if ($name == 'preview') { $button['value'] = isset($editor_context['labels']['preview_button']) ? $editor_context['labels']['preview_button'] : $button['value']; $button['onclick'] = $editor_context['preview_type'] == 2 ? '' : 'return submitThisOnce(this);'; $button['show'] = $editor_context['preview_type']; } if ($button['show']) { echo ' '; } } echo ' '; // Load in the PM autosaver if it's enabled if (!empty($context['drafts_pm_save']) && !empty($context['drafts_autosave'])) echo ' '; // Start an instance of the auto saver if its enabled if (!empty($context['drafts_save']) && !empty($context['drafts_autosave'])) echo ' '; } /** * This template displays a verification form * * @param int|string $verify_id The verification control ID * @param string $display_type What type to display. Can be 'single' to only show one verification option or 'all' to show all of them * @param bool $reset Whether to reset the internal tracking counter * @return bool False if there's nothing else to show, true if $display_type is 'single', nothing otherwise */ function template_control_verification($verify_id, $display_type = 'all', $reset = false) { global $context, $txt; $verify_context = &$context['controls']['verification'][$verify_id]; // Keep track of where we are. if (empty($verify_context['tracking']) || $reset) $verify_context['tracking'] = 0; // How many items are there to display in total. $total_items = count($verify_context['questions']) + ($verify_context['show_visual'] || $verify_context['can_recaptcha'] ? 1 : 0); // If we've gone too far, stop. if ($verify_context['tracking'] > $total_items) return false; // Loop through each item to show them. for ($i = 0; $i < $total_items; $i++) { // If we're after a single item only show it if we're in the right place. if ($display_type == 'single' && $verify_context['tracking'] != $i) continue; if ($display_type != 'single') echo '
'; // Display empty field, but only if we have one, and it's the first time. if ($verify_context['empty_field'] && empty($i)) echo '
', $txt['visual_verification_hidden'], ':
'; // Do the actual stuff if ($i == 0 && ($verify_context['show_visual'] || $verify_context['can_recaptcha'])) { if ($verify_context['show_visual']) { if ($context['use_graphic_library']) echo ' ', $txt['visual_verification_description'], ''; else echo ' ', $txt['visual_verification_description'], ' ', $txt['visual_verification_description'], ' ', $txt['visual_verification_description'], ' ', $txt['visual_verification_description'], ' ', $txt['visual_verification_description'], ' ', $txt['visual_verification_description'], ''; echo '
', $txt['visual_verification_sound'], ' / ', $txt['visual_verification_request_new'], '', $display_type != 'quick_reply' ? '
' : '', '
', $txt['visual_verification_description'], ':', $display_type != 'quick_reply' ? '
' : '', '
'; } if ($verify_context['can_recaptcha']) { $lang = (isset($txt['lang_recaptcha']) ? $txt['lang_recaptcha'] : $txt['lang_dictionary']); echo '

'; } } else { // Where in the question array is this question? $qIndex = $verify_context['show_visual'] || $verify_context['can_recaptcha'] ? $i - 1 : $i; if (isset($verify_context['questions'][$qIndex])) echo '
', $verify_context['questions'][$qIndex]['q'], ':
'; } if ($display_type != 'single') echo '
'; // If we were displaying just one and we did it, break. if ($display_type == 'single' && $verify_context['tracking'] == $i) break; } // Assume we found something, always. $verify_context['tracking']++; // Tell something displaying piecemeal to keep going. if ($display_type == 'single') return true; } ?>