Created
May 24, 2016 10:54
-
-
Save hissy/137b748448c1cac5c61bcab28aea668f 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(); | |
if ($inheritance !== 'PARENT') { | |
$node->title = $node->title . ' (' . $inheritance . ')'; | |
} | |
} | |
return $node; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment