From: Geoffrey T. D. <da...@us...> - 2001-02-07 22:14:16
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv12644/lib Modified Files: config.php editpage.php savepage.php stdlib.php Log Message: Added "Minor edit, do not archive" checkbox on the edit form. (Sourceforge task #25913) Index: config.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/config.php,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -r1.24 -r1.25 *** config.php 2001/01/31 07:38:10 1.24 --- config.php 2001/02/07 22:14:35 1.25 *************** *** 161,164 **** --- 161,171 ---- $InlineImages = "png|jpg|gif"; + + // If the last edit is older than MINOR_EDIT_TIMEOUT seconds, the default + // state for the "minor edit" checkbox on the edit page form will be off + // (even if the page author hasn't changed.) + define("MINOR_EDIT_TIMEOUT", 7 * 24 * 3600); + + // Perl regexp for WikiNames // (?<!..) & (?!...) used instead of '\b' because \b matches '_' as well Index: editpage.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/editpage.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** editpage.php 2001/01/01 23:13:32 1.8 --- editpage.php 2001/02/07 22:14:35 1.9 *************** *** 43,49 **** $pagehash["version"] = $currentpage["version"]; } ! elseif ($pagehash["version"] > 1) { ! if(IsInArchive($dbi, $pagename)) ! $pagehash["copy"] = 1; } } else { --- 43,51 ---- $pagehash["version"] = $currentpage["version"]; } ! else { ! if ($pagehash["version"] > 1 && IsInArchive($dbi, $pagename)) { ! $pagehash["copy"] = 1; ! } ! $currentpage = $pagehash; } } else { *************** *** 54,57 **** --- 56,67 ---- $pagehash["lastmodified"] = time(); $pagehash["author"] = ''; + $currentpage = $pagehash; + } + + if ($currentpage['author'] == $remoteuser) { + $page_age = time() - $currentpage['lastmodified']; + if ($page_age < MINOR_EDIT_TIMEOUT) { + $pagehash['minor_edit'] = 1; + } } Index: savepage.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/savepage.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** savepage.php 2001/01/04 18:30:32 1.7 --- savepage.php 2001/02/07 22:14:35 1.8 *************** *** 130,134 **** // archive it if it's a new author ! if ($pagehash['author'] != $remoteuser) { SaveCopyToArchive($dbi, $pagename, $pagehash); } --- 130,134 ---- // archive it if it's a new author ! if (empty($minor_edit)) { SaveCopyToArchive($dbi, $pagename, $pagehash); } Index: stdlib.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/stdlib.php,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -r1.23 -r1.24 *** stdlib.php 2001/02/07 17:21:33 1.23 --- stdlib.php 2001/02/07 22:14:35 1.24 *************** *** 316,319 **** --- 316,320 ---- ($hash['flags'] & FLAG_PAGE_LOCKED)), $page); _iftoken('ADMIN', defined('WIKI_ADMIN'), $page); + _iftoken('MINOR_EDIT', isset($hash['minor_edit']), $page); _dotoken('SCRIPTURL', $ScriptUrl, $page); |