layoutadd.php 791 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * Addon for page meta information
  4. */
  5. namespace PHPPE\AddOn;
  6. use PHPPE\Core;
  7. use PHPPE\View;
  8. use PHPPE\Views;
  9. // L("layoutadd")
  10. class layoutadd extends \PHPPE\AddOn
  11. {
  12. public $heightClass = "infobox";
  13. function edit()
  14. {
  15. $quickhelp=!Core::lib("CMS")->expert;
  16. View::assign("quickhelp",$quickhelp);
  17. return View::template("cms_layoutadd");
  18. }
  19. function save($params)
  20. {
  21. $v = new Views();
  22. $v->id = $params['layoutid'];
  23. $v->name = $params['layoutname'];
  24. try {
  25. if($v->save(true)){
  26. die("<script>top.document.location.href='".url("cms/layouts/".$params['layoutid'])."';</script>");
  27. }
  28. }catch(\Exception $e){
  29. Core::error($e->getMessage());
  30. }
  31. }
  32. }
  33. ?>