default.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?php
  2. /**
  3. * Elgg pageshell
  4. * The standard HTML page shell that everything else fits into
  5. *
  6. * @package Elgg
  7. * @subpackage Core
  8. *
  9. * @uses $vars['head'] Parameters for the <head> element
  10. * @uses $vars['body_attrs'] Attributes of the <body> tag
  11. * @uses $vars['body'] The main content of the page
  12. * @uses $vars['sysmessages'] A 2d array of various message registers, passed from system_messages()
  13. */
  14. // backward compatability support for plugins that are not using the new approach
  15. // of routing through admin. See reportedcontent plugin for a simple example.
  16. if (elgg_get_context() == 'admin') {
  17. if (get_input('handler') != 'admin') {
  18. elgg_deprecated_notice("admin plugins should route through 'admin'.", 1.8);
  19. }
  20. _elgg_admin_add_plugin_settings_menu();
  21. elgg_unregister_css('elgg');
  22. echo elgg_view('page/admin', $vars);
  23. return true;
  24. }
  25. // render content before head so that JavaScript and CSS can be loaded. See #4032
  26. $messages = elgg_view('page/elements/messages', array('object' => $vars['sysmessages']));
  27. $header = elgg_view('page/elements/header', $vars);
  28. $navbar = elgg_view('page/elements/navbar', $vars);
  29. $content = elgg_view('page/elements/body', $vars);
  30. $footer = elgg_view('page/elements/footer', $vars);
  31. $body = <<<__BODY
  32. <div class="elgg-page elgg-page-default">
  33. <div class="elgg-page-messages">
  34. $messages
  35. </div>
  36. __BODY;
  37. $body .= elgg_view('page/elements/topbar_wrapper', $vars);
  38. $body .= <<<__BODY
  39. <div class="elgg-page-header">
  40. <div class="elgg-inner">
  41. $header
  42. </div>
  43. </div>
  44. <div class="elgg-page-navbar">
  45. <div class="elgg-inner">
  46. $navbar
  47. </div>
  48. </div>
  49. <div class="elgg-page-body">
  50. <div class="elgg-inner">
  51. $content
  52. </div>
  53. </div>
  54. <div class="elgg-page-footer">
  55. <div class="elgg-inner">
  56. $footer
  57. </div>
  58. </div>
  59. </div>
  60. __BODY;
  61. $body .= elgg_view('page/elements/foot');
  62. $head = elgg_view('page/elements/head', $vars['head']);
  63. $params = array(
  64. 'head' => $head,
  65. 'body' => $body,
  66. );
  67. if (isset($vars['body_attrs'])) {
  68. $params['body_attrs'] = $vars['body_attrs'];
  69. }
  70. echo elgg_view("page/elements/html", $params);