WeakWiki


include\history.include.php



/********************************************************************************
WeakWiki (WeakWiki history viewer include file: history.include.php)
Copyright (C) 2010 Alexander Lang

This program is free software; 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 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this
program; if not, see .

Project Home: http://weakwiki.robnet.wmweb.at/
Contact:      robbiblubber@robnet.wmweb.at
********************************************************************************/



require_once(_lang('history'));


$d = new Document($_GET['title']);

if($_GET['action'] == "history")
{
	$pm = new PageMenu();
	$pm->add("" . _L_HI_0000 . "");
	$pm->add("" . _L_HI_0001 . "");
	
	if($d->request(OP_WRITE))
	{
		$pm->add("" . _L_HI_0002 . "");
		$pm->add("" . _L_HI_0003 . "");
	}
	
	$pm->add("" . _L_HI_0004 . "");
	$pm->write();
	
	
	if($d->request(OP_HISTORY))
	{
		echo(wikiParse(_getHistory($_GET['title'])));
	}
	else
	{
		$m = new MessageBox(_L_HI_0020, _L_HI_0021, MSG_ERROR);
		$m->write();
	}
}
else if($_GET['action'] == "showhistory")
{
	$pm = new PageMenu();
	$pm->add("" . _L_HI_0010. "");
	$pm->add("" . _L_HI_0011 . "");
	$pm->add("" . _L_HI_0012 . "");
	$pm->add("" . _L_HI_0013 . "");
	$pm->add("" . _L_HI_0000 . "");
	$pm->add("" . _L_HI_0004 . "");
	$pm->write();
	
	 
	$mode = "wiki";
	if(isset($_GET['mode'])) { $mode = $_GET['mode']; }
	
	switch($mode)
	{
		case "source":
			echo("

\n"); echo(formatSource(_getText($_GET['title'], $_GET['fileid']))); echo("\n

\n"); break; case "diffcurr": require_once('./lib/diff.library.php'); $diff = new Diff(); echo("
\n"); echo($diff->getText(_getText($_GET['title'], $_GET['fileid']), file_get_contents(_PATH_CONTENT . toTitle($_GET['title'] . ".wiki")))); break; case "diffprev": require_once('./lib/diff.library.php'); $diff = new Diff(); echo("
\n"); echo($diff->getText(_getPrevious($_GET['title'], $_GET['fileid']), _getText($_GET['title'], $_GET['fileid']))); break; default: echo(wikiParse(_getText($_GET['title'], $_GET['fileid']))); break; } } ?>

WeakWiki