Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93610364
PhabricatorPackagesVersionEditEngine.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
Sat, Nov 30, 03:40
Size
2 KB
Mime Type
text/x-php
Expires
Mon, Dec 2, 03:40 (2 d)
Engine
blob
Format
Raw Data
Handle
22638354
Attached To
rPH Phabricator
PhabricatorPackagesVersionEditEngine.php
View Options
<?php
final
class
PhabricatorPackagesVersionEditEngine
extends
PhabricatorPackagesEditEngine
{
const
ENGINECONST
=
'packages.version'
;
public
function
getEngineName
()
{
return
pht
(
'Package Versions'
);
}
public
function
getSummaryHeader
()
{
return
pht
(
'Edit Package Version Configurations'
);
}
public
function
getSummaryText
()
{
return
pht
(
'This engine is used to edit Packages versions.'
);
}
protected
function
newEditableObject
()
{
$viewer
=
$this
->
getViewer
();
return
PhabricatorPackagesVersion
::
initializeNewVersion
(
$viewer
);
}
protected
function
newObjectQuery
()
{
return
new
PhabricatorPackagesVersionQuery
();
}
protected
function
getObjectCreateTitleText
(
$object
)
{
return
pht
(
'Create Version'
);
}
protected
function
getObjectCreateButtonText
(
$object
)
{
return
pht
(
'Create Version'
);
}
protected
function
getObjectEditTitleText
(
$object
)
{
return
pht
(
'Edit Version: %s'
,
$object
->
getName
());
}
protected
function
getObjectEditShortText
(
$object
)
{
return
pht
(
'Edit Version'
);
}
protected
function
getObjectCreateShortText
()
{
return
pht
(
'Create Version'
);
}
protected
function
getObjectName
()
{
return
pht
(
'Version'
);
}
protected
function
getEditorURI
()
{
return
'/packages/version/edit/'
;
}
protected
function
getObjectCreateCancelURI
(
$object
)
{
return
'/packages/version/'
;
}
protected
function
getObjectViewURI
(
$object
)
{
return
$object
->
getURI
();
}
protected
function
buildCustomEditFields
(
$object
)
{
$fields
=
array
();
if
(
$this
->
getIsCreate
())
{
$fields
[]
=
id
(
new
PhabricatorDatasourceEditField
())
->
setKey
(
'package'
)
->
setAliases
(
array
(
'packagePHID'
))
->
setLabel
(
pht
(
'Package'
))
->
setDescription
(
pht
(
'Package for this version.'
))
->
setTransactionType
(
PhabricatorPackagesVersionPackageTransaction
::
TRANSACTIONTYPE
)
->
setIsRequired
(
true
)
->
setDatasource
(
new
PhabricatorPackagesPackageDatasource
())
->
setSingleValue
(
$object
->
getPackagePHID
());
$fields
[]
=
id
(
new
PhabricatorTextEditField
())
->
setKey
(
'name'
)
->
setLabel
(
pht
(
'Name'
))
->
setDescription
(
pht
(
'Name of the version.'
))
->
setTransactionType
(
PhabricatorPackagesVersionNameTransaction
::
TRANSACTIONTYPE
)
->
setIsRequired
(
true
)
->
setValue
(
$object
->
getName
());
}
return
$fields
;
}
}
Event Timeline
Log In to Comment