Admin.template.php 60 KB

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