Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2990386
PhabricatorPhurlURLEditEngine.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
3 KB
Referenced Files
None
Subscribers
None
PhabricatorPhurlURLEditEngine.php
View Options
<?php
final
class
PhabricatorPhurlURLEditEngine
extends
PhabricatorEditEngine
{
const
ENGINECONST
=
'phurl.url'
;
public
function
getEngineName
(
)
{
return
pht
(
'Phurl'
)
;
}
public
function
getEngineApplicationClass
(
)
{
return
PhabricatorPhurlApplication
::
class
;
}
public
function
getSummaryHeader
(
)
{
return
pht
(
'Configure Phurl Forms'
)
;
}
public
function
getSummaryText
(
)
{
return
pht
(
'Configure creation and editing forms in Phurl.'
)
;
}
public
function
isEngineConfigurable
(
)
{
return
false
;
}
protected
function
newEditableObject
(
)
{
return
PhabricatorPhurlURL
::
initializeNewPhurlURL
(
$this
->
getViewer
(
)
)
;
}
protected
function
newObjectQuery
(
)
{
return
new
PhabricatorPhurlURLQuery
(
)
;
}
protected
function
getObjectCreateTitleText
(
$object
)
{
return
pht
(
'Create New URL'
)
;
}
protected
function
getObjectEditTitleText
(
$object
)
{
return
pht
(
'Edit URL: %s'
,
$object
->
getName
(
)
)
;
}
protected
function
getObjectEditShortText
(
$object
)
{
return
$object
->
getName
(
)
;
}
protected
function
getObjectCreateShortText
(
)
{
return
pht
(
'Create URL'
)
;
}
protected
function
getObjectName
(
)
{
return
pht
(
'URL'
)
;
}
protected
function
getObjectCreateCancelURI
(
$object
)
{
return
$this
->
getApplication
(
)
->
getApplicationURI
(
'/'
)
;
}
protected
function
getEditorURI
(
)
{
return
$this
->
getApplication
(
)
->
getApplicationURI
(
'url/edit/'
)
;
}
protected
function
getObjectViewURI
(
$object
)
{
return
$object
->
getURI
(
)
;
}
protected
function
getCreateNewObjectPolicy
(
)
{
return
$this
->
getApplication
(
)
->
getPolicy
(
PhabricatorPhurlURLCreateCapability
::
CAPABILITY
)
;
}
protected
function
buildCustomEditFields
(
$object
)
{
return
array
(
id
(
new
PhabricatorTextEditField
(
)
)
->
setKey
(
'name'
)
->
setLabel
(
pht
(
'Name'
)
)
->
setDescription
(
pht
(
'URL name.'
)
)
->
setIsRequired
(
true
)
->
setConduitTypeDescription
(
pht
(
'New URL name.'
)
)
->
setTransactionType
(
PhabricatorPhurlURLNameTransaction
::
TRANSACTIONTYPE
)
->
setValue
(
$object
->
getName
(
)
)
,
id
(
new
PhabricatorTextEditField
(
)
)
->
setKey
(
'url'
)
->
setLabel
(
pht
(
'URL'
)
)
->
setDescription
(
pht
(
'The URL to shorten.'
)
)
->
setConduitTypeDescription
(
pht
(
'New URL.'
)
)
->
setValue
(
$object
->
getLongURL
(
)
)
->
setIsRequired
(
true
)
->
setTransactionType
(
PhabricatorPhurlURLLongURLTransaction
::
TRANSACTIONTYPE
)
,
id
(
new
PhabricatorTextEditField
(
)
)
->
setKey
(
'alias'
)
->
setLabel
(
pht
(
'Alias'
)
)
->
setIsRequired
(
true
)
->
setTransactionType
(
PhabricatorPhurlURLAliasTransaction
::
TRANSACTIONTYPE
)
->
setDescription
(
pht
(
'The alias to give the URL.'
)
)
->
setConduitTypeDescription
(
pht
(
'New alias.'
)
)
->
setValue
(
$object
->
getAlias
(
)
)
,
id
(
new
PhabricatorRemarkupEditField
(
)
)
->
setKey
(
'description'
)
->
setLabel
(
pht
(
'Description'
)
)
->
setDescription
(
pht
(
'URL long description.'
)
)
->
setConduitTypeDescription
(
pht
(
'New URL description.'
)
)
->
setTransactionType
(
PhabricatorPhurlURLDescriptionTransaction
::
TRANSACTIONTYPE
)
->
setValue
(
$object
->
getDescription
(
)
)
,
)
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Feb 22, 22:40 (21 h, 21 m ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1180050
Default Alt Text
PhabricatorPhurlURLEditEngine.php (3 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment