Admin.template.php 61 KB

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