From 78d4079ae5088e071624d2727884784c42ad07e4 Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Tue, 23 Dec 2008 12:15:20 +0100 Subject: [PATCH] Add link to the core ChangeLog. Signed-off-by: Florent Bruneau --- core | 2 +- modules/platal.php | 44 +++++++++++++++++++++++++----------------- templates/platal/changeLog.tpl | 7 +++++++ 3 files changed, 34 insertions(+), 19 deletions(-) diff --git a/core b/core index 0709dd7..c210416 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit 0709dd7d7f98df88be921553740e43114fe684f4 +Subproject commit c21041687b7e324a1804a712fe2580593fb9cbe5 diff --git a/modules/platal.php b/modules/platal.php index f396e06..301366d 100644 --- a/modules/platal.php +++ b/modules/platal.php @@ -70,7 +70,7 @@ class PlatalModule extends PLModule if (S::logged()) { pl_redirect('events'); } else if (!@$GLOBALS['IS_XNET_SITE']) { - pl_redirect('review'); + $this->handler_review($page); } } @@ -87,26 +87,34 @@ class PlatalModule extends PLModule exit; } - function handler_changelog(&$page) + function handler_changelog(&$page, $core = null) { $page->changeTpl('platal/changeLog.tpl'); - $clog = pl_entities(file_get_contents(dirname(__FILE__).'/../ChangeLog')); - $clog = preg_replace('/===+\s*/', '
', $clog);
-        // url catch only (not all wiki syntax)
-        $clog = preg_replace(array(
-            '/((?:https?|ftp):\/\/(?:\.*,*[\w@~%$£µ&i#\-+=_\/\?;])*)/ui',
-            '/(\s|^)www\.((?:\.*,*[\w@~%$£µ&i#\-+=_\/\?;])*)/iu',
-            '/(?:mailto:)?([a-z0-9.\-+_]+@([\-.+_]?[a-z0-9])+)/i'),
-          array(
-            '\\0',
-            '\\1www.\\2',
-            '\\0'),
-          $clog);
-        $clog = preg_replace('!(#[0-9]+(,[0-9]+)*)!e', 'bugize("\1")', $clog);
-        $clog = preg_replace('!vim:.*$!', '', $clog);
-        $clog = preg_replace("!(
(\\s|\n)*)?
(\s|\n)*
((\\s|\n)*
)?!m", "", "
$clog
"); - $page->assign('ChangeLog', $clog); + function formatChangeLog($file) { + $clog = pl_entities(file_get_contents($file)); + $clog = preg_replace('/===+\s*/', '

', $clog);
+            // url catch only (not all wiki syntax)
+            $clog = preg_replace(array(
+                '/((?:https?|ftp):\/\/(?:\.*,*[\w@~%$£µ&i#\-+=_\/\?;])*)/ui',
+                '/(\s|^)www\.((?:\.*,*[\w@~%$£µ&i#\-+=_\/\?;])*)/iu',
+                '/(?:mailto:)?([a-z0-9.\-+_]+@([\-.+_]?[a-z0-9])+)/i'),
+              array(
+                '\\0',
+                '\\1www.\\2',
+                '\\0'),
+              $clog);
+            $clog = preg_replace('!(#[0-9]+(,[0-9]+)*)!e', 'bugize("\1")', $clog);
+            $clog = preg_replace('!vim:.*$!', '', $clog);
+            return preg_replace("!(
(\\s|\n)*)?
(\s|\n)*
((\\s|\n)*
)?!m", "", "
$clog
"); + } + if ($core != 'core') { + $page->assign('core', false); + $page->assign('ChangeLog', formatChangeLog(dirname(__FILE__).'/../ChangeLog')); + } else { + $page->assign('core', true); + $page->assign('ChangeLog', formatChangeLog(dirname(__FILE__).'/../core/ChangeLog')); + } } function __set_rss_state($state) diff --git a/templates/platal/changeLog.tpl b/templates/platal/changeLog.tpl index e5574be..1b2a395 100644 --- a/templates/platal/changeLog.tpl +++ b/templates/platal/changeLog.tpl @@ -20,6 +20,13 @@ {* *} {**************************************************************************}

ChangeLog

+{if !$core}

Voici la liste des modifications faites sur plat/al, le support libre de ce site.

+ +

Cette version utilise plat/al-core {$globals->coreVersion}.

+{else} +

Voici la liste des modifications faites sur la bibliothèque plat/al-core.

+{/if} + {$ChangeLog|smarty:nodefaults} {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *} -- 2.1.4