1 |
<?php |
2 |
/** |
3 |
* mageia.org global nav bar. |
4 |
* |
5 |
* PHP version 5.4 |
6 |
* |
7 |
* @category Mageia |
8 |
* @package Mageia\Web\nav |
9 |
* @author rda <rda@mageia.org> |
10 |
* @link http://nav.mageia.org/ |
11 |
* |
12 |
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU GPL v2+ |
13 |
* |
14 |
* This program is free software; you can redistribute it and/or modify it |
15 |
* under the terms of the GNU General Public License aspublished by the |
16 |
* Free Software Foundation; either version 2 of the License, or (at your |
17 |
* option) any later version. |
18 |
*/ |
19 |
|
20 |
$t0 = microtime(); |
21 |
|
22 |
/** Below variables are defined after the document variables. */ |
23 |
|
24 |
/** URL of the document calling the service. */ |
25 |
$url = isset($_GET['u']) ? trim($_GET['u']) : null; |
26 |
|
27 |
/** html[lang] of the doc. */ |
28 |
$lang = isset($_GET['l']) ? trim($_GET['l']) : null; |
29 |
if ($lang == 'undefined' || |
30 |
$lang == '') { |
31 |
|
32 |
$lang = 'en'; |
33 |
} |
34 |
|
35 |
/** body[class] of the doc. */ |
36 |
$body = isset($_GET['b']) ? trim($_GET['b']) : null; |
37 |
|
38 |
/** meta[name=context] */ |
39 |
$context = isset($_GET['c']) ? trim($_GET['c']) : null; |
40 |
|
41 |
/** wrap the returned HTML in <header id="hmgn" />? */ |
42 |
$wrap = isset($_GET['w']) ? true : false; |
43 |
|
44 |
require 'conf.php'; |
45 |
include '../lib.php'; |
46 |
|
47 |
header('Access-Control-Allow-Origin: *'); |
48 |
header('Access-Control-Allow-Methods: GET'); |
49 |
header('Content-Type: text/html;charset=utf-8'); |
50 |
header(sprintf('Expires: %s', gmdate('r', strtotime('+1 day')))); |
51 |
|
52 |
echo _mgnav_html($wrap, $lang, null, $www_host, NCache::build($cache_path)); |
53 |
|
54 |
apache_note('navMakeTime', number_format(microtime() - $t0, 6)); |