admin.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. /**
  3. * Elgg pageshell for the admin area
  4. *
  5. * @package Elgg
  6. * @subpackage Core
  7. *
  8. * @uses $vars['head'] Parameters for the <head> element
  9. * @uses $vars['body'] The main content of the page
  10. * @uses $vars['sysmessages'] A 2d array of various message registers, passed from system_messages()
  11. */
  12. // render content before head so that JavaScript and CSS can be loaded. See #4032
  13. $notices_html = '';
  14. $notices = elgg_get_admin_notices();
  15. if ($notices) {
  16. foreach ($notices as $notice) {
  17. $notices_html .= elgg_view_entity($notice);
  18. }
  19. $notices_html = "<div class=\"elgg-admin-notices\">$notices_html</div>";
  20. }
  21. $header = elgg_view('admin/header', $vars);
  22. $messages = elgg_view('page/elements/messages', array('object' => $vars['sysmessages']));
  23. $messages .= $notices_html;
  24. $content = $vars["body"];
  25. $footer = elgg_view('admin/footer', $vars);
  26. $body = <<<__BODY
  27. <div class="elgg-page elgg-page-admin">
  28. <div class="elgg-inner">
  29. <div class="elgg-page-header">
  30. <div class="elgg-inner clearfix">
  31. $header
  32. </div>
  33. </div>
  34. <div class="elgg-page-messages">
  35. $messages
  36. </div>
  37. <div class="elgg-page-body">
  38. <div class="elgg-inner">
  39. $content
  40. </div>
  41. </div>
  42. <div class="elgg-page-footer">
  43. <div class="elgg-inner">
  44. $footer
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. __BODY;
  50. $body .= elgg_view('page/elements/foot');
  51. $head = elgg_view('page/elements/head', $vars['head']);
  52. echo elgg_view("page/elements/html", array("head" => $head, "body" => $body));