Page Menu
Home
Mnkras Phabricator
Search
Configure Global Search
Log In
Files
F683289
controller.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
914 B
Subscribers
None
controller.php
View Options
<?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
Details
Attached
Mime Type
text/x-php
Expires
Wed, Jan 22, 12:57 PM (3 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
269932
Attached To
rCMI Custom Menu Items
Event Timeline
Log In to Comment