aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/elgglib.php2
-rw-r--r--engine/lib/views.php23
2 files changed, 25 insertions, 0 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php
index 7dd485227..e65af1cbd 100644
--- a/engine/lib/elgglib.php
+++ b/engine/lib/elgglib.php
@@ -150,6 +150,8 @@ function elgg_register_external_file($type, $url, $id, $location) {
return false;
}
+ $url = elgg_format_url($url);
+
if (!isset($CONFIG->externals)) {
$CONFIG->externals = array();
}
diff --git a/engine/lib/views.php b/engine/lib/views.php
index c70489117..9d10862ee 100644
--- a/engine/lib/views.php
+++ b/engine/lib/views.php
@@ -1345,6 +1345,22 @@ function elgg_is_valid_view_type($view_type) {
return in_array($view_type, $CONFIG->view_types);
}
+/**
+ * Add the core Elgg head elements that could be cached
+ */
+function elgg_views_register_core_head_elements() {
+ global $CONFIG;
+
+ $base = elgg_get_site_url();
+ $lastcache = $CONFIG->lastcache;
+ $viewtype = elgg_get_viewtype();
+
+ $url = "{$base}_css/js.php?lastcache=$lastcache&js=initialise_elgg&viewtype=$viewtype";
+ elgg_register_js($url, 'initialise_elgg');
+
+ $url = "{$base}_css/css.css?lastcache=$lastcache&viewtype=$viewtype";
+ elgg_register_css($url, 'elgg');
+}
/**
* Initialize viewtypes on system boot event
@@ -1361,6 +1377,13 @@ function elgg_views_boot() {
elgg_view_register_simplecache('js/friendsPickerv1');
elgg_view_register_simplecache('js/initialise_elgg');
+ $base = elgg_get_site_url();
+ elgg_register_js("{$base}vendors/jquery/jquery-1.4.2.min.js", 'jquery');
+ elgg_register_js("{$base}vendors/jquery/jquery-ui-1.7.2.min.js", 'jquery-ui');
+ elgg_register_js("{$base}vendors/jquery/jquery.form.js", 'jquery.form');
+
+ register_elgg_event_handler('pagesetup', 'system', 'elgg_views_register_core_head_elements');
+
// discover the built-in view types
// @todo cache this
$view_path = $CONFIG->viewpath;