Skip to content
Browse files

ENHANCEMENT: #6579 Show page status in page tree

  • Loading branch information...
1 parent 1914f0b commit afecc6b20bd39de11ddb56afc91a0fdcb0c4e625 @wolfv wolfv committed Dec 22, 2011
Showing with 9 additions and 7 deletions.
  1. +2 −1 code/controllers/CMSMain.php
  2. +7 −6 code/model/SiteTree.php
View
3 code/controllers/CMSMain.php
@@ -251,9 +251,10 @@ public function SiteTreeHints() {
$def[$class]['defaultChild'] = $defaultChild;
$defaultParent = $obj->defaultParent();
+ if(SiteTree::get_by_link($defaultParent)) {
$id = $defaultParent ? SiteTree::get_by_link($defaultParent)->ID : null;
$defaultParent = $id ? SiteTree::get_by_link($obj->defaultParent())->ID : null;
-
+ }
if ($defaultParent != 1 && $defaultParent != null) $def[$class]['defaultParent'] = $defaultParent;
if(is_array($def[$class]['disallowedChildren'])) {
View
13 code/model/SiteTree.php
@@ -2465,22 +2465,23 @@ function TreeTitle() {
* @return string
*/
function getTreeTitle() {
+ $text = Convert::raw2xml(str_replace(array("\n","\r"),"",$this->MenuTitle));
if($this->IsDeletedFromStage) {
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 {
- $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) {
- $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) {
- $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 {
$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;
}
/**

0 comments on commit afecc6b

Please sign in to comment.
Something went wrong with that request. Please try again.