Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F101305516
AlmanacNamespaceEditEngine.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
Fri, Feb 7, 15:27
Size
2 KB
Mime Type
text/x-php
Expires
Sun, Feb 9, 15:27 (2 d)
Engine
blob
Format
Raw Data
Handle
24134063
Attached To
rPH Phabricator
AlmanacNamespaceEditEngine.php
View Options
<?php
final
class
AlmanacNamespaceEditEngine
extends
PhabricatorEditEngine
{
const
ENGINECONST
=
'almanac.namespace'
;
public
function
isEngineConfigurable
()
{
return
false
;
}
public
function
getEngineName
()
{
return
pht
(
'Almanac Namespaces'
);
}
public
function
getSummaryHeader
()
{
return
pht
(
'Edit Almanac Namespace Configurations'
);
}
public
function
getSummaryText
()
{
return
pht
(
'This engine is used to edit Almanac namespaces.'
);
}
public
function
getEngineApplicationClass
()
{
return
'PhabricatorAlmanacApplication'
;
}
protected
function
newEditableObject
()
{
return
AlmanacNamespace
::
initializeNewNamespace
();
}
protected
function
newObjectQuery
()
{
return
new
AlmanacNamespaceQuery
();
}
protected
function
getObjectCreateTitleText
(
$object
)
{
return
pht
(
'Create Namespace'
);
}
protected
function
getObjectCreateButtonText
(
$object
)
{
return
pht
(
'Create Namespace'
);
}
protected
function
getObjectEditTitleText
(
$object
)
{
return
pht
(
'Edit Namespace: %s'
,
$object
->
getName
());
}
protected
function
getObjectEditShortText
(
$object
)
{
return
pht
(
'Edit Namespace'
);
}
protected
function
getObjectCreateShortText
()
{
return
pht
(
'Create Namespace'
);
}
protected
function
getObjectName
()
{
return
pht
(
'Namespace'
);
}
protected
function
getEditorURI
()
{
return
'/almanac/namespace/edit/'
;
}
protected
function
getObjectCreateCancelURI
(
$object
)
{
return
'/almanac/namespace/'
;
}
protected
function
getObjectViewURI
(
$object
)
{
$id
=
$object
->
getID
();
return
"/almanac/namespace/{$id}/"
;
}
protected
function
getCreateNewObjectPolicy
()
{
return
$this
->
getApplication
()->
getPolicy
(
AlmanacCreateNamespacesCapability
::
CAPABILITY
);
}
protected
function
buildCustomEditFields
(
$object
)
{
return
array
(
id
(
new
PhabricatorTextEditField
())
->
setKey
(
'name'
)
->
setLabel
(
pht
(
'Name'
))
->
setDescription
(
pht
(
'Name of the namespace.'
))
->
setTransactionType
(
AlmanacNamespaceNameTransaction
::
TRANSACTIONTYPE
)
->
setIsRequired
(
true
)
->
setValue
(
$object
->
getName
()),
);
}
}
Event Timeline
Log In to Comment