Subversion Repositories LCARS

Rev

Rev 156 | Rev 189 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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