summaryrefslogtreecommitdiff
path: root/inc/actions.php
diff options
context:
space:
mode:
authorAdrian Lang <lang@cosmocode.de>2010-03-09 11:42:34 +0100
committerAdrian Lang <lang@cosmocode.de>2010-03-09 12:06:59 +0100
commit45a9933524f9a31e0a104cccfd082217501017ba (patch)
tree1496e69b25ff8a32bd86bb226d42ec7c4d32a255 /inc/actions.php
parentffde0ac9c67ac7dea5886a325e05300c3a88c163 (diff)
downloadrpg-45a9933524f9a31e0a104cccfd082217501017ba.tar.gz
rpg-45a9933524f9a31e0a104cccfd082217501017ba.tar.bz2
Move data preprocessing out of html_edit
Diffstat (limited to 'inc/actions.php')
-rw-r--r--inc/actions.php37
1 files changed, 35 insertions, 2 deletions
diff --git a/inc/actions.php b/inc/actions.php
index b7567bc20..5802bd6f5 100644
--- a/inc/actions.php
+++ b/inc/actions.php
@@ -111,7 +111,7 @@ function act_dispatch(){
$ACT = act_draftsave($ACT);
//edit
- if(($ACT == 'edit' || $ACT == 'preview') && $INFO['editable']){
+ if(($ACT == 'edit' || $ACT == 'preview' || $ACT == 'recover') && $INFO['editable']){
$ACT = act_edit($ACT);
}else{
unlock($ID); //try to unlock
@@ -442,7 +442,7 @@ function act_auth($act){
}
/**
- * Handle 'edit', 'preview'
+ * Handle 'edit', 'preview', 'recover'
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
@@ -450,6 +450,39 @@ function act_edit($act){
global $ID;
global $INFO;
+ global $TEXT;
+ global $RANGE;
+ global $PRE;
+ global $SUF;
+ global $REV;
+ global $SUM;
+ global $lang;
+ global $DATE;
+
+ if (!isset($TEXT)) {
+ if ($INFO['exists']) {
+ if ($RANGE) {
+ list($PRE,$TEXT,$SUF) = rawWikiSlices($RANGE,$ID,$REV);
+ } else {
+ $TEXT = rawWiki($ID,$REV);
+ }
+ } else {
+ $data = array($ID);
+ $TEXT = trigger_event('HTML_PAGE_FROMTEMPLATE',$data,'pageTemplate',true);
+ }
+ }
+
+ //set summary default
+ if(!$SUM){
+ if($REV){
+ $SUM = $lang['restored'];
+ }elseif(!$INFO['exists']){
+ $SUM = $lang['created'];
+ }
+ }
+
+ if(!$DATE) $DATE = $INFO['lastmod'];
+
//check if locked by anyone - if not lock for my self
$lockedby = checklock($ID);
if($lockedby) return 'locked';