Subversion Repositories LCARS

Rev

Rev 141 | Rev 152 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

1
<?php

$encoding = 'UTF-8';
header("Content-Type: text/html" . ($encoding ? "; charset=$encoding" : ""));

$modi = max(array(
  @filemtime(__FILE__),
  @filemtime('LocaleData'),
  @filemtime('index.phtml'),
  @filemtime('styles/lcars-basic.css'),
  @filemtime('styles/lcars22.css'),
  @filemtime('styles/lcars-ani.css'),
  @filemtime('scripts/object.js'),
));

header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $modi) . ' GMT');

/* Cached resource expires in HTTP/1.1 caches 24h after last retrieval */
header('Cache-Control: max-age=86400, s-maxage=86400, must-revalidate, proxy-revalidate');

/* Cached resource expires in HTTP/1.0 caches 24h after last retrieval */
header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 86400) . ' GMT');

$languages = array(
  'en' => 'English',
  'de' => 'Deutsch'
);

/* TODO: Use Autoloader */
require_once 'Zend/Stdlib/ErrorHandler.php';
require_once 'Zend/I18n/Translator/TextDomain.php';
require_once 'Zend/I18n/Translator/Loader/FileLoaderInterface.php';
require_once 'Zend/I18n/Translator/Loader/Gettext.php';
require_once 'Zend/ServiceManager/ServiceLocatorAwareInterface.php';
require_once 'Zend/ServiceManager/ServiceLocatorInterface.php';
require_once 'Zend/ServiceManager/ServiceManager.php';
require_once 'Zend/ServiceManager/AbstractPluginManager.php';
require_once 'Zend/I18n/Translator/LoaderPluginManager.php';
require_once 'Zend/I18n/Translator/Translator.php';
 
$translator = new Zend\I18n\Translator\Translator();
$type = 'gettext';
$baseDir = './LocaleData';
$pattern = '%s/LC_MESSAGES/%1$s.pointedears.mo';
$textDomain = 'de.pointedears';
$translator->addTranslationFilePattern($type, $baseDir, $pattern, $textDomain);

/**
 * Returns the translation of the parameter, if any,
 * using Zend Framework 2.1 Translate
 * @param string $s
 * @return string
 */

function tr ($s)
{
  global $translator;
  global $textDomain;
  global $language;
 
  if ($translator)
  {
    return $translator->translate($s, $textDomain, $language);
  }

  return $s;
}

$menu = array(
  'scripts'   => array('path' => 'scripts/', 'text' => 'Scripting'),
  'es-matrix' => array(
    'path'  => 'es-matrix',
    'text'  => 'ES Matrix',
    'title' => 'ECMAScript Support Matrix: ' . tr("A comparison of features of ECMAScript implementations")
  ),
  'devel'     => array('path' => 'devel/',   'text' => tr('Other software')),
  'series'    => array('path' => "media/video/series/", 'text' => 'Seri-o-meter'),
  'ufpdb'     => array(
    'path'  => "ufpdb/index.$language",
    'text'  => 'UFPDB',
    'title' => tr('United Federation of Planets DataBase')
  )
);