mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-11 16:35:38 +00:00
pass version nr to controller instead content object
This commit is contained in:
parent
8db66fa33b
commit
211eae5587
|
@ -58,16 +58,14 @@ if (isset($_GET["version"])) { /* {{{ */
|
|||
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_version"));
|
||||
}
|
||||
$version = $_GET["version"];
|
||||
$content = $document->getContentByVersion($version);
|
||||
|
||||
if (!is_object($content)) {
|
||||
$controller->setParam('document', $document);
|
||||
$controller->setParam('version', $version);
|
||||
$controller->setParam('type', 'version');
|
||||
if(!$controller->run()) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_version"));
|
||||
}
|
||||
|
||||
$controller->setParam('content', $content);
|
||||
$controller->setParam('type', 'version');
|
||||
$controller->run();
|
||||
|
||||
} /* }}} */
|
||||
elseif (isset($_GET["file"])) { /* {{{ */
|
||||
|
||||
|
|
|
@ -53,18 +53,12 @@ if(isset($_GET["version"])) {
|
|||
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_version"));
|
||||
}
|
||||
|
||||
if(intval($version)<1)
|
||||
$content = $document->getLatestContent();
|
||||
else
|
||||
$content = $document->getContentByVersion($version);
|
||||
|
||||
if (!is_object($content)) {
|
||||
$controller->setParam('document', $document);
|
||||
$controller->setParam('version', intval($version));
|
||||
$controller->setParam('type', 'version');
|
||||
if(!$controller->run()) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_version"));
|
||||
}
|
||||
|
||||
$controller->setParam('content', $content);
|
||||
$controller->setParam('type', 'version');
|
||||
$controller->run();
|
||||
} elseif(isset($_GET["file"])) {
|
||||
$fileid = $_GET["file"];
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user