X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fwiki.engine.inc.php;h=b26daa54fedcf4cc1b9f9202400c3e35ea3c13a8;hb=b0a8daa8a2428ffc76ea4eb690ab8379cdc22aec;hp=956d39c82420b035765a2517ba507c3fe6bbb794;hpb=2b27ff99ce8ff74aa0e8a2a3e51c02d1c0655e13;p=platal.git diff --git a/include/wiki.engine.inc.php b/include/wiki.engine.inc.php index 956d39c..b26daa5 100644 --- a/include/wiki.engine.inc.php +++ b/include/wiki.engine.inc.php @@ -1,6 +1,6 @@ applyPerms('admin'); if ($wp->setPerms($p, $wp->writePerms())) { - $page->trigSuccess('Permissions mises à jour'); + Platal::page()->trigSuccess('Permissions mises à jour'); } } if ($p = Post::v('setwperms')) { $wp->applyPerms('admin'); if ($wp->setPerms($wp->readPerms(), $p)) { - $page->trigSuccess('Permissions mises à jour'); + Platal::page()->trigSuccess('Permissions mises à jour'); } } @@ -59,7 +59,8 @@ $wiki_cache = $wp->cacheFilename(); $cache_exists = file_exists($wiki_cache); if (Env::v('action') || !$cache_exists) { if ($cache_exists && !$feed) { - unlink($wiki_cache); + $wp->removePageCache(); + $cache_exists = false; } // we leave pmwiki do whatever it wants and store everything @@ -77,7 +78,7 @@ if (Env::v('action') || !$cache_exists) { $wiki_exists = file_exists($wp->filename()); $page =& Platal::page(); -$page->changeTpl('core/wiki.tpl'); +$page->coreTpl('wiki.tpl'); if ($feed) { $wikiAll = str_replace('dc:contributor', 'author', $wikiAll); @@ -95,11 +96,12 @@ if ($feed) { file_put_contents($wiki_cache, $wikiAll); } elseif ($cache_exists) { $wikiAll = file_get_contents($wiki_cache); - } elseif (S::has_perms()) { + } elseif (S::admin()) { $wikiAll = "

La page de wiki $n n'existe pas. " . "Il te suffit de l'éditer

"; } else { - $page->changeTpl('core/404.tpl'); + global $platal; + $platal->error404(); } } @@ -110,7 +112,7 @@ $page->assign('perms', array($wp->readPerms(), $wp->writePerms())); $page->assign('perms_opts', PlWikiPage::permOptions()); $page->assign('canedit', $wp->canWrite()); -$page->assign('has_perms', S::has_perms()); +$page->assign('has_perms', S::admin()); $page->assign('wikipage', str_replace('.', '/', $n)); if (!$feed && $wp->writePerms() == 'admin' && !Env::v('action') && $wiki_exists) { @@ -124,7 +126,7 @@ $page->addJsLink('wiki.js'); if (!Env::v('action')) { $url = '/' . str_replace('.', '/', $n) . '?action=rss'; if (S::logged()) { - $url .= '&user=' . S::v('forlife') . '&hash=' . S::v('core_rss_hash'); + $url .= '&user=' . S::user()->login() . '&hash=' . S::v('core_rss_hash'); } $page->setRssLink($n, $url); }