diff options
author | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-10-06 12:37:31 +0000 |
---|---|---|
committer | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-10-06 12:37:31 +0000 |
commit | 811215c4855d6698324e33f981db8d9a7eb8db46 (patch) | |
tree | a9f86990466b0a886b2016ebe5a65a3235c4c00b /engine | |
parent | 8662654b40694c2e5e91414a8537beabdf4b470f (diff) | |
download | elgg-811215c4855d6698324e33f981db8d9a7eb8db46.tar.gz elgg-811215c4855d6698324e33f981db8d9a7eb8db46.tar.bz2 |
Elgg Javascript now goes through the views system
git-svn-id: https://code.elgg.org/elgg/trunk@2185 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine')
-rw-r--r-- | engine/lib/elgglib.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index 0d2b1e073..17766053c 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -1827,6 +1827,18 @@ }
+ function js_page_handler($page) {
+
+ if (is_array($page) && sizeof($page)) {
+ header('Content-type: text/javascript');
+ $js = str_replace('.js','',$page[0]);
+ echo elgg_view('js/' . $js);
+
+ exit;
+ }
+
+ }
+
function elgg_init() {
// Important actions
register_action('comments/add');
@@ -1834,6 +1846,8 @@ // Menu
global $CONFIG;
add_menu(elgg_echo('content:latest'), $CONFIG->wwwroot . 'dashboard/latest.php');
+ // Page handler for JS
+ register_page_handler('js','js_page_handler');
}
register_elgg_event_handler('init','system','elgg_init'); |