projects
/
platal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add basic tests of the platal engine.
[platal.git]
/
classes
/
plpage.php
diff --git
a/classes/plpage.php
b/classes/plpage.php
index
cc932a6
..
875981e
100644
(file)
--- a/
classes/plpage.php
+++ b/
classes/plpage.php
@@
-1,6
+1,6
@@
<?php
/***************************************************************************
<?php
/***************************************************************************
- * Copyright (C) 2003-20
09
Polytechnique.org *
+ * Copyright (C) 2003-20
10
Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
@@
-60,7
+60,6
@@
abstract class PlPage extends Smarty
. " actuellement désactivée, en particulier aucune donnée ne sera sauvegardée");
}
$this->register_prefilter('at_to_globals');
. " actuellement désactivée, en particulier aucune donnée ne sera sauvegardée");
}
$this->register_prefilter('at_to_globals');
- $this->addJsLink('jquery.js');
}
// }}}
}
// }}}
@@
-153,10
+152,9
@@
abstract class PlPage extends Smarty
if (S::i('auth') <= AUTH_PUBLIC) {
$this->register_outputfilter('hide_emails');
}
if (S::i('auth') <= AUTH_PUBLIC) {
$this->register_outputfilter('hide_emails');
}
- $this->addJsLink('wiki.js');
header("Accept-Charset: utf-8");
if (Env::v('forceXml')) {
header("Accept-Charset: utf-8");
if (Env::v('forceXml')) {
-
header("Content-Type: text/xml; charset=utf-8
");
+
pl_content_headers("text/xml
");
}
if (!$globals->debug) {
}
if (!$globals->debug) {
@@
-251,7
+249,7
@@
abstract class PlPage extends Smarty
// PHP is used on command line... do not run the whole page stuff.
if (php_sapi_name() == 'cli') {
echo $msg . "\n";
// PHP is used on command line... do not run the whole page stuff.
if (php_sapi_name() == 'cli') {
echo $msg . "\n";
- exit;
+ exit
(-1)
;
}
global $platal;
}
global $platal;
@@
-291,9
+289,13
@@
abstract class PlPage extends Smarty
// }}}
// {{{ function addJsLink
// }}}
// {{{ function addJsLink
- public function addJsLink($
path
)
+ public function addJsLink($
filename, $static_content = true
)
{
{
- $this->append('pl_js', $path);
+ if ($static_content) {
+ $this->append('pl_js', pl_static_content_path("javascript/", $filename));
+ } else {
+ $this->append('pl_js', "javascript/$filename");
+ }
}
// }}}
}
// }}}
@@
-335,7
+337,7
@@
abstract class PlPage extends Smarty
// {{{ function jsonDisplay
protected function jsonDisplay()
{
// {{{ function jsonDisplay
protected function jsonDisplay()
{
-
header("Content-type: text/javascript; charset=utf-8
");
+
pl_content_headers("text/javascript
");
array_walk_recursive($this->_jsonVars, "escape_xorgDB");
$jsonbegin = Env::v('jsonBegin');
$jsonend = Env::v('jsonEnd');
array_walk_recursive($this->_jsonVars, "escape_xorgDB");
$jsonbegin = Env::v('jsonBegin');
$jsonend = Env::v('jsonEnd');