ENHANCEMENT: #6579 Show page status in page tree

This commit is contained in:
Wolf Vollprecht 2011-12-22 15:11:41 +01:00
parent 1914f0b29d
commit afecc6b20b
2 changed files with 9 additions and 7 deletions

View File

@ -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'])) {

View File

@ -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;
} }
/** /**