protected $mime = null;
protected $x = null;
protected $y = null;
+ protected $ts = null;
protected $data = null;
protected $file = null;
public function send()
{
+ if (!is_null($this->ts)) {
+ header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $this->ts) . ' GMT');
+ }
pl_cached_dynamic_content_headers($this->mime);
if (empty($this->data)) {
readfile($this->file);
return $this->mime;
}
- public static function fromData($data, $mime, $x = null, $y = null)
+ public static function fromData($data, $mime, $x = null, $y = null, $ts = null)
{
$image = new PlImage();
$image->data = $data;
$image->mime = $mime;
$image->x = $x;
$image->y = $y;
+ $image->ts = $ts;
return $image;
}
- public static function fromFile($path, $mime, $x = null, $y = null)
+ public static function fromFile($path, $mime, $x = null, $y = null, $ts = null)
{
$image = new PlImage();
$image->file = $path;
$image->mime = $mime;
$image->x = $x;
$image->y = $y;
+ $image->ts = $ts;
return $image;
}
}
return $this->jsonDisplay();
}
- if (Env::v('display') == 'light') {
+ $display = Env::s('display');
+ if ($display == 'light' && $this->_page_type == SKINNED) {
$this->_page_type = SIMPLE;
- } elseif (Env::v('display') == 'raw') {
+ } elseif ($display == 'raw') {
$this->_page_type = NO_SKIN;
- } elseif (Env::v('display') == 'full') {
+ } elseif ($display == 'full') {
$this->_page_typ = SKINNED;
}
global $platal;
$page =& Platal::page();
$platal->force_login($page);
+ } else if ($perm == 'admin' && !S::admin()) {
+ global $platal;
+ $platal->error403();
}
}
if ($this->bt) {
$this->bt->stop();
}
+ if (is_null($answer)) {
+ Platal::page()->trigError("L'accès aux listes de diffusion n'est pas disponible actuellement.");
+ $this->bt->update(0, "Connection failed");
+ return null;
+ }
+ Platal::assert(starts_with($answer, 'HTTP/1.0 200 OK'), "HTTP Error:\n" . $answer,
+ "Une erreur est survenue lors de l'accès aux listes de diffusion.");
$result = $this->find_and_decode_xml($answer);
if ($this->bt) {
if (is_array($result) && isset($result['faultCode'])) {
} else {
$this->bt->update(count($result));
}
+ } else {
+ Platal::assert(!is_array($result) || !isset($result['faultCode']),
+ "RPC Error:\n" . $answer,
+ "Une erreur est survenue lors de l'accès aux listes de diffusion.");
}
if (is_array($result) && isset($result['faultCode'])) {
'assert_errors' => $this->make_hook('siteerror', AUTH_COOKIE, 'admin'),
'site_errors' => $this->make_hook('siteerror', AUTH_COOKIE, 'admin'),
+ 'embedded' => $this->make_hook('embedded', AUTH_PUBLIC),
+
'wiki_help' => $this->make_hook('wiki_help', AUTH_PUBLIC),
'wiki_preview' => $this->make_hook('wiki_preview', AUTH_COOKIE, 'user', NO_AUTH),
}
$page->assign('errors', PlErrorReport::iterate());
}
+
+ function handler_embedded($page)
+ {
+ global $platal, $globals;
+ $allkeys = func_get_args();
+ $mode = $allkeys[1];
+ unset($allkeys[0]);
+ unset($allkeys[1]);
+ $_REQUEST['display'] = $mode;
+ $globals->baseurl .= '/embedded/' . $mode;
+ $platal->path = join('/', $allkeys);
+ $platal->run();
+ }
}
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: