mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-12 00:45:34 +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"));
|
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_version"));
|
||||||
}
|
}
|
||||||
$version = $_GET["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"));
|
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"])) { /* {{{ */
|
elseif (isset($_GET["file"])) { /* {{{ */
|
||||||
|
|
||||||
|
|
|
@ -53,18 +53,12 @@ if(isset($_GET["version"])) {
|
||||||
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_version"));
|
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_version"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(intval($version)<1)
|
$controller->setParam('document', $document);
|
||||||
$content = $document->getLatestContent();
|
$controller->setParam('version', intval($version));
|
||||||
else
|
$controller->setParam('type', 'version');
|
||||||
$content = $document->getContentByVersion($version);
|
if(!$controller->run()) {
|
||||||
|
|
||||||
if (!is_object($content)) {
|
|
||||||
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_version"));
|
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"])) {
|
} elseif(isset($_GET["file"])) {
|
||||||
$fileid = $_GET["file"];
|
$fileid = $_GET["file"];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user