Page MenuHomeMnkras Phabricator

controller.php
No OneTemporary

controller.php

<?php
namespace Concrete\Package\CustomMenuItems\MenuItem\CustomMenuItem;
use HtmlObject\Link;
class Controller extends \Concrete\Core\Application\UserInterface\Menu\Item\Controller
{
public $menuItem;
public function getMenuItemLinkElement()
{
$a = new Link();
$page = \Page::getByID($this->menuItem->getLink());
$a->setValue(h(t($page->getCollectionName())));
$a->href($page->getCollectionLink());
$a->style('line-height: 14px;padding-top: 16px;width: '.(strlen($page->getCollectionName()) * 6.5 + 30).'px;');
return $a;
}
public function displayItem()
{
$page = \Page::getByID($this->menuItem->getLink());
if (is_object($page) && !$page->isError()) {
$tcp = new \Permissions($page);
if ($tcp->canRead()) {
return true;
}
}
return false;
}
}

File Metadata

Mime Type
text/x-php
Expires
Wed, Jan 22, 11:33 PM (14 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
269932

Event Timeline