A tumblelog CMS built on AJAX, PHP and MySQL.

options.php 4.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <?php
  2. /* ===========================
  3. gelato CMS - A PHP based tumblelog CMS
  4. development version
  5. http://www.gelatocms.com/
  6. gelato CMS is a free software licensed under GPL (General public license)
  7. =========================== */
  8. ?>
  9. <?php
  10. require_once('../config.php');
  11. include("../classes/functions.php");
  12. include("../classes/user.class.php");
  13. include("../classes/gelato.class.php");
  14. require_once("../classes/configuration.class.php");
  15. $user = new user();
  16. $tumble = new gelato();
  17. $conf = new configuration();
  18. if ($user->isAdmin()) {
  19. if(isset($_POST["btnsubmit"])) {
  20. unset($_POST["btnsubmit"]);
  21. $tumble->saveOption($_POST["rich_text"], "rich_text");
  22. $tumble->saveOption($_POST["urlFriendly"], "rich_text");
  23. } else {
  24. ?>
  25. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  26. <html xmlns="http://www.w3.org/1999/xhtml">
  27. <head>
  28. <title>gelato :: options</title>
  29. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  30. <meta name="generator" content="gelato cms <?php echo version();?>" />
  31. <link rel="shortcut icon" href="<?php echo $conf->urlGelato;?>/images/favicon.ico" />
  32. <script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato;?>/admin/scripts/mootools.js"></script>
  33. <script type="text/javascript">
  34. <!--
  35. window.onload = function() {
  36. contenedor = new Fx.Style('divMessages', 'opacity', {duration: 5000, onComplete:
  37. function() {
  38. document.getElementById('divMessages').style.display="none";
  39. }
  40. });
  41. contenedor.custom(1,0);
  42. }
  43. -->
  44. </script>
  45. <style type="text/css" media="screen">
  46. @import "<?php echo $conf->urlGelato;?>/admin/css/style.css";
  47. </style>
  48. </head>
  49. <body>
  50. <div id="div-process" style="display:none;">Processing request...</div>
  51. <div id="cont">
  52. <div id="head">
  53. <h1><a href="<?php echo $conf->urlGelato;?>/" title="gelato :: home">gelato cms</a></h1>
  54. <ul id="nav">
  55. <li><a href="<?php echo $conf->urlGelato;?>/" title="Take me to the tumblelog">Back to the Tumblelog</a></li>
  56. </ul>
  57. </div>
  58. <div id="main">
  59. <div class="box">
  60. <ul class="menu manage">
  61. <h3>Tumblelog options</h3>
  62. <li><a href="index.php">Post</a></li>
  63. <li><a href="admin.php">Users</a></li>
  64. <li><a href="settings.php">Settings</a></li>
  65. <li class="selected"><a>Options</a></li>
  66. </ul>
  67. <p>&nbsp;</p>
  68. <?php
  69. if (isset($_GET["modified"])) {
  70. if ($_GET["modified"]=="true") {
  71. echo "<div class=\"exito\" id=\"divMessages\">The configuration has been modified successfully.</div>";
  72. }
  73. }
  74. if (isset($_GET["error"])) {
  75. if ($_GET["error"]==1) {
  76. echo "<div class=\"error\" id=\"divMessages\"><strong>Error on the database server: </strong>".$_GET["des"]."</div>";
  77. }
  78. }
  79. ?>
  80. <div class="tabla">
  81. <form action="options.php" method="post" id="options_form" autocomplete="off" class="newpost">
  82. <fieldset>
  83. <ul>
  84. <li><label for="rich_text">Rich text editor:</label>
  85. <select name="rich_text" id="rich_text">
  86. <option value="1" <?php if($conf->richText) echo "selected"; ?>>Active</option>
  87. <option value="0" <?php if(!$conf->richText) echo "selected"; ?>>Deactive</option>
  88. </select>
  89. </li>
  90. <li><label for="rich_text">URL friendly:</label>
  91. <select name="url_friendly" id="url_friendly">
  92. <option value="1" <?php if($conf->urlFriendly) echo "selected"; ?>>Active</option>
  93. <option value="0" <?php if(!$conf->urlFriendly) echo "selected"; ?>>Deactive</option>
  94. </select>
  95. </li>
  96. </ul>
  97. </fieldset>
  98. <p>
  99. <input type="submit" name="btnsubmit" id="btnsubmit" value="Modify" class="submit"/>
  100. </p>
  101. </form>
  102. </div>
  103. <div class="footer-box">&nbsp;</div>
  104. </div>
  105. </div>
  106. <div id="foot">
  107. <a href="http://www.gelatocms.com/" title="gelato CMS">gelato CMS</a> :: PHP/MySQL Tumblelog Content Management System.
  108. </div>
  109. </div>
  110. </body>
  111. </html>
  112. <?php
  113. }
  114. } else {
  115. header("Location: ".$conf->urlGelato."/login.php");
  116. }
  117. ?>