Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2991581
PonderQuestionEditEngine.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
PonderQuestionEditEngine.php
View Options
<?php
final
class
PonderQuestionEditEngine
extends
PhabricatorEditEngine
{
const
ENGINECONST
=
'ponder.question'
;
public
function
getEngineName
(
)
{
return
pht
(
'Ponder Question'
)
;
}
public
function
getEngineApplicationClass
(
)
{
return
PhabricatorPonderApplication
::
class
;
}
public
function
getSummaryHeader
(
)
{
return
pht
(
'Configure Ponder Question Forms'
)
;
}
public
function
getSummaryText
(
)
{
return
pht
(
'Configure creation and editing forms in Ponder Questions.'
)
;
}
public
function
isEngineConfigurable
(
)
{
return
false
;
}
protected
function
newEditableObject
(
)
{
return
PonderQuestion
::
initializeNewQuestion
(
$this
->
getViewer
(
)
)
;
}
protected
function
newObjectQuery
(
)
{
return
new
PonderQuestionQuery
(
)
;
}
protected
function
getObjectCreateTitleText
(
$object
)
{
return
pht
(
'Create New Question'
)
;
}
protected
function
getObjectEditTitleText
(
$object
)
{
return
pht
(
'Edit Question: %s'
,
$object
->
getTitle
(
)
)
;
}
protected
function
getObjectEditShortText
(
$object
)
{
return
$object
->
getTitle
(
)
;
}
protected
function
getObjectCreateShortText
(
)
{
return
pht
(
'New Question'
)
;
}
protected
function
getObjectName
(
)
{
return
pht
(
'Question'
)
;
}
protected
function
getObjectCreateCancelURI
(
$object
)
{
return
$this
->
getApplication
(
)
->
getApplicationURI
(
'/'
)
;
}
protected
function
getEditorURI
(
)
{
return
$this
->
getApplication
(
)
->
getApplicationURI
(
'question/edit/'
)
;
}
protected
function
getObjectViewURI
(
$object
)
{
return
$object
->
getViewURI
(
)
;
}
protected
function
buildCustomEditFields
(
$object
)
{
return
array
(
id
(
new
PhabricatorTextEditField
(
)
)
->
setKey
(
'title'
)
->
setLabel
(
pht
(
'Question'
)
)
->
setDescription
(
pht
(
'Question title.'
)
)
->
setConduitTypeDescription
(
pht
(
'New question title.'
)
)
->
setTransactionType
(
PonderQuestionTitleTransaction
::
TRANSACTIONTYPE
)
->
setValue
(
$object
->
getTitle
(
)
)
->
setIsRequired
(
true
)
,
id
(
new
PhabricatorRemarkupEditField
(
)
)
->
setKey
(
'content'
)
->
setLabel
(
pht
(
'Details'
)
)
->
setDescription
(
pht
(
'Long details of the question.'
)
)
->
setConduitTypeDescription
(
pht
(
'New question details.'
)
)
->
setValue
(
$object
->
getContent
(
)
)
->
setTransactionType
(
PonderQuestionContentTransaction
::
TRANSACTIONTYPE
)
,
id
(
new
PhabricatorRemarkupEditField
(
)
)
->
setKey
(
'answerWiki'
)
->
setLabel
(
pht
(
'Answer Summary'
)
)
->
setDescription
(
pht
(
'Answer summary of the question.'
)
)
->
setConduitTypeDescription
(
pht
(
'New question answer summary.'
)
)
->
setValue
(
$object
->
getAnswerWiki
(
)
)
->
setTransactionType
(
PonderQuestionAnswerWikiTransaction
::
TRANSACTIONTYPE
)
,
id
(
new
PhabricatorSelectEditField
(
)
)
->
setKey
(
'status'
)
->
setLabel
(
pht
(
'Status'
)
)
->
setDescription
(
pht
(
'Status of the question.'
)
)
->
setConduitTypeDescription
(
pht
(
'New question status.'
)
)
->
setValue
(
$object
->
getStatus
(
)
)
->
setTransactionType
(
PonderQuestionStatusTransaction
::
TRANSACTIONTYPE
)
->
setOptions
(
PonderQuestionStatus
::
getQuestionStatusMap
(
)
)
,
)
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Feb 23, 02:43 (1 d, 9 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1111374
Default Alt Text
PonderQuestionEditEngine.php (3 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment