-
-
Save katzueno/fc314afdce63c5164f3f10493f86b554 to your computer and use it in GitHub Desktop.
#concrete5 #version7 Show Permission Inheritance on Sitemap dynatree
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Add below line to application/bootstrap/app.php | |
Core::bind('helper/concrete/dashboard/sitemap', 'Application\Src\Application\Service\Dashboard\PermissionSitemap'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Upload this file to application/src/Application/Service/Dashboard/PermissionSitemap.php | |
namespace Application\Src\Application\Service\Dashboard; | |
use Page; | |
class PermissionSitemap extends \Concrete\Core\Application\Service\Dashboard\Sitemap | |
{ | |
public function getNode($cItem, $includeChildren = true, $onGetNode = null) | |
{ | |
$node = parent::getNode($cItem, $includeChildren, $onGetNode); | |
$c = Page::getByID($node->cID, 'RECENT'); | |
if (!$c->isError()) { | |
$inheritance = $c->getCollectionInheritance(); | |
switch ($inheritance) { | |
case 'TEMPLATE': | |
$inheritance = t("PageType"); | |
$node->title = '<span style="color:blue">' . $node->title . ' (' . $inheritance . ')</span>'; | |
break; | |
case 'OVERRIDE': | |
$inheritance = t("Manual"); | |
$node->title = '<span style="color:red">' . $node->title . ' (' . $inheritance . ')</span>'; | |
break; | |
case 'PARENT': | |
break; | |
} | |
} | |
return $node; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment