Admin.template.php 60 KB

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