start.php 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <?php
  2. /**
  3. * Modbash Clean Elgg Theme
  4. *
  5. * Copyright (c) 2015 ModBash
  6. *
  7. * @author Shane Barron <admin@modbash.com>
  8. * @copyright 2015 SocialApparatus
  9. * @license GNU General Public License (GPL) version 2
  10. * @version 1
  11. * @link http://modbash.com
  12. */
  13. elgg_register_event_handler('init', 'system', 'lorea_hydra_init');
  14. function lorea_hydra_init() {
  15. elgg_unextend_view('page/elements/header', 'search/header');
  16. elgg_extend_view('page/elements/sidebar', 'search/header', 0);
  17. if (elgg_get_context() != "admin") {
  18. elgg_require_js("lorea_hydra/js");
  19. }
  20. elgg_register_event_handler('pagesetup', 'system', 'lorea_hydra_pagesetup', 1000);
  21. elgg_register_plugin_hook_handler('head', 'page', 'lorea_hydra_setup_head');
  22. $bower = elgg_get_site_url() . "mod/lorea_hydra/vendors/bower_components/";
  23. elgg_register_css("bootstrap", "{$bower}bootstrap/dist/css/bootstrap.css", 0);
  24. /** elgg_register_css("open", "https://fonts.googleapis.com/css?family=Open+Sans:400,700,700italic,400italic");
  25. elgg_register_css("passion", "https://fonts.googleapis.com/css?family=Passion+One");*/
  26. elgg_register_css("lorea_hydra", elgg_get_site_url() . "mod/lorea_hydra/css/lorea_hydra.css", 10000);
  27. elgg_register_css("font-awesome", "{$bower}fontawesome/css/font-awesome.min.css");
  28. elgg_register_css("bootstrap-select", "{$bower}bootstrap-select/dist/css/bootstrap-select.min.css");
  29. elgg_register_css("jasny", "{$bower}jasny-bootstrap/dist/css/jasny-bootstrap.min.css");
  30. elgg_register_css("fuelux", "{$bower}fuelux/dist/css/fuelux.min.css");
  31. elgg_register_css("agency", elgg_get_site_url() . "mod/lorea_hydra/css/agency.css", 20000);
  32. elgg_register_css("home", elgg_get_site_url() . "mod/lorea_hydra/css/home.css", 30000);
  33. elgg_register_js('respond', "{$bower}respond/src/respond.js");
  34. elgg_define_js("bootstrap", array("src" => "{$bower}bootstrap/dist/js/bootstrap.min.js"));
  35. elgg_register_js("bootstrap-select", "{$bower}bootstrap-select/dist/js/bootstrap-select.min.js");
  36. elgg_register_js("jasny", "{$bower}jasny-bootstrap/dist/js/jasny-bootstrap.min.js");
  37. elgg_register_js("agency", elgg_get_site_url() . "mod/lorea_hydra/js/agency.js");
  38. elgg_register_js("cbpAnimatedHeader", elgg_get_site_url() . "mod/lorea_hydra/js/cbpAnimatedHeader.js");
  39. elgg_register_js("classie", elgg_get_site_url() . "mod/lorea_hydra/js/classie.js");
  40. elgg_register_js("contact_me", elgg_get_site_url() . "mod/lorea_hydra/js/contact_me.js");
  41. elgg_register_js("scrollspy", "{$bower}scrollspy/jquery.scrollspy.js");
  42. elgg_register_js("parallax", "{$bower}jquery-parallax/scripts/jquery.parallax-1.13.js");
  43. elgg_register_js("scrollto", "{$bower}jquery.scrollTo/jquery.scrollTo.min.js");
  44. elgg_define_js('fuelux', array(
  45. 'src' => "{$bower}fuelux/dist/js/fuelux.min.js",
  46. ));
  47. if (elgg_get_context() != "admin") {
  48. elgg_load_js('respond');
  49. elgg_load_js("bootstrap");
  50. elgg_load_js("jscolor");
  51. elgg_load_js("lorea_hydra");
  52. elgg_load_js("bootstrap-select");
  53. elgg_load_js("jasny");
  54. //elgg_load_js("agency");
  55. //elgg_load_js("parallax");
  56. //elgg_load_js("scrollto");
  57. elgg_require_js("fuelux");
  58. elgg_load_css("bootstrap");
  59. elgg_load_css("open");
  60. elgg_load_css("passion");
  61. elgg_load_css("font-awesome");
  62. elgg_load_css("bootstrap-select");
  63. elgg_load_css("lorea_hydra");
  64. elgg_load_css("jasny");
  65. elgg_load_css("fuelux");
  66. //elgg_load_css("agency");
  67. }
  68. // non-members do not get visible links to RSS feeds
  69. if (!elgg_is_logged_in()) {
  70. elgg_unregister_plugin_hook_handler('output:before', 'layout', 'elgg_views_add_rss_link');
  71. }
  72. elgg_register_action("lorea_hydra/contact", elgg_get_plugins_path() . "lorea_hydra/actions/contact.php", "public");
  73. }
  74. /**
  75. * Rearrange menu items
  76. */
  77. function lorea_hydra_pagesetup() {
  78. elgg_unextend_view('page/elements/header', 'search/header');
  79. }
  80. /**
  81. * Register items for the html head
  82. *
  83. * @param string $hook Hook name ('head')
  84. * @param string $type Hook type ('page')
  85. * @param array $data Array of items for head
  86. * @return array
  87. */
  88. function lorea_hydra_setup_head($hook, $type, $data) {
  89. $data['metas'][] = array(
  90. 'name' => 'viewport',
  91. 'content' => 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0',
  92. );
  93. $data['links'][] = array(
  94. 'rel' => 'apple-touch-icon',
  95. 'href' => elgg_normalize_url('mod/lorea_hydra/graphics/homescreen.png'),
  96. );
  97. return $data;
  98. }