Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F81195609
DiffusionRepositoryManagementPanel.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Sep 4, 16:57
Size
2 KB
Mime Type
text/x-php
Expires
Fri, Sep 6, 16:57 (2 d)
Engine
blob
Format
Raw Data
Handle
20473050
Attached To
rPH Phabricator
DiffusionRepositoryManagementPanel.php
View Options
<?php
abstract
class
DiffusionRepositoryManagementPanel
extends
Phobject
{
private
$viewer
;
private
$repository
;
private
$controller
;
final
public
function
setViewer
(
PhabricatorUser
$viewer
)
{
$this
->
viewer
=
$viewer
;
return
$this
;
}
final
public
function
getViewer
()
{
return
$this
->
viewer
;
}
final
public
function
setRepository
(
PhabricatorRepository
$repository
)
{
$this
->
repository
=
$repository
;
return
$this
;
}
final
public
function
getRepository
()
{
return
$this
->
repository
;
}
final
public
function
setController
(
PhabricatorController
$controller
)
{
$this
->
controller
=
$controller
;
return
$this
;
}
final
public
function
getManagementPanelKey
()
{
return
$this
->
getPhobjectClassConstant
(
'PANELKEY'
);
}
abstract
public
function
getManagementPanelLabel
();
abstract
public
function
getManagementPanelOrder
();
abstract
public
function
buildManagementPanelContent
();
protected
function
buildManagementPanelActions
()
{
return
array
();
}
final
protected
function
newActions
()
{
$actions
=
$this
->
buildManagementPanelActions
();
if
(!
$actions
)
{
return
null
;
}
$viewer
=
$this
->
getViewer
();
$action_list
=
id
(
new
PhabricatorActionListView
())
->
setViewer
(
$viewer
);
foreach
(
$actions
as
$action
)
{
$action_list
->
addAction
(
$action
);
}
return
$action_list
;
}
public
function
buildManagementPanelCurtain
()
{
// TODO: Delete or fix this, curtains always render in the left gutter
// at the moment.
return
null
;
$actions
=
$this
->
newActions
();
if
(!
$actions
)
{
return
null
;
}
$viewer
=
$this
->
getViewer
();
$curtain
=
id
(
new
PHUICurtainView
())
->
setViewer
(
$viewer
)
->
setActionList
(
$actions
);
return
$curtain
;
}
public
static
function
getAllPanels
()
{
return
id
(
new
PhutilClassMapQuery
())
->
setAncestorClass
(
__CLASS__
)
->
setUniqueMethod
(
'getManagementPanelKey'
)
->
setSortMethod
(
'getManagementPanelOrder'
)
->
execute
();
}
final
protected
function
newBox
(
$header_text
,
$body
)
{
return
id
(
new
PHUIObjectBoxView
())
->
setHeaderText
(
$header_text
)
->
setBackground
(
PHUIObjectBoxView
::
BLUE_PROPERTY
)
->
appendChild
(
$body
);
}
final
protected
function
newTimeline
()
{
return
$this
->
controller
->
newTimeline
(
$this
->
getRepository
());
}
}
Event Timeline
Log In to Comment