settings.inc 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. foreach ( $model as $key => $item ) {
  13. $line .= '<tr>';
  14. $line .= '<td><label for="' . $key . '">' . $item['label'] . '</label></td>';
  15. if($item['form_field'] == 'select') {
  16. $line .= '<td><select class="cooltext" name="' . $key . '" id="' . $key . '">';
  17. foreach ( $item['select_opts'] as $option ) {
  18. $line .= '<option value="' . $option . '">' . $option . '</option>';
  19. }
  20. $line .= '</select></td>';
  21. } elseif($item['form_field'] == 'input') {
  22. $line .= '<td><input type="text" class="cooltext" name="' . $key . '" id="' . $key . '" placeholder="'.$item['default'].'" />';
  23. }
  24. $line .= '</tr>';
  25. }
  26. echo "$line\n";
  27. ?>
  28. </table>
  29. <br />
  30. <input type="submit" class="coolbutton" value="Commit Changes" />
  31. </form>
  32. <hr />
  33. <p class="title">
  34. User management:
  35. </p>
  36. <hr />
  37. <form id="userConfig" method="post" action="index.php">
  38. <input type="hidden" name="conf_change_type" value="user" />
  39. <table>
  40. <?php
  41. $conf = $conf_obj->get('users');
  42. $model = $conf_obj->get_config_model('users');
  43. $line = '';
  44. foreach ( $conf as $user => $data ) {
  45. $line .= "<tr><td colspan=2><em>Manage user '$user'</em></td></tr>";
  46. foreach ( $model as $key => $item ) {
  47. $line .= '<tr><td><label for="' . $key . '">' . $item['label'] . '</label></td>';
  48. $val = "";
  49. if( array_key_exists( $key, $data ) ) {
  50. $val = $data[$key];
  51. } else if( array_key_exists( 'masks', $item ) && $item['masks'] == 'parent' ) {
  52. $val = $user;
  53. }
  54. $line .= '<td><input class="cooltext" name="' . $key . '" id="' . $key . '" type="' . $item['field_type'] . '" placeholder="' . $item['placeholder'] . '" value="' . $val . '" /></td></tr>';
  55. }
  56. }
  57. echo "$line\n";
  58. ?>
  59. </table>
  60. <br />
  61. <input type="submit" class="coolbutton" value="Commit Changes" />
  62. </form>
  63. <br />
  64. <p class="title">
  65. Add User:
  66. </p>
  67. <form id="addUser" method="post" action="index.php">
  68. <input type="hidden" name="conf_change_type" value="user" />
  69. <table>
  70. <?php
  71. $line = '';
  72. foreach ( $model as $key => $item ) {
  73. $line .= '<td><label for="' . $key . '">' . $item['label'] . '</label></td>';
  74. $line .= '<td><input class="cooltext" name="' . $key . '" id="' . $key . '" type="' . $item['field_type'] . '" placeholder="' . $item['placeholder'] . '" value="" /></td></tr>';
  75. }
  76. echo "$line\n";
  77. ?>
  78. </table>
  79. <br />
  80. <input type="submit" class="coolbutton" value="Commit Changes" />
  81. </form>
  82. <hr />
  83. <p class="title">
  84. Theme cloner:
  85. </p>
  86. <hr />
  87. <p>
  88. Want to write your own theme?
  89. 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>
  90. for information on how tCMS' templates, image sets and CSS work in the theming system.
  91. </p>
  92. INSERT FORM HERE