annotate forum/Themes/default/Admin.template.php @ 78:96118bc49f04 website

Add RGU-MFS
author Chris Cannam
date Thu, 17 Oct 2013 09:22:53 +0100
parents e3e11437ecea
children
rev   line source
Chris@76 1 <?php
Chris@76 2 /**
Chris@76 3 * Simple Machines Forum (SMF)
Chris@76 4 *
Chris@76 5 * @package SMF
Chris@76 6 * @author Simple Machines
Chris@76 7 * @copyright 2011 Simple Machines
Chris@76 8 * @license http://www.simplemachines.org/about/smf/license.php BSD
Chris@76 9 *
Chris@76 10 * @version 2.0
Chris@76 11 */
Chris@76 12
Chris@76 13 // This is the administration center home.
Chris@76 14 function template_admin()
Chris@76 15 {
Chris@76 16 global $context, $settings, $options, $scripturl, $txt, $modSettings;
Chris@76 17
Chris@76 18 // Welcome message for the admin.
Chris@76 19 echo '
Chris@76 20 <div id="admincenter">
Chris@76 21 <div class="cat_bar">
Chris@76 22 <h3 class="catbg">';
Chris@76 23
Chris@76 24 if ($context['user']['is_admin'])
Chris@76 25 echo '
Chris@76 26 <object id="quick_search">
Chris@76 27 <form action="', $scripturl, '?action=admin;area=search" method="post" accept-charset="', $context['character_set'], '" class="floatright">
Chris@76 28 <img src="', $settings['images_url'] , '/filter.gif" alt="" />
Chris@76 29 <input type="text" name="search_term" value="', $txt['admin_search'], '" onclick="if (this.value == \'', $txt['admin_search'], '\') this.value = \'\';" class="input_text" />
Chris@76 30 <select name="search_type">
Chris@76 31 <option value="internal"', (empty($context['admin_preferences']['sb']) || $context['admin_preferences']['sb'] == 'internal' ? ' selected="selected"' : ''), '>', $txt['admin_search_type_internal'], '</option>
Chris@76 32 <option value="member"', (!empty($context['admin_preferences']['sb']) && $context['admin_preferences']['sb'] == 'member' ? ' selected="selected"' : ''), '>', $txt['admin_search_type_member'], '</option>
Chris@76 33 <option value="online"', (!empty($context['admin_preferences']['sb']) && $context['admin_preferences']['sb'] == 'online' ? ' selected="selected"' : ''), '>', $txt['admin_search_type_online'], '</option>
Chris@76 34 </select>
Chris@76 35 <input type="submit" name="search_go" id="search_go" value="', $txt['admin_search_go'], '" class="button_submit" />
Chris@76 36 </form>
Chris@76 37 </object>';
Chris@76 38
Chris@76 39 echo $txt['admin_center'], '
Chris@76 40 </h3>
Chris@76 41 </div>
Chris@76 42 <span class="upperframe"><span></span></span>
Chris@76 43 <div class="roundframe">
Chris@76 44 <div id="welcome">
Chris@76 45 <strong>', $txt['hello_guest'], ' ', $context['user']['name'], '!</strong>
Chris@76 46 ', sprintf($txt['admin_main_welcome'], $txt['admin_center'], $txt['help'], $txt['help']), '
Chris@76 47 </div>
Chris@76 48 </div>
Chris@76 49 <span class="lowerframe"><span></span></span>';
Chris@76 50
Chris@76 51 // Is there an update available?
Chris@76 52 echo '
Chris@76 53 <div id="update_section"></div>';
Chris@76 54
Chris@76 55 echo '
Chris@76 56 <div id="admin_main_section">';
Chris@76 57
Chris@76 58 // Display the "live news" from simplemachines.org.
Chris@76 59 echo '
Chris@76 60 <div id="live_news" class="floatleft">
Chris@76 61 <div class="cat_bar">
Chris@76 62 <h3 class="catbg">
Chris@76 63 <span class="ie6_header floatleft"><a href="', $scripturl, '?action=helpadmin;help=live_news" onclick="return reqWin(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics.gif" class="icon" alt="', $txt['help'], '" /></a> ', $txt['live'], '</span>
Chris@76 64 </h3>
Chris@76 65 </div>
Chris@76 66 <div class="windowbg nopadding">
Chris@76 67 <span class="topslice"><span></span></span>
Chris@76 68 <div class="content">
Chris@76 69 <div id="smfAnnouncements">', $txt['lfyi'], '</div>
Chris@76 70 </div>
Chris@76 71 <span class="botslice"><span></span></span>
Chris@76 72 </div>
Chris@76 73 </div>';
Chris@76 74
Chris@76 75 // Show the user version information from their server.
Chris@76 76 echo '
Chris@76 77 <div id="supportVersionsTable" class="floatright">
Chris@76 78 <div class="cat_bar">
Chris@76 79 <h3 class="catbg">
Chris@76 80 <a href="', $scripturl, '?action=admin;area=credits">', $txt['support_title'], '</a>
Chris@76 81 </h3>
Chris@76 82 </div>
Chris@76 83 <div class="windowbg nopadding">
Chris@76 84 <span class="topslice"><span></span></span>
Chris@76 85 <div class="content">
Chris@76 86 <div id="version_details">
Chris@76 87 <strong>', $txt['support_versions'], ':</strong><br />
Chris@76 88 ', $txt['support_versions_forum'], ':
Chris@76 89 <em id="yourVersion" style="white-space: nowrap;">', $context['forum_version'], '</em><br />
Chris@76 90 ', $txt['support_versions_current'], ':
Chris@76 91 <em id="smfVersion" style="white-space: nowrap;">??</em><br />
Chris@76 92 ', $context['can_admin'] ? '<a href="' . $scripturl . '?action=admin;area=maintain;sa=routine;activity=version">' . $txt['version_check_more'] . '</a>' : '', '<br />';
Chris@76 93
Chris@76 94 // Display all the members who can administrate the forum.
Chris@76 95 echo '
Chris@76 96 <br />
Chris@76 97 <strong>', $txt['administrators'], ':</strong>
Chris@76 98 ', implode(', ', $context['administrators']);
Chris@76 99 // If we have lots of admins... don't show them all.
Chris@76 100 if (!empty($context['more_admins_link']))
Chris@76 101 echo '
Chris@76 102 (', $context['more_admins_link'], ')';
Chris@76 103
Chris@76 104 echo '
Chris@76 105 </div>
Chris@76 106 </div>
Chris@76 107 <span class="botslice"><span></span></span>
Chris@76 108 </div>
Chris@76 109 </div>
Chris@76 110 </div>';
Chris@76 111
Chris@76 112 echo '
Chris@76 113 <div class="windowbg2 clear_right">
Chris@76 114 <span class="topslice"><span></span></span>
Chris@76 115 <div class="content">
Chris@76 116 <ul id="quick_tasks" class="flow_hidden">';
Chris@76 117
Chris@76 118 foreach ($context['quick_admin_tasks'] as $task)
Chris@76 119 echo '
Chris@76 120 <li>
Chris@76 121 ', !empty($task['icon']) ? '<a href="' . $task['href'] . '"><img src="' . $settings['default_images_url'] . '/admin/' . $task['icon'] . '" alt="" class="home_image png_fix" /></a>' : '', '
Chris@76 122 <h5>', $task['link'], '</h5>
Chris@76 123 <span class="task">', $task['description'],'</span>
Chris@76 124 </li>';
Chris@76 125
Chris@76 126 echo '
Chris@76 127 </ul>
Chris@76 128 </div>
Chris@76 129 <span class="botslice clear"><span></span></span>
Chris@76 130 </div>
Chris@76 131 </div>
Chris@76 132 <br class="clear" />';
Chris@76 133
Chris@76 134 // The below functions include all the scripts needed from the simplemachines.org site. The language and format are passed for internationalization.
Chris@76 135 if (empty($modSettings['disable_smf_js']))
Chris@76 136 echo '
Chris@76 137 <script type="text/javascript" src="', $scripturl, '?action=viewsmfile;filename=current-version.js"></script>
Chris@76 138 <script type="text/javascript" src="', $scripturl, '?action=viewsmfile;filename=latest-news.js"></script>';
Chris@76 139
Chris@76 140 // This sets the announcements and current versions themselves ;).
Chris@76 141 echo '
Chris@76 142 <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/admin.js?fin20"></script>
Chris@76 143 <script type="text/javascript"><!-- // --><![CDATA[
Chris@76 144 var oAdminIndex = new smf_AdminIndex({
Chris@76 145 sSelf: \'oAdminCenter\',
Chris@76 146
Chris@76 147 bLoadAnnouncements: true,
Chris@76 148 sAnnouncementTemplate: ', JavaScriptEscape('
Chris@76 149 <dl>
Chris@76 150 %content%
Chris@76 151 </dl>
Chris@76 152 '), ',
Chris@76 153 sAnnouncementMessageTemplate: ', JavaScriptEscape('
Chris@76 154 <dt><a href="%href%">%subject%</a> ' . $txt['on'] . ' %time%</dt>
Chris@76 155 <dd>
Chris@76 156 %message%
Chris@76 157 </dd>
Chris@76 158 '), ',
Chris@76 159 sAnnouncementContainerId: \'smfAnnouncements\',
Chris@76 160
Chris@76 161 bLoadVersions: true,
Chris@76 162 sSmfVersionContainerId: \'smfVersion\',
Chris@76 163 sYourVersionContainerId: \'yourVersion\',
Chris@76 164 sVersionOutdatedTemplate: ', JavaScriptEscape('
Chris@76 165 <span class="alert">%currentVersion%</span>
Chris@76 166 '), ',
Chris@76 167
Chris@76 168 bLoadUpdateNotification: true,
Chris@76 169 sUpdateNotificationContainerId: \'update_section\',
Chris@76 170 sUpdateNotificationDefaultTitle: ', JavaScriptEscape($txt['update_available']), ',
Chris@76 171 sUpdateNotificationDefaultMessage: ', JavaScriptEscape($txt['update_message']), ',
Chris@76 172 sUpdateNotificationTemplate: ', JavaScriptEscape('
Chris@76 173 <div class="cat_bar">
Chris@76 174 <h3 id="update_title" class="catbg">
Chris@76 175 %title%
Chris@76 176 </h3>
Chris@76 177 </div>
Chris@76 178 <div class="windowbg">
Chris@76 179 <span class="topslice"><span></span></span>
Chris@76 180 <div class="content">
Chris@76 181 <div id="update_message" class="smalltext">
Chris@76 182 %message%
Chris@76 183 </div>
Chris@76 184 </div>
Chris@76 185 <span class="botslice"><span></span></span>
Chris@76 186 </div>
Chris@76 187 '), ',
Chris@76 188 sUpdateNotificationLink: ', JavaScriptEscape($scripturl . '?action=admin;area=packages;pgdownload;auto;package=%package%;' . $context['session_var'] . '=' . $context['session_id']), '
Chris@76 189
Chris@76 190 });
Chris@76 191 // ]]></script>';
Chris@76 192 }
Chris@76 193
Chris@76 194 // Show some support information and credits to those who helped make this.
Chris@76 195 function template_credits()
Chris@76 196 {
Chris@76 197 global $context, $settings, $options, $scripturl, $txt;
Chris@76 198
Chris@76 199 // Show the user version information from their server.
Chris@76 200 echo '
Chris@76 201
Chris@76 202 <div id="admincenter">
Chris@76 203 <div class="cat_bar">
Chris@76 204 <h3 class="catbg">
Chris@76 205 ', $txt['support_title'], '
Chris@76 206 </h3>
Chris@76 207 </div>
Chris@76 208 <div class="windowbg">
Chris@76 209 <span class="topslice"><span></span></span>
Chris@76 210 <div class="content">
Chris@76 211 <strong>', $txt['support_versions'], ':</strong><br />
Chris@76 212 ', $txt['support_versions_forum'], ':
Chris@76 213 <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 />
Chris@76 214 ', $txt['support_versions_current'], ':
Chris@76 215 <em id="smfVersion" style="white-space: nowrap;">??</em><br />';
Chris@76 216
Chris@76 217 // Display all the variables we have server information for.
Chris@76 218 foreach ($context['current_versions'] as $version)
Chris@76 219 echo '
Chris@76 220 ', $version['title'], ':
Chris@76 221 <em>', $version['version'], '</em><br />';
Chris@76 222
Chris@76 223 echo '
Chris@76 224 </div>
Chris@76 225 <span class="botslice"><span></span></span>
Chris@76 226 </div>
Chris@76 227 ';
Chris@76 228
Chris@76 229 // Point the admin to common support resources.
Chris@76 230 echo '
Chris@76 231 <div class="cat_bar">
Chris@76 232 <h3 class="catbg">
Chris@76 233 ', $txt['support_resources'], '
Chris@76 234 </h3>
Chris@76 235 </div>
Chris@76 236 <div class="windowbg2">
Chris@76 237 <span class="topslice"><span></span></span>
Chris@76 238 <div class="content">
Chris@76 239 <p>', $txt['support_resources_p1'], '</p>
Chris@76 240 <p>', $txt['support_resources_p2'], '</p>
Chris@76 241 </div>
Chris@76 242 <span class="botslice"><span></span></span>
Chris@76 243 </div>';
Chris@76 244
Chris@76 245 // Display latest support questions from simplemachines.org.
Chris@76 246 echo '
Chris@76 247 <div class="cat_bar">
Chris@76 248 <h3 class="catbg">
Chris@76 249 <span class="ie6_header floatleft"><a href="', $scripturl, '?action=helpadmin;help=latest_support" onclick="return reqWin(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics.gif" class="icon" alt="', $txt['help'], '" /></a> ', $txt['support_latest'], '</span>
Chris@76 250 </h3>
Chris@76 251 </div>
Chris@76 252 <div class="windowbg2">
Chris@76 253 <span class="topslice"><span></span></span>
Chris@76 254 <div class="content">
Chris@76 255 <div id="latestSupport">', $txt['support_latest_fetch'], '</div>
Chris@76 256 </div>
Chris@76 257 <span class="botslice"><span></span></span>
Chris@76 258 </div>';
Chris@76 259
Chris@76 260 // The most important part - the credits :P.
Chris@76 261 echo '
Chris@76 262 <div class="cat_bar">
Chris@76 263 <h3 class="catbg">
Chris@76 264 ', $txt['admin_credits'], '
Chris@76 265 </h3>
Chris@76 266 </div>
Chris@76 267 <div class="windowbg">
Chris@76 268 <span class="topslice"><span></span></span>
Chris@76 269 <div class="content">';
Chris@76 270
Chris@76 271 foreach ($context['credits'] as $section)
Chris@76 272 {
Chris@76 273 if (isset($section['pretext']))
Chris@76 274 echo '
Chris@76 275 <p>', $section['pretext'], '</p>';
Chris@76 276
Chris@76 277 echo '
Chris@76 278 <dl>';
Chris@76 279
Chris@76 280 foreach ($section['groups'] as $group)
Chris@76 281 {
Chris@76 282 if (isset($group['title']))
Chris@76 283 echo '
Chris@76 284 <dt>
Chris@76 285 <strong>', $group['title'], ':</strong>
Chris@76 286 </dt>';
Chris@76 287
Chris@76 288 echo '
Chris@76 289 <dd>', implode(', ', $group['members']), '</dd>';
Chris@76 290 }
Chris@76 291
Chris@76 292 echo '
Chris@76 293 </dl>';
Chris@76 294
Chris@76 295 if (isset($section['posttext']))
Chris@76 296 echo '
Chris@76 297 <p>', $section['posttext'], '</p>';
Chris@76 298 }
Chris@76 299
Chris@76 300 echo '
Chris@76 301 </div>
Chris@76 302 <span class="botslice"><span></span></span>
Chris@76 303 </div>
Chris@76 304 </div>
Chris@76 305 <br class="clear" />';
Chris@76 306
Chris@76 307 // This makes all the support information available to the support script...
Chris@76 308 echo '
Chris@76 309 <script type="text/javascript"><!-- // --><![CDATA[
Chris@76 310 var smfSupportVersions = {};
Chris@76 311
Chris@76 312 smfSupportVersions.forum = "', $context['forum_version'], '";';
Chris@76 313
Chris@76 314 // Don't worry, none of this is logged, it's just used to give information that might be of use.
Chris@76 315 foreach ($context['current_versions'] as $variable => $version)
Chris@76 316 echo '
Chris@76 317 smfSupportVersions.', $variable, ' = "', $version['version'], '";';
Chris@76 318
Chris@76 319 // Now we just have to include the script and wait ;).
Chris@76 320 echo '
Chris@76 321 // ]]></script>
Chris@76 322 <script type="text/javascript" src="', $scripturl, '?action=viewsmfile;filename=current-version.js"></script>
Chris@76 323 <script type="text/javascript" src="', $scripturl, '?action=viewsmfile;filename=latest-news.js"></script>
Chris@76 324 <script type="text/javascript" src="', $scripturl, '?action=viewsmfile;filename=latest-support.js"></script>';
Chris@76 325
Chris@76 326 // This sets the latest support stuff.
Chris@76 327 echo '
Chris@76 328 <script type="text/javascript"><!-- // --><![CDATA[
Chris@76 329 function smfSetLatestSupport()
Chris@76 330 {
Chris@76 331 if (window.smfLatestSupport)
Chris@76 332 setInnerHTML(document.getElementById("latestSupport"), window.smfLatestSupport);
Chris@76 333 }
Chris@76 334
Chris@76 335 function smfCurrentVersion()
Chris@76 336 {
Chris@76 337 var smfVer, yourVer;
Chris@76 338
Chris@76 339 if (!window.smfVersion)
Chris@76 340 return;
Chris@76 341
Chris@76 342 smfVer = document.getElementById("smfVersion");
Chris@76 343 yourVer = document.getElementById("yourVersion");
Chris@76 344
Chris@76 345 setInnerHTML(smfVer, window.smfVersion);
Chris@76 346
Chris@76 347 var currentVersion = getInnerHTML(yourVer);
Chris@76 348 if (currentVersion != window.smfVersion)
Chris@76 349 setInnerHTML(yourVer, "<span class=\"alert\">" + currentVersion + "</span>");
Chris@76 350 }';
Chris@76 351
Chris@76 352 // IE 4 is rather annoying, this wouldn't be necessary...
Chris@76 353 echo '
Chris@76 354 var fSetupCredits = function ()
Chris@76 355 {
Chris@76 356 smfSetLatestSupport();
Chris@76 357 smfCurrentVersion()
Chris@76 358 }
Chris@76 359 addLoadEvent(fSetupCredits);
Chris@76 360 // ]]></script>';
Chris@76 361 }
Chris@76 362
Chris@76 363 // Displays information about file versions installed, and compares them to current version.
Chris@76 364 function template_view_versions()
Chris@76 365 {
Chris@76 366 global $context, $settings, $options, $scripturl, $txt;
Chris@76 367
Chris@76 368 echo '
Chris@76 369 <div id="admincenter">
Chris@76 370 <div class="cat_bar">
Chris@76 371 <h3 class="catbg">
Chris@76 372 ', $txt['admin_version_check'], '
Chris@76 373 </h3>
Chris@76 374 </div>
Chris@76 375 <div class="information">', $txt['version_check_desc'], '</div>
Chris@76 376 <table width="100%" class="table_grid">
Chris@76 377 <thead>
Chris@76 378 <tr class="catbg" align="left">
Chris@76 379 <th class="first_th" scope="col" width="50%">
Chris@76 380 <strong>', $txt['admin_smffile'], '</strong>
Chris@76 381 </th>
Chris@76 382 <th scope="col" width="25%">
Chris@76 383 <strong>', $txt['dvc_your'], '</strong>
Chris@76 384 </th>
Chris@76 385 <th class="last_th" scope="col"" width="25%">
Chris@76 386 <strong>', $txt['dvc_current'], '</strong>
Chris@76 387 </th>
Chris@76 388 </tr>
Chris@76 389 </thead>
Chris@76 390 <tbody>';
Chris@76 391
Chris@76 392 // The current version of the core SMF package.
Chris@76 393 echo '
Chris@76 394 <tr>
Chris@76 395 <td class="windowbg">
Chris@76 396 ', $txt['admin_smfpackage'], '
Chris@76 397 </td>
Chris@76 398 <td class="windowbg">
Chris@76 399 <em id="yourSMF">', $context['forum_version'], '</em>
Chris@76 400 </td>
Chris@76 401 <td class="windowbg">
Chris@76 402 <em id="currentSMF">??</em>
Chris@76 403 </td>
Chris@76 404 </tr>';
Chris@76 405
Chris@76 406 // Now list all the source file versions, starting with the overall version (if all match!).
Chris@76 407 echo '
Chris@76 408 <tr>
Chris@76 409 <td class="windowbg">
Chris@76 410 <a href="#" id="Sources-link">', $txt['dvc_sources'], '</a>
Chris@76 411 </td>
Chris@76 412 <td class="windowbg">
Chris@76 413 <em id="yourSources">??</em>
Chris@76 414 </td>
Chris@76 415 <td class="windowbg">
Chris@76 416 <em id="currentSources">??</em>
Chris@76 417 </td>
Chris@76 418 </tr>
Chris@76 419 </tbody>
Chris@76 420 </table>
Chris@76 421
Chris@76 422 <table id="Sources" width="100%" class="table_grid">
Chris@76 423 <tbody>';
Chris@76 424
Chris@76 425 // Loop through every source file displaying its version - using javascript.
Chris@76 426 foreach ($context['file_versions'] as $filename => $version)
Chris@76 427 echo '
Chris@76 428 <tr>
Chris@76 429 <td class="windowbg2" width="50%" style="padding-left: 3ex;">
Chris@76 430 ', $filename, '
Chris@76 431 </td>
Chris@76 432 <td class="windowbg2" width="25%">
Chris@76 433 <em id="yourSources', $filename, '">', $version, '</em>
Chris@76 434 </td>
Chris@76 435 <td class="windowbg2" width="25%">
Chris@76 436 <em id="currentSources', $filename, '">??</em>
Chris@76 437 </td>
Chris@76 438 </tr>';
Chris@76 439
Chris@76 440 // Default template files.
Chris@76 441 echo '
Chris@76 442 </tbody>
Chris@76 443 </table>
Chris@76 444
Chris@76 445 <table width="100%" class="table_grid">
Chris@76 446 <tbody>
Chris@76 447 <tr>
Chris@76 448 <td class="windowbg" width="50%">
Chris@76 449 <a href="#" id="Default-link">', $txt['dvc_default'], '</a>
Chris@76 450 </td>
Chris@76 451 <td class="windowbg" width="25%">
Chris@76 452 <em id="yourDefault">??</em>
Chris@76 453 </td>
Chris@76 454 <td class="windowbg" width="25%">
Chris@76 455 <em id="currentDefault">??</em>
Chris@76 456 </td>
Chris@76 457 </tr>
Chris@76 458 </tbody>
Chris@76 459 </table>
Chris@76 460
Chris@76 461 <table id="Default" width="100%" class="table_grid">
Chris@76 462 <tbody>';
Chris@76 463
Chris@76 464 foreach ($context['default_template_versions'] as $filename => $version)
Chris@76 465 echo '
Chris@76 466 <tr>
Chris@76 467 <td class="windowbg2" width="50%" style="padding-left: 3ex;">
Chris@76 468 ', $filename, '
Chris@76 469 </td>
Chris@76 470 <td class="windowbg2" width="25%">
Chris@76 471 <em id="yourDefault', $filename, '">', $version, '</em>
Chris@76 472 </td>
Chris@76 473 <td class="windowbg2" width="25%">
Chris@76 474 <em id="currentDefault', $filename, '">??</em>
Chris@76 475 </td>
Chris@76 476 </tr>';
Chris@76 477
Chris@76 478 // Now the language files...
Chris@76 479 echo '
Chris@76 480 </tbody>
Chris@76 481 </table>
Chris@76 482
Chris@76 483 <table width="100%" class="table_grid">
Chris@76 484 <tbody>
Chris@76 485 <tr>
Chris@76 486 <td class="windowbg" width="50%">
Chris@76 487 <a href="#" id="Languages-link">', $txt['dvc_languages'], '</a>
Chris@76 488 </td>
Chris@76 489 <td class="windowbg" width="25%">
Chris@76 490 <em id="yourLanguages">??</em>
Chris@76 491 </td>
Chris@76 492 <td class="windowbg" width="25%">
Chris@76 493 <em id="currentLanguages">??</em>
Chris@76 494 </td>
Chris@76 495 </tr>
Chris@76 496 </tbody>
Chris@76 497 </table>
Chris@76 498
Chris@76 499 <table id="Languages" width="100%" class="table_grid">
Chris@76 500 <tbody>';
Chris@76 501
Chris@76 502 foreach ($context['default_language_versions'] as $language => $files)
Chris@76 503 {
Chris@76 504 foreach ($files as $filename => $version)
Chris@76 505 echo '
Chris@76 506 <tr>
Chris@76 507 <td class="windowbg2" width="50%" style="padding-left: 3ex;">
Chris@76 508 ', $filename, '.<em>', $language, '</em>.php
Chris@76 509 </td>
Chris@76 510 <td class="windowbg2" width="25%">
Chris@76 511 <em id="your', $filename, '.', $language, '">', $version, '</em>
Chris@76 512 </td>
Chris@76 513 <td class="windowbg2" width="25%">
Chris@76 514 <em id="current', $filename, '.', $language, '">??</em>
Chris@76 515 </td>
Chris@76 516 </tr>';
Chris@76 517 }
Chris@76 518
Chris@76 519 echo '
Chris@76 520 </tbody>
Chris@76 521 </table>';
Chris@76 522
Chris@76 523 // Finally, display the version information for the currently selected theme - if it is not the default one.
Chris@76 524 if (!empty($context['template_versions']))
Chris@76 525 {
Chris@76 526 echo '
Chris@76 527 <table width="100%" class="table_grid">
Chris@76 528 <tbody>
Chris@76 529 <tr>
Chris@76 530 <td class="windowbg" width="50%">
Chris@76 531 <a href="#" id="Templates-link">', $txt['dvc_templates'], '</a>
Chris@76 532 </td>
Chris@76 533 <td class="windowbg" width="25%">
Chris@76 534 <em id="yourTemplates">??</em>
Chris@76 535 </td>
Chris@76 536 <td class="windowbg" width="25%">
Chris@76 537 <em id="currentTemplates">??</em>
Chris@76 538 </td>
Chris@76 539 </tr>
Chris@76 540 </tbody>
Chris@76 541 </table>
Chris@76 542
Chris@76 543 <table id="Templates" width="100%" class="table_grid">
Chris@76 544 <tbody>';
Chris@76 545
Chris@76 546 foreach ($context['template_versions'] as $filename => $version)
Chris@76 547 echo '
Chris@76 548 <tr>
Chris@76 549 <td class="windowbg2" width="50%" style="padding-left: 3ex;">
Chris@76 550 ', $filename, '
Chris@76 551 </td>
Chris@76 552 <td class="windowbg2" width="25%">
Chris@76 553 <em id="yourTemplates', $filename, '">', $version, '</em>
Chris@76 554 </td>
Chris@76 555 <td class="windowbg2" width="25%">
Chris@76 556 <em id="currentTemplates', $filename, '">??</em>
Chris@76 557 </td>
Chris@76 558 </tr>';
Chris@76 559
Chris@76 560 echo '
Chris@76 561 </tbody>
Chris@76 562 </table>';
Chris@76 563 }
Chris@76 564
Chris@76 565 echo '
Chris@76 566 </div>
Chris@76 567 <br class="clear" />';
Chris@76 568
Chris@76 569 /* Below is the hefty javascript for this. Upon opening the page it checks the current file versions with ones
Chris@76 570 held at simplemachines.org and works out if they are up to date. If they aren't it colors that files number
Chris@76 571 red. It also contains the function, swapOption, that toggles showing the detailed information for each of the
Chris@76 572 file categories. (sources, languages, and templates.) */
Chris@76 573 echo '
Chris@76 574 <script type="text/javascript" src="', $scripturl, '?action=viewsmfile;filename=detailed-version.js"></script>
Chris@76 575 <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/admin.js?fin20"></script>
Chris@76 576 <script type="text/javascript"><!-- // --><![CDATA[
Chris@76 577 var oViewVersions = new smf_ViewVersions({
Chris@76 578 aKnownLanguages: [
Chris@76 579 \'.', implode('\',
Chris@76 580 \'.', $context['default_known_languages']), '\'
Chris@76 581 ],
Chris@76 582 oSectionContainerIds: {
Chris@76 583 Sources: \'Sources\',
Chris@76 584 Default: \'Default\',
Chris@76 585 Languages: \'Languages\',
Chris@76 586 Templates: \'Templates\'
Chris@76 587 }
Chris@76 588 });
Chris@76 589 // ]]></script>';
Chris@76 590
Chris@76 591 }
Chris@76 592
Chris@76 593 // Form for stopping people using naughty words, etc.
Chris@76 594 function template_edit_censored()
Chris@76 595 {
Chris@76 596 global $context, $settings, $options, $scripturl, $txt, $modSettings;
Chris@76 597
Chris@76 598 // First section is for adding/removing words from the censored list.
Chris@76 599 echo '
Chris@76 600 <div id="admincenter">
Chris@76 601 <form action="', $scripturl, '?action=admin;area=postsettings;sa=censor" method="post" accept-charset="', $context['character_set'], '">
Chris@76 602 <div class="cat_bar">
Chris@76 603 <h3 class="catbg">
Chris@76 604 ', $txt['admin_censored_words'], '
Chris@76 605 </h3>
Chris@76 606 </div>
Chris@76 607 <div class="windowbg2">
Chris@76 608 <span class="topslice"><span></span></span>
Chris@76 609 <div class="content">
Chris@76 610 <p>', $txt['admin_censored_where'], '</p>';
Chris@76 611
Chris@76 612 // Show text boxes for censoring [bad ] => [good ].
Chris@76 613 foreach ($context['censored_words'] as $vulgar => $proper)
Chris@76 614 echo '
Chris@76 615 <div style="margin-top: 1ex;"><input type="text" name="censor_vulgar[]" value="', $vulgar, '" size="20" /> => <input type="text" name="censor_proper[]" value="', $proper, '" size="20" /></div>';
Chris@76 616
Chris@76 617 // Now provide a way to censor more words.
Chris@76 618 echo '
Chris@76 619 <noscript>
Chris@76 620 <div style="margin-top: 1ex;"><input type="text" name="censor_vulgar[]" size="20" class="input_text" /> => <input type="text" name="censor_proper[]" size="20" class="input_text" /></div>
Chris@76 621 </noscript>
Chris@76 622 <div id="moreCensoredWords"></div><div style="margin-top: 1ex; display: none;" id="moreCensoredWords_link"><a href="#;" onclick="addNewWord(); return false;">', $txt['censor_clickadd'], '</a></div>
Chris@76 623 <script type="text/javascript"><!-- // --><![CDATA[
Chris@76 624 document.getElementById("moreCensoredWords_link").style.display = "";
Chris@76 625
Chris@76 626 function addNewWord()
Chris@76 627 {
Chris@76 628 setOuterHTML(document.getElementById("moreCensoredWords"), \'<div style="margin-top: 1ex;"><input type="text" name="censor_vulgar[]" size="20" class="input_text" /> => <input type="text" name="censor_proper[]" size="20" class="input_text" /><\' + \'/div><div id="moreCensoredWords"><\' + \'/div>\');
Chris@76 629 }
Chris@76 630 // ]]></script>
Chris@76 631 <hr width="100%" size="1" class="hrcolor clear" />
Chris@76 632 <dl class="settings">
Chris@76 633 <dt>
Chris@76 634 <strong><label for="censorWholeWord_check">', $txt['censor_whole_words'], ':</label></strong>
Chris@76 635 </dt>
Chris@76 636 <dd>
Chris@76 637 <input type="checkbox" name="censorWholeWord" value="1" id="censorWholeWord_check"', empty($modSettings['censorWholeWord']) ? '' : ' checked="checked"', ' class="input_check" />
Chris@76 638 </dd>
Chris@76 639 <dt>
Chris@76 640 <strong><label for="censorIgnoreCase_check">', $txt['censor_case'], ':</label></strong>
Chris@76 641 </dt>
Chris@76 642 <dd>
Chris@76 643 <input type="checkbox" name="censorIgnoreCase" value="1" id="censorIgnoreCase_check"', empty($modSettings['censorIgnoreCase']) ? '' : ' checked="checked"', ' class="input_check" />
Chris@76 644 </dd>
Chris@76 645 </dl>
Chris@76 646 <input type="submit" name="save_censor" value="', $txt['save'], '" class="button_submit" />
Chris@76 647 </div>
Chris@76 648 <span class="botslice"><span></span></span>
Chris@76 649 </div>';
Chris@76 650
Chris@76 651 // This table lets you test out your filters by typing in rude words and seeing what comes out.
Chris@76 652 echo '
Chris@76 653 <div class="cat_bar">
Chris@76 654 <h3 class="catbg">
Chris@76 655 ', $txt['censor_test'], '
Chris@76 656 </h3>
Chris@76 657 </div>
Chris@76 658 <div class="windowbg">
Chris@76 659 <span class="topslice"><span></span></span>
Chris@76 660 <div class="content">
Chris@76 661 <p class="centertext">
Chris@76 662 <input type="text" name="censortest" value="', empty($context['censor_test']) ? '' : $context['censor_test'], '" class="input_text" />
Chris@76 663 <input type="submit" value="', $txt['censor_test_save'], '" class="button_submit" />
Chris@76 664 </p>
Chris@76 665 </div>
Chris@76 666 <span class="botslice"><span></span></span>
Chris@76 667 </div>
Chris@76 668
Chris@76 669 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
Chris@76 670 </form>
Chris@76 671 </div>
Chris@76 672 <br class="clear" />';
Chris@76 673 }
Chris@76 674
Chris@76 675 // Maintenance is a lovely thing, isn't it?
Chris@76 676 function template_not_done()
Chris@76 677 {
Chris@76 678 global $context, $settings, $options, $txt, $scripturl;
Chris@76 679
Chris@76 680 echo '
Chris@76 681 <div id="admincenter">
Chris@76 682 <div class="cat_bar">
Chris@76 683 <h3 class="catbg">
Chris@76 684 ', $txt['not_done_title'], '
Chris@76 685 </h3>
Chris@76 686 </div>
Chris@76 687 <div class="windowbg">
Chris@76 688 <span class="topslice"><span></span></span>
Chris@76 689 <div class="content">
Chris@76 690 ', $txt['not_done_reason'];
Chris@76 691
Chris@76 692 if (!empty($context['continue_percent']))
Chris@76 693 echo '
Chris@76 694 <div style="padding-left: 20%; padding-right: 20%; margin-top: 1ex;">
Chris@76 695 <div style="font-size: 8pt; height: 12pt; border: 1px solid black; background-color: white; padding: 1px; position: relative;">
Chris@76 696 <div style="padding-top: ', $context['browser']['is_webkit'] || $context['browser']['is_konqueror'] ? '2pt' : '1pt', '; width: 100%; z-index: 2; color: black; position: absolute; text-align: center; font-weight: bold;">', $context['continue_percent'], '%</div>
Chris@76 697 <div style="width: ', $context['continue_percent'], '%; height: 12pt; z-index: 1; background-color: red;">&nbsp;</div>
Chris@76 698 </div>
Chris@76 699 </div>';
Chris@76 700
Chris@76 701 if (!empty($context['substep_enabled']))
Chris@76 702 echo '
Chris@76 703 <div style="padding-left: 20%; padding-right: 20%; margin-top: 1ex;">
Chris@76 704 <span class="smalltext">', $context['substep_title'], '</span>
Chris@76 705 <div style="font-size: 8pt; height: 12pt; border: 1px solid black; background-color: white; padding: 1px; position: relative;">
Chris@76 706 <div style="padding-top: ', $context['browser']['is_webkit'] || $context['browser']['is_konqueror'] ? '2pt' : '1pt', '; width: 100%; z-index: 2; color: black; position: absolute; text-align: center; font-weight: bold;">', $context['substep_continue_percent'], '%</div>
Chris@76 707 <div style="width: ', $context['substep_continue_percent'], '%; height: 12pt; z-index: 1; background-color: blue;">&nbsp;</div>
Chris@76 708 </div>
Chris@76 709 </div>';
Chris@76 710
Chris@76 711 echo '
Chris@76 712 <form action="', $scripturl, $context['continue_get_data'], '" method="post" accept-charset="', $context['character_set'], '" style="margin: 0;" name="autoSubmit" id="autoSubmit">
Chris@76 713 <div style="margin: 1ex; text-align: right;"><input type="submit" name="cont" value="', $txt['not_done_continue'], '" class="button_submit" /></div>
Chris@76 714 ', $context['continue_post_data'], '
Chris@76 715 </form>
Chris@76 716 </div>
Chris@76 717 <span class="botslice"><span></span></span>
Chris@76 718 </div>
Chris@76 719 </div>
Chris@76 720 <br class="clear" />
Chris@76 721 <script type="text/javascript"><!-- // --><![CDATA[
Chris@76 722 var countdown = ', $context['continue_countdown'], ';
Chris@76 723 doAutoSubmit();
Chris@76 724
Chris@76 725 function doAutoSubmit()
Chris@76 726 {
Chris@76 727 if (countdown == 0)
Chris@76 728 document.forms.autoSubmit.submit();
Chris@76 729 else if (countdown == -1)
Chris@76 730 return;
Chris@76 731
Chris@76 732 document.forms.autoSubmit.cont.value = "', $txt['not_done_continue'], ' (" + countdown + ")";
Chris@76 733 countdown--;
Chris@76 734
Chris@76 735 setTimeout("doAutoSubmit();", 1000);
Chris@76 736 }
Chris@76 737 // ]]></script>';
Chris@76 738 }
Chris@76 739
Chris@76 740 // Template for showing settings (Of any kind really!)
Chris@76 741 function template_show_settings()
Chris@76 742 {
Chris@76 743 global $context, $txt, $settings, $scripturl;
Chris@76 744
Chris@76 745 echo '
Chris@76 746 <script type="text/javascript"><!-- // --><![CDATA[';
Chris@76 747
Chris@76 748 if (!empty($context['settings_pre_javascript']))
Chris@76 749 echo $context['settings_pre_javascript'];
Chris@76 750
Chris@76 751 // If we have BBC selection we have a bit of JS.
Chris@76 752 if (!empty($context['bbc_sections']))
Chris@76 753 {
Chris@76 754 echo '
Chris@76 755 function toggleBBCDisabled(section, disable)
Chris@76 756 {
Chris@76 757 for (var i = 0; i < document.forms.bbcForm.length; i++)
Chris@76 758 {
Chris@76 759 if (typeof(document.forms.bbcForm[i].name) == "undefined" || (document.forms.bbcForm[i].name.substr(0, 11) != "enabledTags") || (document.forms.bbcForm[i].name.indexOf(section) != 11))
Chris@76 760 continue;
Chris@76 761
Chris@76 762 document.forms.bbcForm[i].disabled = disable;
Chris@76 763 }
Chris@76 764 document.getElementById("bbc_" + section + "_select_all").disabled = disable;
Chris@76 765 }';
Chris@76 766 }
Chris@76 767 echo '
Chris@76 768 // ]]></script>';
Chris@76 769
Chris@76 770 if (!empty($context['settings_insert_above']))
Chris@76 771 echo $context['settings_insert_above'];
Chris@76 772
Chris@76 773 echo '
Chris@76 774 <div id="admincenter">
Chris@76 775 <form action="', $context['post_url'], '" method="post" accept-charset="', $context['character_set'], '"', !empty($context['force_form_onsubmit']) ? ' onsubmit="' . $context['force_form_onsubmit'] . '"' : '', '>';
Chris@76 776
Chris@76 777 // Is there a custom title?
Chris@76 778 if (isset($context['settings_title']))
Chris@76 779 echo '
Chris@76 780 <div class="cat_bar">
Chris@76 781 <h3 class="catbg">
Chris@76 782 ', $context['settings_title'], '
Chris@76 783 </h3>
Chris@76 784 </div>';
Chris@76 785
Chris@76 786 // Have we got some custom code to insert?
Chris@76 787 if (!empty($context['settings_message']))
Chris@76 788 echo '
Chris@76 789 <div class="information">', $context['settings_message'], '</div>';
Chris@76 790
Chris@76 791 // Now actually loop through all the variables.
Chris@76 792 $is_open = false;
Chris@76 793 foreach ($context['config_vars'] as $config_var)
Chris@76 794 {
Chris@76 795 // Is it a title or a description?
Chris@76 796 if (is_array($config_var) && ($config_var['type'] == 'title' || $config_var['type'] == 'desc'))
Chris@76 797 {
Chris@76 798 // Not a list yet?
Chris@76 799 if ($is_open)
Chris@76 800 {
Chris@76 801 $is_open = false;
Chris@76 802 echo '
Chris@76 803 </dl>
Chris@76 804 </div>
Chris@76 805 <span class="botslice"><span></span></span>
Chris@76 806 </div>';
Chris@76 807 }
Chris@76 808
Chris@76 809 // A title?
Chris@76 810 if ($config_var['type'] == 'title')
Chris@76 811 {
Chris@76 812 echo '
Chris@76 813 <div class="cat_bar">
Chris@76 814 <h3 class="', !empty($config_var['class']) ? $config_var['class'] : 'catbg', '"', !empty($config_var['force_div_id']) ? ' id="' . $config_var['force_div_id'] . '"' : '', '>
Chris@76 815 ', ($config_var['help'] ? '<a href="' . $scripturl . '?action=helpadmin;help=' . $config_var['help'] . '" onclick="return reqWin(this.href);" class="help"><img src="' . $settings['images_url'] . '/helptopics.gif" class="icon" alt="' . $txt['help'] . '" /></a>' : ''), '
Chris@76 816 ', $config_var['label'], '
Chris@76 817 </h3>
Chris@76 818 </div>';
Chris@76 819 }
Chris@76 820 // A description?
Chris@76 821 else
Chris@76 822 {
Chris@76 823 echo '
Chris@76 824 <p class="description">
Chris@76 825 ', $config_var['label'], '
Chris@76 826 </p>';
Chris@76 827 }
Chris@76 828
Chris@76 829 continue;
Chris@76 830 }
Chris@76 831
Chris@76 832 // Not a list yet?
Chris@76 833 if (!$is_open)
Chris@76 834 {
Chris@76 835 $is_open = true;
Chris@76 836 echo '
Chris@76 837 <div class="windowbg2">
Chris@76 838 <span class="topslice"><span></span></span>
Chris@76 839 <div class="content">
Chris@76 840 <dl class="settings">';
Chris@76 841 }
Chris@76 842
Chris@76 843 // Hang about? Are you pulling my leg - a callback?!
Chris@76 844 if (is_array($config_var) && $config_var['type'] == 'callback')
Chris@76 845 {
Chris@76 846 if (function_exists('template_callback_' . $config_var['name']))
Chris@76 847 call_user_func('template_callback_' . $config_var['name']);
Chris@76 848
Chris@76 849 continue;
Chris@76 850 }
Chris@76 851
Chris@76 852 if (is_array($config_var))
Chris@76 853 {
Chris@76 854 // First off, is this a span like a message?
Chris@76 855 if (in_array($config_var['type'], array('message', 'warning')))
Chris@76 856 {
Chris@76 857 echo '
Chris@76 858 <dd', $config_var['type'] == 'warning' ? ' class="alert"' : '', (!empty($config_var['force_div_id']) ? ' id="' . $config_var['force_div_id'] . '_dd"' : ''), '>
Chris@76 859 ', $config_var['label'], '
Chris@76 860 </dd>';
Chris@76 861 }
Chris@76 862 // Otherwise it's an input box of some kind.
Chris@76 863 else
Chris@76 864 {
Chris@76 865 echo '
Chris@76 866 <dt', is_array($config_var) && !empty($config_var['force_div_id']) ? ' id="' . $config_var['force_div_id'] . '"' : '', '>';
Chris@76 867
Chris@76 868 // Some quick helpers...
Chris@76 869 $javascript = $config_var['javascript'];
Chris@76 870 $disabled = !empty($config_var['disabled']) ? ' disabled="disabled"' : '';
Chris@76 871 $subtext = !empty($config_var['subtext']) ? '<br /><span class="smalltext"> ' . $config_var['subtext'] . '</span>' : '';
Chris@76 872
Chris@76 873 // Show the [?] button.
Chris@76 874 if ($config_var['help'])
Chris@76 875 echo '
Chris@76 876 <a id="setting_', $config_var['name'], '" href="', $scripturl, '?action=helpadmin;help=', $config_var['help'], '" onclick="return reqWin(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics.gif" class="icon" alt="', $txt['help'], '" /></a><span', ($config_var['disabled'] ? ' style="color: #777777;"' : ($config_var['invalid'] ? ' class="error"' : '')), '><label for="', $config_var['name'], '">', $config_var['label'], '</label>', $subtext, ($config_var['type'] == 'password' ? '<br /><em>' . $txt['admin_confirm_password'] . '</em>' : ''), '</span>
Chris@76 877 </dt>';
Chris@76 878 else
Chris@76 879 echo '
Chris@76 880 <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>
Chris@76 881 </dt>';
Chris@76 882
Chris@76 883 echo '
Chris@76 884 <dd', (!empty($config_var['force_div_id']) ? ' id="' . $config_var['force_div_id'] . '_dd"' : ''), '>',
Chris@76 885 $config_var['preinput'];
Chris@76 886
Chris@76 887 // Show a check box.
Chris@76 888 if ($config_var['type'] == 'check')
Chris@76 889 echo '
Chris@76 890 <input type="checkbox"', $javascript, $disabled, ' name="', $config_var['name'], '" id="', $config_var['name'], '"', ($config_var['value'] ? ' checked="checked"' : ''), ' value="1" class="input_check" />';
Chris@76 891 // Escape (via htmlspecialchars.) the text box.
Chris@76 892 elseif ($config_var['type'] == 'password')
Chris@76 893 echo '
Chris@76 894 <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 />
Chris@76 895 <input type="password" disabled="disabled" id="', $config_var['name'], '" name="', $config_var['name'], '[1]"', ($config_var['size'] ? ' size="' . $config_var['size'] . '"' : ''), ' class="input_password" />';
Chris@76 896 // Show a selection box.
Chris@76 897 elseif ($config_var['type'] == 'select')
Chris@76 898 {
Chris@76 899 echo '
Chris@76 900 <select name="', $config_var['name'], '" id="', $config_var['name'], '" ', $javascript, $disabled, (!empty($config_var['multiple']) ? ' multiple="multiple"' : ''), '>';
Chris@76 901 foreach ($config_var['data'] as $option)
Chris@76 902 echo '
Chris@76 903 <option value="', $option[0], '"', (($option[0] == $config_var['value'] || (!empty($config_var['multiple']) && in_array($option[0], $config_var['value']))) ? ' selected="selected"' : ''), '>', $option[1], '</option>';
Chris@76 904 echo '
Chris@76 905 </select>';
Chris@76 906 }
Chris@76 907 // Text area?
Chris@76 908 elseif ($config_var['type'] == 'large_text')
Chris@76 909 echo '
Chris@76 910 <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>';
Chris@76 911 // Permission group?
Chris@76 912 elseif ($config_var['type'] == 'permissions')
Chris@76 913 theme_inline_permissions($config_var['name']);
Chris@76 914 // BBC selection?
Chris@76 915 elseif ($config_var['type'] == 'bbc')
Chris@76 916 {
Chris@76 917 echo '
Chris@76 918 <fieldset id="', $config_var['name'], '">
Chris@76 919 <legend>', $txt['bbcTagsToUse_select'], '</legend>
Chris@76 920 <ul class="reset">';
Chris@76 921
Chris@76 922 foreach ($context['bbc_columns'] as $bbcColumn)
Chris@76 923 {
Chris@76 924 foreach ($bbcColumn as $bbcTag)
Chris@76 925 echo '
Chris@76 926 <li class="list_bbc floatleft">
Chris@76 927 <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>)' : '', '
Chris@76 928 </li>';
Chris@76 929 }
Chris@76 930 echo ' </ul>
Chris@76 931 <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>
Chris@76 932 </fieldset>';
Chris@76 933 }
Chris@76 934 // A simple message?
Chris@76 935 elseif ($config_var['type'] == 'var_message')
Chris@76 936 echo '
Chris@76 937 <div', !empty($config_var['name']) ? ' id="' . $config_var['name'] . '"' : '', '>', $config_var['var_message'], '</div>';
Chris@76 938 // Assume it must be a text box.
Chris@76 939 else
Chris@76 940 echo '
Chris@76 941 <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" />';
Chris@76 942
Chris@76 943 echo isset($config_var['postinput']) ? '
Chris@76 944 ' . $config_var['postinput'] : '',
Chris@76 945 '</dd>';
Chris@76 946 }
Chris@76 947 }
Chris@76 948
Chris@76 949 else
Chris@76 950 {
Chris@76 951 // Just show a separator.
Chris@76 952 if ($config_var == '')
Chris@76 953 echo '
Chris@76 954 </dl>
Chris@76 955 <hr class="hrcolor clear" />
Chris@76 956 <dl class="settings">';
Chris@76 957 else
Chris@76 958 echo '
Chris@76 959 <dd>
Chris@76 960 <strong>' . $config_var . '</strong>
Chris@76 961 </dd>';
Chris@76 962 }
Chris@76 963 }
Chris@76 964
Chris@76 965 if ($is_open)
Chris@76 966 echo '
Chris@76 967 </dl>';
Chris@76 968
Chris@76 969 if (empty($context['settings_save_dont_show']))
Chris@76 970 echo '
Chris@76 971 <hr class="hrcolor clear" />
Chris@76 972 <div class="righttext">
Chris@76 973 <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" />
Chris@76 974 </div>';
Chris@76 975
Chris@76 976 if ($is_open)
Chris@76 977 echo '
Chris@76 978 </div>
Chris@76 979 <span class="botslice"><span></span></span>
Chris@76 980 </div>';
Chris@76 981
Chris@76 982 echo '
Chris@76 983 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
Chris@76 984 </form>
Chris@76 985 </div>
Chris@76 986 <br class="clear" />';
Chris@76 987
Chris@76 988 if (!empty($context['settings_post_javascript']))
Chris@76 989 echo '
Chris@76 990 <script type="text/javascript"><!-- // --><![CDATA[
Chris@76 991 ', $context['settings_post_javascript'], '
Chris@76 992 // ]]></script>';
Chris@76 993
Chris@76 994 if (!empty($context['settings_insert_below']))
Chris@76 995 echo $context['settings_insert_below'];
Chris@76 996 }
Chris@76 997
Chris@76 998 // Template for showing custom profile fields.
Chris@76 999 function template_show_custom_profile()
Chris@76 1000 {
Chris@76 1001 global $context, $txt, $settings, $scripturl;
Chris@76 1002
Chris@76 1003 // Standard fields.
Chris@76 1004 template_show_list('standard_profile_fields');
Chris@76 1005
Chris@76 1006 echo '
Chris@76 1007 <script type="text/javascript"><!-- // --><![CDATA[
Chris@76 1008 var iNumChecks = document.forms.standardProfileFields.length;
Chris@76 1009 for (var i = 0; i < iNumChecks; i++)
Chris@76 1010 if (document.forms.standardProfileFields[i].id.indexOf(\'reg_\') == 0)
Chris@76 1011 document.forms.standardProfileFields[i].disabled = document.forms.standardProfileFields[i].disabled || !document.getElementById(\'active_\' + document.forms.standardProfileFields[i].id.substr(4)).checked;
Chris@76 1012 // ]]></script><br />';
Chris@76 1013
Chris@76 1014 // Custom fields.
Chris@76 1015 template_show_list('custom_profile_fields');
Chris@76 1016 }
Chris@76 1017
Chris@76 1018 // Edit a profile field?
Chris@76 1019 function template_edit_profile_field()
Chris@76 1020 {
Chris@76 1021 global $context, $txt, $settings, $scripturl;
Chris@76 1022
Chris@76 1023 // All the javascript for this page - quite a bit!
Chris@76 1024 echo '
Chris@76 1025 <script type="text/javascript"><!-- // --><![CDATA[
Chris@76 1026 function updateInputBoxes()
Chris@76 1027 {
Chris@76 1028 curType = document.getElementById("field_type").value;
Chris@76 1029 privStatus = document.getElementById("private").value;
Chris@76 1030 document.getElementById("max_length_dt").style.display = curType == "text" || curType == "textarea" ? "" : "none";
Chris@76 1031 document.getElementById("max_length_dd").style.display = curType == "text" || curType == "textarea" ? "" : "none";
Chris@76 1032 document.getElementById("dimension_dt").style.display = curType == "textarea" ? "" : "none";
Chris@76 1033 document.getElementById("dimension_dd").style.display = curType == "textarea" ? "" : "none";
Chris@76 1034 document.getElementById("bbc_dt").style.display = curType == "text" || curType == "textarea" ? "" : "none";
Chris@76 1035 document.getElementById("bbc_dd").style.display = curType == "text" || curType == "textarea" ? "" : "none";
Chris@76 1036 document.getElementById("options_dt").style.display = curType == "select" || curType == "radio" ? "" : "none";
Chris@76 1037 document.getElementById("options_dd").style.display = curType == "select" || curType == "radio" ? "" : "none";
Chris@76 1038 document.getElementById("default_dt").style.display = curType == "check" ? "" : "none";
Chris@76 1039 document.getElementById("default_dd").style.display = curType == "check" ? "" : "none";
Chris@76 1040 document.getElementById("mask_dt").style.display = curType == "text" ? "" : "none";
Chris@76 1041 document.getElementById("mask").style.display = curType == "text" ? "" : "none";
Chris@76 1042 document.getElementById("can_search_dt").style.display = curType == "text" || curType == "textarea" ? "" : "none";
Chris@76 1043 document.getElementById("can_search_dd").style.display = curType == "text" || curType == "textarea" ? "" : "none";
Chris@76 1044 document.getElementById("regex_div").style.display = curType == "text" && document.getElementById("mask").value == "regex" ? "" : "none";
Chris@76 1045 document.getElementById("display").disabled = false;
Chris@76 1046 // Cannot show this on the topic
Chris@76 1047 if (curType == "textarea" || privStatus >= 2)
Chris@76 1048 {
Chris@76 1049 document.getElementById("display").checked = false;
Chris@76 1050 document.getElementById("display").disabled = true;
Chris@76 1051 }
Chris@76 1052 }
Chris@76 1053
Chris@76 1054 var startOptID = ', count($context['field']['options']), ';
Chris@76 1055 function addOption()
Chris@76 1056 {
Chris@76 1057 setOuterHTML(document.getElementById("addopt"), \'<br /><input type="radio" name="default_select" value="\' + startOptID + \'" id="\' + startOptID + \'" class="input_radio" /><input type="text" name="select_option[\' + startOptID + \']" value="" class="input_text" /><span id="addopt"></span>\');
Chris@76 1058 startOptID++;
Chris@76 1059 }
Chris@76 1060 // ]]></script>';
Chris@76 1061
Chris@76 1062 echo '
Chris@76 1063 <div id="admincenter">
Chris@76 1064 <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'], '">
Chris@76 1065 <div class="cat_bar">
Chris@76 1066 <h3 class="catbg">
Chris@76 1067 ', $context['page_title'], '
Chris@76 1068 </h3>
Chris@76 1069 </div>
Chris@76 1070 <div class="windowbg">
Chris@76 1071 <span class="topslice"><span></span></span>
Chris@76 1072 <div class="content">
Chris@76 1073 <fieldset>
Chris@76 1074 <legend>', $txt['custom_edit_general'], '</legend>
Chris@76 1075
Chris@76 1076 <dl class="settings">
Chris@76 1077 <dt>
Chris@76 1078 <strong>', $txt['custom_edit_name'], ':</strong>
Chris@76 1079 </dt>
Chris@76 1080 <dd>
Chris@76 1081 <input type="text" name="field_name" value="', $context['field']['name'], '" size="20" maxlength="40" class="input_text" />
Chris@76 1082 </dd>
Chris@76 1083 <dt>
Chris@76 1084 <strong>', $txt['custom_edit_desc'], ':</strong>
Chris@76 1085 </dt>
Chris@76 1086 <dd>
Chris@76 1087 <textarea name="field_desc" rows="3" cols="40">', $context['field']['desc'], '</textarea>
Chris@76 1088 </dd>
Chris@76 1089 <dt>
Chris@76 1090 <strong>', $txt['custom_edit_profile'], ':</strong><br />
Chris@76 1091 <span class="smalltext">', $txt['custom_edit_profile_desc'], '</span>
Chris@76 1092 </dt>
Chris@76 1093 <dd>
Chris@76 1094 <select name="profile_area">
Chris@76 1095 <option value="none"', $context['field']['profile_area'] == 'none' ? ' selected="selected"' : '', '>', $txt['custom_edit_profile_none'], '</option>
Chris@76 1096 <option value="account"', $context['field']['profile_area'] == 'account' ? ' selected="selected"' : '', '>', $txt['account'], '</option>
Chris@76 1097 <option value="forumprofile"', $context['field']['profile_area'] == 'forumprofile' ? ' selected="selected"' : '', '>', $txt['forumprofile'], '</option>
Chris@76 1098 <option value="theme"', $context['field']['profile_area'] == 'theme' ? ' selected="selected"' : '', '>', $txt['theme'], '</option>
Chris@76 1099 </select>
Chris@76 1100 </dd>
Chris@76 1101 <dt>
Chris@76 1102 <strong>', $txt['custom_edit_registration'], ':</strong>
Chris@76 1103 </dt>
Chris@76 1104 <dd>
Chris@76 1105 <select name="reg" id="reg">
Chris@76 1106 <option value="0"', $context['field']['reg'] == 0 ? ' selected="selected"' : '', '>', $txt['custom_edit_registration_disable'], '</option>
Chris@76 1107 <option value="1"', $context['field']['reg'] == 1 ? ' selected="selected"' : '', '>', $txt['custom_edit_registration_allow'], '</option>
Chris@76 1108 <option value="2"', $context['field']['reg'] == 2 ? ' selected="selected"' : '', '>', $txt['custom_edit_registration_require'], '</option>
Chris@76 1109 </select>
Chris@76 1110 </dd>
Chris@76 1111 <dt>
Chris@76 1112 <strong>', $txt['custom_edit_display'], ':</strong>
Chris@76 1113 </dt>
Chris@76 1114 <dd>
Chris@76 1115 <input type="checkbox" name="display" id="display"', $context['field']['display'] ? ' checked="checked"' : '', ' class="input_check" />
Chris@76 1116 </dd>
Chris@76 1117
Chris@76 1118 <dt>
Chris@76 1119 <strong>', $txt['custom_edit_placement'], ':</strong>
Chris@76 1120 </dt>
Chris@76 1121 <dd>
Chris@76 1122 <select name="placement" id="placement">
Chris@76 1123 <option value="0"', $context['field']['placement'] == '0' ? ' selected="selected"' : '', '>', $txt['custom_edit_placement_standard'], '</option>
Chris@76 1124 <option value="1"', $context['field']['placement'] == '1' ? ' selected="selected"' : '', '>', $txt['custom_edit_placement_withicons'], '</option>
Chris@76 1125 <option value="2"', $context['field']['placement'] == '2' ? ' selected="selected"' : '', '>', $txt['custom_edit_placement_abovesignature'], '</option>
Chris@76 1126 </select>
Chris@76 1127 </dd>
Chris@76 1128 <dt>
Chris@76 1129 <a id="field_show_enclosed" href="', $scripturl, '?action=helpadmin;help=field_show_enclosed" onclick="return reqWin(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics.gif" class="icon" alt="', $txt['help'], '" align="top" /></a>
Chris@76 1130 <strong>', $txt['custom_edit_enclose'], ':</strong><br />
Chris@76 1131 <span class="smalltext">', $txt['custom_edit_enclose_desc'], '</span>
Chris@76 1132 </dt>
Chris@76 1133 <dd>
Chris@76 1134 <textarea name="enclose" rows="10" cols="50">', @$context['field']['enclose'], '</textarea>
Chris@76 1135 </dd>
Chris@76 1136 </dl>
Chris@76 1137 </fieldset>
Chris@76 1138 <fieldset>
Chris@76 1139 <legend>', $txt['custom_edit_input'], '</legend>
Chris@76 1140 <dl class="settings">
Chris@76 1141 <dt>
Chris@76 1142 <strong>', $txt['custom_edit_picktype'], ':</strong>
Chris@76 1143 </dt>
Chris@76 1144 <dd>
Chris@76 1145 <select name="field_type" id="field_type" onchange="updateInputBoxes();">
Chris@76 1146 <option value="text"', $context['field']['type'] == 'text' ? ' selected="selected"' : '', '>', $txt['custom_profile_type_text'], '</option>
Chris@76 1147 <option value="textarea"', $context['field']['type'] == 'textarea' ? ' selected="selected"' : '', '>', $txt['custom_profile_type_textarea'], '</option>
Chris@76 1148 <option value="select"', $context['field']['type'] == 'select' ? ' selected="selected"' : '', '>', $txt['custom_profile_type_select'], '</option>
Chris@76 1149 <option value="radio"', $context['field']['type'] == 'radio' ? ' selected="selected"' : '', '>', $txt['custom_profile_type_radio'], '</option>
Chris@76 1150 <option value="check"', $context['field']['type'] == 'check' ? ' selected="selected"' : '', '>', $txt['custom_profile_type_check'], '</option>
Chris@76 1151 </select>
Chris@76 1152 </dd>
Chris@76 1153 <dt id="max_length_dt">
Chris@76 1154 <strong>', $txt['custom_edit_max_length'], ':</strong><br />
Chris@76 1155 <span class="smalltext">', $txt['custom_edit_max_length_desc'], '</span>
Chris@76 1156 </dt>
Chris@76 1157 <dd id="max_length_dd">
Chris@76 1158 <input type="text" name="max_length" value="', $context['field']['max_length'], '" size="7" maxlength="6" class="input_text" />
Chris@76 1159 </dd>
Chris@76 1160 <dt id="dimension_dt">
Chris@76 1161 <strong>', $txt['custom_edit_dimension'], ':</strong>
Chris@76 1162 </dt>
Chris@76 1163 <dd id="dimension_dd">
Chris@76 1164 <strong>', $txt['custom_edit_dimension_row'], ':</strong> <input type="text" name="rows" value="', $context['field']['rows'], '" size="5" maxlength="3" class="input_text" />
Chris@76 1165 <strong>', $txt['custom_edit_dimension_col'], ':</strong> <input type="text" name="cols" value="', $context['field']['cols'], '" size="5" maxlength="3" class="input_text" />
Chris@76 1166 </dd>
Chris@76 1167 <dt id="bbc_dt">
Chris@76 1168 <strong>', $txt['custom_edit_bbc'], '</strong>
Chris@76 1169 </dt>
Chris@76 1170 <dd id="bbc_dd">
Chris@76 1171 <input type="checkbox" name="bbc"', $context['field']['bbc'] ? ' checked="checked"' : '', ' class="input_check" />
Chris@76 1172 </dd>
Chris@76 1173 <dt id="options_dt">
Chris@76 1174 <a href="', $scripturl, '?action=helpadmin;help=customoptions" onclick="return reqWin(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics.gif" class="icon" alt="', $txt['help'], '" /></a>
Chris@76 1175 <strong>', $txt['custom_edit_options'], ':</strong><br />
Chris@76 1176 <span class="smalltext">', $txt['custom_edit_options_desc'], '</span>
Chris@76 1177 </dt>
Chris@76 1178 <dd id="options_dd">
Chris@76 1179 <div>';
Chris@76 1180
Chris@76 1181 foreach ($context['field']['options'] as $k => $option)
Chris@76 1182 {
Chris@76 1183 echo '
Chris@76 1184 ', $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" />';
Chris@76 1185 }
Chris@76 1186 echo '
Chris@76 1187 <span id="addopt"></span>
Chris@76 1188 [<a href="" onclick="addOption(); return false;">', $txt['custom_edit_options_more'], '</a>]
Chris@76 1189 </div>
Chris@76 1190 </dd>
Chris@76 1191 <dt id="default_dt">
Chris@76 1192 <strong>', $txt['custom_edit_default'], ':</strong>
Chris@76 1193 </dt>
Chris@76 1194 <dd id="default_dd">
Chris@76 1195 <input type="checkbox" name="default_check"', $context['field']['default_check'] ? ' checked="checked"' : '', ' class="input_check" />
Chris@76 1196 </dd>
Chris@76 1197 </dl>
Chris@76 1198 </fieldset>
Chris@76 1199 <fieldset>
Chris@76 1200 <legend>', $txt['custom_edit_advanced'], '</legend>
Chris@76 1201 <dl class="settings">
Chris@76 1202 <dt id="mask_dt">
Chris@76 1203 <a id="custom_mask" href="', $scripturl, '?action=helpadmin;help=custom_mask" onclick="return reqWin(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics.gif" class="icon" alt="', $txt['help'], '" align="top" /></a>
Chris@76 1204 <strong>', $txt['custom_edit_mask'], ':</strong><br />
Chris@76 1205 <span class="smalltext">', $txt['custom_edit_mask_desc'], '</span>
Chris@76 1206 </dt>
Chris@76 1207 <dd>
Chris@76 1208 <select name="mask" id="mask" onchange="updateInputBoxes();">
Chris@76 1209 <option value="nohtml"', $context['field']['mask'] == 'nohtml' ? ' selected="selected"' : '', '>', $txt['custom_edit_mask_nohtml'], '</option>
Chris@76 1210 <option value="email"', $context['field']['mask'] == 'email' ? ' selected="selected"' : '', '>', $txt['custom_edit_mask_email'], '</option>
Chris@76 1211 <option value="number"', $context['field']['mask'] == 'number' ? ' selected="selected"' : '', '>', $txt['custom_edit_mask_number'], '</option>
Chris@76 1212 <option value="regex"', substr($context['field']['mask'], 0, 5) == 'regex' ? ' selected="selected"' : '', '>', $txt['custom_edit_mask_regex'], '</option>
Chris@76 1213 </select>
Chris@76 1214 <br />
Chris@76 1215 <span id="regex_div">
Chris@76 1216 <input type="text" name="regex" value="', $context['field']['regex'], '" size="30" class="input_text" />
Chris@76 1217 </span>
Chris@76 1218 </dd>
Chris@76 1219 <dt>
Chris@76 1220 <strong>', $txt['custom_edit_privacy'], ':</strong>
Chris@76 1221 <span class="smalltext">', $txt['custom_edit_privacy_desc'], '</span>
Chris@76 1222 </dt>
Chris@76 1223 <dd>
Chris@76 1224 <select name="private" id="private" onchange="updateInputBoxes();" style="width: 100%">
Chris@76 1225 <option value="0"', $context['field']['private'] == 0 ? ' selected="selected"' : '', '>', $txt['custom_edit_privacy_all'], '</option>
Chris@76 1226 <option value="1"', $context['field']['private'] == 1 ? ' selected="selected"' : '', '>', $txt['custom_edit_privacy_see'], '</option>
Chris@76 1227 <option value="2"', $context['field']['private'] == 2 ? ' selected="selected"' : '', '>', $txt['custom_edit_privacy_owner'], '</option>
Chris@76 1228 <option value="3"', $context['field']['private'] == 3 ? ' selected="selected"' : '', '>', $txt['custom_edit_privacy_none'], '</option>
Chris@76 1229 </select>
Chris@76 1230 </dd>
Chris@76 1231 <dt id="can_search_dt">
Chris@76 1232 <strong>', $txt['custom_edit_can_search'], ':</strong><br />
Chris@76 1233 <span class="smalltext">', $txt['custom_edit_can_search_desc'], '</span>
Chris@76 1234 </dt>
Chris@76 1235 <dd id="can_search_dd">
Chris@76 1236 <input type="checkbox" name="can_search"', $context['field']['can_search'] ? ' checked="checked"' : '', ' class="input_check" />
Chris@76 1237 </dd>
Chris@76 1238 <dt>
Chris@76 1239 <strong>', $txt['custom_edit_active'], ':</strong><br />
Chris@76 1240 <span class="smalltext">', $txt['custom_edit_active_desc'], '</span>
Chris@76 1241 </dt>
Chris@76 1242 <dd>
Chris@76 1243 <input type="checkbox" name="active"', $context['field']['active'] ? ' checked="checked"' : '', ' class="input_check" />
Chris@76 1244 </dd>
Chris@76 1245 </dl>
Chris@76 1246 </fieldset>
Chris@76 1247 <div class="righttext">
Chris@76 1248 <input type="submit" name="save" value="', $txt['save'], '" class="button_submit" />';
Chris@76 1249
Chris@76 1250 if ($context['fid'])
Chris@76 1251 echo '
Chris@76 1252 <input type="submit" name="delete" value="', $txt['delete'], '" onclick="return confirm(\'', $txt['custom_edit_delete_sure'], '\');" class="button_submit" />';
Chris@76 1253
Chris@76 1254 echo '
Chris@76 1255 </div>
Chris@76 1256 </div>
Chris@76 1257 <span class="botslice"><span></span></span>
Chris@76 1258 </div>
Chris@76 1259 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
Chris@76 1260 </form>
Chris@76 1261 </div>
Chris@76 1262 <br class="clear" />';
Chris@76 1263
Chris@76 1264 // Get the javascript bits right!
Chris@76 1265 echo '
Chris@76 1266 <script type="text/javascript"><!-- // --><![CDATA[
Chris@76 1267 updateInputBoxes();
Chris@76 1268 // ]]></script>';
Chris@76 1269 }
Chris@76 1270
Chris@76 1271 // Results page for an admin search.
Chris@76 1272 function template_admin_search_results()
Chris@76 1273 {
Chris@76 1274 global $context, $txt, $settings, $options, $scripturl;
Chris@76 1275
Chris@76 1276 echo '
Chris@76 1277 <div class="cat_bar">
Chris@76 1278 <h3 class="catbg">
Chris@76 1279 <object id="quick_search">
Chris@76 1280 <form action="', $scripturl, '?action=admin;area=search" method="post" accept-charset="', $context['character_set'], '" class="floatright">
Chris@76 1281 <input type="text" name="search_term" value="', $context['search_term'], '" class="input_text" />
Chris@76 1282 <input type="hidden" name="search_type" value="', $context['search_type'], '" />
Chris@76 1283 <input type="submit" name="search_go" value="', $txt['admin_search_results_again'], '" class="button_submit" />
Chris@76 1284 </form>
Chris@76 1285 </object>
Chris@76 1286 <span class="ie6_header floatleft"><img src="' . $settings['images_url'] . '/buttons/search.gif" alt="" />&nbsp;', sprintf($txt['admin_search_results_desc'], $context['search_term']), '</span>
Chris@76 1287 </h3>
Chris@76 1288 </div>
Chris@76 1289 <div class="windowbg nopadding">
Chris@76 1290 <span class="topslice"><span></span></span>
Chris@76 1291 <div class="content">';
Chris@76 1292
Chris@76 1293 if (empty($context['search_results']))
Chris@76 1294 {
Chris@76 1295 echo '
Chris@76 1296 <p class="centertext"><strong>', $txt['admin_search_results_none'], '</strong></p>';
Chris@76 1297 }
Chris@76 1298 else
Chris@76 1299 {
Chris@76 1300 echo '
Chris@76 1301 <ol class="search_results">';
Chris@76 1302 foreach ($context['search_results'] as $result)
Chris@76 1303 {
Chris@76 1304 // Is it a result from the online manual?
Chris@76 1305 if ($context['search_type'] == 'online')
Chris@76 1306 {
Chris@76 1307 echo '
Chris@76 1308 <li>
Chris@76 1309 <p>
Chris@76 1310 <a href="', $context['doc_scripturl'], '?topic=', $result['topic_id'], '.0" target="_blank" class="new_win"><strong>', $result['messages'][0]['subject'], '</strong></a>
Chris@76 1311 <br /><span class="smalltext"><a href="', $result['category']['href'], '" target="_blank" class="new_win">', $result['category']['name'], '</a> &nbsp;/&nbsp;
Chris@76 1312 <a href="', $result['board']['href'], '" target="_blank" class="new_win">', $result['board']['name'], '</a> /</span>
Chris@76 1313 </p>
Chris@76 1314 <p class="double_height">
Chris@76 1315 ', $result['messages'][0]['body'], '
Chris@76 1316 </p>
Chris@76 1317 </li>';
Chris@76 1318 }
Chris@76 1319 // Otherwise it's... not!
Chris@76 1320 else
Chris@76 1321 {
Chris@76 1322 echo '
Chris@76 1323 <li class="windowbg">
Chris@76 1324 <a href="', $result['url'], '"><strong>', $result['name'], '</strong></a> [', isset($txt['admin_search_section_' . $result['type']]) ? $txt['admin_search_section_' . $result['type']] : $result['type'] , ']';
Chris@76 1325
Chris@76 1326 if ($result['help'])
Chris@76 1327 echo '
Chris@76 1328 <p class="double_height">', $result['help'], '</p>';
Chris@76 1329
Chris@76 1330 echo '
Chris@76 1331 </li>';
Chris@76 1332 }
Chris@76 1333 }
Chris@76 1334 echo '
Chris@76 1335 </ol>';
Chris@76 1336 }
Chris@76 1337
Chris@76 1338 echo '
Chris@76 1339 </div>
Chris@76 1340 <span class="botslice"><span></span></span>
Chris@76 1341 </div>
Chris@76 1342 <br class="clear" />';
Chris@76 1343 }
Chris@76 1344
Chris@76 1345 // Turn on and off certain key features.
Chris@76 1346 function template_core_features()
Chris@76 1347 {
Chris@76 1348 global $context, $txt, $settings, $options, $scripturl;
Chris@76 1349
Chris@76 1350 echo '
Chris@76 1351 <script type="text/javascript"><!-- // --><![CDATA[
Chris@76 1352 function toggleItem(itemID)
Chris@76 1353 {
Chris@76 1354 // Toggle the hidden item.
Chris@76 1355 var itemValueHandle = document.getElementById("feature_" + itemID);
Chris@76 1356 itemValueHandle.value = itemValueHandle.value == 1 ? 0 : 1;
Chris@76 1357
Chris@76 1358 // Change the image, alternative text and the title.
Chris@76 1359 document.getElementById("switch_" + itemID).src = \'', $settings['images_url'], '/admin/switch_\' + (itemValueHandle.value == 1 ? \'on\' : \'off\') + \'.png\';
Chris@76 1360 document.getElementById("switch_" + itemID).alt = itemValueHandle.value == 1 ? \'', $txt['core_settings_switch_off'], '\' : \'', $txt['core_settings_switch_on'], '\';
Chris@76 1361 document.getElementById("switch_" + itemID).title = itemValueHandle.value == 1 ? \'', $txt['core_settings_switch_off'], '\' : \'', $txt['core_settings_switch_on'], '\';
Chris@76 1362
Chris@76 1363 // Don\'t reload.
Chris@76 1364 return false;
Chris@76 1365 }
Chris@76 1366 // ]]></script>
Chris@76 1367 <div id="admincenter">';
Chris@76 1368 if ($context['is_new_install'])
Chris@76 1369 {
Chris@76 1370 echo '
Chris@76 1371 <div class="cat_bar">
Chris@76 1372 <h3 class="catbg">
Chris@76 1373 ', $txt['core_settings_welcome_msg'], '
Chris@76 1374 </h3>
Chris@76 1375 </div>
Chris@76 1376 <div class="information">
Chris@76 1377 ', $txt['core_settings_welcome_msg_desc'], '
Chris@76 1378 </div>';
Chris@76 1379 }
Chris@76 1380
Chris@76 1381 echo '
Chris@76 1382 <form action="', $scripturl, '?action=admin;area=corefeatures;" method="post" accept-charset="', $context['character_set'], '">
Chris@76 1383 <div class="cat_bar">
Chris@76 1384 <h3 class="catbg">
Chris@76 1385 ', $txt['core_settings_title'], '
Chris@76 1386 </h3>
Chris@76 1387 </div>';
Chris@76 1388
Chris@76 1389 $alternate = true;
Chris@76 1390 foreach ($context['features'] as $id => $feature)
Chris@76 1391 {
Chris@76 1392 echo '
Chris@76 1393 <div class="windowbg', $alternate ? '2' : '', '">
Chris@76 1394 <span class="topslice"><span></span></span>
Chris@76 1395 <div class="content features">
Chris@76 1396 <img class="features_image png_fix" src="', $settings['default_images_url'], '/admin/feature_', $id, '.png" alt="', $feature['title'], '" />
Chris@76 1397 <div class="features_switch" id="js_feature_', $id, '" style="display: none;">
Chris@76 1398 <a href="', $scripturl, '?action=admin;area=featuresettings;sa=core;', $context['session_var'], '=', $context['session_id'], ';toggle=', $id, ';state=', $feature['enabled'] ? 0 : 1, '" onclick="return toggleItem(\'', $id, '\');">
Chris@76 1399 <input type="hidden" name="feature_', $id, '" id="feature_', $id, '" value="', $feature['enabled'] ? 1 : 0, '" /><img src="', $settings['images_url'], '/admin/switch_', $feature['enabled'] ? 'on' : 'off', '.png" id="switch_', $id, '" style="margin-top: 1.3em;" alt="', $txt['core_settings_switch_' . ($feature['enabled'] ? 'off' : 'on')], '" title="', $txt['core_settings_switch_' . ($feature['enabled'] ? 'off' : 'on')], '" />
Chris@76 1400 </a>
Chris@76 1401 </div>
Chris@76 1402 <h4>', ($feature['enabled'] && $feature['url'] ? '<a href="' . $feature['url'] . '">' . $feature['title'] . '</a>' : $feature['title']), '</h4>
Chris@76 1403 <p>', $feature['desc'], '</p>
Chris@76 1404 <div id="plain_feature_', $id, '">
Chris@76 1405 <label for="plain_feature_', $id, '_radio_on"><input type="radio" name="feature_plain_', $id, '" id="plain_feature_', $id, '_radio_on" value="1"', $feature['enabled'] ? ' checked="checked"' : '', ' class="input_radio" />', $txt['core_settings_enabled'], '</label>
Chris@76 1406 <label for="plain_feature_', $id, '_radio_off"><input type="radio" name="feature_plain_', $id, '" id="plain_feature_', $id, '_radio_off" value="0"', !$feature['enabled'] ? ' checked="checked"' : '', ' class="input_radio" />', $txt['core_settings_disabled'], '</label>
Chris@76 1407 </div>
Chris@76 1408 </div>
Chris@76 1409 <span class="botslice clear_right"><span></span></span>
Chris@76 1410 </div>';
Chris@76 1411
Chris@76 1412 $alternate = !$alternate;
Chris@76 1413 }
Chris@76 1414
Chris@76 1415 echo '
Chris@76 1416 <div class="righttext">
Chris@76 1417 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
Chris@76 1418 <input type="hidden" value="0" name="js_worked" id="js_worked" />
Chris@76 1419 <input type="submit" value="', $txt['save'], '" name="save" class="button_submit" />
Chris@76 1420 </div>
Chris@76 1421 </form>
Chris@76 1422 </div>
Chris@76 1423 <br class="clear" />';
Chris@76 1424
Chris@76 1425 // Turn on the pretty javascript if we can!
Chris@76 1426 echo '
Chris@76 1427 <script type="text/javascript"><!-- // --><![CDATA[
Chris@76 1428 document.getElementById(\'js_worked\').value = "1";';
Chris@76 1429 foreach ($context['features'] as $id => $feature)
Chris@76 1430 echo '
Chris@76 1431 document.getElementById(\'js_feature_', $id, '\').style.display = "";
Chris@76 1432 document.getElementById(\'plain_feature_', $id, '\').style.display = "none";';
Chris@76 1433 echo '
Chris@76 1434 // ]]></script>';
Chris@76 1435 }
Chris@76 1436
Chris@76 1437 // Add a new language
Chris@76 1438 function template_add_language()
Chris@76 1439 {
Chris@76 1440 global $context, $settings, $options, $txt, $scripturl;
Chris@76 1441
Chris@76 1442 echo '
Chris@76 1443 <div id="admincenter">
Chris@76 1444 <form action="', $scripturl, '?action=admin;area=languages;sa=add;', $context['session_var'], '=', $context['session_id'], '" method="post" accept-charset="', $context['character_set'], '">
Chris@76 1445 <div class="cat_bar">
Chris@76 1446 <h3 class="catbg">
Chris@76 1447 ', $txt['add_language'], '
Chris@76 1448 </h3>
Chris@76 1449 </div>
Chris@76 1450 <div class="windowbg">
Chris@76 1451 <span class="topslice"><span></span></span>
Chris@76 1452 <div class="content">
Chris@76 1453 <fieldset>
Chris@76 1454 <legend>', $txt['add_language_smf'], '</legend>
Chris@76 1455 <label class="smalltext">', $txt['add_language_smf_browse'], '</label>
Chris@76 1456 <input type="text" name="smf_add" size="40" value="', !empty($context['smf_search_term']) ? $context['smf_search_term'] : '', '" class="input_text" />';
Chris@76 1457
Chris@76 1458 if (!empty($context['smf_error']))
Chris@76 1459 echo '
Chris@76 1460 <div class="smalltext error">', $txt['add_language_error_' . $context['smf_error']], '</div>';
Chris@76 1461
Chris@76 1462 echo '
Chris@76 1463
Chris@76 1464 </fieldset>
Chris@76 1465 <div class="righttext">
Chris@76 1466 ', $context['browser']['is_ie'] ? '<input type="text" name="ie_fix" style="display: none;" class="input_text" /> ' : '', '
Chris@76 1467 <input type="submit" name="smf_add_sub" value="', $txt['search'], '" class="button_submit" />
Chris@76 1468 </div>
Chris@76 1469 </div>
Chris@76 1470 <span class="botslice"><span></span></span>
Chris@76 1471 </div>
Chris@76 1472 ';
Chris@76 1473
Chris@76 1474 // Had some results?
Chris@76 1475 if (!empty($context['smf_languages']))
Chris@76 1476 {
Chris@76 1477 echo '
Chris@76 1478 <div class="information">', $txt['add_language_smf_found'], '</div>
Chris@76 1479
Chris@76 1480 <table class="table_grid" cellspacing="0" width="100%">
Chris@76 1481 <thead>
Chris@76 1482 <tr class="catbg">
Chris@76 1483 <th class="first_th" scope="col">', $txt['name'], '</th>
Chris@76 1484 <th scope="col">', $txt['add_language_smf_desc'], '</th>
Chris@76 1485 <th scope="col">', $txt['add_language_smf_version'], '</th>
Chris@76 1486 <th scope="col">', $txt['add_language_smf_utf8'], '</th>
Chris@76 1487 <th class="last_th" scope="col">', $txt['add_language_smf_install'], '</th>
Chris@76 1488 </tr>
Chris@76 1489 </thead>
Chris@76 1490 <tbody>';
Chris@76 1491
Chris@76 1492 foreach ($context['smf_languages'] as $language)
Chris@76 1493 echo '
Chris@76 1494 <tr class="windowbg2">
Chris@76 1495 <td align="left">', $language['name'], '</td>
Chris@76 1496 <td align="left">', $language['description'], '</td>
Chris@76 1497 <td align="left">', $language['version'], '</td>
Chris@76 1498 <td align="center">', $language['utf8'] ? $txt['yes'] : $txt['no'], '</td>
Chris@76 1499 <td align="left"><a href="', $language['link'], '">', $txt['add_language_smf_install'], '</a></td>
Chris@76 1500 </tr>';
Chris@76 1501
Chris@76 1502 echo '
Chris@76 1503 </tbody>
Chris@76 1504 </table>';
Chris@76 1505 }
Chris@76 1506
Chris@76 1507 echo '
Chris@76 1508 </form>
Chris@76 1509 </div>
Chris@76 1510 <br class="clear" />';
Chris@76 1511 }
Chris@76 1512
Chris@76 1513 // Download a new language file?
Chris@76 1514 function template_download_language()
Chris@76 1515 {
Chris@76 1516 global $context, $settings, $options, $txt, $scripturl, $modSettings;
Chris@76 1517
Chris@76 1518 // Actually finished?
Chris@76 1519 if (!empty($context['install_complete']))
Chris@76 1520 {
Chris@76 1521 echo '
Chris@76 1522 <div id="admincenter">
Chris@76 1523 <div class="cat_bar">
Chris@76 1524 <h3 class="catbg">
Chris@76 1525 ', $txt['languages_download_complete'], '
Chris@76 1526 </h3>
Chris@76 1527 </div>
Chris@76 1528 <div class="windowbg">
Chris@76 1529 <span class="topslice"><span></span></span>
Chris@76 1530 <div class="content">
Chris@76 1531 ', $context['install_complete'], '
Chris@76 1532 </div>
Chris@76 1533 <span class="botslice"><span></span></span>
Chris@76 1534 </div>
Chris@76 1535 </div>
Chris@76 1536 <br class="clear" />';
Chris@76 1537 return;
Chris@76 1538 }
Chris@76 1539
Chris@76 1540 // An error?
Chris@76 1541 if (!empty($context['error_message']))
Chris@76 1542 echo '
Chris@76 1543 <div id="errorbox">
Chris@76 1544 <p>', $context['error_message'], '</p>
Chris@76 1545 </div>';
Chris@76 1546
Chris@76 1547 // Provide something of an introduction...
Chris@76 1548 echo '
Chris@76 1549 <div id="admincenter">
Chris@76 1550 <form action="', $scripturl, '?action=admin;area=languages;sa=downloadlang;did=', $context['download_id'], ';', $context['session_var'], '=', $context['session_id'], '" method="post" accept-charset="', $context['character_set'], '">
Chris@76 1551 <div class="cat_bar">
Chris@76 1552 <h3 class="catbg">
Chris@76 1553 ', $txt['languages_download'], '
Chris@76 1554 </h3>
Chris@76 1555 </div>
Chris@76 1556 <div class="windowbg">
Chris@76 1557 <span class="topslice"><span></span></span>
Chris@76 1558 <div class="content">
Chris@76 1559 <p>
Chris@76 1560 ', $txt['languages_download_note'], '
Chris@76 1561 </p>
Chris@76 1562 <div class="smalltext">
Chris@76 1563 ', $txt['languages_download_info'], '
Chris@76 1564 </div>
Chris@76 1565 </div>
Chris@76 1566 <span class="botslice"><span></span></span>
Chris@76 1567 </div>';
Chris@76 1568
Chris@76 1569 // Show the main files.
Chris@76 1570 template_show_list('lang_main_files_list');
Chris@76 1571
Chris@76 1572 // Now, all the images and the likes, hidden via javascript 'cause there are so fecking many.
Chris@76 1573 echo '
Chris@76 1574 <br />
Chris@76 1575 <div class="title_bar">
Chris@76 1576 <h3 class="titlebg">
Chris@76 1577 ', $txt['languages_download_theme_files'], '
Chris@76 1578 </h3>
Chris@76 1579 </div>
Chris@76 1580 <table class="table_grid" cellspacing="0" width="100%">
Chris@76 1581 <thead>
Chris@76 1582 <tr class="catbg">
Chris@76 1583 <th class="first_th" scope="col">
Chris@76 1584 ', $txt['languages_download_filename'], '
Chris@76 1585 </th>
Chris@76 1586 <th scope="col" width="100">
Chris@76 1587 ', $txt['languages_download_writable'], '
Chris@76 1588 </th>
Chris@76 1589 <th scope="col" width="100">
Chris@76 1590 ', $txt['languages_download_exists'], '
Chris@76 1591 </th>
Chris@76 1592 <th class="last_th" scope="col" width="50">
Chris@76 1593 ', $txt['languages_download_copy'], '
Chris@76 1594 </th>
Chris@76 1595 </tr>
Chris@76 1596 </thead>
Chris@76 1597 <tbody>';
Chris@76 1598
Chris@76 1599 foreach ($context['files']['images'] as $theme => $group)
Chris@76 1600 {
Chris@76 1601 $count = 0;
Chris@76 1602 echo '
Chris@76 1603 <tr class="titlebg">
Chris@76 1604 <td colspan="4">
Chris@76 1605 <img src="', $settings['images_url'], '/sort_down.gif" id="toggle_image_', $theme, '" alt="*" />&nbsp;', isset($context['theme_names'][$theme]) ? $context['theme_names'][$theme] : $theme, '
Chris@76 1606 </td>
Chris@76 1607 </tr>';
Chris@76 1608
Chris@76 1609 $alternate = false;
Chris@76 1610 foreach ($group as $file)
Chris@76 1611 {
Chris@76 1612 echo '
Chris@76 1613 <tr class="windowbg', $alternate ? '2' : '', '" id="', $theme, '-', $count++, '">
Chris@76 1614 <td>
Chris@76 1615 <strong>', $file['name'], '</strong><br />
Chris@76 1616 <span class="smalltext">', $txt['languages_download_dest'], ': ', $file['destination'], '</span>
Chris@76 1617 </td>
Chris@76 1618 <td>
Chris@76 1619 <span style="color: ', ($file['writable'] ? 'green' : 'red'), ';">', ($file['writable'] ? $txt['yes'] : $txt['no']), '</span>
Chris@76 1620 </td>
Chris@76 1621 <td>
Chris@76 1622 ', $file['exists'] ? ($file['exists'] == 'same' ? $txt['languages_download_exists_same'] : $txt['languages_download_exists_different']) : $txt['no'], '
Chris@76 1623 </td>
Chris@76 1624 <td>
Chris@76 1625 <input type="checkbox" name="copy_file[]" value="', $file['generaldest'], '"', ($file['default_copy'] ? ' checked="checked"' : ''), ' class="input_check" />
Chris@76 1626 </td>
Chris@76 1627 </tr>';
Chris@76 1628 $alternate = !$alternate;
Chris@76 1629 }
Chris@76 1630 }
Chris@76 1631
Chris@76 1632 echo '
Chris@76 1633 </tbody>
Chris@76 1634 </table>';
Chris@76 1635
Chris@76 1636 // Do we want some FTP baby?
Chris@76 1637 if (!empty($context['still_not_writable']))
Chris@76 1638 {
Chris@76 1639 if (!empty($context['package_ftp']['error']))
Chris@76 1640 echo '
Chris@76 1641 <div id="errorbox">
Chris@76 1642 <tt>', $context['package_ftp']['error'], '</tt>
Chris@76 1643 </div>';
Chris@76 1644
Chris@76 1645 echo '
Chris@76 1646 <div class="cat_bar">
Chris@76 1647 <h3 class="catbg">
Chris@76 1648 ', $txt['package_ftp_necessary'], '
Chris@76 1649 </h3>
Chris@76 1650 </div>
Chris@76 1651 <div class="windowbg">
Chris@76 1652 <span class="topslice"><span></span></span>
Chris@76 1653 <div class="content">
Chris@76 1654 <p>', $txt['package_ftp_why'],'</p>
Chris@76 1655 <dl class="settings">
Chris@76 1656 <dt
Chris@76 1657 <label for="ftp_server">', $txt['package_ftp_server'], ':</label>
Chris@76 1658 </dt>
Chris@76 1659 <dd>
Chris@76 1660 <div class="floatright" style="margin-right: 1px;"><label for="ftp_port" style="padding-top: 2px; padding-right: 2ex;">', $txt['package_ftp_port'], ':&nbsp;</label> <input type="text" size="3" name="ftp_port" id="ftp_port" value="', isset($context['package_ftp']['port']) ? $context['package_ftp']['port'] : (isset($modSettings['package_port']) ? $modSettings['package_port'] : '21'), '" class="input_text" /></div>
Chris@76 1661 <input type="text" size="30" name="ftp_server" id="ftp_server" value="', isset($context['package_ftp']['server']) ? $context['package_ftp']['server'] : (isset($modSettings['package_server']) ? $modSettings['package_server'] : 'localhost'), '" style="width: 70%;" class="input_text" />
Chris@76 1662 </dd>
Chris@76 1663
Chris@76 1664 <dt>
Chris@76 1665 <label for="ftp_username">', $txt['package_ftp_username'], ':</label>
Chris@76 1666 </dt>
Chris@76 1667 <dd>
Chris@76 1668 <input type="text" size="50" name="ftp_username" id="ftp_username" value="', isset($context['package_ftp']['username']) ? $context['package_ftp']['username'] : (isset($modSettings['package_username']) ? $modSettings['package_username'] : ''), '" style="width: 99%;" class="input_text" />
Chris@76 1669 </dd>
Chris@76 1670
Chris@76 1671 <dt>
Chris@76 1672 <label for="ftp_password">', $txt['package_ftp_password'], ':</label>
Chris@76 1673 </dt>
Chris@76 1674 <dd>
Chris@76 1675 <input type="password" size="50" name="ftp_password" id="ftp_password" style="width: 99%;" class="input_text" />
Chris@76 1676 </dd>
Chris@76 1677
Chris@76 1678 <dt>
Chris@76 1679 <label for="ftp_path">', $txt['package_ftp_path'], ':</label>
Chris@76 1680 </dt>
Chris@76 1681 <dd>
Chris@76 1682 <input type="text" size="50" name="ftp_path" id="ftp_path" value="', $context['package_ftp']['path'], '" style="width: 99%;" class="input_text" />
Chris@76 1683 </dd>
Chris@76 1684 </dl>
Chris@76 1685 </div>
Chris@76 1686 <span class="botslice"><span></span></span>
Chris@76 1687 </div>';
Chris@76 1688 }
Chris@76 1689
Chris@76 1690 // Install?
Chris@76 1691 echo '
Chris@76 1692 <div class="righttext padding">
Chris@76 1693 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
Chris@76 1694 <input type="submit" name="do_install" value="', $txt['add_language_smf_install'], '" class="button_submit" />
Chris@76 1695 </div>
Chris@76 1696 </form>
Chris@76 1697 </div>
Chris@76 1698 <br class="clear" />';
Chris@76 1699
Chris@76 1700 // The javascript for expand and collapse of sections.
Chris@76 1701 echo '
Chris@76 1702 <script type="text/javascript"><!-- // --><![CDATA[';
Chris@76 1703
Chris@76 1704 // Each theme gets its own handler.
Chris@76 1705 foreach ($context['files']['images'] as $theme => $group)
Chris@76 1706 {
Chris@76 1707 $count = 0;
Chris@76 1708 echo '
Chris@76 1709 var oTogglePanel_', $theme, ' = new smc_Toggle({
Chris@76 1710 bToggleEnabled: true,
Chris@76 1711 bCurrentlyCollapsed: true,
Chris@76 1712 aSwappableContainers: [';
Chris@76 1713 foreach ($group as $file)
Chris@76 1714 echo '
Chris@76 1715 ', JavaScriptEscape($theme . '-' . $count++), ',';
Chris@76 1716 echo '
Chris@76 1717 null
Chris@76 1718 ],
Chris@76 1719 aSwapImages: [
Chris@76 1720 {
Chris@76 1721 sId: \'toggle_image_', $theme, '\',
Chris@76 1722 srcExpanded: smf_images_url + \'/sort_down.gif\',
Chris@76 1723 altExpanded: \'*\',
Chris@76 1724 srcCollapsed: smf_images_url + \'/selected.gif\',
Chris@76 1725 altCollapsed: \'*\'
Chris@76 1726 }
Chris@76 1727 ]
Chris@76 1728 });';
Chris@76 1729 }
Chris@76 1730
Chris@76 1731 echo '
Chris@76 1732 // ]]></script>';
Chris@76 1733 }
Chris@76 1734
Chris@76 1735 // Edit some language entries?
Chris@76 1736 function template_modify_language_entries()
Chris@76 1737 {
Chris@76 1738 global $context, $settings, $options, $txt, $scripturl;
Chris@76 1739
Chris@76 1740 echo '
Chris@76 1741 <div id="admincenter">
Chris@76 1742 <form action="', $scripturl, '?action=admin;area=languages;sa=editlang;lid=', $context['lang_id'], '" method="post" accept-charset="', $context['character_set'], '">
Chris@76 1743 <div class="cat_bar">
Chris@76 1744 <h3 class="catbg">
Chris@76 1745 ', $txt['edit_languages'], '
Chris@76 1746 </h3>
Chris@76 1747 </div>';
Chris@76 1748
Chris@76 1749 // Not writable?
Chris@76 1750 if ($context['lang_file_not_writable_message'])
Chris@76 1751 echo '
Chris@76 1752 <div id="errorbox">
Chris@76 1753 <p class="alert">', $context['lang_file_not_writable_message'], '</p>
Chris@76 1754 </div>';
Chris@76 1755
Chris@76 1756 echo '
Chris@76 1757 <div class="information">
Chris@76 1758 ', $txt['edit_language_entries_primary'], '
Chris@76 1759 </div>
Chris@76 1760 <div class="windowbg">
Chris@76 1761 <span class="topslice"><span></span></span>
Chris@76 1762 <div class="content">
Chris@76 1763 <fieldset>
Chris@76 1764 <legend>', $context['primary_settings']['name'], '</legend>
Chris@76 1765 <dl class="settings">
Chris@76 1766 <dt>
Chris@76 1767 ', $txt['languages_character_set'], ':
Chris@76 1768 </dt>
Chris@76 1769 <dd>
Chris@76 1770 <input type="text" name="character_set" size="20" value="', $context['primary_settings']['character_set'], '"', (empty($context['file_entries']) ? '' : ' disabled="disabled"'), ' class="input_text" />
Chris@76 1771 </dd>
Chris@76 1772 <dt>
Chris@76 1773 ', $txt['languages_locale'], ':
Chris@76 1774 </dt>
Chris@76 1775 <dd>
Chris@76 1776 <input type="text" name="locale" size="20" value="', $context['primary_settings']['locale'], '"', (empty($context['file_entries']) ? '' : ' disabled="disabled"'), ' class="input_text" />
Chris@76 1777 </dd>
Chris@76 1778 <dt>
Chris@76 1779 ', $txt['languages_dictionary'], ':
Chris@76 1780 </dt>
Chris@76 1781 <dd>
Chris@76 1782 <input type="text" name="dictionary" size="20" value="', $context['primary_settings']['dictionary'], '"', (empty($context['file_entries']) ? '' : ' disabled="disabled"'), ' class="input_text" />
Chris@76 1783 </dd>
Chris@76 1784 <dt>
Chris@76 1785 ', $txt['languages_spelling'], ':
Chris@76 1786 </dt>
Chris@76 1787 <dd>
Chris@76 1788 <input type="text" name="spelling" size="20" value="', $context['primary_settings']['spelling'], '"', (empty($context['file_entries']) ? '' : ' disabled="disabled"'), ' class="input_text" />
Chris@76 1789 </dd>
Chris@76 1790 <dt>
Chris@76 1791 ', $txt['languages_rtl'], ':
Chris@76 1792 </dt>
Chris@76 1793 <dd>
Chris@76 1794 <input type="checkbox" name="rtl"', $context['primary_settings']['rtl'] ? ' checked="checked"' : '', ' class="input_check"', (empty($context['file_entries']) ? '' : ' disabled="disabled"'), ' />
Chris@76 1795 </dd>
Chris@76 1796 </dl>
Chris@76 1797 </fieldset>
Chris@76 1798 <div class="righttext">
Chris@76 1799 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
Chris@76 1800 <input type="submit" name="save_main" value="', $txt['save'], '"', $context['lang_file_not_writable_message'] || !empty($context['file_entries']) ? ' disabled="disabled"' : '', ' class="button_submit" />';
Chris@76 1801
Chris@76 1802 // English can't be deleted.
Chris@76 1803 if ($context['lang_id'] != 'english')
Chris@76 1804 echo '
Chris@76 1805 <input type="submit" name="delete_main" value="', $txt['delete'], '"', $context['lang_file_not_writable_message'] || !empty($context['file_entries']) ? ' disabled="disabled"' : '', ' onclick="confirm(\'', $txt['languages_delete_confirm'], '\');" class="button_submit" />';
Chris@76 1806
Chris@76 1807 echo '
Chris@76 1808 </div>
Chris@76 1809 </div>
Chris@76 1810 <span class="botslice"><span></span></span>
Chris@76 1811 </div>
Chris@76 1812 </form>
Chris@76 1813
Chris@76 1814 <form action="', $scripturl, '?action=admin;area=languages;sa=editlang;lid=', $context['lang_id'], ';entries" id="entry_form" method="post" accept-charset="', $context['character_set'], '">
Chris@76 1815 <div class="title_bar">
Chris@76 1816 <h3 class="titlebg">
Chris@76 1817 ', $txt['edit_language_entries'], '
Chris@76 1818 </h3>
Chris@76 1819 </div>
Chris@76 1820 <div id="taskpad" class="floatright">
Chris@76 1821 ', $txt['edit_language_entries_file'], ':
Chris@76 1822 <select name="tfid" onchange="if (this.value != -1) document.forms.entry_form.submit();">';
Chris@76 1823 foreach ($context['possible_files'] as $id_theme => $theme)
Chris@76 1824 {
Chris@76 1825 echo '
Chris@76 1826 <option value="-1">', $theme['name'], '</option>';
Chris@76 1827
Chris@76 1828 foreach ($theme['files'] as $file)
Chris@76 1829 echo '
Chris@76 1830 <option value="', $id_theme, '+', $file['id'], '"', $file['selected'] ? ' selected="selected"' : '', '> =&gt; ', $file['name'], '</option>';
Chris@76 1831 }
Chris@76 1832
Chris@76 1833 echo '
Chris@76 1834 </select>
Chris@76 1835 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
Chris@76 1836 <input type="submit" value="', $txt['go'], '" class="button_submit" />
Chris@76 1837 </div>';
Chris@76 1838
Chris@76 1839 // Is it not writable?
Chris@76 1840 if (!empty($context['entries_not_writable_message']))
Chris@76 1841 echo '
Chris@76 1842 <div id="errorbox">
Chris@76 1843 <span class="alert">', $context['entries_not_writable_message'], '</span>
Chris@76 1844 </div>';
Chris@76 1845
Chris@76 1846 // Already have some?
Chris@76 1847 if (!empty($context['file_entries']))
Chris@76 1848 {
Chris@76 1849 echo '
Chris@76 1850 <div class="windowbg2">
Chris@76 1851 <span class="topslice"><span></span></span>
Chris@76 1852 <div class="content">
Chris@76 1853 <dl class="settings">';
Chris@76 1854
Chris@76 1855 $cached = array();
Chris@76 1856 foreach ($context['file_entries'] as $entry)
Chris@76 1857 {
Chris@76 1858 // Do it in two's!
Chris@76 1859 if (empty($cached))
Chris@76 1860 {
Chris@76 1861 $cached = $entry;
Chris@76 1862 continue;
Chris@76 1863 }
Chris@76 1864
Chris@76 1865 echo '
Chris@76 1866 <dt>
Chris@76 1867 <span class="smalltext">', $cached['key'], '</span>
Chris@76 1868 </dt>
Chris@76 1869 <dd>
Chris@76 1870 <span class="smalltext">', $entry['key'], '</span>
Chris@76 1871 </dd>
Chris@76 1872 <dt>
Chris@76 1873 <input type="hidden" name="comp[', $cached['key'], ']" value="', $cached['value'], '" />
Chris@76 1874 <textarea name="entry[', $cached['key'], ']" cols="40" rows="', $cached['rows'] < 2 ? 2 : $cached['rows'], '" style="' . ($context['browser']['is_ie8'] ? 'width: 635px; max-width: 96%; min-width: 96%' : 'width: 96%') . ';">', $cached['value'], '</textarea>
Chris@76 1875 </dt>
Chris@76 1876 <dd>
Chris@76 1877 <input type="hidden" name="comp[', $entry['key'], ']" value="', $entry['value'], '" />
Chris@76 1878 <textarea name="entry[', $entry['key'], ']" cols="40" rows="', $entry['rows'] < 2 ? 2 : $entry['rows'], '" style="' . ($context['browser']['is_ie8'] ? 'width: 635px; max-width: 96%; min-width: 96%' : 'width: 96%') . ';">', $entry['value'], '</textarea>
Chris@76 1879 </dd>';
Chris@76 1880 $cached = array();
Chris@76 1881 }
Chris@76 1882
Chris@76 1883 // Odd number?
Chris@76 1884 if (!empty($cached))
Chris@76 1885 echo '
Chris@76 1886
Chris@76 1887 <dt>
Chris@76 1888 <span class="smalltext">', $cached['key'], '</span>
Chris@76 1889 </dt>
Chris@76 1890 <dd>
Chris@76 1891 </dd>
Chris@76 1892 <dt>
Chris@76 1893 <input type="hidden" name="comp[', $cached['key'], ']" value="', $cached['value'], '" />
Chris@76 1894 <textarea name="entry[', $cached['key'], ']" cols="40" rows="2" style="' . ($context['browser']['is_ie8'] ? 'width: 635px; max-width: 96%; min-width: 96%' : 'width: 96%') . ';">', $cached['value'], '</textarea>
Chris@76 1895 </dt>
Chris@76 1896 <dd>
Chris@76 1897 </dd>';
Chris@76 1898
Chris@76 1899 echo '
Chris@76 1900 </dl>
Chris@76 1901 <input type="submit" name="save_entries" value="', $txt['save'], '"', !empty($context['entries_not_writable_message']) ? ' disabled="disabled"' : '', ' class="button_submit" />';
Chris@76 1902
Chris@76 1903 echo '
Chris@76 1904 </div>
Chris@76 1905 <span class="botslice"><span></span></span>
Chris@76 1906 </div>';
Chris@76 1907 }
Chris@76 1908 echo '
Chris@76 1909 </form>
Chris@76 1910 </div>
Chris@76 1911 <br class="clear" />';
Chris@76 1912 }
Chris@76 1913
Chris@76 1914 // This little beauty shows questions and answer from the captcha type feature.
Chris@76 1915 function template_callback_question_answer_list()
Chris@76 1916 {
Chris@76 1917 global $txt, $context;
Chris@76 1918
Chris@76 1919 echo '
Chris@76 1920 <dt>
Chris@76 1921 <strong>', $txt['setup_verification_question'], '</strong>
Chris@76 1922 </dt>
Chris@76 1923 <dd>
Chris@76 1924 <strong>', $txt['setup_verification_answer'], '</strong>
Chris@76 1925 </dd>';
Chris@76 1926
Chris@76 1927 foreach ($context['question_answers'] as $data)
Chris@76 1928 echo '
Chris@76 1929
Chris@76 1930 <dt>
Chris@76 1931 <input type="text" name="question[', $data['id'], ']" value="', $data['question'], '" size="50" class="input_text verification_question" />
Chris@76 1932 </dt>
Chris@76 1933 <dd>
Chris@76 1934 <input type="text" name="answer[', $data['id'], ']" value="', $data['answer'], '" size="50" class="input_text verification_answer" />
Chris@76 1935 </dd>';
Chris@76 1936
Chris@76 1937 // Some blank ones.
Chris@76 1938 for ($count = 0; $count < 3; $count++)
Chris@76 1939 echo '
Chris@76 1940 <dt>
Chris@76 1941 <input type="text" name="question[]" size="50" class="input_text verification_question" />
Chris@76 1942 </dt>
Chris@76 1943 <dd>
Chris@76 1944 <input type="text" name="answer[]" size="50" class="input_text verification_answer" />
Chris@76 1945 </dd>';
Chris@76 1946
Chris@76 1947 echo '
Chris@76 1948 <dt id="add_more_question_placeholder" style="display: none;"></dt><dd></dd>
Chris@76 1949 <dt id="add_more_link_div" style="display: none;">
Chris@76 1950 <a href="#" onclick="addAnotherQuestion(); return false;">&#171; ', $txt['setup_verification_add_more'], ' &#187;</a>
Chris@76 1951
Chris@76 1952 </dt><dd></dd>';
Chris@76 1953
Chris@76 1954 // The javascript needs to go at the end but we'll put it in this template for looks.
Chris@76 1955 $context['settings_post_javascript'] .= '
Chris@76 1956 // Create a named element dynamically - thanks to: http://www.thunderguy.com/semicolon/2005/05/23/setting-the-name-attribute-in-internet-explorer/
Chris@76 1957 function createNamedElement(type, name, customFields)
Chris@76 1958 {
Chris@76 1959 var element = null;
Chris@76 1960
Chris@76 1961 if (!customFields)
Chris@76 1962 customFields = "";
Chris@76 1963
Chris@76 1964 // Try the IE way; this fails on standards-compliant browsers
Chris@76 1965 try
Chris@76 1966 {
Chris@76 1967 element = document.createElement("<" + type + \' name="\' + name + \'" \' + customFields + ">");
Chris@76 1968 }
Chris@76 1969 catch (e)
Chris@76 1970 {
Chris@76 1971 }
Chris@76 1972 if (!element || element.nodeName != type.toUpperCase())
Chris@76 1973 {
Chris@76 1974 // Non-IE browser; use canonical method to create named element
Chris@76 1975 element = document.createElement(type);
Chris@76 1976 element.name = name;
Chris@76 1977 }
Chris@76 1978
Chris@76 1979 return element;
Chris@76 1980 }
Chris@76 1981
Chris@76 1982 var placeHolder = document.getElementById(\'add_more_question_placeholder\');
Chris@76 1983
Chris@76 1984 function addAnotherQuestion()
Chris@76 1985 {
Chris@76 1986 var newDT = document.createElement("dt");
Chris@76 1987
Chris@76 1988 var newInput = createNamedElement("input", "question[]");
Chris@76 1989 newInput.type = "text";
Chris@76 1990 newInput.className = "input_text";
Chris@76 1991 newInput.size = "50";
Chris@76 1992 newInput.setAttribute("class", "verification_question");
Chris@76 1993 newDT.appendChild(newInput);
Chris@76 1994
Chris@76 1995 newDD = document.createElement("dd");
Chris@76 1996
Chris@76 1997 newInput = createNamedElement("input", "answer[]");
Chris@76 1998 newInput.type = "text";
Chris@76 1999 newInput.className = "input_text";
Chris@76 2000 newInput.size = "50";
Chris@76 2001 newInput.setAttribute("class", "verification_answer");
Chris@76 2002 newDD.appendChild(newInput);
Chris@76 2003
Chris@76 2004 placeHolder.parentNode.insertBefore(newDT, placeHolder);
Chris@76 2005 placeHolder.parentNode.insertBefore(newDD, placeHolder);
Chris@76 2006 }
Chris@76 2007 document.getElementById(\'add_more_link_div\').style.display = \'\';
Chris@76 2008 ';
Chris@76 2009 }
Chris@76 2010
Chris@76 2011 // Repairing boards.
Chris@76 2012 function template_repair_boards()
Chris@76 2013 {
Chris@76 2014 global $context, $txt, $scripturl;
Chris@76 2015
Chris@76 2016 echo '
Chris@76 2017 <div id="admincenter">
Chris@76 2018 <div class="cat_bar">
Chris@76 2019 <h3 class="catbg">',
Chris@76 2020 $context['error_search'] ? $txt['errors_list'] : $txt['errors_fixing'] , '
Chris@76 2021 </h3>
Chris@76 2022 </div>
Chris@76 2023 <div class="windowbg">
Chris@76 2024 <span class="topslice"><span></span></span>
Chris@76 2025 <div class="content">';
Chris@76 2026
Chris@76 2027 // Are we actually fixing them, or is this just a prompt?
Chris@76 2028 if ($context['error_search'])
Chris@76 2029 {
Chris@76 2030 if (!empty($context['to_fix']))
Chris@76 2031 {
Chris@76 2032 echo '
Chris@76 2033 ', $txt['errors_found'], ':
Chris@76 2034 <ul>';
Chris@76 2035
Chris@76 2036 foreach ($context['repair_errors'] as $error)
Chris@76 2037 echo '
Chris@76 2038 <li>
Chris@76 2039 ', $error, '
Chris@76 2040 </li>';
Chris@76 2041
Chris@76 2042 echo '
Chris@76 2043 </ul>
Chris@76 2044 <p>
Chris@76 2045 ', $txt['errors_fix'], '
Chris@76 2046 </p>
Chris@76 2047 <p class="padding">
Chris@76 2048 <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>
Chris@76 2049 </p>';
Chris@76 2050 }
Chris@76 2051 else
Chris@76 2052 echo '
Chris@76 2053 <p>', $txt['maintain_no_errors'], '</p>
Chris@76 2054 <p class="padding">
Chris@76 2055 <a href="', $scripturl, '?action=admin;area=maintain;sa=routine">', $txt['maintain_return'], '</a>
Chris@76 2056 </p>';
Chris@76 2057
Chris@76 2058 }
Chris@76 2059 else
Chris@76 2060 {
Chris@76 2061 if (!empty($context['redirect_to_recount']))
Chris@76 2062 {
Chris@76 2063 echo '
Chris@76 2064 <p>
Chris@76 2065 ', $txt['errors_do_recount'], '
Chris@76 2066 </p>
Chris@76 2067 <form action="', $scripturl, '?action=admin;area=maintain;sa=routine;activity=recount" id="recount_form" method="post">
Chris@76 2068 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
Chris@76 2069 <input type="submit" name="recount" id="recount_now" value="', $txt['errors_recount_now'], '" />
Chris@76 2070 </form>';
Chris@76 2071 }
Chris@76 2072 else
Chris@76 2073 {
Chris@76 2074 echo '
Chris@76 2075 <p>', $txt['errors_fixed'], '</p>
Chris@76 2076 <p class="padding">
Chris@76 2077 <a href="', $scripturl, '?action=admin;area=maintain;sa=routine">', $txt['maintain_return'], '</a>
Chris@76 2078 </p>';
Chris@76 2079 }
Chris@76 2080 }
Chris@76 2081
Chris@76 2082 echo '
Chris@76 2083 </div>
Chris@76 2084 <span class="botslice"><span></span></span>
Chris@76 2085 </div>
Chris@76 2086 </div>
Chris@76 2087 <br class="clear" />';
Chris@76 2088
Chris@76 2089 if (!empty($context['redirect_to_recount']))
Chris@76 2090 {
Chris@76 2091 echo '
Chris@76 2092 <script type="text/javascript"><!-- // --><![CDATA[
Chris@76 2093 var countdown = 5;
Chris@76 2094 doAutoSubmit();
Chris@76 2095
Chris@76 2096 function doAutoSubmit()
Chris@76 2097 {
Chris@76 2098 if (countdown == 0)
Chris@76 2099 document.forms.recount_form.submit();
Chris@76 2100 else if (countdown == -1)
Chris@76 2101 return;
Chris@76 2102
Chris@76 2103 document.forms.recount_form.recount_now.value = "', $txt['errors_recount_now'], ' (" + countdown + ")";
Chris@76 2104 countdown--;
Chris@76 2105
Chris@76 2106 setTimeout("doAutoSubmit();", 1000);
Chris@76 2107 }
Chris@76 2108 // ]]></script>';
Chris@76 2109 }
Chris@76 2110 }
Chris@76 2111
Chris@76 2112 ?>