Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F90657475
PhabricatorPhurlURLEditEngine.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
Sun, Nov 3, 15:36
Size
3 KB
Mime Type
text/x-php
Expires
Tue, Nov 5, 15:36 (2 d)
Engine
blob
Format
Raw Data
Handle
22115626
Attached To
rPH Phabricator
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'
;
}
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
()),
);
}
}
Event Timeline
Log In to Comment