aboutsummaryrefslogtreecommitdiff
path: root/_css/js.php
blob: 41b7901f994bb93c206513046126f40a03e1b2de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
/**
 * Outputs a JS view.
 *
 * There are 2 main JS views used in elgg:
 * 	js/initialise_elgg
 * 	js/friendsPickerv1
 *
 * The location of the files used to generate these view can change based upon
 * current viewtype and plugins enabled.  By default the viewtype is
 * 'default' (HTML) and the view files are in views/default/js/.  Plugins can
 * override or extend these views.
 *
 * These 2 main JS views are cached via simplecache.
 *
 * @see views/default/js/initialise_elgg.php
 * @see views/default/js/friendsPickerv1.php
 * @see simplecache/view.php
 * @see elgg_extend_view()
 *
 * @uses $_GET['viewtype'] The current viewtype.  Determines where to look for the
 * JS view files.
 * @uses $_GET['view'] The view to output, relative to the view js/
 * @uses $override A global that tells simplecache to ignore caching.
 *
 * @package Elgg
 * @subpackage Core
 */

global $viewinput, $override;

$viewinput['view'] = 'js/' . $_GET['js'];
$viewinput['viewtype'] = $_GET['viewtype'];

header('Content-type: text/javascript');
header('Expires: ' . date('r', time() + 864000000));
header("Pragma: public");
header("Cache-Control: public");

require_once(dirname(dirname(__FILE__)) . '/simplecache/view.php');