A tumblelog CMS built on AJAX, PHP and MySQL.

options.php 4.3KB

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