From ebf1501f6d253ef906c44bae278a2f80ffcb9f54 Mon Sep 17 00:00:00 2001 From: Ben Coburn Date: Thu, 7 Dec 2006 08:49:06 +0100 Subject: changelog type strings replaced with constants Using more verbose constant names in the place of single character strings should make the code much more readable. This does not change the behavior of the changelog. darcs-hash:20061207074906-05dcb-0bdc35e7241bf14063b2b43a6ff26d8a3c307cb9.gz --- inc/common.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'inc/common.php') diff --git a/inc/common.php b/inc/common.php index 93e2df34f..60bec57a2 100644 --- a/inc/common.php +++ b/inc/common.php @@ -150,7 +150,7 @@ function pageinfo(){ $info['user'] = $revinfo['user']; $info['sum'] = $revinfo['sum']; // See also $INFO['meta']['last_change'] which is the most recent log line for page $ID. - // Use $INFO['meta']['last_change']['type']==='e' in place of $info['minor']. + // Use $INFO['meta']['last_change']['type']===DOKU_CHANGE_TYPE_MINOR_EDIT in place of $info['minor']. if($revinfo['user']){ $info['editor'] = $revinfo['user']; @@ -736,7 +736,7 @@ function saveWikiText($id,$text,$summary,$minor=false){ saveOldRevision($id); // add a changelog entry if this edit came from outside dokuwiki if ($old>$oldRev) { - addLogEntry($old, $id, 'E', $lang['external_edit'], '', array('ExternalEdit'=>true)); + addLogEntry($old, $id, DOKU_CHANGE_TYPE_EDIT, $lang['external_edit'], '', array('ExternalEdit'=>true)); // remove soon to be stale instructions $cache = new cache_instructions($id, $file); $cache->removeCache(); @@ -773,14 +773,14 @@ function saveWikiText($id,$text,$summary,$minor=false){ // select changelog line type $extra = ''; - $type = 'E'; + $type = DOKU_CHANGE_TYPE_EDIT; if ($wasReverted) { - $type = 'R'; + $type = DOKU_CHANGE_TYPE_REVERT; $extra = $REV; } - else if ($wasCreated) { $type = 'C'; } - else if ($wasRemoved) { $type = 'D'; } - else if ($minor && $conf['useacl'] && $_SERVER['REMOTE_USER']) { $type = 'e'; } //minor edits only for logged in users + else if ($wasCreated) { $type = DOKU_CHANGE_TYPE_CREATE; } + else if ($wasRemoved) { $type = DOKU_CHANGE_TYPE_DELETE; } + else if ($minor && $conf['useacl'] && $_SERVER['REMOTE_USER']) { $type = DOKU_CHANGE_TYPE_MINOR_EDIT; } //minor edits only for logged in users addLogEntry($newRev, $id, $type, $summary, $extra); // send notify mails -- cgit v1.2.3