settings.inc 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <p class="title">
  2. General settings:
  3. </p>
  4. <hr />
  5. <form id="mainConfig" method="post" action="index.php">
  6. <input type="hidden" name="conf_change_type" value="main" />
  7. <table>
  8. <?php
  9. $conf = $conf_obj->get('main');
  10. $model = $conf_obj->get_config_model('main');
  11. $line = '';
  12. # For now there's no use to the 'form_field' setting, as main only uses select, user only inputs
  13. foreach ( $model as $key => $item ) {
  14. $line .= '<tr>';
  15. $line .= '<td><label for="' . $key . '">' . $item['label'] . '</label></td>';
  16. $line .= '<td><select name="' . $key . '" id="' . $key . '">';
  17. foreach ( $item['select_opts'] as $option ) {
  18. $line .= '<option value="' . $option . '">' . $option . '</option>';
  19. }
  20. $line .= '</select></td></tr>';
  21. }
  22. echo "$line\n";
  23. ?>
  24. </table>
  25. <br />
  26. <input type="submit" value="Commit Changes" />
  27. </form>
  28. <hr />
  29. <p class="title">
  30. User management:
  31. </p>
  32. <hr />
  33. <form id="userConfig" method="post" action="index.php">
  34. <input type="hidden" name="conf_change_type" value="user" />
  35. <table>
  36. <?php
  37. $conf = $conf_obj->get('users');
  38. $model = $conf_obj->get_config_model('users');
  39. $line = '';
  40. foreach ( $conf as $user => $data ) {
  41. $line .= "<tr><td colspan=2><em>Manage user '$user'</em></td></tr>";
  42. foreach ( $model as $key => $item ) {
  43. $line .= '<tr><td><label for="' . $key . '">' . $item['label'] . '</label></td>';
  44. $val = "";
  45. if( array_key_exists( $key, $data ) ) {
  46. $val = $data[$key];
  47. } else if( array_key_exists( 'masks', $item ) && $item['masks'] == 'parent' ) {
  48. $val = $user;
  49. }
  50. $line .= '<td><input name="' . $key . '" id="' . $key . '" type="' . $item['field_type'] . '" placeholder="' . $item['placeholder'] . '" value="' . $val . '" /></td></tr>';
  51. }
  52. }
  53. echo "$line\n";
  54. ?>
  55. </table>
  56. <br />
  57. <input type="submit" value="Commit Changes" />
  58. </form>
  59. <br />
  60. <p class="title">
  61. Add User:
  62. </p>
  63. <form id="addUser" method="post" action="index.php">
  64. <input type="hidden" name="conf_change_type" value="user" />
  65. <table>
  66. <?php
  67. $line = '';
  68. foreach ( $model as $key => $item ) {
  69. $line .= '<td><label for="' . $key . '">' . $item['label'] . '</label></td>';
  70. $line .= '<td><input name="' . $key . '" id="' . $key . '" type="' . $item['field_type'] . '" placeholder="' . $item['placeholder'] . '" value="" /></td></tr>';
  71. }
  72. echo "$line\n";
  73. ?>
  74. </table>
  75. <br />
  76. <input type="submit" value="Commit Changes" />
  77. </form>
  78. <hr />
  79. <p class="title">
  80. Theme cloner:
  81. </p>
  82. <hr />
  83. <p>
  84. Want to write your own theme?
  85. Clone a theme here then see the <a href="https://tcms.troglodyne.net/index.php?nav=5&post=fileshare/manual/Chapter 03-Customization.post" title="GET UR MIND RITE">styling guide</a>
  86. for information on how tCMS' templates, image sets and CSS work in the theming system.
  87. </p>
  88. INSERT FORM HERE