aboutsummaryrefslogtreecommitdiff
path: root/scripts/transition.php
diff options
context:
space:
mode:
authorpmichaud <pmichaud@524c5546-5005-0410-9a3e-e25e191bd360>2005-07-09 16:54:14 +0000
committerpmichaud <pmichaud@524c5546-5005-0410-9a3e-e25e191bd360>2005-07-09 16:54:14 +0000
commitc534d28d8a2fbb086f7c58d8dbe9f141ac0ffe57 (patch)
tree3b9632d8b0d794276e626b46d7f3ebe368cbb894 /scripts/transition.php
parent0459af55648d60217fb41167fd28cd3bdbc58017 (diff)
downloadpmwiki.svn-c534d28d8a2fbb086f7c58d8dbe9f141ac0ffe57.tar.bz2
Changed "fixup" to "transitions".
git-svn-id: svn://pmwiki.org/trunk/pmwiki@696 524c5546-5005-0410-9a3e-e25e191bd360
Diffstat (limited to 'scripts/transition.php')
-rw-r--r--scripts/transition.php63
1 files changed, 63 insertions, 0 deletions
diff --git a/scripts/transition.php b/scripts/transition.php
new file mode 100644
index 00000000..e87ef83c
--- /dev/null
+++ b/scripts/transition.php
@@ -0,0 +1,63 @@
+<?php if (!defined('PmWiki')) exit();
+/* Copyright 2005 Patrick R. Michaud (pmichaud@pobox.com)
+ This file is part of PmWiki; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version. See pmwiki.php for full details.
+
+ This script handles various "fixup transitions" that might need to
+ occur to help existing sites smoothly upgrade to newer releases of
+ PmWiki. Rather than put the workarounds in the main code files, we
+ try to centralize them here so we can see what's deprecated and a
+ simple switch ($EnableTransitions=0, or ?trans=0 in the url) can tell
+ the admin if his site is relying on an outdated feature or
+ way of doing things.
+*/
+
+## if ?trans=0 is specified, then we don't do any fixups.
+if (@$_REQUEST['trans']==='0') return;
+
+## $PageEditFmt has been deprecated in favor of using wiki markup forms
+## to layout the edit page (as controlled by the $EditFormPage variable).
+## However, some sites and skins have customized $PageEditFmt -- if
+## that appears to have happened we restore PmWiki's older defaults here.
+## If not, then we take any $EditMessages (which may have come from
+## cookbook scripts) and stick them into the new $MessagesFmt array.
+if ($PageEditFmt || $PagePreviewFmt || $HandleEditFmt) {
+ SDV($PageEditFmt, "<div id='wikiedit'>
+ <a id='top' name='top'></a>
+ <h1 class='wikiaction'>$[Editing \$FullName]</h1>
+ <form method='post' action='\$PageUrl?action=edit'>
+ <input type='hidden' name='action' value='edit' />
+ <input type='hidden' name='n' value='\$FullName' />
+ <input type='hidden' name='basetime' value='\$EditBaseTime' />
+ \$EditMessageFmt
+ <textarea id='text' name='text' rows='25' cols='60'
+ onkeydown='if (event.keyCode==27) event.returnValue=false;'
+ >\$EditText</textarea><br />
+ $[Author]: <input type='text' name='author' value='\$Author' />
+ <input type='checkbox' name='diffclass' value='minor' \$DiffClassMinor />
+ $[This is a minor edit]<br />
+ <input type='submit' name='post' value=' $[Save] ' />
+ <input type='submit' name='preview' value=' $[Preview] ' />
+ <input type='reset' value=' $[Reset] ' /></form></div>");
+ if (@$_POST['preview'])
+ SDV($PagePreviewFmt, "<div id='wikipreview'>
+ <h2 class='wikiaction'>$[Preview \$FullName]</h2>
+ <p><b>$[Page is unsaved]</b></p>
+ \$PreviewText
+ <hr /><p><b>$[End of preview -- remember to save]</b><br />
+ <a href='#top'>$[Top]</a></p></div>");
+ SDV($HandleEditFmt, array(&$PageStartFmt,
+ &$PageEditFmt, 'wiki:$[PmWiki.EditQuickReference]', &$PagePreviewFmt,
+ &$PageEndFmt));
+ $EditMessageFmt = implode('', $MessagesFmt) . $EditMessageFmt;
+ if (IsEnabled($EnableGUIButtons, 0))
+ array_push($EditFunctions, 'GUIEdit');
+} else $MessagesFmt[] = $EditMessageFmt;
+
+
+function GUIEdit($pagename, &$page, &$new) {
+ global $EditMessageFmt;
+ $EditMessageFmt .= GUIButtonCode($pagename);
+}