/admin/template/content_configuration_edit.php

https://github.com/AwkwardDev/wowarmory · PHP · 140 lines · 126 code · 14 blank · 0 comment · 27 complexity · 07e3c9d4080c46aeb6c0db37488acb29 MD5 · raw file

  1. <!-- CONTENT START -->
  2. <div class="grid_16" id="content">
  3. <!-- CONTENT TITLE -->
  4. <div class="grid_9">
  5. <h1 class="content_edit">Edit Configuration</h1>
  6. </div>
  7. <!-- TEXT CONTENT OR ANY OTHER CONTENT START -->
  8. <div class="grid_15" id="textcontent">
  9. <a href="?action=config">Go back</a>
  10. <form id="edit" name="edit" method="post" action="?action=config&subaction=edit">
  11. <label><span style="color: red;">MySQL connection info:</span></label>
  12. <label>Armory database host:</label>
  13. <input type="text" name="host_armory" value="<?php echo Armory::$mysqlconfig['host_armory']; ?>" />
  14. <label>Armory database user:</label>
  15. <input type="text" name="user_armory" value="<?php echo Armory::$mysqlconfig['user_armory']; ?>" />
  16. <label>Armory database user password:</label>
  17. <input type="text" name="pass_armory" value="<?php echo Armory::$mysqlconfig['pass_armory']; ?>" />
  18. <label>Armory database name:</label>
  19. <input type="text" name="name_armory" value="<?php echo Armory::$mysqlconfig['name_armory']; ?>" />
  20. <label>Armory database charset:</label>
  21. <input type="text" name="charset_armory" value="<?php echo Armory::$mysqlconfig['charset_armory']; ?>" />
  22. <br />
  23. <label>Realmd database host:</label>
  24. <input type="text" name="host_realmd" value="<?php echo Armory::$mysqlconfig['host_realmd']; ?>" />
  25. <label>Realmd database user:</label>
  26. <input type="text" name="user_realmd" value="<?php echo Armory::$mysqlconfig['user_realmd']; ?>" />
  27. <label>Realmd database user password:</label>
  28. <input type="text" name="pass_realmd" value="<?php echo Armory::$mysqlconfig['pass_realmd']; ?>" />
  29. <label>Realmd database name:</label>
  30. <input type="text" name="name_realmd" value="<?php echo Armory::$mysqlconfig['name_realmd']; ?>" />
  31. <label>Realmd database charset:</label>
  32. <input type="text" name="charset_realmd" value="<?php echo Armory::$mysqlconfig['charset_realmd']; ?>" />
  33. <br />
  34. <label><span style="color: red;">Armory settings:</span></label>
  35. <label>News support:</label>
  36. <input type="radio" name="useNews" value="0"<?php echo Armory::$armoryconfig['useNews'] == false ? ' checked="checked"' : null; ?> /> Disabled
  37. <input type="radio" name="useNews" value="1"<?php echo Armory::$armoryconfig['useNews'] == true ? ' checked="checked"' : null; ?> /> Enabled
  38. <label>Default Battlegroup name:</label>
  39. <input type="text" name="defaultBGName" value="<?php echo Armory::$armoryconfig['defaultBGName']; ?>" />
  40. <label>Cache support:</label>
  41. <input type="radio" name="useCache" value="0"<?php echo Armory::$armoryconfig['useCache'] == false ? ' checked="checked"' : null; ?> /> Disabled
  42. <input type="radio" name="useCache" value="1"<?php echo Armory::$armoryconfig['useCache'] == true ? ' checked="checked"' : null; ?> /> Enabled
  43. <label>Cache lifetime (in seconds):</label>
  44. <input type="text" name="cache_lifetime" value="<?php echo Armory::$armoryconfig['cache_lifetime']; ?>" />
  45. <label>Armory database prefix (without "_"!):</label>
  46. <input type="text" name="db_prefix" value="<?php echo Armory::$armoryconfig['db_prefix']; ?>" />
  47. <label>Min. character level to display (0 to disable):</label>
  48. <input type="text" name="minlevel" value="<?php echo Armory::$armoryconfig['minlevel']; ?>" />
  49. <label>GM Level display filter:</label>
  50. <select name="minGmLevelToShow">
  51. <option value="3"<?php echo Armory::$armoryconfig['minGmLevelToShow'] == 3 ? ' selected' : null; ?>>Everyone</option>
  52. <option value="2"<?php echo Armory::$armoryconfig['minGmLevelToShow'] == 2 ? ' selected' : null; ?>>Everyone except Administrations</option>
  53. <option value="1"<?php echo Armory::$armoryconfig['minGmLevelToShow'] == 1 ? ' selected' : null; ?>>Everyone except Administrations and GMs</option>
  54. <option value="0"<?php echo Armory::$armoryconfig['minGmLevelToShow'] == 0 ? ' selected' : null; ?>>Only players</option>
  55. <option value="-1"<?php echo Armory::$armoryconfig['minGmLevelToShow'] > 3 ? ' selected' : null; ?>>Custom value</option>
  56. </select>
  57. <input type="text" name="minGmLevelToShowCustom" value="<?php echo Armory::$armoryconfig['minGmLevelToShow'] > 3 ? Armory::$armoryconfig['minGmLevelToShow'] : 'Or enter custom value'; ?>" />
  58. <label>Disable characters loading from banned accounts</label>
  59. <input type="radio" name="skipBanned" value="0"<?php echo Armory::$armoryconfig['skipBanned'] == false ? ' checked="checked"' : null; ?> /> Disabled
  60. <input type="radio" name="skipBanned" value="1"<?php echo Armory::$armoryconfig['skipBanned'] == true ? ' checked="checked"' : null; ?> /> Enabled
  61. <label>Default locale:</label>
  62. <select name="defaultLocale">
  63. <option value="en_gb"<?php echo Armory::$armoryconfig['defaultLocale'] == 'en_gb' ? ' selected' : null; ?>>English (EU)</option>
  64. <option value="en_us"<?php echo Armory::$armoryconfig['defaultLocale'] == 'en_us' ? ' selected' : null; ?>>English (US)</option>
  65. <option value="de_de"<?php echo Armory::$armoryconfig['defaultLocale'] == 'de_de' ? ' selected' : null; ?>>German</option>
  66. <option value="es_es"<?php echo Armory::$armoryconfig['defaultLocale'] == 'es_es' ? ' selected' : null; ?>>Spanish</option>
  67. <option value="fr_fr"<?php echo Armory::$armoryconfig['defaultLocale'] == 'fr_fr' ? ' selected' : null; ?>>French</option>
  68. <option value="ru_ru"<?php echo Armory::$armoryconfig['defaultLocale'] == 'ru_ru' ? ' selected' : null; ?>>Russian</option>
  69. </select>
  70. <label>Disable site (maintenance)?</label>
  71. <input type="radio" name="maintenance" value="1"<?php echo Armory::$armoryconfig['maintenance'] == true ? ' checked' : null; ?> /> Yes
  72. <input type="radio" name="maintenance" value="0"<?php echo Armory::$armoryconfig['maintenance'] == false ? ' checked' : null; ?> /> No
  73. <label>Debug log feature:</label>
  74. <input type="radio" name="useDebug" value="1"<?php echo Armory::$armoryconfig['useDebug'] == true ? ' checked' : null; ?> /> Enabled
  75. <input type="radio" name="useDebug" value="0"<?php echo Armory::$armoryconfig['useDebug'] == false ? ' checked' : null; ?> /> Disabled
  76. <label>Debug log level:</label>
  77. <select name="logLevel">
  78. <option value="3"<?php echo Armory::$armoryconfig['logLevel'] == 3 ? ' selected' : null; ?>>Debug + SQL + Errors</option>
  79. <option value="2"<?php echo Armory::$armoryconfig['logLevel'] == 2 ? ' selected' : null; ?>>Debug + Errors</option>
  80. <option value="1"<?php echo Armory::$armoryconfig['logLevel'] == 1 ? ' selected' : null; ?>>Errors only</option>
  81. </select>
  82. <label>How to report about version errors?</label>
  83. <select name="checkVersionType">
  84. <option value="show"<?php echo Armory::$armoryconfig['checkVersionType'] == 'show' ? ' selected' : null; ?>>Display all errors and halt script (Recommended)</option>
  85. <option value="log"<?php echo Armory::$armoryconfig['checkVersionType'] == 'log' ? ' selected' : null; ?>>Write errors to log and continue script work</option>
  86. </select>
  87. <br />
  88. <label><span style="color: red;">Realms configuration</span></label>
  89. <?php
  90. foreach(Armory::$realmData as $realm_info) {
  91. echo sprintf('<label><span style="color: red;">Realm #%d</span></label>
  92. <label>ID:</label>
  93. <input type="text" name="realmid_%d" value="%d" />
  94. <label>Name:</label>
  95. <input type="text" name="realmname_%d" value="%s" />
  96. <label>Type:</label>
  97. <select name="realmtype_%d">
  98. <option value="1"%s>MaNGOS</option>
  99. <option value="2"%s>Trinity Core</option>
  100. </select>
  101. <label>Characters DB info (in "host;user;password;name;charset" format):</label>
  102. <input type="text" name="realmchars_%d" value="%s" size="50" />
  103. <label>World DB info (in "host;user;password;name;charset" format):</label>
  104. <input type="text" name="realmworld_%d" value="%s" size="50" />
  105. <br />
  106. <!--
  107. TODO
  108. <a href="?action=config&subaction=removeRealm&id=%d">Remove realm "%s"</a>
  109. <br />
  110. -->', $realm_info['id'],
  111. $realm_info['id'], $realm_info['id'],
  112. $realm_info['id'], $realm_info['name'],
  113. $realm_info['id'], $realm_info['type'] == SERVER_MANGOS ? ' selected' : null, $realm_info['type'] == SERVER_TRINITY ? ' selected' : null,
  114. $realm_info['id'], sprintf('%s;%s;%s;%s;%s', $realm_info['host_characters'], $realm_info['user_characters'], $realm_info['pass_characters'], $realm_info['name_characters'], $realm_info['charset_characters']),
  115. $realm_info['id'], sprintf('%s;%s;%s;%s;%s', $realm_info['host_world'], $realm_info['user_world'], $realm_info['pass_world'], $realm_info['name_world'], $realm_info['charset_world']),
  116. $realm_info['id'], $realm_info['name']
  117. );
  118. }
  119. ?>
  120. <br />
  121. <input type="submit" name="subm" value="Submit" />
  122. </form>
  123. <div class="clear"></div><br />
  124. </div>
  125. <div class="clear"> </div>
  126. <!-- END CONTENT-->