objectManager: Preserve page title when processing entries from a list
This commit is contained in:
committed by
Chris Morgan
parent
9acdadfc34
commit
d90ce3d8ef
@@ -13,6 +13,7 @@ class ObjectManager
|
|||||||
private $iId;
|
private $iId;
|
||||||
private $bIsRejected;
|
private $bIsRejected;
|
||||||
private $sReturnTo;
|
private $sReturnTo;
|
||||||
|
private $sReturnToTitle; /* Used to preserve the title when processing entries from a queue list, for instance */
|
||||||
private $oMultiPage;
|
private $oMultiPage;
|
||||||
private $oTableRow;
|
private $oTableRow;
|
||||||
private $oObject; /* Store an instance of the object of the class
|
private $oObject; /* Store an instance of the object of the class
|
||||||
@@ -65,6 +66,11 @@ class ObjectManager
|
|||||||
$this->sReturnTo = $sReturnTo;
|
$this->sReturnTo = $sReturnTo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setReturnToTitle($sTitle)
|
||||||
|
{
|
||||||
|
$this->sReturnToTitle = $sTitle;
|
||||||
|
}
|
||||||
|
|
||||||
public function setIsRejected($bIsRejected)
|
public function setIsRejected($bIsRejected)
|
||||||
{
|
{
|
||||||
$this->bIsRejected = $bIsRejected;
|
$this->bIsRejected = $bIsRejected;
|
||||||
@@ -210,6 +216,9 @@ class ObjectManager
|
|||||||
/* Output header cells */
|
/* Output header cells */
|
||||||
$this->outputHeader("color4");
|
$this->outputHeader("color4");
|
||||||
|
|
||||||
|
/* Preserve the page title */
|
||||||
|
$this->setReturnToTitle($this->sTitle);
|
||||||
|
|
||||||
/* output each entry */
|
/* output each entry */
|
||||||
for($iCount = 0; $oRow = query_fetch_object($hResult); $iCount++)
|
for($iCount = 0; $oRow = query_fetch_object($hResult); $iCount++)
|
||||||
{
|
{
|
||||||
@@ -990,7 +999,7 @@ class ObjectManager
|
|||||||
/* Displaying the entire un-queued list for a class is not a good idea,
|
/* Displaying the entire un-queued list for a class is not a good idea,
|
||||||
so only do so for queued data */
|
so only do so for queued data */
|
||||||
if($this->bIsQueue)
|
if($this->bIsQueue)
|
||||||
$sRedirectLink = $this->makeUrl("view", false, "$this->sClass list");
|
$sRedirectLink = $this->makeUrl("view", false, $this->sReturnToTitle ? $this->sReturnToTitle : "$this->sClass list");
|
||||||
else
|
else
|
||||||
$sRedirectLink = APPDB_ROOT;
|
$sRedirectLink = APPDB_ROOT;
|
||||||
|
|
||||||
@@ -1022,6 +1031,9 @@ class ObjectManager
|
|||||||
if(!$sTitle)
|
if(!$sTitle)
|
||||||
$sTitle = $this->sTitle;
|
$sTitle = $this->sTitle;
|
||||||
|
|
||||||
|
if($this->sReturnToTitle)
|
||||||
|
$sUrl .= "&sReturnToTitle=".$this->sReturnToTitle;
|
||||||
|
|
||||||
$sUrl .= "&sTitle=".urlencode($sTitle);
|
$sUrl .= "&sTitle=".urlencode($sTitle);
|
||||||
|
|
||||||
if($this->oMultiPage->bEnabled)
|
if($this->oMultiPage->bEnabled)
|
||||||
@@ -1055,6 +1067,9 @@ class ObjectManager
|
|||||||
$this->oMultiPage->iPage."\" />\n";
|
$this->oMultiPage->iPage."\" />\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($this->sReturnToTitle)
|
||||||
|
$sReturn .= "<input type=\"hidden\" name=\"sReturnToTitle\" value=\"".$this->sReturnToTitle."\" />\n";
|
||||||
|
|
||||||
return $sReturn;
|
return $sReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -48,6 +48,9 @@ if(isset($aClean['bIsQueue']) && $aClean['bIsQueue'] == 'true')
|
|||||||
else
|
else
|
||||||
$oObject->setIsQueue(false);
|
$oObject->setIsQueue(false);
|
||||||
|
|
||||||
|
if(isset($aClean['sReturnToTitle']))
|
||||||
|
$oObject->setReturnToTitle($aClean['sReturnToTitle']);
|
||||||
|
|
||||||
if(isset($aClean['sReturnTo']))
|
if(isset($aClean['sReturnTo']))
|
||||||
$oObject->setReturnTo($aClean['sReturnTo']);
|
$oObject->setReturnTo($aClean['sReturnTo']);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user