default.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. $content = elgg_view('page/elements/body', $vars);
  29. $footer = elgg_view('page/elements/footer', $vars);
  30. $body = <<<__BODY
  31. <div class="elgg-page elgg-page-default">
  32. <div class="elgg-page-messages">
  33. $messages
  34. </div>
  35. __BODY;
  36. $body .= elgg_view('page/elements/topbar_wrapper', $vars);
  37. $body .= <<<__BODY
  38. <div class="elgg-page-header">
  39. <div class="elgg-inner">
  40. $header
  41. </div>
  42. </div>
  43. <div class="elgg-page-body">
  44. <div class="elgg-inner">
  45. $content
  46. </div>
  47. </div>
  48. <div class="elgg-page-footer">
  49. <div class="elgg-inner">
  50. $footer
  51. </div>
  52. </div>
  53. </div>
  54. __BODY;
  55. $body .= elgg_view('page/elements/foot');
  56. $head = elgg_view('page/elements/head', $vars['head']);
  57. $params = array(
  58. 'head' => $head,
  59. 'body' => $body,
  60. );
  61. if (isset($vars['body_attrs'])) {
  62. $params['body_attrs'] = $vars['body_attrs'];
  63. }
  64. echo elgg_view("page/elements/html", $params);