add log file support
[phinde.git] / www / www-header.php
index 60adacf2c5109051a002f005d992ae46b8be9710..070c391484e3967f317ad353b8c395fa9c442991 100644 (file)
@@ -12,13 +12,22 @@ $GLOBALS['twig'] = new \Twig_Environment(
 );
 $GLOBALS['twig']->addExtension(new \Twig_Extension_Debug());
 
+$twig->addFunction('ellipsis', new \Twig_Function_Function('\phinde\ellipsis'));
+function ellipsis($text, $maxlength)
+{
+    if (strlen($text) > $maxlength) {
+        $text = substr($text, 0, $maxlength - 1) . '…';
+    }
+    return $text;
+}
 
 function render($tplname, $vars = array(), $return = false)
 {
     if (!isset($vars['htmlhelper'])) {
         //$vars['htmlhelper'] = new HtmlHelper();
     }
-    $vars['apptitle'] = 'cweiske.de search';
+    $vars['apptitle'] = $GLOBALS['phinde']['apptitle'];
+    $vars['baseUrl'] = '/';
 
     $template = $GLOBALS['twig']->loadTemplate($tplname . '.htm');
     if ($return) {