mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
ENHANCEMENT: #6579 Show page status in page tree
This commit is contained in:
parent
1914f0b29d
commit
afecc6b20b
@ -251,9 +251,10 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
|||||||
$def[$class]['defaultChild'] = $defaultChild;
|
$def[$class]['defaultChild'] = $defaultChild;
|
||||||
|
|
||||||
$defaultParent = $obj->defaultParent();
|
$defaultParent = $obj->defaultParent();
|
||||||
|
if(SiteTree::get_by_link($defaultParent)) {
|
||||||
$id = $defaultParent ? SiteTree::get_by_link($defaultParent)->ID : null;
|
$id = $defaultParent ? SiteTree::get_by_link($defaultParent)->ID : null;
|
||||||
$defaultParent = $id ? SiteTree::get_by_link($obj->defaultParent())->ID : null;
|
$defaultParent = $id ? SiteTree::get_by_link($obj->defaultParent())->ID : null;
|
||||||
|
}
|
||||||
if ($defaultParent != 1 && $defaultParent != null) $def[$class]['defaultParent'] = $defaultParent;
|
if ($defaultParent != 1 && $defaultParent != null) $def[$class]['defaultParent'] = $defaultParent;
|
||||||
|
|
||||||
if(is_array($def[$class]['disallowedChildren'])) {
|
if(is_array($def[$class]['disallowedChildren'])) {
|
||||||
|
@ -2465,22 +2465,23 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
|||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function getTreeTitle() {
|
function getTreeTitle() {
|
||||||
|
$text = Convert::raw2xml(str_replace(array("\n","\r"),"",$this->MenuTitle));
|
||||||
if($this->IsDeletedFromStage) {
|
if($this->IsDeletedFromStage) {
|
||||||
if($this->ExistsOnLive) {
|
if($this->ExistsOnLive) {
|
||||||
$tag ="span class=\"del\" title=\"" . _t('SiteTree.REMOVEDFROMDRAFT', 'Removed from draft site') . "\"";
|
$tag ="<span class=\"del item\" title=\"" . _t('SiteTree.REMOVEDFROMDRAFT', 'Removed from draft site') . "\" >{$text}</span> <span class=\"badge removedfromdraft\">" . _t('SiteTree.REMOVEDFROMDRAFT', 'Removed from draft site') . "</span>";
|
||||||
} else {
|
} else {
|
||||||
$tag ="span class=\"del\" class=\"deletedOnLive\" title=\"" . _t('SiteTree.DELETEDPAGE', 'Deleted page') . "\"";
|
$tag ="<span class=\"del item\" title=\"" . _t('SiteTree.DELETEDPAGE', 'Deleted page') . "\">{$text}</span> <span class=\"badge deletedonlive\">". _t('SiteTree.DELETEDPAGE', 'Deleted page') . "</span>";
|
||||||
}
|
}
|
||||||
} elseif($this->IsAddedToStage) {
|
} elseif($this->IsAddedToStage) {
|
||||||
$tag = "span class=\"ins\" title=\"" . _t('SiteTree.ADDEDTODRAFT', 'Added to draft site') . "\"";
|
$tag = "<span class=\"ins item\" title=\"" . _t('SiteTree.ADDEDTODRAFT', 'Added to draft site') . "\">{$text}</span> <span class=\"badge addedtodraft\">". _t('SiteTree.ADDEDTODRAFT', 'Added to draft site') . "</span>";
|
||||||
} elseif($this->IsModifiedOnStage) {
|
} elseif($this->IsModifiedOnStage) {
|
||||||
$tag = "span title=\"" . _t('SiteTree.MODIFIEDONDRAFT', 'Modified on draft site') . "\" class=\"status modified\"";
|
$tag = "<span title=\"" . _t('SiteTree.MODIFIEDONDRAFT', 'Modified on draft site') . "\" class=\"ins item\">{$text}</span> <span class=\"badge modified\">" . _t('SiteTree.MODIFIEDONDRAFT', 'Modified on draft site') . "</span>";
|
||||||
} else {
|
} else {
|
||||||
$tag = '';
|
$tag = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$text = Convert::raw2xml(str_replace(array("\n","\r"),"",$this->MenuTitle));
|
|
||||||
return ($tag) ? "<span class=\"jstree-pageicon\"></span>"."<$tag>" . $text . "</" . strtok($tag,' ') . ">" : "<span class=\"jstree-pageicon\"></span>". $text;
|
return ($tag) ? "<span class=\"jstree-pageicon\"></span>". $tag : "<span class=\"jstree-pageicon\"></span>". $text;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user