From 8f980e1e020af52b528dd88ee6a494634a4363b8 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Fri, 14 Sep 2007 19:42:24 +0000 Subject: [PATCH] elofgren: USABILITY: Add tooltips to pages in 'Site Content' tree showing 'Page type: className' where className is the page's type. More info: http://www.elijahlofgren.com/silverstripe/icons-missing-from-left-navigation-tree-key/ (merged from branches/gsoc) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@41809 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- code/LeftAndMain.php | 2 +- javascript/LeftAndMain_left.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/code/LeftAndMain.php b/code/LeftAndMain.php index 447dfe15..cc71032e 100644 --- a/code/LeftAndMain.php +++ b/code/LeftAndMain.php @@ -297,7 +297,7 @@ abstract class LeftAndMain extends Controller { // getChildrenAsUL is a flexible and complex way of traversing the tree $siteTree = $obj->getChildrenAsUL("", ' "
  • ID\" class=\"" . $child->CMSTreeClasses($extraArg) . "\">" . - "Link(),0,-1), "show", $child->ID) . "\" " . (($child->canEdit() || $child->canAddChildren()) ? "" : "class=\"disabled\"") . ">" . + "Link(),0,-1), "show", $child->ID) . "\" " . (($child->canEdit() || $child->canAddChildren()) ? "" : "class=\"disabled\"") . " title=\"Page type: ".$child->class."\" >" . ($child->TreeTitle()) . "" ' diff --git a/javascript/LeftAndMain_left.js b/javascript/LeftAndMain_left.js index 9e191031..cc8de246 100755 --- a/javascript/LeftAndMain_left.js +++ b/javascript/LeftAndMain_left.js @@ -66,6 +66,7 @@ TreeAPI.prototype = { var aTag = document.createElement('a'); aTag.href = SiteTreeHandlers.showRecord_url + idx; + aTag.title = 'Page type: ' + pageType; aTag.innerHTML = title; node.appendChild(aTag); @@ -95,6 +96,8 @@ TreeAPI.prototype = { this.performOnTreeNode(idx, function(treeNode) { treeNode.className = treeNode.className.replace(oldClassName,newClassName); treeNode.aSpan.className = 'a ' + treeNode.className.replace('closed','spanClosed'); + var aTag = treeNode.getElementsByTagName('a')[0]; + aTag.title = 'Page type: ' + newClassName; treeNode.setIconByClass(); }); },