Changeset View
Changeset View
Standalone View
Standalone View
src/applications/ponder/view/PonderAddAnswerView.php
Show First 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | $form | ||||
->setLabel(pht('Answer')) | ->setLabel(pht('Answer')) | ||||
->setError(true) | ->setError(true) | ||||
->setID('answer-content') | ->setID('answer-content') | ||||
->setUser($this->user)) | ->setUser($this->user)) | ||||
->appendChild( | ->appendChild( | ||||
id(new AphrontFormSubmitControl()) | id(new AphrontFormSubmitControl()) | ||||
->setValue(pht('Add Answer'))); | ->setValue(pht('Add Answer'))); | ||||
if (!$viewer->isLoggedIn()) { | |||||
$login_href = id(new PhutilURI('/auth/start/')) | |||||
->setQueryParam('next', '/Q'.$question->getID()); | |||||
$form = id(new PHUIFormLayoutView()) | |||||
->addClass('login-to-participate') | |||||
->appendChild( | |||||
id(new PHUIButtonView()) | |||||
->setTag('a') | |||||
->setText(pht('Login to Answer')) | |||||
->setHref((string)$login_href)); | |||||
} | |||||
$box = id(new PHUIObjectBoxView()) | $box = id(new PHUIObjectBoxView()) | ||||
->setHeader($header) | ->setHeader($header) | ||||
->appendChild($form); | ->appendChild($form); | ||||
if ($info_panel) { | if ($info_panel) { | ||||
$box->setInfoView($info_panel); | $box->setInfoView($info_panel); | ||||
} | } | ||||
Show All 12 Lines |