Subversion Repositories LCARS

Rev

Rev 154 | Rev 170 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
63 PointedEar 1
<?php
2
 
3
$encoding = 'UTF-8';
4
header("Content-Type: text/html" . ($encoding ? "; charset=$encoding" : ""));
5
 
6
$modi = max(array(
7
  @filemtime(__FILE__),
106 PointedEar 8
  @filemtime('LocaleData'),
63 PointedEar 9
  @filemtime('index.phtml'),
156 PointedEar 10
  @filemtime('footer.phtml'),
106 PointedEar 11
  @filemtime('styles/lcars-basic.css'),
12
  @filemtime('styles/lcars22.css'),
13
  @filemtime('styles/lcars-ani.css'),
14
  @filemtime('scripts/object.js'),
63 PointedEar 15
));
16
 
17
header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $modi) . ' GMT');
18
 
19
/* Cached resource expires in HTTP/1.1 caches 24h after last retrieval */
117 PointedEar 20
header('Cache-Control: max-age=86400, s-maxage=86400, must-revalidate, proxy-revalidate');
63 PointedEar 21
 
22
/* Cached resource expires in HTTP/1.0 caches 24h after last retrieval */
117 PointedEar 23
header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 86400) . ' GMT');
63 PointedEar 24
 
25
$languages = array(
26
  'en' => 'English',
27
  'de' => 'Deutsch'
28
);
29
 
154 PointedEar 30
require_once 'Zend/Loader/StandardAutoloader.php';
31
$loader = new Zend\Loader\StandardAutoloader(array('autoregister_zf' => true));
32
$loader->register();
33
 
151 PointedEar 34
$translator = new Zend\I18n\Translator\Translator();
154 PointedEar 35
// $translator->setCache(new Zend\Cache\Storage\*Adapter());
151 PointedEar 36
$type = 'gettext';
37
$baseDir = './LocaleData';
38
$pattern = '%s/LC_MESSAGES/%1$s.pointedears.mo';
137 PointedEar 39
$textDomain = 'de.pointedears';
151 PointedEar 40
$translator->addTranslationFilePattern($type, $baseDir, $pattern, $textDomain);
63 PointedEar 41
 
151 PointedEar 42
/**
43
 * Returns the translation of the parameter, if any,
44
 * using Zend Framework 2.1 Translate
156 PointedEar 45
 *
151 PointedEar 46
 * @param string $s
47
 * @return string
48
 */
49
function tr ($s)
141 PointedEar 50
{
151 PointedEar 51
  global $translator;
52
  global $textDomain;
53
  global $language;
141 PointedEar 54
 
156 PointedEar 55
  return $translator->translate($s, $textDomain, $language);
137 PointedEar 56
}
57
 
63 PointedEar 58
$menu = array(
71 PointedEar 59
  'scripts'   => array('path' => 'scripts/', 'text' => 'Scripting'),
60
  'es-matrix' => array(
61
    'path'  => 'es-matrix',
62
    'text'  => 'ES Matrix',
151 PointedEar 63
    'title' => 'ECMAScript Support Matrix: ' . tr("A comparison of features of ECMAScript implementations")
71 PointedEar 64
  ),
152 PointedEar 65
  'devel'     => array('path' => 'websvn/',   'text' => tr('Software projects')),
71 PointedEar 66
  'series'    => array('path' => "media/video/series/", 'text' => 'Seri-o-meter'),
67
  'ufpdb'     => array(
63 PointedEar 68
    'path'  => "ufpdb/index.$language",
69
    'text'  => 'UFPDB',
151 PointedEar 70
    'title' => tr('United Federation of Planets DataBase')
63 PointedEar 71
  )
140 PointedEar 72
);