Admin.template.php 62 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647
  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.1 Alpha 1
  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. <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>
  549. <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>
  550. <script type="text/javascript"><!-- // --><![CDATA[
  551. document.getElementById("moreCensoredWords_link").style.display = "";
  552. function addNewWord()
  553. {
  554. 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>\');
  555. }
  556. // ]]></script>
  557. <hr width="100%" size="1" class="hrcolor clear" />
  558. <dl class="settings">
  559. <dt>
  560. <strong><label for="censorWholeWord_check">', $txt['censor_whole_words'], ':</label></strong>
  561. </dt>
  562. <dd>
  563. <input type="checkbox" name="censorWholeWord" value="1" id="censorWholeWord_check"', empty($modSettings['censorWholeWord']) ? '' : ' checked="checked"', ' class="input_check" />
  564. </dd>
  565. <dt>
  566. <strong><label for="censorIgnoreCase_check">', $txt['censor_case'], ':</label></strong>
  567. </dt>
  568. <dd>
  569. <input type="checkbox" name="censorIgnoreCase" value="1" id="censorIgnoreCase_check"', empty($modSettings['censorIgnoreCase']) ? '' : ' checked="checked"', ' class="input_check" />
  570. </dd>
  571. </dl>
  572. <input type="submit" name="save_censor" value="', $txt['save'], '" class="button_submit" />
  573. </div>
  574. <span class="botslice"><span></span></span>
  575. </div>';
  576. // This table lets you test out your filters by typing in rude words and seeing what comes out.
  577. echo '
  578. <div class="cat_bar">
  579. <h3 class="catbg">
  580. ', $txt['censor_test'], '
  581. </h3>
  582. </div>
  583. <div class="windowbg">
  584. <span class="topslice"><span></span></span>
  585. <div class="content">
  586. <p class="centertext">
  587. <input type="text" name="censortest" value="', empty($context['censor_test']) ? '' : $context['censor_test'], '" class="input_text" />
  588. <input type="submit" value="', $txt['censor_test_save'], '" class="button_submit" />
  589. </p>
  590. </div>
  591. <span class="botslice"><span></span></span>
  592. </div>
  593. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  594. <input type="hidden" name="', $context['admin-censor_token_var'], '" value="', $context['admin-censor_token'], '" />
  595. </form>
  596. </div>
  597. <br class="clear" />';
  598. }
  599. // Maintenance is a lovely thing, isn't it?
  600. function template_not_done()
  601. {
  602. global $context, $settings, $options, $txt, $scripturl;
  603. echo '
  604. <div id="admincenter">
  605. <div class="cat_bar">
  606. <h3 class="catbg">
  607. ', $txt['not_done_title'], '
  608. </h3>
  609. </div>
  610. <div class="windowbg">
  611. <span class="topslice"><span></span></span>
  612. <div class="content">
  613. ', $txt['not_done_reason'];
  614. if (!empty($context['continue_percent']))
  615. echo '
  616. <div style="padding-left: 20%; padding-right: 20%; margin-top: 1ex;">
  617. <div style="font-size: 8pt; height: 12pt; border: 1px solid black; background-color: white; padding: 1px; position: relative;">
  618. <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>
  619. <div style="width: ', $context['continue_percent'], '%; height: 12pt; z-index: 1; background-color: red;">&nbsp;</div>
  620. </div>
  621. </div>';
  622. if (!empty($context['substep_enabled']))
  623. echo '
  624. <div style="padding-left: 20%; padding-right: 20%; margin-top: 1ex;">
  625. <span class="smalltext">', $context['substep_title'], '</span>
  626. <div style="font-size: 8pt; height: 12pt; border: 1px solid black; background-color: white; padding: 1px; position: relative;">
  627. <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>
  628. <div style="width: ', $context['substep_continue_percent'], '%; height: 12pt; z-index: 1; background-color: blue;">&nbsp;</div>
  629. </div>
  630. </div>';
  631. echo '
  632. <form action="', $scripturl, $context['continue_get_data'], '" method="post" accept-charset="', $context['character_set'], '" style="margin: 0;" name="autoSubmit" id="autoSubmit">
  633. <div style="margin: 1ex; text-align: right;"><input type="submit" name="cont" value="', $txt['not_done_continue'], '" class="button_submit" /></div>
  634. ', $context['continue_post_data'], '
  635. </form>
  636. </div>
  637. <span class="botslice"><span></span></span>
  638. </div>
  639. </div>
  640. <br class="clear" />
  641. <script type="text/javascript"><!-- // --><![CDATA[
  642. var countdown = ', $context['continue_countdown'], ';
  643. doAutoSubmit();
  644. function doAutoSubmit()
  645. {
  646. if (countdown == 0)
  647. document.forms.autoSubmit.submit();
  648. else if (countdown == -1)
  649. return;
  650. document.forms.autoSubmit.cont.value = "', $txt['not_done_continue'], ' (" + countdown + ")";
  651. countdown--;
  652. setTimeout("doAutoSubmit();", 1000);
  653. }
  654. // ]]></script>';
  655. }
  656. // Template for showing settings (Of any kind really!)
  657. function template_show_settings()
  658. {
  659. global $context, $txt, $settings, $scripturl;
  660. echo '
  661. <script type="text/javascript"><!-- // --><![CDATA[';
  662. if (!empty($context['settings_pre_javascript']))
  663. echo $context['settings_pre_javascript'];
  664. // If we have BBC selection we have a bit of JS.
  665. if (!empty($context['bbc_sections']))
  666. {
  667. echo '
  668. function toggleBBCDisabled(section, disable)
  669. {
  670. for (var i = 0; i < document.forms.bbcForm.length; i++)
  671. {
  672. 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))
  673. continue;
  674. document.forms.bbcForm[i].disabled = disable;
  675. }
  676. document.getElementById("bbc_" + section + "_select_all").disabled = disable;
  677. }';
  678. }
  679. echo '
  680. // ]]></script>';
  681. if (!empty($context['settings_insert_above']))
  682. echo $context['settings_insert_above'];
  683. echo '
  684. <div id="admincenter">
  685. <form action="', $context['post_url'], '" method="post" accept-charset="', $context['character_set'], '"', !empty($context['force_form_onsubmit']) ? ' onsubmit="' . $context['force_form_onsubmit'] . '"' : '', '>';
  686. // Is there a custom title?
  687. if (isset($context['settings_title']))
  688. echo '
  689. <div class="cat_bar">
  690. <h3 class="catbg">
  691. ', $context['settings_title'], '
  692. </h3>
  693. </div>';
  694. // Have we got some custom code to insert?
  695. if (!empty($context['settings_message']))
  696. echo '
  697. <div class="information">', $context['settings_message'], '</div>';
  698. // Now actually loop through all the variables.
  699. $is_open = false;
  700. foreach ($context['config_vars'] as $config_var)
  701. {
  702. // Is it a title or a description?
  703. if (is_array($config_var) && ($config_var['type'] == 'title' || $config_var['type'] == 'desc'))
  704. {
  705. // Not a list yet?
  706. if ($is_open)
  707. {
  708. $is_open = false;
  709. echo '
  710. </dl>
  711. </div>
  712. <span class="botslice"><span></span></span>
  713. </div>';
  714. }
  715. // A title?
  716. if ($config_var['type'] == 'title')
  717. {
  718. echo '
  719. <div class="cat_bar">
  720. <h3 class="', !empty($config_var['class']) ? $config_var['class'] : 'catbg', '"', !empty($config_var['force_div_id']) ? ' id="' . $config_var['force_div_id'] . '"' : '', '>
  721. ', ($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>' : ''), '
  722. ', $config_var['label'], '
  723. </h3>
  724. </div>';
  725. }
  726. // A description?
  727. else
  728. {
  729. echo '
  730. <p class="description">
  731. ', $config_var['label'], '
  732. </p>';
  733. }
  734. continue;
  735. }
  736. // Not a list yet?
  737. if (!$is_open)
  738. {
  739. $is_open = true;
  740. echo '
  741. <div class="windowbg2">
  742. <span class="topslice"><span></span></span>
  743. <div class="content">
  744. <dl class="settings">';
  745. }
  746. // Hang about? Are you pulling my leg - a callback?!
  747. if (is_array($config_var) && $config_var['type'] == 'callback')
  748. {
  749. if (function_exists('template_callback_' . $config_var['name']))
  750. call_user_func('template_callback_' . $config_var['name']);
  751. continue;
  752. }
  753. if (is_array($config_var))
  754. {
  755. // First off, is this a span like a message?
  756. if (in_array($config_var['type'], array('message', 'warning')))
  757. {
  758. echo '
  759. <dd', $config_var['type'] == 'warning' ? ' class="alert"' : '', (!empty($config_var['force_div_id']) ? ' id="' . $config_var['force_div_id'] . '_dd"' : ''), '>
  760. ', $config_var['label'], '
  761. </dd>';
  762. }
  763. // Otherwise it's an input box of some kind.
  764. else
  765. {
  766. echo '
  767. <dt', is_array($config_var) && !empty($config_var['force_div_id']) ? ' id="' . $config_var['force_div_id'] . '"' : '', '>';
  768. // Some quick helpers...
  769. $javascript = $config_var['javascript'];
  770. $disabled = !empty($config_var['disabled']) ? ' disabled="disabled"' : '';
  771. $subtext = !empty($config_var['subtext']) ? '<br /><span class="smalltext"> ' . $config_var['subtext'] . '</span>' : '';
  772. // Show the [?] button.
  773. if ($config_var['help'])
  774. echo '
  775. <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>
  776. </dt>';
  777. else
  778. echo '
  779. <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>
  780. </dt>';
  781. echo '
  782. <dd', (!empty($config_var['force_div_id']) ? ' id="' . $config_var['force_div_id'] . '_dd"' : ''), '>',
  783. $config_var['preinput'];
  784. // Show a check box.
  785. if ($config_var['type'] == 'check')
  786. echo '
  787. <input type="checkbox"', $javascript, $disabled, ' name="', $config_var['name'], '" id="', $config_var['name'], '"', ($config_var['value'] ? ' checked="checked"' : ''), ' value="1" class="input_check" />';
  788. // Escape (via htmlspecialchars.) the text box.
  789. elseif ($config_var['type'] == 'password')
  790. echo '
  791. <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 />
  792. <input type="password" disabled="disabled" id="', $config_var['name'], '" name="', $config_var['name'], '[1]"', ($config_var['size'] ? ' size="' . $config_var['size'] . '"' : ''), ' class="input_password" />';
  793. // Show a selection box.
  794. elseif ($config_var['type'] == 'select')
  795. {
  796. echo '
  797. <select name="', $config_var['name'], '" id="', $config_var['name'], '" ', $javascript, $disabled, (!empty($config_var['multiple']) ? ' multiple="multiple"' : ''), '>';
  798. foreach ($config_var['data'] as $option)
  799. echo '
  800. <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>';
  801. echo '
  802. </select>';
  803. }
  804. // Text area?
  805. elseif ($config_var['type'] == 'large_text')
  806. echo '
  807. <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>';
  808. // Permission group?
  809. elseif ($config_var['type'] == 'permissions')
  810. theme_inline_permissions($config_var['name']);
  811. // BBC selection?
  812. elseif ($config_var['type'] == 'bbc')
  813. {
  814. echo '
  815. <fieldset id="', $config_var['name'], '">
  816. <legend>', $txt['bbcTagsToUse_select'], '</legend>
  817. <ul class="reset">';
  818. foreach ($context['bbc_columns'] as $bbcColumn)
  819. {
  820. foreach ($bbcColumn as $bbcTag)
  821. echo '
  822. <li class="list_bbc floatleft">
  823. <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>)' : '', '
  824. </li>';
  825. }
  826. echo ' </ul>
  827. <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>
  828. </fieldset>';
  829. }
  830. // A simple message?
  831. elseif ($config_var['type'] == 'var_message')
  832. echo '
  833. <div', !empty($config_var['name']) ? ' id="' . $config_var['name'] . '"' : '', '>', $config_var['var_message'], '</div>';
  834. // Assume it must be a text box.
  835. else
  836. echo '
  837. <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" />';
  838. echo isset($config_var['postinput']) ? '
  839. ' . $config_var['postinput'] : '',
  840. '</dd>';
  841. }
  842. }
  843. else
  844. {
  845. // Just show a separator.
  846. if ($config_var == '')
  847. echo '
  848. </dl>
  849. <hr class="hrcolor clear" />
  850. <dl class="settings">';
  851. else
  852. echo '
  853. <dd>
  854. <strong>' . $config_var . '</strong>
  855. </dd>';
  856. }
  857. }
  858. if ($is_open)
  859. echo '
  860. </dl>';
  861. if (empty($context['settings_save_dont_show']))
  862. echo '
  863. <hr class="hrcolor clear" />
  864. <div class="righttext">
  865. <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" />
  866. </div>';
  867. if ($is_open)
  868. echo '
  869. </div>
  870. <span class="botslice"><span></span></span>
  871. </div>';
  872. // At least one token has to be used!
  873. if (isset($context['admin-ssc_token']))
  874. echo '
  875. <input type="hidden" name="', $context['admin-ssc_token_var'], '" value="', $context['admin-ssc_token'], '" />';
  876. if (isset($context['admin-dbsc_token']))
  877. echo '
  878. <input type="hidden" name="', $context['admin-dbsc_token_var'], '" value="', $context['admin-dbsc_token'], '" />';
  879. echo '
  880. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  881. </form>
  882. </div>
  883. <br class="clear" />';
  884. if (!empty($context['settings_post_javascript']))
  885. echo '
  886. <script type="text/javascript"><!-- // --><![CDATA[
  887. ', $context['settings_post_javascript'], '
  888. // ]]></script>';
  889. if (!empty($context['settings_insert_below']))
  890. echo $context['settings_insert_below'];
  891. }
  892. // Template for showing custom profile fields.
  893. function template_show_custom_profile()
  894. {
  895. global $context, $txt, $settings, $scripturl;
  896. // Standard fields.
  897. template_show_list('standard_profile_fields');
  898. echo '
  899. <script type="text/javascript"><!-- // --><![CDATA[
  900. var iNumChecks = document.forms.standardProfileFields.length;
  901. for (var i = 0; i < iNumChecks; i++)
  902. if (document.forms.standardProfileFields[i].id.indexOf(\'reg_\') == 0)
  903. document.forms.standardProfileFields[i].disabled = document.forms.standardProfileFields[i].disabled || !document.getElementById(\'active_\' + document.forms.standardProfileFields[i].id.substr(4)).checked;
  904. // ]]></script><br />';
  905. // Custom fields.
  906. template_show_list('custom_profile_fields');
  907. }
  908. // Edit a profile field?
  909. function template_edit_profile_field()
  910. {
  911. global $context, $txt, $settings, $scripturl;
  912. // All the javascript for this page - quite a bit!
  913. echo '
  914. <script type="text/javascript"><!-- // --><![CDATA[
  915. function updateInputBoxes()
  916. {
  917. curType = document.getElementById("field_type").value;
  918. privStatus = document.getElementById("private").value;
  919. document.getElementById("max_length_dt").style.display = curType == "text" || curType == "textarea" ? "" : "none";
  920. document.getElementById("max_length_dd").style.display = curType == "text" || curType == "textarea" ? "" : "none";
  921. document.getElementById("dimension_dt").style.display = curType == "textarea" ? "" : "none";
  922. document.getElementById("dimension_dd").style.display = curType == "textarea" ? "" : "none";
  923. document.getElementById("bbc_dt").style.display = curType == "text" || curType == "textarea" ? "" : "none";
  924. document.getElementById("bbc_dd").style.display = curType == "text" || curType == "textarea" ? "" : "none";
  925. document.getElementById("options_dt").style.display = curType == "select" || curType == "radio" ? "" : "none";
  926. document.getElementById("options_dd").style.display = curType == "select" || curType == "radio" ? "" : "none";
  927. document.getElementById("default_dt").style.display = curType == "check" ? "" : "none";
  928. document.getElementById("default_dd").style.display = curType == "check" ? "" : "none";
  929. document.getElementById("mask_dt").style.display = curType == "text" ? "" : "none";
  930. document.getElementById("mask").style.display = curType == "text" ? "" : "none";
  931. document.getElementById("can_search_dt").style.display = curType == "text" || curType == "textarea" ? "" : "none";
  932. document.getElementById("can_search_dd").style.display = curType == "text" || curType == "textarea" ? "" : "none";
  933. document.getElementById("regex_div").style.display = curType == "text" && document.getElementById("mask").value == "regex" ? "" : "none";
  934. document.getElementById("display").disabled = false;
  935. // Cannot show this on the topic
  936. if (curType == "textarea" || privStatus >= 2)
  937. {
  938. document.getElementById("display").checked = false;
  939. document.getElementById("display").disabled = true;
  940. }
  941. }
  942. var startOptID = ', count($context['field']['options']), ';
  943. function addOption()
  944. {
  945. 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>\');
  946. startOptID++;
  947. }
  948. // ]]></script>';
  949. echo '
  950. <div id="admincenter">
  951. <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'], '">
  952. <div class="cat_bar">
  953. <h3 class="catbg">
  954. ', $context['page_title'], '
  955. </h3>
  956. </div>
  957. <div class="windowbg">
  958. <span class="topslice"><span></span></span>
  959. <div class="content">
  960. <fieldset>
  961. <legend>', $txt['custom_edit_general'], '</legend>
  962. <dl class="settings">
  963. <dt>
  964. <strong>', $txt['custom_edit_name'], ':</strong>
  965. </dt>
  966. <dd>
  967. <input type="text" name="field_name" value="', $context['field']['name'], '" size="20" maxlength="40" class="input_text" />
  968. </dd>
  969. <dt>
  970. <strong>', $txt['custom_edit_desc'], ':</strong>
  971. </dt>
  972. <dd>
  973. <textarea name="field_desc" rows="3" cols="40">', $context['field']['desc'], '</textarea>
  974. </dd>
  975. <dt>
  976. <strong>', $txt['custom_edit_profile'], ':</strong><br />
  977. <span class="smalltext">', $txt['custom_edit_profile_desc'], '</span>
  978. </dt>
  979. <dd>
  980. <select name="profile_area">
  981. <option value="none"', $context['field']['profile_area'] == 'none' ? ' selected="selected"' : '', '>', $txt['custom_edit_profile_none'], '</option>
  982. <option value="account"', $context['field']['profile_area'] == 'account' ? ' selected="selected"' : '', '>', $txt['account'], '</option>
  983. <option value="forumprofile"', $context['field']['profile_area'] == 'forumprofile' ? ' selected="selected"' : '', '>', $txt['forumprofile'], '</option>
  984. <option value="theme"', $context['field']['profile_area'] == 'theme' ? ' selected="selected"' : '', '>', $txt['theme'], '</option>
  985. </select>
  986. </dd>
  987. <dt>
  988. <strong>', $txt['custom_edit_registration'], ':</strong>
  989. </dt>
  990. <dd>
  991. <select name="reg" id="reg">
  992. <option value="0"', $context['field']['reg'] == 0 ? ' selected="selected"' : '', '>', $txt['custom_edit_registration_disable'], '</option>
  993. <option value="1"', $context['field']['reg'] == 1 ? ' selected="selected"' : '', '>', $txt['custom_edit_registration_allow'], '</option>
  994. <option value="2"', $context['field']['reg'] == 2 ? ' selected="selected"' : '', '>', $txt['custom_edit_registration_require'], '</option>
  995. </select>
  996. </dd>
  997. <dt>
  998. <strong>', $txt['custom_edit_display'], ':</strong>
  999. </dt>
  1000. <dd>
  1001. <input type="checkbox" name="display" id="display"', $context['field']['display'] ? ' checked="checked"' : '', ' class="input_check" />
  1002. </dd>
  1003. <dt>
  1004. <strong>', $txt['custom_edit_placement'], ':</strong>
  1005. </dt>
  1006. <dd>
  1007. <select name="placement" id="placement">
  1008. <option value="0"', $context['field']['placement'] == '0' ? ' selected="selected"' : '', '>', $txt['custom_edit_placement_standard'], '</option>
  1009. <option value="1"', $context['field']['placement'] == '1' ? ' selected="selected"' : '', '>', $txt['custom_edit_placement_withicons'], '</option>
  1010. <option value="2"', $context['field']['placement'] == '2' ? ' selected="selected"' : '', '>', $txt['custom_edit_placement_abovesignature'], '</option>
  1011. </select>
  1012. </dd>
  1013. <dt>
  1014. <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>
  1015. <strong>', $txt['custom_edit_enclose'], ':</strong><br />
  1016. <span class="smalltext">', $txt['custom_edit_enclose_desc'], '</span>
  1017. </dt>
  1018. <dd>
  1019. <textarea name="enclose" rows="10" cols="50">', @$context['field']['enclose'], '</textarea>
  1020. </dd>
  1021. </dl>
  1022. </fieldset>
  1023. <fieldset>
  1024. <legend>', $txt['custom_edit_input'], '</legend>
  1025. <dl class="settings">
  1026. <dt>
  1027. <strong>', $txt['custom_edit_picktype'], ':</strong>
  1028. </dt>
  1029. <dd>
  1030. <select name="field_type" id="field_type" onchange="updateInputBoxes();">
  1031. <option value="text"', $context['field']['type'] == 'text' ? ' selected="selected"' : '', '>', $txt['custom_profile_type_text'], '</option>
  1032. <option value="textarea"', $context['field']['type'] == 'textarea' ? ' selected="selected"' : '', '>', $txt['custom_profile_type_textarea'], '</option>
  1033. <option value="select"', $context['field']['type'] == 'select' ? ' selected="selected"' : '', '>', $txt['custom_profile_type_select'], '</option>
  1034. <option value="radio"', $context['field']['type'] == 'radio' ? ' selected="selected"' : '', '>', $txt['custom_profile_type_radio'], '</option>
  1035. <option value="check"', $context['field']['type'] == 'check' ? ' selected="selected"' : '', '>', $txt['custom_profile_type_check'], '</option>
  1036. </select>
  1037. </dd>
  1038. <dt id="max_length_dt">
  1039. <strong>', $txt['custom_edit_max_length'], ':</strong><br />
  1040. <span class="smalltext">', $txt['custom_edit_max_length_desc'], '</span>
  1041. </dt>
  1042. <dd id="max_length_dd">
  1043. <input type="text" name="max_length" value="', $context['field']['max_length'], '" size="7" maxlength="6" class="input_text" />
  1044. </dd>
  1045. <dt id="dimension_dt">
  1046. <strong>', $txt['custom_edit_dimension'], ':</strong>
  1047. </dt>
  1048. <dd id="dimension_dd">
  1049. <strong>', $txt['custom_edit_dimension_row'], ':</strong> <input type="text" name="rows" value="', $context['field']['rows'], '" size="5" maxlength="3" class="input_text" />
  1050. <strong>', $txt['custom_edit_dimension_col'], ':</strong> <input type="text" name="cols" value="', $context['field']['cols'], '" size="5" maxlength="3" class="input_text" />
  1051. </dd>
  1052. <dt id="bbc_dt">
  1053. <strong>', $txt['custom_edit_bbc'], '</strong>
  1054. </dt>
  1055. <dd id="bbc_dd">
  1056. <input type="checkbox" name="bbc"', $context['field']['bbc'] ? ' checked="checked"' : '', ' class="input_check" />
  1057. </dd>
  1058. <dt id="options_dt">
  1059. <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>
  1060. <strong>', $txt['custom_edit_options'], ':</strong><br />
  1061. <span class="smalltext">', $txt['custom_edit_options_desc'], '</span>
  1062. </dt>
  1063. <dd id="options_dd">
  1064. <div>';
  1065. foreach ($context['field']['options'] as $k => $option)
  1066. {
  1067. echo '
  1068. ', $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" />';
  1069. }
  1070. echo '
  1071. <span id="addopt"></span>
  1072. [<a href="" onclick="addOption(); return false;">', $txt['custom_edit_options_more'], '</a>]
  1073. </div>
  1074. </dd>
  1075. <dt id="default_dt">
  1076. <strong>', $txt['custom_edit_default'], ':</strong>
  1077. </dt>
  1078. <dd id="default_dd">
  1079. <input type="checkbox" name="default_check"', $context['field']['default_check'] ? ' checked="checked"' : '', ' class="input_check" />
  1080. </dd>
  1081. </dl>
  1082. </fieldset>
  1083. <fieldset>
  1084. <legend>', $txt['custom_edit_advanced'], '</legend>
  1085. <dl class="settings">
  1086. <dt id="mask_dt">
  1087. <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>
  1088. <strong>', $txt['custom_edit_mask'], ':</strong><br />
  1089. <span class="smalltext">', $txt['custom_edit_mask_desc'], '</span>
  1090. </dt>
  1091. <dd>
  1092. <select name="mask" id="mask" onchange="updateInputBoxes();">
  1093. <option value="nohtml"', $context['field']['mask'] == 'nohtml' ? ' selected="selected"' : '', '>', $txt['custom_edit_mask_nohtml'], '</option>
  1094. <option value="email"', $context['field']['mask'] == 'email' ? ' selected="selected"' : '', '>', $txt['custom_edit_mask_email'], '</option>
  1095. <option value="number"', $context['field']['mask'] == 'number' ? ' selected="selected"' : '', '>', $txt['custom_edit_mask_number'], '</option>
  1096. <option value="regex"', substr($context['field']['mask'], 0, 5) == 'regex' ? ' selected="selected"' : '', '>', $txt['custom_edit_mask_regex'], '</option>
  1097. </select>
  1098. <br />
  1099. <span id="regex_div">
  1100. <input type="text" name="regex" value="', $context['field']['regex'], '" size="30" class="input_text" />
  1101. </span>
  1102. </dd>
  1103. <dt>
  1104. <strong>', $txt['custom_edit_privacy'], ':</strong>
  1105. <span class="smalltext">', $txt['custom_edit_privacy_desc'], '</span>
  1106. </dt>
  1107. <dd>
  1108. <select name="private" id="private" onchange="updateInputBoxes();" style="width: 100%">
  1109. <option value="0"', $context['field']['private'] == 0 ? ' selected="selected"' : '', '>', $txt['custom_edit_privacy_all'], '</option>
  1110. <option value="1"', $context['field']['private'] == 1 ? ' selected="selected"' : '', '>', $txt['custom_edit_privacy_see'], '</option>
  1111. <option value="2"', $context['field']['private'] == 2 ? ' selected="selected"' : '', '>', $txt['custom_edit_privacy_owner'], '</option>
  1112. <option value="3"', $context['field']['private'] == 3 ? ' selected="selected"' : '', '>', $txt['custom_edit_privacy_none'], '</option>
  1113. </select>
  1114. </dd>
  1115. <dt id="can_search_dt">
  1116. <strong>', $txt['custom_edit_can_search'], ':</strong><br />
  1117. <span class="smalltext">', $txt['custom_edit_can_search_desc'], '</span>
  1118. </dt>
  1119. <dd id="can_search_dd">
  1120. <input type="checkbox" name="can_search"', $context['field']['can_search'] ? ' checked="checked"' : '', ' class="input_check" />
  1121. </dd>
  1122. <dt>
  1123. <strong>', $txt['custom_edit_active'], ':</strong><br />
  1124. <span class="smalltext">', $txt['custom_edit_active_desc'], '</span>
  1125. </dt>
  1126. <dd>
  1127. <input type="checkbox" name="active"', $context['field']['active'] ? ' checked="checked"' : '', ' class="input_check" />
  1128. </dd>
  1129. </dl>
  1130. </fieldset>
  1131. <div class="righttext">
  1132. <input type="submit" name="save" value="', $txt['save'], '" class="button_submit" />';
  1133. if ($context['fid'])
  1134. echo '
  1135. <input type="submit" name="delete" value="', $txt['delete'], '" onclick="return confirm(\'', $txt['custom_edit_delete_sure'], '\');" class="button_submit" />';
  1136. echo '
  1137. </div>
  1138. </div>
  1139. <span class="botslice"><span></span></span>
  1140. </div>
  1141. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  1142. <input type="hidden" name="', $context['admin-ecp_token_var'], '" value="', $context['admin-ecp_token'], '" />
  1143. </form>
  1144. </div>
  1145. <br class="clear" />';
  1146. // Get the javascript bits right!
  1147. echo '
  1148. <script type="text/javascript"><!-- // --><![CDATA[
  1149. updateInputBoxes();
  1150. // ]]></script>';
  1151. }
  1152. // Results page for an admin search.
  1153. function template_admin_search_results()
  1154. {
  1155. global $context, $txt, $settings, $options, $scripturl;
  1156. echo '
  1157. <div class="cat_bar">
  1158. <h3 class="catbg">
  1159. <object id="quick_search">
  1160. <form action="', $scripturl, '?action=admin;area=search" method="post" accept-charset="', $context['character_set'], '" class="floatright">
  1161. <input type="text" name="search_term" value="', $context['search_term'], '" class="input_text" />
  1162. <input type="hidden" name="search_type" value="', $context['search_type'], '" />
  1163. <input type="submit" name="search_go" value="', $txt['admin_search_results_again'], '" class="button_submit" />
  1164. </form>
  1165. </object>
  1166. <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>
  1167. </h3>
  1168. </div>
  1169. <div class="windowbg nopadding">
  1170. <span class="topslice"><span></span></span>
  1171. <div class="content">';
  1172. if (empty($context['search_results']))
  1173. {
  1174. echo '
  1175. <p class="centertext"><strong>', $txt['admin_search_results_none'], '</strong></p>';
  1176. }
  1177. else
  1178. {
  1179. echo '
  1180. <ol class="search_results">';
  1181. foreach ($context['search_results'] as $result)
  1182. {
  1183. // Is it a result from the online manual?
  1184. if ($context['search_type'] == 'online')
  1185. {
  1186. echo '
  1187. <li>
  1188. <p>
  1189. <a href="', $context['doc_scripturl'], '?topic=', $result['topic_id'], '.0" target="_blank" class="new_win"><strong>', $result['messages'][0]['subject'], '</strong></a>
  1190. <br /><span class="smalltext"><a href="', $result['category']['href'], '" target="_blank" class="new_win">', $result['category']['name'], '</a> &nbsp;/&nbsp;
  1191. <a href="', $result['board']['href'], '" target="_blank" class="new_win">', $result['board']['name'], '</a> /</span>
  1192. </p>
  1193. <p class="double_height">
  1194. ', $result['messages'][0]['body'], '
  1195. </p>
  1196. </li>';
  1197. }
  1198. // Otherwise it's... not!
  1199. else
  1200. {
  1201. echo '
  1202. <li class="windowbg">
  1203. <a href="', $result['url'], '"><strong>', $result['name'], '</strong></a> [', isset($txt['admin_search_section_' . $result['type']]) ? $txt['admin_search_section_' . $result['type']] : $result['type'] , ']';
  1204. if ($result['help'])
  1205. echo '
  1206. <p class="double_height">', $result['help'], '</p>';
  1207. echo '
  1208. </li>';
  1209. }
  1210. }
  1211. echo '
  1212. </ol>';
  1213. }
  1214. echo '
  1215. </div>
  1216. <span class="botslice"><span></span></span>
  1217. </div>
  1218. <br class="clear" />';
  1219. }
  1220. // Turn on and off certain key features.
  1221. function template_core_features()
  1222. {
  1223. global $context, $txt, $settings, $options, $scripturl;
  1224. echo '
  1225. <script type="text/javascript"><!-- // --><![CDATA[
  1226. function toggleItem(itemID)
  1227. {
  1228. // Toggle the hidden item.
  1229. var itemValueHandle = document.getElementById("feature_" + itemID);
  1230. itemValueHandle.value = itemValueHandle.value == 1 ? 0 : 1;
  1231. // Change the image, alternative text and the title.
  1232. document.getElementById("switch_" + itemID).src = \'', $settings['images_url'], '/admin/switch_\' + (itemValueHandle.value == 1 ? \'on\' : \'off\') + \'.png\';
  1233. document.getElementById("switch_" + itemID).alt = itemValueHandle.value == 1 ? \'', $txt['core_settings_switch_off'], '\' : \'', $txt['core_settings_switch_on'], '\';
  1234. document.getElementById("switch_" + itemID).title = itemValueHandle.value == 1 ? \'', $txt['core_settings_switch_off'], '\' : \'', $txt['core_settings_switch_on'], '\';
  1235. // Don\'t reload.
  1236. return false;
  1237. }
  1238. // ]]></script>
  1239. <div id="admincenter">';
  1240. if ($context['is_new_install'])
  1241. {
  1242. echo '
  1243. <div class="cat_bar">
  1244. <h3 class="catbg">
  1245. ', $txt['core_settings_welcome_msg'], '
  1246. </h3>
  1247. </div>
  1248. <div class="information">
  1249. ', $txt['core_settings_welcome_msg_desc'], '
  1250. </div>';
  1251. }
  1252. echo '
  1253. <form action="', $scripturl, '?action=admin;area=corefeatures;" method="post" accept-charset="', $context['character_set'], '">
  1254. <div class="cat_bar">
  1255. <h3 class="catbg">
  1256. ', $txt['core_settings_title'], '
  1257. </h3>
  1258. </div>';
  1259. $alternate = true;
  1260. foreach ($context['features'] as $id => $feature)
  1261. {
  1262. echo '
  1263. <div class="windowbg', $alternate ? '2' : '', '">
  1264. <span class="topslice"><span></span></span>
  1265. <div class="content features">
  1266. <img class="features_image png_fix" src="', $settings['default_images_url'], '/admin/feature_', $id, '.png" alt="', $feature['title'], '" />
  1267. <div class="features_switch" id="js_feature_', $id, '" style="display: none;">
  1268. <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, '\');">
  1269. <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')], '" />
  1270. </a>
  1271. </div>
  1272. <h4>', ($feature['enabled'] && $feature['url'] ? '<a href="' . $feature['url'] . '">' . $feature['title'] . '</a>' : $feature['title']), '</h4>
  1273. <p>', $feature['desc'], '</p>
  1274. <div id="plain_feature_', $id, '">
  1275. <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>
  1276. <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>
  1277. </div>
  1278. </div>
  1279. <span class="botslice clear_right"><span></span></span>
  1280. </div>';
  1281. $alternate = !$alternate;
  1282. }
  1283. echo '
  1284. <div class="righttext">
  1285. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  1286. <input type="hidden" name="', $context['admin-core_token_var'], '" value="', $context['admin-core_token'], '" />
  1287. <input type="hidden" value="0" name="js_worked" id="js_worked" />
  1288. <input type="submit" value="', $txt['save'], '" name="save" class="button_submit" />
  1289. </div>
  1290. </form>
  1291. </div>
  1292. <br class="clear" />';
  1293. // Turn on the pretty javascript if we can!
  1294. echo '
  1295. <script type="text/javascript"><!-- // --><![CDATA[
  1296. document.getElementById(\'js_worked\').value = "1";';
  1297. foreach ($context['features'] as $id => $feature)
  1298. echo '
  1299. document.getElementById(\'js_feature_', $id, '\').style.display = "";
  1300. document.getElementById(\'plain_feature_', $id, '\').style.display = "none";';
  1301. echo '
  1302. // ]]></script>';
  1303. }
  1304. // This little beauty shows questions and answer from the captcha type feature.
  1305. function template_callback_question_answer_list()
  1306. {
  1307. global $txt, $context;
  1308. echo '
  1309. <dt>
  1310. <strong>', $txt['setup_verification_question'], '</strong>
  1311. </dt>
  1312. <dd>
  1313. <strong>', $txt['setup_verification_answer'], '</strong>
  1314. </dd>';
  1315. foreach ($context['question_answers'] as $data)
  1316. echo '
  1317. <dt>
  1318. <input type="text" name="question[', $data['id'], ']" value="', $data['question'], '" size="50" class="input_text verification_question" />
  1319. </dt>
  1320. <dd>
  1321. <input type="text" name="answer[', $data['id'], ']" value="', $data['answer'], '" size="50" class="input_text verification_answer" />
  1322. </dd>';
  1323. // Some blank ones.
  1324. for ($count = 0; $count < 3; $count++)
  1325. echo '
  1326. <dt>
  1327. <input type="text" name="question[]" size="50" class="input_text verification_question" />
  1328. </dt>
  1329. <dd>
  1330. <input type="text" name="answer[]" size="50" class="input_text verification_answer" />
  1331. </dd>';
  1332. echo '
  1333. <dt id="add_more_question_placeholder" style="display: none;"></dt><dd></dd>
  1334. <dt id="add_more_link_div" style="display: none;">
  1335. <a href="#" onclick="addAnotherQuestion(); return false;">&#171; ', $txt['setup_verification_add_more'], ' &#187;</a>
  1336. </dt><dd></dd>';
  1337. // The javascript needs to go at the end but we'll put it in this template for looks.
  1338. $context['settings_post_javascript'] .= '
  1339. // Create a named element dynamically - thanks to: http://www.thunderguy.com/semicolon/2005/05/23/setting-the-name-attribute-in-internet-explorer/
  1340. function createNamedElement(type, name, customFields)
  1341. {
  1342. var element = null;
  1343. if (!customFields)
  1344. customFields = "";
  1345. // Try the IE way; this fails on standards-compliant browsers
  1346. try
  1347. {
  1348. element = document.createElement("<" + type + \' name="\' + name + \'" \' + customFields + ">");
  1349. }
  1350. catch (e)
  1351. {
  1352. }
  1353. if (!element || element.nodeName != type.toUpperCase())
  1354. {
  1355. // Non-IE browser; use canonical method to create named element
  1356. element = document.createElement(type);
  1357. element.name = name;
  1358. }
  1359. return element;
  1360. }
  1361. var placeHolder = document.getElementById(\'add_more_question_placeholder\');
  1362. function addAnotherQuestion()
  1363. {
  1364. var newDT = document.createElement("dt");
  1365. var newInput = createNamedElement("input", "question[]");
  1366. newInput.type = "text";
  1367. newInput.className = "input_text";
  1368. newInput.size = "50";
  1369. newInput.setAttribute("class", "verification_question");
  1370. newDT.appendChild(newInput);
  1371. newDD = document.createElement("dd");
  1372. newInput = createNamedElement("input", "answer[]");
  1373. newInput.type = "text";
  1374. newInput.className = "input_text";
  1375. newInput.size = "50";
  1376. newInput.setAttribute("class", "verification_answer");
  1377. newDD.appendChild(newInput);
  1378. placeHolder.parentNode.insertBefore(newDT, placeHolder);
  1379. placeHolder.parentNode.insertBefore(newDD, placeHolder);
  1380. }
  1381. document.getElementById(\'add_more_link_div\').style.display = \'\';
  1382. ';
  1383. }
  1384. // Repairing boards.
  1385. function template_repair_boards()
  1386. {
  1387. global $context, $txt, $scripturl;
  1388. echo '
  1389. <div id="admincenter">
  1390. <div class="cat_bar">
  1391. <h3 class="catbg">',
  1392. $context['error_search'] ? $txt['errors_list'] : $txt['errors_fixing'] , '
  1393. </h3>
  1394. </div>
  1395. <div class="windowbg">
  1396. <span class="topslice"><span></span></span>
  1397. <div class="content">';
  1398. // Are we actually fixing them, or is this just a prompt?
  1399. if ($context['error_search'])
  1400. {
  1401. if (!empty($context['to_fix']))
  1402. {
  1403. echo '
  1404. ', $txt['errors_found'], ':
  1405. <ul>';
  1406. foreach ($context['repair_errors'] as $error)
  1407. echo '
  1408. <li>
  1409. ', $error, '
  1410. </li>';
  1411. echo '
  1412. </ul>
  1413. <p>
  1414. ', $txt['errors_fix'], '
  1415. </p>
  1416. <p class="padding">
  1417. <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>
  1418. </p>';
  1419. }
  1420. else
  1421. echo '
  1422. <p>', $txt['maintain_no_errors'], '</p>
  1423. <p class="padding">
  1424. <a href="', $scripturl, '?action=admin;area=maintain;sa=routine">', $txt['maintain_return'], '</a>
  1425. </p>';
  1426. }
  1427. else
  1428. {
  1429. if (!empty($context['redirect_to_recount']))
  1430. {
  1431. echo '
  1432. <p>
  1433. ', $txt['errors_do_recount'], '
  1434. </p>
  1435. <form action="', $scripturl, '?action=admin;area=maintain;sa=routine;activity=recount" id="recount_form" method="post">
  1436. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  1437. <input type="submit" name="recount" id="recount_now" value="', $txt['errors_recount_now'], '" />
  1438. </form>';
  1439. }
  1440. else
  1441. {
  1442. echo '
  1443. <p>', $txt['errors_fixed'], '</p>
  1444. <p class="padding">
  1445. <a href="', $scripturl, '?action=admin;area=maintain;sa=routine">', $txt['maintain_return'], '</a>
  1446. </p>';
  1447. }
  1448. }
  1449. echo '
  1450. </div>
  1451. <span class="botslice"><span></span></span>
  1452. </div>
  1453. </div>
  1454. <br class="clear" />';
  1455. if (!empty($context['redirect_to_recount']))
  1456. {
  1457. echo '
  1458. <script type="text/javascript"><!-- // --><![CDATA[
  1459. var countdown = 5;
  1460. doAutoSubmit();
  1461. function doAutoSubmit()
  1462. {
  1463. if (countdown == 0)
  1464. document.forms.recount_form.submit();
  1465. else if (countdown == -1)
  1466. return;
  1467. document.forms.recount_form.recount_now.value = "', $txt['errors_recount_now'], ' (" + countdown + ")";
  1468. countdown--;
  1469. setTimeout("doAutoSubmit();", 1000);
  1470. }
  1471. // ]]></script>';
  1472. }
  1473. }
  1474. ?>