git.cweiske.de
/
phinde.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Support web linking in rss feed (atom:link)
[phinde.git]
/
www
/
www-header.php
diff --git
a/www/www-header.php
b/www/www-header.php
index 60adacf2c5109051a002f005d992ae46b8be9710..e5cee94aa092e672fbfe59a6c535b2966ebf012c 100644
(file)
--- a/
www/www-header.php
+++ b/
www/www-header.php
@@
-2,7
+2,6
@@
namespace phinde;
require_once __DIR__ . '/../src/init.php';
namespace phinde;
require_once __DIR__ . '/../src/init.php';
-\Twig_Autoloader::register();
$GLOBALS['twig'] = new \Twig_Environment(
new \Twig_Loader_Filesystem(__DIR__ . '/../data/templates'),
array(
$GLOBALS['twig'] = new \Twig_Environment(
new \Twig_Loader_Filesystem(__DIR__ . '/../data/templates'),
array(
@@
-12,13
+11,22
@@
$GLOBALS['twig'] = new \Twig_Environment(
);
$GLOBALS['twig']->addExtension(new \Twig_Extension_Debug());
);
$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();
}
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) {
$template = $GLOBALS['twig']->loadTemplate($tplname . '.htm');
if ($return) {