Help.template.php 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <?php
  2. /**
  3. * Simple Machines Forum (SMF)
  4. *
  5. * @package SMF
  6. * @author Simple Machines
  7. * @copyright 2014 Simple Machines and individual contributors
  8. * @license http://www.simplemachines.org/about/smf/license.php BSD
  9. *
  10. * @version 2.1 Alpha 1
  11. */
  12. function template_popup()
  13. {
  14. global $context, $settings, $txt;
  15. // Since this is a popup of its own we need to start the html, etc.
  16. echo '<!DOCTYPE html>
  17. <html', $context['right_to_left'] ? ' dir="rtl"' : '', '>
  18. <head>
  19. <meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '">
  20. <meta name="robots" content="noindex">
  21. <title>', $context['page_title'], '</title>
  22. <link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css?alp21">
  23. <script src="', $settings['default_theme_url'], '/scripts/script.js"></script>
  24. </head>
  25. <body id="help_popup">
  26. <div class="windowbg description">
  27. ', $context['help_text'], '<br>
  28. <br>
  29. <a href="javascript:self.close();">', $txt['close_window'], '</a>
  30. </div>
  31. </body>
  32. </html>';
  33. }
  34. function template_find_members()
  35. {
  36. global $context, $settings, $scripturl, $modSettings, $txt;
  37. echo '<!DOCTYPE html>
  38. <html', $context['right_to_left'] ? ' dir="rtl"' : '', '>
  39. <head>
  40. <title>', $txt['find_members'], '</title>
  41. <meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '">
  42. <meta name="robots" content="noindex">
  43. <link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css?alp21">
  44. <script src="', $settings['default_theme_url'], '/scripts/script.js"></script>
  45. <script><!-- // --><![CDATA[
  46. var membersAdded = [];
  47. function addMember(name)
  48. {
  49. var theTextBox = window.opener.document.getElementById("', $context['input_box_name'], '");
  50. if (name in membersAdded)
  51. return;
  52. // If we only accept one name don\'t remember what is there.
  53. if (', JavaScriptEscape($context['delimiter']), ' != \'null\')
  54. membersAdded[name] = true;
  55. if (theTextBox.value.length < 1 || ', JavaScriptEscape($context['delimiter']), ' == \'null\')
  56. theTextBox.value = ', $context['quote_results'] ? '"\"" + name + "\""' : 'name', ';
  57. else
  58. theTextBox.value += ', JavaScriptEscape($context['delimiter']), ' + ', $context['quote_results'] ? '"\"" + name + "\""' : 'name', ';
  59. window.focus();
  60. }
  61. // ]]></script>
  62. </head>
  63. <body id="help_popup">
  64. <form action="', $scripturl, '?action=findmember;', $context['session_var'], '=', $context['session_id'], '" method="post" accept-charset="', $context['character_set'], '" class="padding description">
  65. <div class="roundframe">
  66. <div class="cat_bar">
  67. <h3 class="catbg">', $txt['find_members'], '</h3>
  68. </div>
  69. <div class="padding">
  70. <strong>', $txt['find_username'], ':</strong><br>
  71. <input type="text" name="search" id="search" value="', isset($context['last_search']) ? $context['last_search'] : '', '" style="margin-top: 4px; width: 96%;" class="input_text"><br>
  72. <span class="smalltext"><em>', $txt['find_wildcards'], '</em></span><br>';
  73. // Only offer to search for buddies if we have some!
  74. if (!empty($context['show_buddies']))
  75. echo '
  76. <span class="smalltext"><label for="buddies"><input type="checkbox" class="input_check" name="buddies" id="buddies"', !empty($context['buddy_search']) ? ' checked' : '', '> ', $txt['find_buddies'], '</label></span><br>';
  77. echo '
  78. <div class="padding righttext">
  79. <input type="submit" value="', $txt['search'], '" class="button_submit">
  80. <input type="button" value="', $txt['find_close'], '" onclick="window.close();" class="button_submit">
  81. </div>
  82. </div>
  83. </div>
  84. <br>
  85. <div class="roundframe">
  86. <div class="cat_bar">
  87. <h3 class="catbg">', $txt['find_results'], '</h3>
  88. </div>';
  89. if (empty($context['results']))
  90. echo '
  91. <p class="error">', $txt['find_no_results'], '</p>';
  92. else
  93. {
  94. echo '
  95. <ul class="reset padding">';
  96. $alternate = true;
  97. foreach ($context['results'] as $result)
  98. {
  99. echo '
  100. <li class="', $alternate ? 'windowbg2' : 'windowbg', '">
  101. <a href="', $result['href'], '" target="_blank" class="new_win"><img src="', $settings['images_url'], '/icons/profile_sm.png" alt="', $txt['view_profile'], '" title="', $txt['view_profile'], '"></a>
  102. <a href="javascript:void(0);" onclick="addMember(this.innerHTML); return false;">', $result['name'], '</a>
  103. </li>';
  104. $alternate = !$alternate;
  105. }
  106. echo '
  107. </ul>
  108. <div class="pagesection">
  109. ', $context['page_index'], '
  110. </div>';
  111. }
  112. echo '
  113. </div>
  114. <input type="hidden" name="input" value="', $context['input_box_name'], '">
  115. <input type="hidden" name="delim" value="', $context['delimiter'], '">
  116. <input type="hidden" name="quote" value="', $context['quote_results'] ? '1' : '0', '">
  117. </form>';
  118. if (empty($context['results']))
  119. echo '
  120. <script><!-- // --><![CDATA[
  121. document.getElementById("search").focus();
  122. // ]]></script>';
  123. echo '
  124. </body>
  125. </html>';
  126. }
  127. // The main help page.
  128. function template_manual()
  129. {
  130. global $context, $scripturl, $txt;
  131. echo '
  132. <div class="cat_bar">
  133. <h3 class="catbg">', $txt['manual_smf_user_help'], '</h3>
  134. </div>
  135. <div id="help_container">
  136. <div id="helpmain" class="windowbg2 content">
  137. <p>', sprintf($txt['manual_welcome'], $context['forum_name']), '</p>
  138. <p>', $txt['manual_introduction'], '</p>
  139. <ul>';
  140. foreach ($context['manual_sections'] as $section_id => $wiki_id)
  141. {
  142. echo '
  143. <li><a href="', $context['wiki_url'], '/', $wiki_id, ($txt['lang_dictionary'] != 'en' ? '/' . $txt['lang_dictionary'] : ''), '" target="_blank" class="new_win">', $txt['manual_section_' . $section_id . '_title'], '</a> - ', $txt['manual_section_' . $section_id . '_desc'], '</li>';
  144. }
  145. echo '
  146. </ul>
  147. <p>', sprintf($txt['manual_docs_and_credits'], $context['wiki_url'], $scripturl . '?action=credits'), '</p>
  148. </div>
  149. </div>';
  150. }
  151. ?>