cms.document.php 626 B

123456789101112131415161718192021222324252627
  1. <?php
  2. if (core::ifPost("from") AND core::getPost("from") == "document") {
  3. if(core::getPost("id") == "add"){
  4. $add = document::add();
  5. if($add != FALSE) {
  6. session::resetTemp();
  7. $location = "/document-". $add .".html";
  8. } else {
  9. $location = "/add-document.html";
  10. }
  11. } else {
  12. document::update();
  13. $location = "/document-". core::getPost("id") .".html";
  14. }
  15. json::create("documents");
  16. document::cleanOrphanTags();
  17. header("Location: " . $location);
  18. exit();
  19. } else {
  20. header('HTTP/1.0 401 Unauthorized');
  21. exit();
  22. }