Improve 'move to another parent' texts
This commit is contained in:
committed by
Alexander Nicolaysen Sørnes
parent
d817ffa77a
commit
0dc6d47958
@@ -939,6 +939,11 @@ class Application {
|
|||||||
return $oTable->GetString();
|
return $oTable->GetString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function objectGetClassDisplayName()
|
||||||
|
{
|
||||||
|
return 'application';
|
||||||
|
}
|
||||||
|
|
||||||
public function objectMakeUrl()
|
public function objectMakeUrl()
|
||||||
{
|
{
|
||||||
$sUrl = APPDB_ROOT."objectManager.php?sClass=application&iId=$this->iAppId";
|
$sUrl = APPDB_ROOT."objectManager.php?sClass=application&iId=$this->iAppId";
|
||||||
|
|||||||
@@ -912,8 +912,13 @@ class ObjectManager
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$oParent = $oObject->objectGetParent();
|
||||||
|
$oParentOM = new objectManager(get_class($oParent), '', $oParent->objectGetId());
|
||||||
|
|
||||||
|
$sClassDisplayName = $oParentOM->GetOptionalSetting('objectGetClassDisplayName', 'parent entry');
|
||||||
|
|
||||||
/* Display some help text */
|
/* Display some help text */
|
||||||
echo "<p>Move ".$oObject->objectMakeLink()." to the parent entry ";
|
echo "<p>Move ".$oObject->objectMakeLink()." to the $sClassDisplayName ";
|
||||||
echo "selected below:</p>\n";
|
echo "selected below:</p>\n";
|
||||||
|
|
||||||
echo "<table width=\"50%\" cellpadding=\"3\">\n";
|
echo "<table width=\"50%\" cellpadding=\"3\">\n";
|
||||||
@@ -922,16 +927,12 @@ class ObjectManager
|
|||||||
"Move here"),
|
"Move here"),
|
||||||
"color4");
|
"color4");
|
||||||
|
|
||||||
$oParent = $oObject->objectGetParent();
|
|
||||||
|
|
||||||
if(method_exists($oParent, 'objectGetParent'))
|
if(method_exists($oParent, 'objectGetParent'))
|
||||||
{
|
{
|
||||||
$oGrandFather = $oParent->objectGetParent();
|
$oGrandFather = $oParent->objectGetParent();
|
||||||
$oParentOM = new objectManager(get_class($oParent), '', $oParent->objectGetId());
|
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
$oGrandFather = null;
|
$oGrandFather = null;
|
||||||
$oParentOM = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if($oGrandFather && $oParentOM->GetOptionalSetting('objectRestrictMoveObjectListsToParents', false))
|
if($oGrandFather && $oParentOM->GetOptionalSetting('objectRestrictMoveObjectListsToParents', false))
|
||||||
@@ -1149,13 +1150,23 @@ class ObjectManager
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function displayChangeParent($oObject, $sLinkText = 'Move to another parent entry')
|
private function displayChangeParent($oObject, $sLinkText = 'default')
|
||||||
{
|
{
|
||||||
/* Display a link to the move child objects page if the class has the necessary
|
/* Display a link to the move child objects page if the class has the necessary
|
||||||
functions and the user has edit rights. Not all classes have child objects. */
|
functions and the user has edit rights. Not all classes have child objects. */
|
||||||
if(method_exists($oObject, "objectSetParent") &&
|
if(method_exists($oObject, "objectSetParent") &&
|
||||||
method_exists($oObject, "objectGetId") && $oObject->canEdit())
|
method_exists($oObject, "objectGetId") && $oObject->canEdit())
|
||||||
{
|
{
|
||||||
|
if($sLinkText == 'default')
|
||||||
|
{
|
||||||
|
$oParent = $oObject->objectGetParent();
|
||||||
|
$oParentOM = new objectManager(get_class($oParent), '', $oParent->objectGetId());
|
||||||
|
$sClassName = $oParentOM->getOptionalSetting('objectGetClassDisplayName', false);
|
||||||
|
if($sClassName)
|
||||||
|
$sLinkText = "Move to another $sClassName";
|
||||||
|
else
|
||||||
|
$sLinkText = 'Move to another parent entry';
|
||||||
|
}
|
||||||
echo "<a href=\"".$this->makeUrl("showChangeParent", $this->iId,
|
echo "<a href=\"".$this->makeUrl("showChangeParent", $this->iId,
|
||||||
"Move to another parent entry")."\">$sLinkText</a>\n";
|
"Move to another parent entry")."\">$sLinkText</a>\n";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -398,6 +398,11 @@ class Vendor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function objectGetClassDisplayName()
|
||||||
|
{
|
||||||
|
return 'developer';
|
||||||
|
}
|
||||||
|
|
||||||
/* Make a URL for viewing the specified vendor */
|
/* Make a URL for viewing the specified vendor */
|
||||||
function objectMakeUrl()
|
function objectMakeUrl()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1447,6 +1447,11 @@ class version {
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function objectGetClassDisplayName()
|
||||||
|
{
|
||||||
|
return 'version';
|
||||||
|
}
|
||||||
|
|
||||||
public function objectMakeUrl()
|
public function objectMakeUrl()
|
||||||
{
|
{
|
||||||
return APPDB_ROOT."objectManager.php?sClass=version&iId=$this->iVersionId";
|
return APPDB_ROOT."objectManager.php?sClass=version&iId=$this->iVersionId";
|
||||||
|
|||||||
Reference in New Issue
Block a user