Skip to content

Instantly share code, notes, and snippets.

@hissy
Created May 24, 2016 10:54
Show Gist options
  • Save hissy/137b748448c1cac5c61bcab28aea668f to your computer and use it in GitHub Desktop.
Save hissy/137b748448c1cac5c61bcab28aea668f to your computer and use it in GitHub Desktop.
#concrete5 #version7 Show Permission Inheritance on Sitemap dynatree
<?php
// Add below line to application/bootstrap/app.php
Core::bind('helper/concrete/dashboard/sitemap', 'Application\Src\Application\Service\Dashboard\PermissionSitemap');
<?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