Use objectManager to display versions
This commit is contained in:
committed by
Chris Morgan
parent
69b14f58c7
commit
a6a62a2299
@@ -700,6 +700,29 @@ class ObjectManager
|
||||
}
|
||||
}
|
||||
|
||||
/* Gets the title of the page to be displayed. Classes can set
|
||||
the page title depending on the action, or return null to
|
||||
let objectManager use one, normally the title specified in
|
||||
the URL. Since this only affects the user interface and not
|
||||
functionality, objectGetCustomTitle is not a required method.
|
||||
Why do we need this method? Think of the versions, for instance.
|
||||
If we were to fetch the name from the URL, that would mean
|
||||
that changes to the version name would not be reflected in
|
||||
static URLs, like external links to the AppDB. */
|
||||
function get_title($sAction)
|
||||
{
|
||||
$oObject = new $this->sClass($this->iId);
|
||||
$sTitle = "";
|
||||
|
||||
if(method_exists($oObject, "objectGetCustomTitle"))
|
||||
$sTitle = $oObject->objectGetCustomTitle($sAction);
|
||||
|
||||
if(!$sTitle)
|
||||
$sTitle = $this->sTitle;
|
||||
|
||||
return $sTitle;
|
||||
}
|
||||
|
||||
/* Gets the custom variables, if any, from a class depending on
|
||||
the action which is being taken, such as viewing an entry,
|
||||
editing one etc.
|
||||
|
||||
@@ -719,6 +719,18 @@ class version {
|
||||
$this->iObsoleteBy = 0;
|
||||
}
|
||||
|
||||
function objectGetCustomTitle($sAction)
|
||||
{
|
||||
switch($sAction)
|
||||
{
|
||||
case "display":
|
||||
return "Viewing App: ".version::fullName($this->iVersionId);
|
||||
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function objectGetCustomVars($aClean, $sAction)
|
||||
{
|
||||
switch($sAction)
|
||||
@@ -986,7 +998,7 @@ class version {
|
||||
// show the test results table
|
||||
if($oTest->iTestingId)
|
||||
{
|
||||
$oTest->ShowVersionsTestingTable($_SERVER['PHP_SELF']."?iVersionId=".$this->iVersionId."&iTestingId=",
|
||||
$oTest->ShowVersionsTestingTable($this->objectMakeUrl()."&iTestingId=",
|
||||
5);
|
||||
}
|
||||
if($_SESSION['current']->isLoggedIn())
|
||||
@@ -1278,7 +1290,7 @@ class version {
|
||||
|
||||
function objectMakeUrl()
|
||||
{
|
||||
return APPDB_ROOT."appview.php?iVersionId=$this->iVersionId";
|
||||
return APPDB_ROOT."objectManager.php?sClass=version&iId=$this->iVersionId";
|
||||
}
|
||||
|
||||
function objectMakeLink()
|
||||
|
||||
Reference in New Issue
Block a user