Admin.template.php 63 KB

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