Admin.template.php 60 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655
  1. <?php
  2. /**
  3. * Simple Machines Forum (SMF)
  4. *
  5. * @package SMF
  6. * @author Simple Machines
  7. * @copyright 2013 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. /**
  13. * This is the administration center home.
  14. */
  15. function template_admin()
  16. {
  17. global $context, $settings, $options, $scripturl, $txt, $modSettings;
  18. // Welcome message for the admin.
  19. echo '
  20. <div id="admincenter">';
  21. // Is there an update available?
  22. echo '
  23. <div id="update_section"></div>';
  24. echo '
  25. <div id="admin_main_section">';
  26. // Display the "live news" from simplemachines.org.
  27. echo '
  28. <div id="live_news" class="floatleft">
  29. <div class="cat_bar">
  30. <h3 class="catbg">
  31. <a href="', $scripturl, '?action=helpadmin;help=live_news" onclick="return reqOverlayDiv(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics_hd.png" class="icon" alt="', $txt['help'], '" /></a> ', $txt['live'], '
  32. </h3>
  33. </div>
  34. <div class="windowbg nopadding">
  35. <div class="content">
  36. <div id="smfAnnouncements">', $txt['lfyi'], '</div>
  37. </div>
  38. </div>
  39. </div>';
  40. // Show the user version information from their server.
  41. echo '
  42. <div id="supportVersionsTable" class="floatright">
  43. <div class="cat_bar">
  44. <h3 class="catbg">
  45. <a href="', $scripturl, '?action=admin;area=credits">', $txt['support_title'], '</a>
  46. </h3>
  47. </div>
  48. <div class="windowbg nopadding">
  49. <div class="content">
  50. <div id="version_details">
  51. <strong>', $txt['support_versions'], ':</strong><br />
  52. ', $txt['support_versions_forum'], ':
  53. <em id="yourVersion" style="white-space: nowrap;">', $context['forum_version'], '</em><br />
  54. ', $txt['support_versions_current'], ':
  55. <em id="smfVersion" style="white-space: nowrap;">??</em><br />
  56. ', $context['can_admin'] ? '<a href="' . $scripturl . '?action=admin;area=maintain;sa=routine;activity=version">' . $txt['version_check_more'] . '</a>' : '', '<br />';
  57. // Display all the members who can administrate the forum.
  58. echo '
  59. <br />
  60. <strong>', $txt['administrators'], ':</strong>
  61. ', implode(', ', $context['administrators']);
  62. // If we have lots of admins... don't show them all.
  63. if (!empty($context['more_admins_link']))
  64. echo '
  65. (', $context['more_admins_link'], ')';
  66. echo '
  67. </div>
  68. </div>
  69. </div>
  70. </div>
  71. </div>';
  72. echo '
  73. <div class="windowbg2 quick_tasks">
  74. <div class="content">
  75. <ul id="quick_tasks" class="flow_hidden">';
  76. foreach ($context['quick_admin_tasks'] as $task)
  77. echo '
  78. <li>
  79. ', !empty($task['icon']) ? '<a href="' . $task['href'] . '"><img src="' . $settings['default_images_url'] . '/admin/' . $task['icon'] . '" alt="" class="home_image" /></a>' : '', '
  80. <h5>', $task['link'], '</h5>
  81. <span class="task">', $task['description'],'</span>
  82. </li>';
  83. echo '
  84. </ul>
  85. </div>
  86. </div>
  87. </div>';
  88. // The below functions include all the scripts needed from the simplemachines.org site. The language and format are passed for internationalization.
  89. if (empty($modSettings['disable_smf_js']))
  90. echo '
  91. <script type="text/javascript" src="', $scripturl, '?action=viewsmfile;filename=current-version.js"></script>
  92. <script type="text/javascript" src="', $scripturl, '?action=viewsmfile;filename=latest-news.js"></script>';
  93. // This sets the announcements and current versions themselves ;).
  94. echo '
  95. <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/admin.js?alp21"></script>
  96. <script type="text/javascript"><!-- // --><![CDATA[
  97. var oAdminIndex = new smf_AdminIndex({
  98. sSelf: \'oAdminCenter\',
  99. bLoadAnnouncements: true,
  100. sAnnouncementTemplate: ', JavaScriptEscape('
  101. <dl>
  102. %content%
  103. </dl>
  104. '), ',
  105. sAnnouncementMessageTemplate: ', JavaScriptEscape('
  106. <dt><a href="%href%">%subject%</a> ' . $txt['on'] . ' %time%</dt>
  107. <dd>
  108. %message%
  109. </dd>
  110. '), ',
  111. sAnnouncementContainerId: \'smfAnnouncements\',
  112. bLoadVersions: true,
  113. sSmfVersionContainerId: \'smfVersion\',
  114. sYourVersionContainerId: \'yourVersion\',
  115. sVersionOutdatedTemplate: ', JavaScriptEscape('
  116. <span class="alert">%currentVersion%</span>
  117. '), ',
  118. bLoadUpdateNotification: true,
  119. sUpdateNotificationContainerId: \'update_section\',
  120. sUpdateNotificationDefaultTitle: ', JavaScriptEscape($txt['update_available']), ',
  121. sUpdateNotificationDefaultMessage: ', JavaScriptEscape($txt['update_message']), ',
  122. sUpdateNotificationTemplate: ', JavaScriptEscape('
  123. <div class="cat_bar">
  124. <h3 id="update_title" class="catbg">
  125. %title%
  126. </h3>
  127. </div>
  128. <div class="windowbg">
  129. <span class="topslice"><span></span></span>
  130. <div class="content">
  131. <div id="update_message" class="smalltext">
  132. %message%
  133. </div>
  134. </div>
  135. </div>
  136. '), ',
  137. sUpdateNotificationLink: smf_scripturl + ', JavaScriptEscape('?action=admin;area=packages;pgdownload;auto;package=%package%;' . $context['session_var'] . '=' . $context['session_id']), '
  138. });
  139. // ]]></script>';
  140. }
  141. /**
  142. * Show some support information and credits to those who helped make this.
  143. */
  144. function template_credits()
  145. {
  146. global $context, $settings, $options, $scripturl, $txt;
  147. // Show the user version information from their server.
  148. echo '
  149. <div id="admincenter">
  150. <div id="support_credits">
  151. <div class="cat_bar">
  152. <h3 class="catbg">
  153. ', $txt['support_title'], ' <img src="', $settings['images_url'], '/smflogo.png" id="credits_logo" alt="" />
  154. </h3>
  155. </div>
  156. <div class="windowbg">
  157. <div class="content">
  158. <strong>', $txt['support_versions'], ':</strong><br />
  159. ', $txt['support_versions_forum'], ':
  160. <em id="yourVersion" style="white-space: nowrap;">', $context['forum_version'], '</em>', $context['can_admin'] ? ' <a href="' . $scripturl . '?action=admin;area=maintain;sa=routine;activity=version">' . $txt['version_check_more'] . '</a>' : '', '<br />
  161. ', $txt['support_versions_current'], ':
  162. <em id="smfVersion" style="white-space: nowrap;">??</em><br />';
  163. // Display all the variables we have server information for.
  164. foreach ($context['current_versions'] as $version)
  165. {
  166. echo '
  167. ', $version['title'], ':
  168. <em>', $version['version'], '</em>';
  169. // more details for this item, show them a link
  170. if ($context['can_admin'] && isset($version['more']))
  171. echo
  172. ' <a href="', $scripturl, $version['more'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['version_check_more'], '</a>';
  173. echo '
  174. <br />';
  175. }
  176. echo '
  177. </div>
  178. </div>';
  179. // Point the admin to common support resources.
  180. echo '
  181. <div id="support_resources" class="cat_bar">
  182. <h3 class="catbg">
  183. ', $txt['support_resources'], '
  184. </h3>
  185. </div>
  186. <div class="windowbg2">
  187. <div class="content">
  188. <p>', $txt['support_resources_p1'], '</p>
  189. <p>', $txt['support_resources_p2'], '</p>
  190. </div>
  191. </div>';
  192. // The most important part - the credits :P.
  193. echo '
  194. <div id="credits_sections" class="cat_bar">
  195. <h3 class="catbg">
  196. ', $txt['admin_credits'], '
  197. </h3>
  198. </div>
  199. <div class="windowbg2">
  200. <div class="content">';
  201. foreach ($context['credits'] as $section)
  202. {
  203. if (isset($section['pretext']))
  204. echo '
  205. <p>', $section['pretext'], '</p><hr />';
  206. echo '
  207. <dl>';
  208. foreach ($section['groups'] as $group)
  209. {
  210. if (isset($group['title']))
  211. echo '
  212. <dt>
  213. <strong>', $group['title'], ':</strong>
  214. </dt>';
  215. echo '
  216. <dd>', implode(', ', $group['members']), '</dd>';
  217. }
  218. echo '
  219. </dl>';
  220. if (isset($section['posttext']))
  221. echo '
  222. <hr />
  223. <p>', $section['posttext'], '</p>';
  224. }
  225. echo '
  226. </div>
  227. </div>
  228. </div>
  229. </div>';
  230. // This makes all the support information available to the support script...
  231. echo '
  232. <script type="text/javascript"><!-- // --><![CDATA[
  233. var smfSupportVersions = {};
  234. smfSupportVersions.forum = "', $context['forum_version'], '";';
  235. // Don't worry, none of this is logged, it's just used to give information that might be of use.
  236. foreach ($context['current_versions'] as $variable => $version)
  237. echo '
  238. smfSupportVersions.', $variable, ' = "', $version['version'], '";';
  239. // Now we just have to include the script and wait ;).
  240. echo '
  241. // ]]></script>
  242. <script type="text/javascript" src="', $scripturl, '?action=viewsmfile;filename=current-version.js"></script>
  243. <script type="text/javascript" src="', $scripturl, '?action=viewsmfile;filename=latest-news.js"></script>';
  244. // This sets the latest support stuff.
  245. echo '
  246. <script type="text/javascript"><!-- // --><![CDATA[
  247. function smfCurrentVersion()
  248. {
  249. var smfVer, yourVer;
  250. if (!window.smfVersion)
  251. return;
  252. smfVer = document.getElementById("smfVersion");
  253. yourVer = document.getElementById("yourVersion");
  254. setInnerHTML(smfVer, window.smfVersion);
  255. var currentVersion = getInnerHTML(yourVer);
  256. if (currentVersion != window.smfVersion)
  257. setInnerHTML(yourVer, "<span class=\"alert\">" + currentVersion + "</span>");
  258. }
  259. addLoadEvent(smfCurrentVersion)
  260. // ]]></script>';
  261. }
  262. /**
  263. * Displays information about file versions installed, and compares them to current version.
  264. */
  265. function template_view_versions()
  266. {
  267. global $context, $settings, $options, $scripturl, $txt;
  268. echo '
  269. <div id="admincenter">
  270. <div id="section_header" class="cat_bar">
  271. <h3 class="catbg">
  272. ', $txt['admin_version_check'], '
  273. </h3>
  274. </div>
  275. <div class="information">', $txt['version_check_desc'], '</div>
  276. <table width="100%" class="table_grid">
  277. <thead>
  278. <tr class="catbg" align="left">
  279. <th class="first_th" scope="col" width="50%">
  280. <strong>', $txt['admin_smffile'], '</strong>
  281. </th>
  282. <th scope="col" width="25%">
  283. <strong>', $txt['dvc_your'], '</strong>
  284. </th>
  285. <th class="last_th" scope="col" width="25%">
  286. <strong>', $txt['dvc_current'], '</strong>
  287. </th>
  288. </tr>
  289. </thead>
  290. <tbody>';
  291. // The current version of the core SMF package.
  292. echo '
  293. <tr>
  294. <td class="windowbg">
  295. ', $txt['admin_smfpackage'], '
  296. </td>
  297. <td class="windowbg">
  298. <em id="yourSMF">', $context['forum_version'], '</em>
  299. </td>
  300. <td class="windowbg">
  301. <em id="currentSMF">??</em>
  302. </td>
  303. </tr>';
  304. // Now list all the source file versions, starting with the overall version (if all match!).
  305. echo '
  306. <tr>
  307. <td class="windowbg">
  308. <a href="#" id="Sources-link">', $txt['dvc_sources'], '</a>
  309. </td>
  310. <td class="windowbg">
  311. <em id="yourSources">??</em>
  312. </td>
  313. <td class="windowbg">
  314. <em id="currentSources">??</em>
  315. </td>
  316. </tr>
  317. </tbody>
  318. </table>
  319. <table id="Sources" width="100%" class="table_grid">
  320. <tbody>';
  321. // Loop through every source file displaying its version - using javascript.
  322. foreach ($context['file_versions'] as $filename => $version)
  323. echo '
  324. <tr>
  325. <td class="windowbg2" width="50%" style="padding-left: 3ex;">
  326. ', $filename, '
  327. </td>
  328. <td class="windowbg2" width="25%">
  329. <em id="yourSources', $filename, '">', $version, '</em>
  330. </td>
  331. <td class="windowbg2" width="25%">
  332. <em id="currentSources', $filename, '">??</em>
  333. </td>
  334. </tr>';
  335. // Default template files.
  336. echo '
  337. </tbody>
  338. </table>
  339. <table width="100%" class="table_grid">
  340. <tbody>
  341. <tr>
  342. <td class="windowbg" width="50%">
  343. <a href="#" id="Default-link">', $txt['dvc_default'], '</a>
  344. </td>
  345. <td class="windowbg" width="25%">
  346. <em id="yourDefault">??</em>
  347. </td>
  348. <td class="windowbg" width="25%">
  349. <em id="currentDefault">??</em>
  350. </td>
  351. </tr>
  352. </tbody>
  353. </table>
  354. <table id="Default" width="100%" class="table_grid">
  355. <tbody>';
  356. foreach ($context['default_template_versions'] as $filename => $version)
  357. echo '
  358. <tr>
  359. <td class="windowbg2" width="50%" style="padding-left: 3ex;">
  360. ', $filename, '
  361. </td>
  362. <td class="windowbg2" width="25%">
  363. <em id="yourDefault', $filename, '">', $version, '</em>
  364. </td>
  365. <td class="windowbg2" width="25%">
  366. <em id="currentDefault', $filename, '">??</em>
  367. </td>
  368. </tr>';
  369. // Now the language files...
  370. echo '
  371. </tbody>
  372. </table>
  373. <table width="100%" class="table_grid">
  374. <tbody>
  375. <tr>
  376. <td class="windowbg" width="50%">
  377. <a href="#" id="Languages-link">', $txt['dvc_languages'], '</a>
  378. </td>
  379. <td class="windowbg" width="25%">
  380. <em id="yourLanguages">??</em>
  381. </td>
  382. <td class="windowbg" width="25%">
  383. <em id="currentLanguages">??</em>
  384. </td>
  385. </tr>
  386. </tbody>
  387. </table>
  388. <table id="Languages" width="100%" class="table_grid">
  389. <tbody>';
  390. foreach ($context['default_language_versions'] as $language => $files)
  391. {
  392. foreach ($files as $filename => $version)
  393. echo '
  394. <tr>
  395. <td class="windowbg2" width="50%" style="padding-left: 3ex;">
  396. ', $filename, '.<em>', $language, '</em>.php
  397. </td>
  398. <td class="windowbg2" width="25%">
  399. <em id="your', $filename, '.', $language, '">', $version, '</em>
  400. </td>
  401. <td class="windowbg2" width="25%">
  402. <em id="current', $filename, '.', $language, '">??</em>
  403. </td>
  404. </tr>';
  405. }
  406. echo '
  407. </tbody>
  408. </table>';
  409. // Finally, display the version information for the currently selected theme - if it is not the default one.
  410. if (!empty($context['template_versions']))
  411. {
  412. echo '
  413. <table width="100%" class="table_grid">
  414. <tbody>
  415. <tr>
  416. <td class="windowbg" width="50%">
  417. <a href="#" id="Templates-link">', $txt['dvc_templates'], '</a>
  418. </td>
  419. <td class="windowbg" width="25%">
  420. <em id="yourTemplates">??</em>
  421. </td>
  422. <td class="windowbg" width="25%">
  423. <em id="currentTemplates">??</em>
  424. </td>
  425. </tr>
  426. </tbody>
  427. </table>
  428. <table id="Templates" width="100%" class="table_grid">
  429. <tbody>';
  430. foreach ($context['template_versions'] as $filename => $version)
  431. echo '
  432. <tr>
  433. <td class="windowbg2" width="50%" style="padding-left: 3ex;">
  434. ', $filename, '
  435. </td>
  436. <td class="windowbg2" width="25%">
  437. <em id="yourTemplates', $filename, '">', $version, '</em>
  438. </td>
  439. <td class="windowbg2" width="25%">
  440. <em id="currentTemplates', $filename, '">??</em>
  441. </td>
  442. </tr>';
  443. echo '
  444. </tbody>
  445. </table>';
  446. }
  447. echo '
  448. </div>';
  449. /* Below is the hefty javascript for this. Upon opening the page it checks the current file versions with ones
  450. held at simplemachines.org and works out if they are up to date. If they aren't it colors that files number
  451. red. It also contains the function, swapOption, that toggles showing the detailed information for each of the
  452. file categories. (sources, languages, and templates.) */
  453. echo '
  454. <script type="text/javascript" src="', $scripturl, '?action=viewsmfile;filename=detailed-version.js"></script>
  455. <script type="text/javascript"><!-- // --><![CDATA[
  456. var oViewVersions = new smf_ViewVersions({
  457. aKnownLanguages: [
  458. \'.', implode('\',
  459. \'.', $context['default_known_languages']), '\'
  460. ],
  461. oSectionContainerIds: {
  462. Sources: \'Sources\',
  463. Default: \'Default\',
  464. Languages: \'Languages\',
  465. Templates: \'Templates\'
  466. }
  467. });
  468. // ]]></script>';
  469. }
  470. // Form for stopping people using naughty words, etc.
  471. function template_edit_censored()
  472. {
  473. global $context, $settings, $options, $scripturl, $txt, $modSettings;
  474. // First section is for adding/removing words from the censored list.
  475. echo '
  476. <div id="admincenter">
  477. <form id="admin_form_wrapper" action="', $scripturl, '?action=admin;area=postsettings;sa=censor" method="post" accept-charset="', $context['character_set'], '">
  478. <div id="section_header" class="cat_bar">
  479. <h3 class="catbg">
  480. ', $txt['admin_censored_words'], '
  481. </h3>
  482. </div>
  483. <div class="windowbg2">
  484. <div class="content">
  485. <p>', $txt['admin_censored_where'], '</p>';
  486. // Show text boxes for censoring [bad ] => [good ].
  487. foreach ($context['censored_words'] as $vulgar => $proper)
  488. echo '
  489. <div style="margin-top: 1ex;">
  490. <input type="text" name="censor_vulgar[]" value="', $vulgar, '" size="30" /> => <input type="text" name="censor_proper[]" value="', $proper, '" size="30" />
  491. </div>';
  492. // Now provide a way to censor more words.
  493. echo '
  494. <div style="margin-top: 1ex;">
  495. <input type="text" name="censor_vulgar[]" size="30" class="input_text" /> => <input type="text" name="censor_proper[]" size="30" class="input_text" />
  496. </div>
  497. <div id="moreCensoredWords"></div><div style="margin-top: 1ex; display: none;" id="moreCensoredWords_link">
  498. <a class="button_link" style="float: left" href="#;" onclick="addNewWord(); return false;">', $txt['censor_clickadd'], '</a><br />
  499. </div>
  500. <script type="text/javascript"><!-- // --><![CDATA[
  501. document.getElementById("moreCensoredWords_link").style.display = "";
  502. // ]]></script>
  503. <hr width="100%" size="1" class="hrcolor clear" />
  504. <dl class="settings">
  505. <dt>
  506. <strong><label for="allow_no_censored">', $txt['allow_no_censored'], ':</label></strong>
  507. </dt>
  508. <dd>
  509. <input type="checkbox" name="allow_no_censored" value="1" id="allow_no_censored"', empty($modSettings['allow_no_censored']) ? '' : ' checked="checked"', ' class="input_check" />
  510. </dd>
  511. <dt>
  512. <strong><label for="censorWholeWord_check">', $txt['censor_whole_words'], ':</label></strong>
  513. </dt>
  514. <dd>
  515. <input type="checkbox" name="censorWholeWord" value="1" id="censorWholeWord_check"', empty($modSettings['censorWholeWord']) ? '' : ' checked="checked"', ' class="input_check" />
  516. </dd>
  517. <dt>
  518. <strong><label for="censorIgnoreCase_check">', $txt['censor_case'], ':</label></strong>
  519. </dt>
  520. <dd>
  521. <input type="checkbox" name="censorIgnoreCase" value="1" id="censorIgnoreCase_check"', empty($modSettings['censorIgnoreCase']) ? '' : ' checked="checked"', ' class="input_check" />
  522. </dd>
  523. </dl>
  524. <input type="submit" name="save_censor" value="', $txt['save'], '" class="button_submit" />
  525. </div>
  526. </div>
  527. <br />';
  528. // This table lets you test out your filters by typing in rude words and seeing what comes out.
  529. echo '
  530. <div class="cat_bar">
  531. <h3 class="catbg">
  532. ', $txt['censor_test'], '
  533. </h3>
  534. </div>
  535. <div class="windowbg">
  536. <div class="content">
  537. <p class="centertext">
  538. <input type="text" name="censortest" value="', empty($context['censor_test']) ? '' : $context['censor_test'], '" class="input_text" />
  539. <input type="submit" value="', $txt['censor_test_save'], '" class="button_submit" />
  540. </p>
  541. </div>
  542. </div>
  543. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  544. <input type="hidden" name="', $context['admin-censor_token_var'], '" value="', $context['admin-censor_token'], '" />
  545. </form>
  546. </div>';
  547. }
  548. // Maintenance is a lovely thing, isn't it?
  549. function template_not_done()
  550. {
  551. global $context, $settings, $options, $txt, $scripturl;
  552. echo '
  553. <div id="admincenter">
  554. <div id="section_header" class="cat_bar">
  555. <h3 class="catbg">
  556. ', $txt['not_done_title'], '
  557. </h3>
  558. </div>
  559. <div class="windowbg">
  560. <div class="content">
  561. ', $txt['not_done_reason'];
  562. if (!empty($context['continue_percent']))
  563. echo '
  564. <div class="progress_bar">
  565. <div class="full_bar">', $context['continue_percent'], '%</div>
  566. <div class="green_percent" style="width: ', $context['continue_percent'], '%;">&nbsp;</div>
  567. </div>';
  568. if (!empty($context['substep_enabled']))
  569. echo '
  570. <div class="progress_bar">
  571. <div class="full_bar">', $context['substep_title'], ' (', $context['substep_continue_percent'], '%)</div>
  572. <div class="blue_percent" style="width: ', $context['substep_continue_percent'], '%;">&nbsp;</div>
  573. </div>';
  574. echo '
  575. <form action="', $scripturl, $context['continue_get_data'], '" method="post" accept-charset="', $context['character_set'], '" style="margin: 0;" name="autoSubmit" id="autoSubmit">
  576. <input type="submit" name="cont" value="', $txt['not_done_continue'], '" class="button_submit" />
  577. ', $context['continue_post_data'], '
  578. </form>
  579. </div>
  580. </div>
  581. </div>
  582. <script type="text/javascript"><!-- // --><![CDATA[
  583. var countdown = ', $context['continue_countdown'], ';
  584. doAutoSubmit();
  585. function doAutoSubmit()
  586. {
  587. if (countdown == 0)
  588. document.forms.autoSubmit.submit();
  589. else if (countdown == -1)
  590. return;
  591. document.forms.autoSubmit.cont.value = "', $txt['not_done_continue'], ' (" + countdown + ")";
  592. countdown--;
  593. setTimeout("doAutoSubmit();", 1000);
  594. }
  595. // ]]></script>';
  596. }
  597. // Template for showing settings (Of any kind really!)
  598. function template_show_settings()
  599. {
  600. global $context, $txt, $settings, $scripturl;
  601. if (!empty($context['settings_pre_javascript']))
  602. echo '
  603. <script type="text/javascript"><!-- // --><![CDATA[', $context['settings_pre_javascript'], '// ]]></script>';
  604. if (!empty($context['settings_insert_above']))
  605. echo $context['settings_insert_above'];
  606. echo '
  607. <div id="admincenter">
  608. <form id="admin_form_wrapper" action="', $context['post_url'], '" method="post" accept-charset="', $context['character_set'], '"', !empty($context['force_form_onsubmit']) ? ' onsubmit="' . $context['force_form_onsubmit'] . '"' : '', '>';
  609. // Is there a custom title?
  610. if (isset($context['settings_title']))
  611. echo '
  612. <div class="cat_bar">
  613. <h3 class="catbg">
  614. ', $context['settings_title'], '
  615. </h3>
  616. </div>';
  617. // Have we got a message to display?
  618. if (!empty($context['settings_message']))
  619. echo '
  620. <div class="information">', $context['settings_message'], '</div>';
  621. // Now actually loop through all the variables.
  622. $is_open = false;
  623. foreach ($context['config_vars'] as $config_var)
  624. {
  625. // Is it a title or a description?
  626. if (is_array($config_var) && ($config_var['type'] == 'title' || $config_var['type'] == 'desc'))
  627. {
  628. // Not a list yet?
  629. if ($is_open)
  630. {
  631. $is_open = false;
  632. echo '
  633. </dl>
  634. </div>
  635. </div>';
  636. }
  637. // A title?
  638. if ($config_var['type'] == 'title')
  639. {
  640. echo '
  641. <div class="cat_bar">
  642. <h3 class="', !empty($config_var['class']) ? $config_var['class'] : 'catbg', '"', !empty($config_var['force_div_id']) ? ' id="' . $config_var['force_div_id'] . '"' : '', '>
  643. ', ($config_var['help'] ? '<a href="' . $scripturl . '?action=helpadmin;help=' . $config_var['help'] . '" onclick="return reqOverlayDiv(this.href);" class="help"><img src="' . $settings['images_url'] . '/helptopics_hd.png" class="icon" alt="' . $txt['help'] . '" /></a>' : ''), '
  644. ', $config_var['label'], '
  645. </h3>
  646. </div>';
  647. }
  648. // A description?
  649. else
  650. {
  651. echo '
  652. <p class="description">
  653. ', $config_var['label'], '
  654. </p>';
  655. }
  656. continue;
  657. }
  658. // Not a list yet?
  659. if (!$is_open)
  660. {
  661. $is_open = true;
  662. echo '
  663. <div class="windowbg2">
  664. <div class="content">
  665. <dl class="settings">';
  666. }
  667. // Hang about? Are you pulling my leg - a callback?!
  668. if (is_array($config_var) && $config_var['type'] == 'callback')
  669. {
  670. if (function_exists('template_callback_' . $config_var['name']))
  671. call_user_func('template_callback_' . $config_var['name']);
  672. continue;
  673. }
  674. if (is_array($config_var))
  675. {
  676. // First off, is this a span like a message?
  677. if (in_array($config_var['type'], array('message', 'warning')))
  678. {
  679. echo '
  680. <dd', $config_var['type'] == 'warning' ? ' class="alert"' : '', (!empty($config_var['force_div_id']) ? ' id="' . $config_var['force_div_id'] . '_dd"' : ''), '>
  681. ', $config_var['label'], '
  682. </dd>';
  683. }
  684. // Otherwise it's an input box of some kind.
  685. else
  686. {
  687. echo '
  688. <dt', is_array($config_var) && !empty($config_var['force_div_id']) ? ' id="' . $config_var['force_div_id'] . '"' : '', '>';
  689. // Some quick helpers...
  690. $javascript = $config_var['javascript'];
  691. $disabled = !empty($config_var['disabled']) ? ' disabled="disabled"' : '';
  692. $subtext = !empty($config_var['subtext']) ? '<br /><span class="smalltext"> ' . $config_var['subtext'] . '</span>' : '';
  693. // Show the [?] button.
  694. if ($config_var['help'])
  695. echo '
  696. <a id="setting_', $config_var['name'], '" href="', $scripturl, '?action=helpadmin;help=', $config_var['help'], '" onclick="return reqOverlayDiv(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics.png" class="icon" alt="', $txt['help'], '" /></a><span', ($config_var['disabled'] ? ' style="color: #777777;"' : ($config_var['invalid'] ? ' class="error"' : '')), '><label for="', $config_var['name'], '">', $config_var['label'], '</label>', $subtext, ($config_var['type'] == 'password' ? '<br /><em>' . $txt['admin_confirm_password'] . '</em>' : ''), '</span>
  697. </dt>';
  698. else
  699. echo '
  700. <a id="setting_', $config_var['name'], '"></a> <span', ($config_var['disabled'] ? ' style="color: #777777;"' : ($config_var['invalid'] ? ' class="error"' : '')), '><label for="', $config_var['name'], '">', $config_var['label'], '</label>', $subtext, ($config_var['type'] == 'password' ? '<br /><em>' . $txt['admin_confirm_password'] . '</em>' : ''), '</span>
  701. </dt>';
  702. echo '
  703. <dd', (!empty($config_var['force_div_id']) ? ' id="' . $config_var['force_div_id'] . '_dd"' : ''), '>',
  704. $config_var['preinput'];
  705. // Show a check box.
  706. if ($config_var['type'] == 'check')
  707. echo '
  708. <input type="checkbox"', $javascript, $disabled, ' name="', $config_var['name'], '" id="', $config_var['name'], '"', ($config_var['value'] ? ' checked="checked"' : ''), ' value="1" class="input_check" />';
  709. // Escape (via htmlspecialchars.) the text box.
  710. elseif ($config_var['type'] == 'password')
  711. echo '
  712. <input type="password"', $disabled, $javascript, ' name="', $config_var['name'], '[0]"', ($config_var['size'] ? ' size="' . $config_var['size'] . '"' : ''), ' value="*#fakepass#*" onfocus="this.value = \'\'; this.form.', $config_var['name'], '.disabled = false;" class="input_password" /><br />
  713. <input type="password" disabled="disabled" id="', $config_var['name'], '" name="', $config_var['name'], '[1]"', ($config_var['size'] ? ' size="' . $config_var['size'] . '"' : ''), ' class="input_password" />';
  714. // Show a selection box.
  715. elseif ($config_var['type'] == 'select')
  716. {
  717. echo '
  718. <select name="', $config_var['name'], '" id="', $config_var['name'], '" ', $javascript, $disabled, (!empty($config_var['multiple']) ? ' multiple="multiple"' : ''), '>';
  719. foreach ($config_var['data'] as $option)
  720. echo '
  721. <option value="', $option[0], '"', (!empty($config_var['value']) && ($option[0] == $config_var['value'] || (!empty($config_var['multiple']) && in_array($option[0], $config_var['value']))) ? ' selected="selected"' : ''), '>', $option[1], '</option>';
  722. echo '
  723. </select>';
  724. }
  725. // Text area?
  726. elseif ($config_var['type'] == 'large_text')
  727. echo '
  728. <textarea rows="', ($config_var['size'] ? $config_var['size'] : 4), '" cols="30" ', $javascript, $disabled, ' name="', $config_var['name'], '" id="', $config_var['name'], '">', $config_var['value'], '</textarea>';
  729. // Permission group?
  730. elseif ($config_var['type'] == 'permissions')
  731. theme_inline_permissions($config_var['name']);
  732. // BBC selection?
  733. elseif ($config_var['type'] == 'bbc')
  734. {
  735. echo '
  736. <fieldset id="', $config_var['name'], '">
  737. <legend>', $txt['bbcTagsToUse_select'], '</legend>
  738. <ul class="reset">';
  739. foreach ($context['bbc_columns'] as $bbcColumn)
  740. {
  741. foreach ($bbcColumn as $bbcTag)
  742. echo '
  743. <li class="list_bbc floatleft">
  744. <input type="checkbox" name="', $config_var['name'], '_enabledTags[]" id="tag_', $config_var['name'], '_', $bbcTag['tag'], '" value="', $bbcTag['tag'], '"', !in_array($bbcTag['tag'], $context['bbc_sections'][$config_var['name']]['disabled']) ? ' checked="checked"' : '', ' class="input_check" /> <label for="tag_', $config_var['name'], '_', $bbcTag['tag'], '">', $bbcTag['tag'], '</label>', $bbcTag['show_help'] ? ' (<a href="' . $scripturl . '?action=helpadmin;help=tag_' . $bbcTag['tag'] . '" onclick="return reqOverlayDiv(this.href);">?</a>)' : '', '
  745. </li>';
  746. }
  747. echo ' </ul>
  748. <input type="checkbox" id="bbc_', $config_var['name'], '_select_all" onclick="invertAll(this, this.form, \'', $config_var['name'], '_enabledTags\');"', $context['bbc_sections'][$config_var['name']]['all_selected'] ? ' checked="checked"' : '', ' class="input_check" /> <label for="bbc_', $config_var['name'], '_select_all"><em>', $txt['bbcTagsToUse_select_all'], '</em></label>
  749. </fieldset>';
  750. }
  751. // A simple message?
  752. elseif ($config_var['type'] == 'var_message')
  753. echo '
  754. <div', !empty($config_var['name']) ? ' id="' . $config_var['name'] . '"' : '', '>', $config_var['var_message'], '</div>';
  755. // Assume it must be a text box.
  756. else
  757. echo '
  758. <input type="text"', $javascript, $disabled, ' name="', $config_var['name'], '" id="', $config_var['name'], '" value="', $config_var['value'], '"', ($config_var['size'] ? ' size="' . $config_var['size'] . '"' : ''), ' class="input_text" />';
  759. echo isset($config_var['postinput']) ? '
  760. ' . $config_var['postinput'] : '',
  761. '</dd>';
  762. }
  763. }
  764. else
  765. {
  766. // Just show a separator.
  767. if ($config_var == '')
  768. echo '
  769. </dl>
  770. <hr class="hrcolor clear" />
  771. <dl class="settings">';
  772. else
  773. echo '
  774. <dd>
  775. <strong>' . $config_var . '</strong>
  776. </dd>';
  777. }
  778. }
  779. if ($is_open)
  780. echo '
  781. </dl>';
  782. if (empty($context['settings_save_dont_show']))
  783. echo '
  784. <input type="submit" value="', $txt['save'], '"', (!empty($context['save_disabled']) ? ' disabled="disabled"' : ''), (!empty($context['settings_save_onclick']) ? ' onclick="' . $context['settings_save_onclick'] . '"' : ''), ' class="button_submit" />';
  785. if ($is_open)
  786. echo '
  787. </div>
  788. </div>';
  789. // At least one token has to be used!
  790. if (isset($context['admin-ssc_token']))
  791. echo '
  792. <input type="hidden" name="', $context['admin-ssc_token_var'], '" value="', $context['admin-ssc_token'], '" />';
  793. if (isset($context['admin-dbsc_token']))
  794. echo '
  795. <input type="hidden" name="', $context['admin-dbsc_token_var'], '" value="', $context['admin-dbsc_token'], '" />';
  796. if (isset($context['admin-mp_token']))
  797. echo '
  798. <input type="hidden" name="', $context['admin-mp_token_var'], '" value="', $context['admin-mp_token'], '" />';
  799. echo '
  800. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  801. </form>
  802. </div>';
  803. if (!empty($context['settings_post_javascript']))
  804. echo '
  805. <script type="text/javascript"><!-- // --><![CDATA[
  806. ', $context['settings_post_javascript'], '
  807. // ]]></script>';
  808. if (!empty($context['settings_insert_below']))
  809. echo $context['settings_insert_below'];
  810. }
  811. // Template for showing custom profile fields.
  812. function template_show_custom_profile()
  813. {
  814. global $context, $txt, $settings, $scripturl;
  815. // Standard fields.
  816. template_show_list('standard_profile_fields');
  817. echo '
  818. <script type="text/javascript"><!-- // --><![CDATA[
  819. var iNumChecks = document.forms.standardProfileFields.length;
  820. for (var i = 0; i < iNumChecks; i++)
  821. if (document.forms.standardProfileFields[i].id.indexOf(\'reg_\') == 0)
  822. document.forms.standardProfileFields[i].disabled = document.forms.standardProfileFields[i].disabled || !document.getElementById(\'active_\' + document.forms.standardProfileFields[i].id.substr(4)).checked;
  823. // ]]></script><br />';
  824. // Custom fields.
  825. template_show_list('custom_profile_fields');
  826. }
  827. // Edit a profile field?
  828. function template_edit_profile_field()
  829. {
  830. global $context, $txt, $settings, $scripturl;
  831. // All the javascript for this page - quite a bit in script.js!
  832. echo '
  833. <script type="text/javascript"><!-- // --><![CDATA[
  834. var startOptID = ', count($context['field']['options']), ';
  835. // ]]></script>';
  836. // any errors messages to show?
  837. if (isset($_GET['msg']))
  838. {
  839. loadLanguage('Errors');
  840. if (isset($txt['custom_option_' . $_GET['msg']]))
  841. echo '
  842. <div class="errorbox">',
  843. $txt['custom_option_' . $_GET['msg']], '
  844. </div>';
  845. }
  846. echo '
  847. <div id="admincenter">
  848. <form action="', $scripturl, '?action=admin;area=featuresettings;sa=profileedit;fid=', $context['fid'], ';', $context['session_var'], '=', $context['session_id'], '" method="post" accept-charset="', $context['character_set'], '">
  849. <div id="section_header" class="cat_bar">
  850. <h3 class="catbg">
  851. ', $context['page_title'], '
  852. </h3>
  853. </div>
  854. <div class="windowbg">
  855. <div class="content">
  856. <fieldset>
  857. <legend>', $txt['custom_edit_general'], '</legend>
  858. <dl class="settings">
  859. <dt>
  860. <strong><label for="field_name">', $txt['custom_edit_name'], ':</label></strong>
  861. </dt>
  862. <dd>
  863. <input type="text" name="field_name" id="field_name" value="', $context['field']['name'], '" size="20" maxlength="40" class="input_text" />
  864. </dd>
  865. <dt>
  866. <strong><label for="field_desc">', $txt['custom_edit_desc'], ':</label></strong>
  867. </dt>
  868. <dd>
  869. <textarea name="field_desc" id="field_desc" rows="3" cols="40">', $context['field']['desc'], '</textarea>
  870. </dd>
  871. <dt>
  872. <strong><label for="profile_area">', $txt['custom_edit_profile'], ':</label></strong><br />
  873. <span class="smalltext">', $txt['custom_edit_profile_desc'], '</span>
  874. </dt>
  875. <dd>
  876. <select name="profile_area" id="profile_area">
  877. <option value="none"', $context['field']['profile_area'] == 'none' ? ' selected="selected"' : '', '>', $txt['custom_edit_profile_none'], '</option>
  878. <option value="account"', $context['field']['profile_area'] == 'account' ? ' selected="selected"' : '', '>', $txt['account'], '</option>
  879. <option value="forumprofile"', $context['field']['profile_area'] == 'forumprofile' ? ' selected="selected"' : '', '>', $txt['forumprofile'], '</option>
  880. <option value="theme"', $context['field']['profile_area'] == 'theme' ? ' selected="selected"' : '', '>', $txt['theme'], '</option>
  881. </select>
  882. </dd>
  883. <dt>
  884. <strong><label for="reg">', $txt['custom_edit_registration'], ':</label></strong>
  885. </dt>
  886. <dd>
  887. <select name="reg" id="reg">
  888. <option value="0"', $context['field']['reg'] == 0 ? ' selected="selected"' : '', '>', $txt['custom_edit_registration_disable'], '</option>
  889. <option value="1"', $context['field']['reg'] == 1 ? ' selected="selected"' : '', '>', $txt['custom_edit_registration_allow'], '</option>
  890. <option value="2"', $context['field']['reg'] == 2 ? ' selected="selected"' : '', '>', $txt['custom_edit_registration_require'], '</option>
  891. </select>
  892. </dd>
  893. <dt>
  894. <strong><label for="display">', $txt['custom_edit_display'], ':</label></strong>
  895. </dt>
  896. <dd>
  897. <input type="checkbox" name="display" id="display"', $context['field']['display'] ? ' checked="checked"' : '', ' class="input_check" />
  898. </dd>
  899. <dt>
  900. <strong><label for="placement">', $txt['custom_edit_placement'], ':</label></strong>
  901. </dt>
  902. <dd>
  903. <select name="placement" id="placement">
  904. <option value="0"', $context['field']['placement'] == '0' ? ' selected="selected"' : '', '>', $txt['custom_edit_placement_standard'], '</option>
  905. <option value="1"', $context['field']['placement'] == '1' ? ' selected="selected"' : '', '>', $txt['custom_edit_placement_withicons'], '</option>
  906. <option value="2"', $context['field']['placement'] == '2' ? ' selected="selected"' : '', '>', $txt['custom_edit_placement_abovesignature'], '</option>
  907. </select>
  908. </dd>
  909. <dt>
  910. <a id="field_show_enclosed" href="', $scripturl, '?action=helpadmin;help=field_show_enclosed" onclick="return reqOverlayDiv(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics.png" class="icon" alt="', $txt['help'], '" /></a>
  911. <strong><label for="enclose">', $txt['custom_edit_enclose'], ':</label></strong><br />
  912. <span class="smalltext">', $txt['custom_edit_enclose_desc'], '</span>
  913. </dt>
  914. <dd>
  915. <textarea name="enclose" id="enclose" rows="10" cols="50">', @$context['field']['enclose'], '</textarea>
  916. </dd>
  917. </dl>
  918. </fieldset>
  919. <fieldset>
  920. <legend>', $txt['custom_edit_input'], '</legend>
  921. <dl class="settings">
  922. <dt>
  923. <strong><label for="field_type">', $txt['custom_edit_picktype'], ':</label></strong>
  924. </dt>
  925. <dd>
  926. <select name="field_type" id="field_type" onchange="updateInputBoxes();">
  927. <option value="text"', $context['field']['type'] == 'text' ? ' selected="selected"' : '', '>', $txt['custom_profile_type_text'], '</option>
  928. <option value="textarea"', $context['field']['type'] == 'textarea' ? ' selected="selected"' : '', '>', $txt['custom_profile_type_textarea'], '</option>
  929. <option value="select"', $context['field']['type'] == 'select' ? ' selected="selected"' : '', '>', $txt['custom_profile_type_select'], '</option>
  930. <option value="radio"', $context['field']['type'] == 'radio' ? ' selected="selected"' : '', '>', $txt['custom_profile_type_radio'], '</option>
  931. <option value="check"', $context['field']['type'] == 'check' ? ' selected="selected"' : '', '>', $txt['custom_profile_type_check'], '</option>
  932. </select>
  933. </dd>
  934. <dt id="max_length_dt">
  935. <strong><label for="max_length_dd">', $txt['custom_edit_max_length'], ':</label></strong><br />
  936. <span class="smalltext">', $txt['custom_edit_max_length_desc'], '</span>
  937. </dt>
  938. <dd>
  939. <input type="text" name="max_length" id="max_length_dd" value="', $context['field']['max_length'], '" size="7" maxlength="6" class="input_text" />
  940. </dd>
  941. <dt id="dimension_dt">
  942. <strong><label for="dimension_dd">', $txt['custom_edit_dimension'], ':</label></strong>
  943. </dt>
  944. <dd id="dimension_dd">
  945. <strong>', $txt['custom_edit_dimension_row'], ':</strong> <input type="text" name="rows" value="', $context['field']['rows'], '" size="5" maxlength="3" class="input_text" />
  946. <strong>', $txt['custom_edit_dimension_col'], ':</strong> <input type="text" name="cols" value="', $context['field']['cols'], '" size="5" maxlength="3" class="input_text" />
  947. </dd>
  948. <dt id="bbc_dt">
  949. <strong><label for="bbc_dd">', $txt['custom_edit_bbc'], '</label></strong>
  950. </dt>
  951. <dd >
  952. <input type="checkbox" name="bbc" id="bbc_dd"', $context['field']['bbc'] ? ' checked="checked"' : '', ' class="input_check" />
  953. </dd>
  954. <dt id="options_dt">
  955. <a href="', $scripturl, '?action=helpadmin;help=customoptions" onclick="return reqOverlayDiv(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics.png" class="icon" alt="', $txt['help'], '" /></a>
  956. <strong><label for="options_dd">', $txt['custom_edit_options'], ':</label></strong><br />
  957. <span class="smalltext">', $txt['custom_edit_options_desc'], '</span>
  958. </dt>
  959. <dd id="options_dd">
  960. <div>';
  961. foreach ($context['field']['options'] as $k => $option)
  962. {
  963. echo '
  964. ', $k == 0 ? '' : '<br />', '<input type="radio" name="default_select" value="', $k, '"', $context['field']['default_select'] == $option ? ' checked="checked"' : '', ' class="input_radio" /><input type="text" name="select_option[', $k, ']" value="', $option, '" class="input_text" />';
  965. }
  966. echo '
  967. <span id="addopt"></span>
  968. [<a href="" onclick="addOption(); return false;">', $txt['custom_edit_options_more'], '</a>]
  969. </div>
  970. </dd>
  971. <dt id="default_dt">
  972. <strong><label for="default_dd">', $txt['custom_edit_default'], ':</label></strong>
  973. </dt>
  974. <dd>
  975. <input type="checkbox" name="default_check" id="default_dd"', $context['field']['default_check'] ? ' checked="checked"' : '', ' class="input_check" />
  976. </dd>
  977. </dl>
  978. </fieldset>
  979. <fieldset>
  980. <legend>', $txt['custom_edit_advanced'], '</legend>
  981. <dl class="settings">
  982. <dt id="mask_dt">
  983. <a id="custom_mask" href="', $scripturl, '?action=helpadmin;help=custom_mask" onclick="return reqOverlayDiv(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics.png" class="icon" alt="', $txt['help'], '" /></a>
  984. <strong><label for="mask">', $txt['custom_edit_mask'], ':</label></strong><br />
  985. <span class="smalltext">', $txt['custom_edit_mask_desc'], '</span>
  986. </dt>
  987. <dd>
  988. <select name="mask" id="mask" onchange="updateInputBoxes();">
  989. <option value="nohtml"', $context['field']['mask'] == 'nohtml' ? ' selected="selected"' : '', '>', $txt['custom_edit_mask_nohtml'], '</option>
  990. <option value="email"', $context['field']['mask'] == 'email' ? ' selected="selected"' : '', '>', $txt['custom_edit_mask_email'], '</option>
  991. <option value="number"', $context['field']['mask'] == 'number' ? ' selected="selected"' : '', '>', $txt['custom_edit_mask_number'], '</option>
  992. <option value="regex"', strpos($context['field']['mask'], 'regex') === 0 ? ' selected="selected"' : '', '>', $txt['custom_edit_mask_regex'], '</option>
  993. </select>
  994. <br />
  995. <span id="regex_div">
  996. <input type="text" name="regex" value="', $context['field']['regex'], '" size="30" class="input_text" />
  997. </span>
  998. </dd>
  999. <dt>
  1000. <strong><label for="private">', $txt['custom_edit_privacy'], ':</label></strong>
  1001. <span class="smalltext">', $txt['custom_edit_privacy_desc'], '</span>
  1002. </dt>
  1003. <dd>
  1004. <select name="private" id="private" onchange="updateInputBoxes();" style="width: 100%">
  1005. <option value="0"', $context['field']['private'] == 0 ? ' selected="selected"' : '', '>', $txt['custom_edit_privacy_all'], '</option>
  1006. <option value="1"', $context['field']['private'] == 1 ? ' selected="selected"' : '', '>', $txt['custom_edit_privacy_see'], '</option>
  1007. <option value="2"', $context['field']['private'] == 2 ? ' selected="selected"' : '', '>', $txt['custom_edit_privacy_owner'], '</option>
  1008. <option value="3"', $context['field']['private'] == 3 ? ' selected="selected"' : '', '>', $txt['custom_edit_privacy_none'], '</option>
  1009. </select>
  1010. </dd>
  1011. <dt id="can_search_dt">
  1012. <strong><label for="can_search_dd">', $txt['custom_edit_can_search'], ':</label></strong><br />
  1013. <span class="smalltext">', $txt['custom_edit_can_search_desc'], '</span>
  1014. </dt>
  1015. <dd>
  1016. <input type="checkbox" name="can_search" id="can_search_dd"', $context['field']['can_search'] ? ' checked="checked"' : '', ' class="input_check" />
  1017. </dd>
  1018. <dt>
  1019. <strong><label for="can_search_check">', $txt['custom_edit_active'], ':</label></strong><br />
  1020. <span class="smalltext">', $txt['custom_edit_active_desc'], '</span>
  1021. </dt>
  1022. <dd>
  1023. <input type="checkbox" name="active" id="can_search_check"', $context['field']['active'] ? ' checked="checked"' : '', ' class="input_check" />
  1024. </dd>
  1025. </dl>
  1026. </fieldset>
  1027. <input type="submit" name="save" value="', $txt['save'], '" class="button_submit" />';
  1028. if ($context['fid'])
  1029. echo '
  1030. <input type="submit" name="delete" value="', $txt['delete'], '" onclick="return confirm(\'', $txt['custom_edit_delete_sure'], '\');" class="button_submit" />';
  1031. echo '
  1032. </div>
  1033. </div>
  1034. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  1035. <input type="hidden" name="', $context['admin-ecp_token_var'], '" value="', $context['admin-ecp_token'], '" />
  1036. </form>
  1037. </div>';
  1038. // Get the javascript bits right!
  1039. echo '
  1040. <script type="text/javascript"><!-- // --><![CDATA[
  1041. updateInputBoxes();
  1042. // ]]></script>';
  1043. }
  1044. // Results page for an admin search.
  1045. function template_admin_search_results()
  1046. {
  1047. global $context, $txt, $settings, $options, $scripturl;
  1048. echo '
  1049. <div id="section_header" class="cat_bar">
  1050. <h3 class="catbg">
  1051. <object id="quick_search">
  1052. <form action="', $scripturl, '?action=admin;area=search" method="post" accept-charset="', $context['character_set'], '" class="floatright">
  1053. <input type="text" name="search_term" value="', $context['search_term'], '" class="input_text" />
  1054. <input type="hidden" name="search_type" value="', $context['search_type'], '" />
  1055. <input type="submit" name="search_go" value="', $txt['admin_search_results_again'], '" class="button_submit" />
  1056. </form>
  1057. </object>
  1058. <img class="icon" src="' . $settings['images_url'] . '/buttons/search.png" alt="" />&nbsp;', sprintf($txt['admin_search_results_desc'], $context['search_term']), '
  1059. </h3>
  1060. </div>
  1061. <div class="windowbg2 generic_list_wrapper">
  1062. <div class="content">';
  1063. if (empty($context['search_results']))
  1064. {
  1065. echo '
  1066. <p class="centertext"><strong>', $txt['admin_search_results_none'], '</strong></p>';
  1067. }
  1068. else
  1069. {
  1070. echo '
  1071. <ol class="search_results">';
  1072. foreach ($context['search_results'] as $result)
  1073. {
  1074. // Is it a result from the online manual?
  1075. if ($context['search_type'] == 'online')
  1076. {
  1077. echo '
  1078. <li>
  1079. <p>
  1080. <a href="', $context['doc_scripturl'], str_replace(' ', '_', $result['title']), '" target="_blank" class="new_win"><strong>', $result['title'], '</strong></a>
  1081. </p>
  1082. <p class="double_height">
  1083. ', $result['snippet'], '
  1084. </p>
  1085. </li>';
  1086. }
  1087. // Otherwise it's... not!
  1088. else
  1089. {
  1090. echo '
  1091. <li class="windowbg2">
  1092. <a href="', $result['url'], '"><strong>', $result['name'], '</strong></a> [', isset($txt['admin_search_section_' . $result['type']]) ? $txt['admin_search_section_' . $result['type']] : $result['type'] , ']';
  1093. if ($result['help'])
  1094. echo '
  1095. <p class="double_height">', $result['help'], '</p>';
  1096. echo '
  1097. </li>';
  1098. }
  1099. }
  1100. echo '
  1101. </ol>';
  1102. }
  1103. echo '
  1104. </div>
  1105. </div>';
  1106. }
  1107. // Turn on and off certain key features.
  1108. function template_core_features()
  1109. {
  1110. global $context, $txt, $settings, $options, $scripturl;
  1111. echo '
  1112. <script type="text/javascript"><!-- // --><![CDATA[
  1113. var message, token_name, token_value;
  1114. var feature_on_text, feature_off_text;
  1115. var activation_text, deactivation_text;
  1116. var generic_error_text, imgs, sImageText;
  1117. var cc, cf, new_state, ajax_infobar;
  1118. feature_on_text = ', JavaScriptEscape($txt['core_settings_switch_off']), ';
  1119. feature_off_text = ', JavaScriptEscape($txt['core_settings_switch_on']), ';
  1120. activation_text = ', JavaScriptEscape($txt['core_settings_activation_message']), ';
  1121. deactivation_text = ', JavaScriptEscape($txt['core_settings_deactivation_message']), ';
  1122. generic_error_text = ', JavaScriptEscape($txt['core_settings_generic_error']), ';
  1123. imgs = [
  1124. "', $settings['images_url'], '/admin/switch_off.png",
  1125. "', $settings['images_url'], '/admin/switch_on.png"
  1126. ];
  1127. $(document).ready(function() {
  1128. $(".core_features_hide").hide();
  1129. $(".core_features_img").css({\'cursor\': \'pointer\', \'display\': \'\'}).each(function() {
  1130. sImageText = $(this).hasClass(\'on\') ? feature_on_text : feature_off_text;
  1131. $(this).attr({title: sImageText, alt: sImageText});
  1132. });
  1133. $("#core_features_submit").hide();
  1134. if (token_name == undefined)
  1135. token_name = $("#core_features_token").attr("name")
  1136. if (token_value == undefined)
  1137. token_value = $("#core_features_token").attr("value")
  1138. $(".core_features_img").click(function() {
  1139. cc = $(this);
  1140. cf = $(this).attr("id").substring(7);
  1141. new_state = !$("#feature_" + cf).attr("checked");
  1142. ajax_infobar = document.createElement(\'div\');
  1143. $(ajax_infobar).addClass("cf_notification");
  1144. $("body").append(ajax_infobar);
  1145. $(ajax_infobar).hide();
  1146. $("#feature_" + cf).attr("checked", new_state);
  1147. data = {save: "save", feature_id: cf};
  1148. data[$("#core_features_session").attr("name")] = $("#core_features_session").val();
  1149. data[token_name] = token_value;
  1150. $(".core_features_status_box").each(function() {
  1151. data[$(this).attr("name")] = !$(this).attr("checked") ? 0 : 1;
  1152. });
  1153. // Launch AJAX request.
  1154. $.ajax({
  1155. // The link we are accessing.
  1156. url: smf_scripturl + "?action=xmlhttp;sa=corefeatures;xml",
  1157. // The type of request.
  1158. type: "post",
  1159. // The type of data that is getting returned.
  1160. data: data,
  1161. error: function(error) {
  1162. $(ajax_infobar).html(error).slideDown(\'fast\');
  1163. },
  1164. success: function(request) {
  1165. if ($(request).find("errors").find("error").length != 0)
  1166. {
  1167. $(ajax_infobar).attr(\'class\', \'errorbox\');
  1168. $(ajax_infobar).html($(request).find("errors").find("error").text()).slideDown(\'fast\');
  1169. }
  1170. else if ($(request).find("smf").length != 0)
  1171. {
  1172. $("#feature_link_" + cf).html($(request).find("corefeatures").find("corefeature").text());
  1173. cc.attr({
  1174. "src": imgs[new_state ? 1 : 0],
  1175. "title": new_state ? feature_on_text : feature_off_text,
  1176. "alt": new_state ? feature_on_text : feature_off_text
  1177. });
  1178. $("#feature_link_" + cf).fadeOut().fadeIn();
  1179. $(ajax_infobar).addClass("infobox");
  1180. message = new_state ? activation_text : deactivation_text;
  1181. $(ajax_infobar).html(message.replace(\'{core_feature}\', $(request).find("corefeatures").find("corefeature").text())).slideDown(\'fast\').delay(5*1000).slideUp(function() { $(this).remove(); });
  1182. token_name = $(request).find("tokens").find(\'[type="token"]\').text();
  1183. token_value = $(request).find("tokens").find(\'[type="token_var"]\').text();
  1184. }
  1185. else
  1186. {
  1187. $(ajax_infobar).addClass("errorbox");
  1188. $(ajax_infobar).text(generic_error_text).slideDown(\'fast\');
  1189. }
  1190. }
  1191. });
  1192. });
  1193. });
  1194. // ]]></script>
  1195. <div id="admincenter">';
  1196. if ($context['is_new_install'])
  1197. {
  1198. echo '
  1199. <div id="section_header" class="cat_bar">
  1200. <h3 class="catbg">
  1201. ', $txt['core_settings_welcome_msg'], '
  1202. </h3>
  1203. </div>
  1204. <div class="information">
  1205. ', $txt['core_settings_welcome_msg_desc'], '
  1206. </div>';
  1207. }
  1208. echo '
  1209. <form id="core_features" action="', $scripturl, '?action=admin;area=corefeatures" method="post" accept-charset="', $context['character_set'], '">
  1210. <div style="display:none" id="activation_message" class="errorbox"></div>';
  1211. $alternate = true;
  1212. $num = 0;
  1213. $num_features = count($context['features']);
  1214. foreach ($context['features'] as $id => $feature)
  1215. {
  1216. $num++;
  1217. echo '
  1218. <div class="content features', $num !== $num_features ? ' features_separate' : '', '">
  1219. <img class="features_image" src="', $feature['image'], '" alt="', $feature['title'], '" />
  1220. <div class="features_switch" id="js_feature_', $id, '">
  1221. <label class="core_features_hide" for="feature_', $id, '">', $txt['core_settings_enabled'], '<input class="core_features_status_box" type="checkbox" name="feature_', $id, '" id="feature_', $id, '"', $feature['enabled'] ? ' checked="checked"' : '', ' /></label>
  1222. <img class="core_features_img ', $feature['state'], '" src="', $settings['images_url'], '/admin/switch_', $feature['state'], '.png" alt="', $feature['state'], '" id="switch_', $id, '" style="margin-top: 1.3em;display:none" />
  1223. </div>
  1224. <h4 id="feature_link_' . $id . '">', ($feature['enabled'] && $feature['url'] ? '<a href="' . $feature['url'] . '">' . $feature['title'] . '</a>' : $feature['title']), '</h4>
  1225. <p>', $feature['desc'], '</p>
  1226. </div>';
  1227. $alternate = !$alternate;
  1228. }
  1229. echo '
  1230. <div class="righttext">
  1231. <input id="core_features_session" type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  1232. <input id="core_features_token" type="hidden" name="', $context['admin-core_token_var'], '" value="', $context['admin-core_token'], '" />
  1233. <input id="core_features_submit" type="submit" value="', $txt['save'], '" name="save" class="button_submit" />
  1234. </div>
  1235. </form>
  1236. </div>';
  1237. }
  1238. // This little beauty shows questions and answer from the captcha type feature.
  1239. function template_callback_question_answer_list()
  1240. {
  1241. global $txt, $context, $settings;
  1242. foreach ($context['languages'] as $lang_id => $lang)
  1243. {
  1244. $lang_id = strtr($lang_id, array('-utf8' => ''));
  1245. $lang['name'] = strtr($lang['name'], array('-utf8' => ''));
  1246. echo '
  1247. <dt id="qa_dt_', $lang_id, '" class="qa_link">
  1248. <a href="javascript:void(0);">[ ', $lang['name'], ' ]</a>
  1249. </dt>
  1250. <fieldset id="qa_fs_', $lang_id, '" class="qa_fieldset">
  1251. <legend><a href="javascript:void(0);">', $lang['name'], '</a></legend>
  1252. <dl class="settings">
  1253. <dt>
  1254. <strong>', $txt['setup_verification_question'], '</strong>
  1255. </dt>
  1256. <dd>
  1257. <strong>', $txt['setup_verification_answer'], '</strong>
  1258. </dd>';
  1259. if (!empty($context['qa_by_lang'][$lang_id]))
  1260. foreach ($context['qa_by_lang'][$lang_id] as $q_id)
  1261. {
  1262. $question = $context['question_answers'][$q_id];
  1263. echo '
  1264. <dt>
  1265. <input type="text" name="question[', $lang_id, '][', $q_id, ']" value="', $question['question'], '" size="50" class="input_text verification_question" />
  1266. </dt>
  1267. <dd>';
  1268. foreach ($question['answers'] as $answer)
  1269. echo '
  1270. <input type="text" name="answer[', $lang_id, '][', $q_id, '][]" value="', $answer, '" size="50" class="input_text verification_answer" />';
  1271. echo '
  1272. <div class="qa_add_answer"><a href="javascript:void(0);" onclick="return addAnswer(this);">[ ', $txt['setup_verification_add_answer'], ' ]</a></div>
  1273. </dd>';
  1274. }
  1275. echo '
  1276. <dt class="qa_add_question"><a href="javascript:void(0);">[ ', $txt['setup_verification_add_more'], ' ]</a></dt>
  1277. </dl>
  1278. </fieldset>';
  1279. }
  1280. }
  1281. // Repairing boards.
  1282. function template_repair_boards()
  1283. {
  1284. global $context, $txt, $scripturl;
  1285. echo '
  1286. <div id="admincenter">
  1287. <div id="section_header" class="cat_bar">
  1288. <h3 class="catbg">',
  1289. $context['error_search'] ? $txt['errors_list'] : $txt['errors_fixing'] , '
  1290. </h3>
  1291. </div>
  1292. <div class="windowbg">
  1293. <div class="content">';
  1294. // Are we actually fixing them, or is this just a prompt?
  1295. if ($context['error_search'])
  1296. {
  1297. if (!empty($context['to_fix']))
  1298. {
  1299. echo '
  1300. ', $txt['errors_found'], ':
  1301. <ul>';
  1302. foreach ($context['repair_errors'] as $error)
  1303. echo '
  1304. <li>
  1305. ', $error, '
  1306. </li>';
  1307. echo '
  1308. </ul>
  1309. <p>
  1310. ', $txt['errors_fix'], '
  1311. </p>
  1312. <p class="padding">
  1313. <strong><a href="', $scripturl, '?action=admin;area=repairboards;fixErrors;', $context['session_var'], '=', $context['session_id'], '">', $txt['yes'], '</a> - <a href="', $scripturl, '?action=admin;area=maintain">', $txt['no'], '</a></strong>
  1314. </p>';
  1315. }
  1316. else
  1317. echo '
  1318. <p>', $txt['maintain_no_errors'], '</p>
  1319. <p class="padding">
  1320. <a href="', $scripturl, '?action=admin;area=maintain;sa=routine">', $txt['maintain_return'], '</a>
  1321. </p>';
  1322. }
  1323. else
  1324. {
  1325. if (!empty($context['redirect_to_recount']))
  1326. {
  1327. echo '
  1328. <p>
  1329. ', $txt['errors_do_recount'], '
  1330. </p>
  1331. <form action="', $scripturl, '?action=admin;area=maintain;sa=routine;activity=recount" id="recount_form" method="post">
  1332. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  1333. <input type="submit" name="recount" id="recount_now" value="', $txt['errors_recount_now'], '" />
  1334. </form>';
  1335. }
  1336. else
  1337. {
  1338. echo '
  1339. <p>', $txt['errors_fixed'], '</p>
  1340. <p class="padding">
  1341. <a href="', $scripturl, '?action=admin;area=maintain;sa=routine">', $txt['maintain_return'], '</a>
  1342. </p>';
  1343. }
  1344. }
  1345. echo '
  1346. </div>
  1347. </div>
  1348. </div>';
  1349. if (!empty($context['redirect_to_recount']))
  1350. {
  1351. echo '
  1352. <script type="text/javascript"><!-- // --><![CDATA[
  1353. var countdown = 5;
  1354. doAutoSubmit();
  1355. function doAutoSubmit()
  1356. {
  1357. if (countdown == 0)
  1358. document.forms.recount_form.submit();
  1359. else if (countdown == -1)
  1360. return;
  1361. document.forms.recount_form.recount_now.value = "', $txt['errors_recount_now'], ' (" + countdown + ")";
  1362. countdown--;
  1363. setTimeout("doAutoSubmit();", 1000);
  1364. }
  1365. // ]]></script>';
  1366. }
  1367. }
  1368. // Retrieves info from the php_info function, scrubs and preps it for display
  1369. function template_php_info()
  1370. {
  1371. global $context, $txt;
  1372. echo '
  1373. <div id="admin_form_wrapper">
  1374. <div id="section_header" class="cat_bar">
  1375. <h3 class="catbg">',
  1376. $txt['phpinfo_settings'], '
  1377. </h3>
  1378. </div>
  1379. <br />';
  1380. // for each php info area
  1381. foreach ($context['pinfo'] as $area => $php_area)
  1382. {
  1383. echo '
  1384. <table id="', str_replace(' ', '_', $area), '" width="100%" class="table_grid">
  1385. <thead>
  1386. <tr class="catbg">
  1387. <th class="first_th" scope="col" width="33%"></th>
  1388. <th scope="col" width="33%" class="centercol"><strong>', $area, '</strong></th>
  1389. <th class="last_th" scope="col" width="33%"></th>
  1390. </tr>
  1391. </thead>
  1392. <tbody>';
  1393. $alternate = true;
  1394. $localmaster = true;
  1395. // and for each setting in this category
  1396. foreach ($php_area as $key => $setting)
  1397. {
  1398. // start of a local / master setting (3 col)
  1399. if (is_array($setting))
  1400. {
  1401. if ($localmaster)
  1402. {
  1403. // heading row for the settings section of this categorys settings
  1404. echo '
  1405. <tr class="titlebg">
  1406. <td align="center" width="33%"><strong>', $txt['phpinfo_itemsettings'], '</strong></td>
  1407. <td align="center" width="33%"><strong>', $txt['phpinfo_localsettings'], '</strong></td>
  1408. <td align="center" width="33%"><strong>', $txt['phpinfo_defaultsettings'], '</strong></td>
  1409. </tr>';
  1410. $localmaster = false;
  1411. }
  1412. echo '
  1413. <tr>
  1414. <td align="left" width="33%" class="windowbg', $alternate ? '2' : '', '">', $key, '</td>';
  1415. foreach ($setting as $key_lm => $value)
  1416. {
  1417. echo '
  1418. <td align="left" width="33%" class="windowbg', $alternate ? '2' : '', '">', $value, '</td>';
  1419. }
  1420. echo '
  1421. </tr>';
  1422. }
  1423. // just a single setting (2 col)
  1424. else
  1425. {
  1426. echo '
  1427. <tr>
  1428. <td align="left" width="33%" class="windowbg', $alternate ? '2' : '', '">', $key, '</td>
  1429. <td align="left" class="windowbg', $alternate ? '2' : '', '" colspan="2">', $setting, '</td>
  1430. </tr>';
  1431. }
  1432. $alternate = !$alternate;
  1433. }
  1434. echo '
  1435. </tbody>
  1436. </table>
  1437. <br />';
  1438. }
  1439. echo '
  1440. </div>';
  1441. }
  1442. function template_clean_cache_button_above()
  1443. {
  1444. }
  1445. function template_clean_cache_button_below()
  1446. {
  1447. global $txt, $scripturl, $context;
  1448. echo '
  1449. <div class="cat_bar">
  1450. <h3 class="catbg">', $txt['maintain_cache'], '</h3>
  1451. </div>
  1452. <div class="windowbg">
  1453. <div class="content">
  1454. <form action="', $scripturl, '?action=admin;area=maintain;sa=routine;activity=cleancache" method="post" accept-charset="', $context['character_set'], '">
  1455. <p>', $txt['maintain_cache_info'], '</p>
  1456. <span><input type="submit" value="', $txt['maintain_run_now'], '" class="button_submit" /></span>
  1457. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  1458. <input type="hidden" name="', $context['admin-maint_token_var'], '" value="', $context['admin-maint_token'], '" />
  1459. </form>
  1460. </div>
  1461. </div>';
  1462. }
  1463. function template_admin_quick_search()
  1464. {
  1465. global $context, $settings, $txt, $scripturl;
  1466. if ($context['user']['is_admin'])
  1467. echo '
  1468. <object id="quick_search">
  1469. <form action="', $scripturl, '?action=admin;area=search" method="post" accept-charset="', $context['character_set'], '" class="floatright">
  1470. <img class="icon" src="', $settings['images_url'] , '/filter.png" alt="" />
  1471. <input type="text" name="search_term" value="', $txt['admin_search'], '" onclick="if (this.value == \'', $txt['admin_search'], '\') this.value = \'\';" class="input_text" />
  1472. <select name="search_type">
  1473. <option value="internal"', (empty($context['admin_preferences']['sb']) || $context['admin_preferences']['sb'] == 'internal' ? ' selected="selected"' : ''), '>', $txt['admin_search_type_internal'], '</option>
  1474. <option value="member"', (!empty($context['admin_preferences']['sb']) && $context['admin_preferences']['sb'] == 'member' ? ' selected="selected"' : ''), '>', $txt['admin_search_type_member'], '</option>
  1475. <option value="online"', (!empty($context['admin_preferences']['sb']) && $context['admin_preferences']['sb'] == 'online' ? ' selected="selected"' : ''), '>', $txt['admin_search_type_online'], '</option>
  1476. </select>
  1477. <input type="submit" name="search_go" id="search_go" value="', $txt['admin_search_go'], '" class="button_submit" />
  1478. </form>
  1479. </object>';
  1480. }
  1481. ?>