git.cweiske.de
/
phorkie.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
part of #34: store last openid and pre-fill URL field
[phorkie.git]
/
www
/
www-header.php
diff --git
a/www/www-header.php
b/www/www-header.php
index c8403152105d86e350f123340af274a4ad2c2f0d..41b5e4731889961080f511e2a5474473ea4bb49e 100644
(file)
--- a/
www/www-header.php
+++ b/
www/www-header.php
@@
-1,8
+1,6
@@
<?php
namespace phorkie;
<?php
namespace phorkie;
-if (session_id() == "") {
- session_start();
-}
+session_start();
set_include_path(
__DIR__ . '/../src/'
set_include_path(
__DIR__ . '/../src/'
@@
-70,8
+68,20
@@
$twig = new \Twig_Environment(
'debug' => true
)
);
'debug' => true
)
);
+$twig->addFunction('ntext', new \Twig_Function_Function('\phorkie\ntext'));
+function ntext($value, $singular, $plural)
+{
+ if (abs($value) == 1) {
+ return sprintf($singular, $value);
+ }
+ return sprintf($plural, $value);
+}
//$twig->addExtension(new \Twig_Extension_Debug());
//$twig->addExtension(new \Twig_Extension_Debug());
+if (!isset($noSecurityCheck) || $noSecurityCheck !== true) {
+ require __DIR__ . '/www-security.php';
+}
+
function render($tplname, $vars = array())
{
$vars['css'] = $GLOBALS['phorkie']['cfg']['css'];
function render($tplname, $vars = array())
{
$vars['css'] = $GLOBALS['phorkie']['cfg']['css'];