BioTorrents.de’s version of Gazelle
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

edit.php 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. declare(strict_types = 1);
  3. if (!isset($_GET['id']) || !is_number($_GET['id'])) {
  4. error(404);
  5. }
  6. $ArticleID = (int) $_GET['id'];
  7. $Article = Wiki::get_article($ArticleID);
  8. list($Revision, $Title, $Body, $Read, $Edit, $Date, $Author) = array_shift($Article);
  9. if ($Edit > $LoggedUser['EffectiveClass']) {
  10. error('You do not have access to edit this article.');
  11. }
  12. View::show_header(
  13. 'Edit '.$Title,
  14. 'bbcode,vendor/easymde.min',
  15. 'vendor/easymde.min'
  16. );
  17. ?>
  18. <div>
  19. <div class="box pad">
  20. <form class="edit_form" name="wiki_article" action="wiki.php" method="post">
  21. <input type="hidden" name="action" value="edit" />
  22. <input type="hidden" name="auth"
  23. value="<?=$LoggedUser['AuthKey']?>" />
  24. <input type="hidden" name="id" value="<?=$ArticleID?>" />
  25. <input type="hidden" name="revision" value="<?=$Revision?>" />
  26. <div>
  27. <h3>Title</h3>
  28. <input type="text" name="title" size="92" maxlength="100"
  29. value="<?=$Title?>" />
  30. <h3>Body</h3>
  31. <?php
  32. $ReplyText = new TEXTAREA_PREVIEW(
  33. $Name = 'body',
  34. $ID = 'body',
  35. $Value = $Body,
  36. );
  37. if (check_perms('admin_manage_wiki')) { ?>
  38. <h3>Access</h3>
  39. <p>
  40. There are some situations in which the viewing
  41. or editing of an article should be restricted to a certain class.
  42. </p>
  43. <strong>Restrict read:</strong> <select name="minclassread"><?=class_list($Read)?></select>
  44. <strong>Restrict edit:</strong> <select name="minclassedit"><?=class_list($Edit)?></select>
  45. <?php } ?>
  46. <div style="text-align: center;">
  47. <input type="button" value="Preview"
  48. class="hidden button_preview_<?=$ReplyText->getID()?>"
  49. tabindex="1" />
  50. <input type="submit" class="button-primary" value="Submit" />
  51. </div>
  52. </div>
  53. </form>
  54. </div>
  55. </div>
  56. <?php View::show_footer();