Admin.template.php 60 KB

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