Add link to the core ChangeLog.
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Tue, 23 Dec 2008 11:15:20 +0000 (12:15 +0100)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Tue, 23 Dec 2008 11:15:20 +0000 (12:15 +0100)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
core
modules/platal.php
templates/platal/changeLog.tpl

diff --git a/core b/core
index 0709dd7..c210416 160000 (submodule)
--- a/core
+++ b/core
@@ -1 +1 @@
-Subproject commit 0709dd7d7f98df88be921553740e43114fe684f4
+Subproject commit c21041687b7e324a1804a712fe2580593fb9cbe5
index f396e06..301366d 100644 (file)
@@ -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*/', '</pre><hr /><pre>', $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(
-            '<a href="\\0">\\0</a>',
-            '\\1<a href="http://www.\\2">www.\\2</a>',
-            '<a href="mailto:\\0">\\0</a>'),
-          $clog);
-        $clog = preg_replace('!(#[0-9]+(,[0-9]+)*)!e', 'bugize("\1")', $clog);
-        $clog = preg_replace('!vim:.*$!', '', $clog);
-        $clog = preg_replace("!(<hr />(\\s|\n)*)?<pre>(\s|\n)*</pre>((\\s|\n)*<hr />)?!m", "", "<pre>$clog</pre>");
-        $page->assign('ChangeLog', $clog);
+        function formatChangeLog($file) {
+            $clog = pl_entities(file_get_contents($file));
+            $clog = preg_replace('/===+\s*/', '</pre><hr /><pre>', $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(
+                '<a href="\\0">\\0</a>',
+                '\\1<a href="http://www.\\2">www.\\2</a>',
+                '<a href="mailto:\\0">\\0</a>'),
+              $clog);
+            $clog = preg_replace('!(#[0-9]+(,[0-9]+)*)!e', 'bugize("\1")', $clog);
+            $clog = preg_replace('!vim:.*$!', '', $clog);
+            return preg_replace("!(<hr />(\\s|\n)*)?<pre>(\s|\n)*</pre>((\\s|\n)*<hr />)?!m", "", "<pre>$clog</pre>");
+        }
+        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)
index e5574be..1b2a395 100644 (file)
 {*                                                                        *}
 {**************************************************************************}
 <h1>ChangeLog</h1>
+{if !$core}
 <p>Voici la liste des modifications faites sur <a href="http://opensource.polytechnique.org/platal/">plat/al</a>, le support libre de ce site.</p>
+
+<p>Cette version utilise <a href="changelog/core">plat/al-core {$globals->coreVersion}</a>.</p>
+{else}
+<p>Voici la liste des modifications faites sur la bibliothèque plat/al-core.</p>
+{/if}
+
 {$ChangeLog|smarty:nodefaults}
 {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}