phpDocumentor koliportal
[ class tree: koliportal ] [ index: koliportal ] [ all elements ]

Source for file page.config.php

Documentation is available at page.config.php

  1. <?php
  2. /** Beállítások változtatása
  3. *
  4. * Itt lehet változtatni a variables tábla tartalmát.
  5. *
  6. * @package koliportal
  7. */
  8. $yesno = array("yes" => "yes", "no" => "no");
  9. if (isset($_POST["edit_config"]) && ("edit_config" == $_POST["edit_config"]))
  10. {
  11. if (isset($_POST["login_allowed"]) && isset($yesno[$_POST["login_allowed"]]))
  12. {
  13. variable_set("login_allowed", $_POST["login_allowed"]);
  14. }
  15. if (isset($_POST["edit_wishes_allowed"]) && isset($yesno[$_POST["edit_wishes_allowed"]]))
  16. {
  17. variable_set("edit_wishes_allowed", $_POST["edit_wishes_allowed"]);
  18. }
  19. }
  20. /** Egy változó beállátásához szükséges xhtml elemek kiírása
  21. *
  22. * @param string $vname a változó neve
  23. * @param string $page_action A form elküldéséhez az action GET változó értéke
  24. */
  25. function config_variable_yesno($vname, $page_action)
  26. {
  27. $value = variable_get($vname);
  28. $info = variable_info_get($vname);
  29. if ((false === $value) || (false === $info))
  30. {
  31. return false;
  32. }
  33. $select_fields = '';
  34. foreach (array("yes" => "igen", "no" => "nem") as $a => $n)
  35. {
  36. $select_fields .= sprintf('<option value="%s"%s>%s</option>%s',
  37. $a, is_selected($value == $a), $n, "\n");
  38. }
  39. ?>
  40. <tr>
  41. <td><?= $vname ?></td>
  42. <td><?= $info["tname"] ?>,<br />
  43. <?= $info["description"] ?></td>
  44. </td>
  45. <form action="<?= $_SERVER["PHP_SELF"] ?>?action=<?= $page_action ?>" method="post">
  46. <input type="hidden" name="edit_config" value="edit_config">
  47. <td>
  48. <select name="<?= $vname ?>">
  49. <?= $select_fields ?>
  50. </select>
  51. </td>
  52. <td>
  53. <input type="submit" value="Módosít">
  54. </td>
  55. </form>
  56. </tr>
  57. <?php
  58. }
  59. ?>
  60. <table border="1" alt="beállítások">
  61. <tr>
  62. <th>azonosító</th>
  63. <th>Változó neve, leírása</th>
  64. <th>Értéke</th>
  65. <th>funkciók</th>
  66. <tr>
  67.  
  68.  
  69. <?php
  70. config_variable_yesno("login_allowed", $action);
  71. config_variable_yesno("edit_wishes_allowed", $action);
  72.  
  73. ?>
  74.  
  75. </table>

Documentation generated on Wed, 18 May 2005 19:24:41 +0200 by phpDocumentor 1.3.0RC3