Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F939633
PhabricatorApplicationConfigurationPanel.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
PhabricatorApplicationConfigurationPanel.php
View Options
<?php
abstract
class
PhabricatorApplicationConfigurationPanel
extends
Phobject
{
private
$viewer
;
private
$application
;
public
function
setViewer
(
PhabricatorUser
$viewer
)
{
$this
->
viewer
=
$viewer
;
return
$this
;
}
public
function
getViewer
()
{
return
$this
->
viewer
;
}
public
function
setApplication
(
PhabricatorApplication
$application
)
{
$this
->
application
=
$application
;
return
$this
;
}
public
function
getApplication
()
{
return
$this
->
application
;
}
/**
* Get the URI for this application configuration panel.
*
* @param string? $path Optional path to append.
* @return string Relative URI for the panel.
*/
public
function
getPanelURI
(
$path
=
''
)
{
$app_key
=
get_class
(
$this
->
getApplication
());
$panel_key
=
$this
->
getPanelKey
();
$base
=
"/applications/panel/{$app_key}/{$panel_key}/"
;
return
$base
.
ltrim
(
$path
,
'/'
);
}
/**
* Return a short, unique string key which identifies this panel.
*
* This key is used in URIs. Good values might be "email" or "files".
*/
abstract
public
function
getPanelKey
();
abstract
public
function
shouldShowForApplication
(
PhabricatorApplication
$application
);
abstract
public
function
buildConfigurationPagePanel
();
abstract
public
function
handlePanelRequest
(
AphrontRequest
$request
,
PhabricatorController
$controller
);
public
static
function
loadAllPanels
()
{
return
id
(
new
PhutilClassMapQuery
())
->
setAncestorClass
(
__CLASS__
)
->
setUniqueMethod
(
'getPanelKey'
)
->
execute
();
}
public
static
function
loadAllPanelsForApplication
(
PhabricatorApplication
$application
)
{
$panels
=
self
::
loadAllPanels
();
$application_panels
=
array
();
foreach
(
$panels
as
$key
=>
$panel
)
{
if
(!
$panel
->
shouldShowForApplication
(
$application
))
{
continue
;
}
$application_panels
[
$key
]
=
$panel
;
}
return
$application_panels
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Jun 17, 5:01 AM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
221731
Default Alt Text
PhabricatorApplicationConfigurationPanel.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment