diff options
Diffstat (limited to 'views/default')
-rw-r--r-- | views/default/css/admin.php | 2 | ||||
-rw-r--r-- | views/default/css/elements/navigation.php | 2 | ||||
-rw-r--r-- | views/default/js/languages.php | 24 |
3 files changed, 23 insertions, 5 deletions
diff --git a/views/default/css/admin.php b/views/default/css/admin.php index ceeac71a2..8197f29de 100644 --- a/views/default/css/admin.php +++ b/views/default/css/admin.php @@ -1003,7 +1003,7 @@ a.elgg-button { ENTITY MENU *************************************** */ <?php // height depends on line height/font size ?> -.elgg-menu-entity, elgg-menu-annotation { +.elgg-menu-entity, .elgg-menu-annotation { float: right; margin-left: 15px; font-size: 90%; diff --git a/views/default/css/elements/navigation.php b/views/default/css/elements/navigation.php index 49e36e494..6b29e4c19 100644 --- a/views/default/css/elements/navigation.php +++ b/views/default/css/elements/navigation.php @@ -450,7 +450,7 @@ ENTITY AND ANNOTATION *************************************** */ <?php // height depends on line height/font size ?> -.elgg-menu-entity, elgg-menu-annotation { +.elgg-menu-entity, .elgg-menu-annotation { float: right; margin-left: 15px; font-size: 90%; diff --git a/views/default/js/languages.php b/views/default/js/languages.php index c51d7bcb2..fcf903d4b 100644 --- a/views/default/js/languages.php +++ b/views/default/js/languages.php @@ -1,15 +1,33 @@ <?php /** * @uses $vars['language'] + * @uses $vars['lc'] if present, client will be sent long expires headers */ -global $CONFIG; $language = $vars['language']; +$lastcache = elgg_extract('lc', $vars, 0); -$translations = $CONFIG->translations['en']; +// @todo add server-side caching +if ($lastcache) { + // we're relying on lastcache changes to predict language changes + $etag = '"' . md5("$language|$lastcache") . '"'; + + header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', strtotime("+6 months")), true); + header("Pragma: public", true); + header("Cache-Control: public", true); + header("ETag: $etag"); + + if (isset($_SERVER['HTTP_IF_NONE_MATCH']) && trim($_SERVER['HTTP_IF_NONE_MATCH']) === $etag) { + header("HTTP/1.1 304 Not Modified"); + exit; + } +} + +$all_translations = elgg_get_config('translations'); +$translations = $all_translations['en']; if ($language != 'en') { - $translations = array_merge($translations, $CONFIG->translations[$language]); + $translations = array_merge($translations, $all_translations[$language]); } echo json_encode($translations);
\ No newline at end of file |