Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F90665389
PonderAddAnswerView.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, 17:07
Size
1 KB
Mime Type
text/x-php
Expires
Tue, Nov 5, 17:07 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22116545
Attached To
rPH Phabricator
PonderAddAnswerView.php
View Options
<?php
final
class
PonderAddAnswerView
extends
AphrontView
{
private
$question
;
private
$actionURI
;
private
$draft
;
public
function
setQuestion
(
$question
)
{
$this
->
question
=
$question
;
return
$this
;
}
public
function
setActionURI
(
$uri
)
{
$this
->
actionURI
=
$uri
;
return
$this
;
}
public
function
render
()
{
require_celerity_resource
(
'ponder-core-view-css'
);
$is_serious
=
PhabricatorEnv
::
getEnvConfig
(
'phabricator.serious-business'
);
$question
=
$this
->
question
;
$header
=
id
(
new
PhabricatorHeaderView
())
->
setHeader
(
'Add Answer'
);
$form
=
new
AphrontFormView
();
$form
->
setFlexible
(
true
)
->
setUser
(
$this
->
user
)
->
setAction
(
$this
->
actionURI
)
->
setWorkflow
(
true
)
->
addHiddenInput
(
'question_id'
,
$question
->
getID
())
->
appendChild
(
id
(
new
PhabricatorRemarkupControl
())
->
setName
(
'answer'
)
->
setLabel
(
'Answer'
)
->
setError
(
true
)
->
setID
(
'answer-content'
)
->
setUser
(
$this
->
user
))
->
appendChild
(
id
(
new
AphrontFormSubmitControl
())
->
setValue
(
$is_serious
?
'Submit'
:
'Make it so'
));
$preview
=
hsprintf
(
'<div class="aphront-panel-flush">'
.
'<div id="answer-preview">'
.
'<span class="aphront-panel-preview-loading-text">'
.
'Loading answer preview...'
.
'</span>'
.
'</div>'
.
'</div>'
);
Javelin
::
initBehavior
(
'ponder-feedback-preview'
,
array
(
'uri'
=>
'/ponder/answer/preview/'
,
'content'
=>
'answer-content'
,
'preview'
=>
'answer-preview'
,
'question_id'
=>
$question
->
getID
()
));
return
id
(
new
AphrontNullView
())
->
appendChild
(
array
(
$header
,
$form
,
$preview
,
))
->
render
();
}
}
Event Timeline
Log In to Comment