Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F436643
PhabricatorProjectReportsProfileMenuItem.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
PhabricatorProjectReportsProfileMenuItem.php
View Options
<?php
final
class
PhabricatorProjectReportsProfileMenuItem
extends
PhabricatorProfileMenuItem
{
const
MENUITEMKEY
=
'project.reports'
;
public
function
getMenuItemTypeName
()
{
return
pht
(
'Project Reports'
);
}
private
function
getDefaultName
()
{
return
pht
(
'Reports (Prototype)'
);
}
public
function
getMenuItemTypeIcon
()
{
return
'fa-area-chart'
;
}
public
function
canMakeDefault
(
PhabricatorProfileMenuItemConfiguration
$config
)
{
return
true
;
}
public
function
shouldEnableForObject
(
$object
)
{
$viewer
=
$this
->
getViewer
();
if
(!
PhabricatorEnv
::
getEnvConfig
(
'phabricator.show-prototypes'
))
{
return
false
;
}
$class
=
'PhabricatorManiphestApplication'
;
if
(!
PhabricatorApplication
::
isClassInstalledForViewer
(
$class
,
$viewer
))
{
return
false
;
}
$class
=
'PhabricatorFactApplication'
;
if
(!
PhabricatorApplication
::
isClassInstalledForViewer
(
$class
,
$viewer
))
{
return
false
;
}
return
true
;
}
public
function
getDisplayName
(
PhabricatorProfileMenuItemConfiguration
$config
)
{
$name
=
$config
->
getMenuItemProperty
(
'name'
);
if
(
phutil_nonempty_string
(
$name
))
{
return
$name
;
}
return
$this
->
getDefaultName
();
}
public
function
buildEditEngineFields
(
PhabricatorProfileMenuItemConfiguration
$config
)
{
return
array
(
id
(
new
PhabricatorTextEditField
())
->
setKey
(
'name'
)
->
setLabel
(
pht
(
'Name'
))
->
setPlaceholder
(
$this
->
getDefaultName
())
->
setValue
(
$config
->
getMenuItemProperty
(
'name'
)),
);
}
protected
function
newMenuItemViewList
(
PhabricatorProfileMenuItemConfiguration
$config
)
{
$project
=
$config
->
getProfileObject
();
$id
=
$project
->
getID
();
$uri
=
$project
->
getReportsURI
();
$name
=
$this
->
getDisplayName
(
$config
);
$item
=
$this
->
newItemView
()
->
setURI
(
$uri
)
->
setName
(
$name
)
->
setIcon
(
'fa-area-chart'
);
return
array
(
$item
,
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, May 4, 12:04 AM (1 d, 12 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
62829
Default Alt Text
PhabricatorProjectReportsProfileMenuItem.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment