Admin.template.php 59 KB

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