mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-27 01:02:42 +01:00
Revert "Promote phutil-tag again"
This reverts commit8fbabdc06d
, reversing changes made to2dab1c1e42
.
This commit is contained in:
parent
8fbabdc06d
commit
73cce6e131
264 changed files with 1717 additions and 1691 deletions
|
@ -9,7 +9,7 @@
|
|||
final class AphrontRequest {
|
||||
|
||||
// NOTE: These magic request-type parameters are automatically included in
|
||||
// certain requests (e.g., by phabricator_form(), JX.Request,
|
||||
// certain requests (e.g., by phabricator_render_form(), JX.Request,
|
||||
// JX.Workflow, and ConduitClient) and help us figure out what sort of
|
||||
// response the client expects.
|
||||
|
||||
|
|
|
@ -210,7 +210,7 @@ class AphrontDefaultApplicationConfiguration
|
|||
|
||||
if ($ex instanceof AphrontUsageException) {
|
||||
$error = new AphrontErrorView();
|
||||
$error->setTitle($ex->getTitle());
|
||||
$error->setTitle(phutil_escape_html($ex->getTitle()));
|
||||
$error->appendChild($ex->getMessage());
|
||||
|
||||
$view = new PhabricatorStandardPageView();
|
||||
|
@ -227,8 +227,8 @@ class AphrontDefaultApplicationConfiguration
|
|||
// Always log the unhandled exception.
|
||||
phlog($ex);
|
||||
|
||||
$class = get_class($ex);
|
||||
$message = $ex->getMessage();
|
||||
$class = phutil_escape_html(get_class($ex));
|
||||
$message = phutil_escape_html($ex->getMessage());
|
||||
|
||||
if ($ex instanceof AphrontQuerySchemaException) {
|
||||
$message .=
|
||||
|
@ -244,13 +244,11 @@ class AphrontDefaultApplicationConfiguration
|
|||
$trace = null;
|
||||
}
|
||||
|
||||
$content = hsprintf(
|
||||
$content =
|
||||
'<div class="aphront-unhandled-exception">'.
|
||||
'<div class="exception-message">%s</div>'.
|
||||
'%s'.
|
||||
'</div>',
|
||||
$message,
|
||||
$trace);
|
||||
'<div class="exception-message">'.$message.'</div>'.
|
||||
$trace.
|
||||
'</div>';
|
||||
|
||||
$dialog = new AphrontDialogView();
|
||||
$dialog
|
||||
|
@ -350,17 +348,17 @@ class AphrontDefaultApplicationConfiguration
|
|||
),
|
||||
$relative);
|
||||
}
|
||||
$file_name = hsprintf('%s : %d', $file_name, $part['line']);
|
||||
$file_name = $file_name.' : '.(int)$part['line'];
|
||||
} else {
|
||||
$file_name = phutil_tag('em', array(), '(Internal)');
|
||||
$file_name = '<em>(Internal)</em>';
|
||||
}
|
||||
|
||||
|
||||
$rows[] = array(
|
||||
$depth--,
|
||||
$lib,
|
||||
phutil_escape_html($lib),
|
||||
$file_name,
|
||||
$where,
|
||||
phutil_escape_html($where),
|
||||
);
|
||||
}
|
||||
$table = new AphrontTableView($rows);
|
||||
|
@ -379,12 +377,11 @@ class AphrontDefaultApplicationConfiguration
|
|||
'wide',
|
||||
));
|
||||
|
||||
return hsprintf(
|
||||
return
|
||||
'<div class="exception-trace">'.
|
||||
'<div class="exception-trace-header">Stack Trace</div>'.
|
||||
'%s',
|
||||
'</div>',
|
||||
$table->render());
|
||||
$table->render().
|
||||
'</div>';
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ final class DarkConsoleErrorLogPlugin extends DarkConsolePlugin {
|
|||
$data = $this->getData();
|
||||
|
||||
$rows = array();
|
||||
$details = array();
|
||||
$details = '';
|
||||
|
||||
foreach ($data as $index => $row) {
|
||||
$file = $row['file'];
|
||||
|
@ -50,11 +50,11 @@ final class DarkConsoleErrorLogPlugin extends DarkConsolePlugin {
|
|||
$row['str'].' at ['.basename($file).':'.$line.']');
|
||||
$rows[] = array($tag);
|
||||
|
||||
$details[] = hsprintf(
|
||||
'<div class="dark-console-panel-error-details" id="row-details-%s">'.
|
||||
"%s\nStack trace:\n",
|
||||
$index,
|
||||
$row['details']);
|
||||
$details .=
|
||||
'<div class="dark-console-panel-error-details" id="row-details-'.
|
||||
$index.'">'.
|
||||
phutil_escape_html($row['details'])."\n".
|
||||
'Stack trace:'."\n";
|
||||
|
||||
foreach ($row['trace'] as $key => $entry) {
|
||||
$line = '';
|
||||
|
@ -73,16 +73,16 @@ final class DarkConsoleErrorLogPlugin extends DarkConsolePlugin {
|
|||
}
|
||||
}
|
||||
|
||||
$details[] = phutil_tag(
|
||||
$details .= phutil_tag(
|
||||
'a',
|
||||
array(
|
||||
'href' => $href,
|
||||
),
|
||||
$line);
|
||||
$details[] = "\n";
|
||||
$details .= "\n";
|
||||
}
|
||||
|
||||
$details[] = hsprintf('</div>');
|
||||
$details .= '</div>';
|
||||
}
|
||||
|
||||
$table = new AphrontTableView($rows);
|
||||
|
@ -90,13 +90,11 @@ final class DarkConsoleErrorLogPlugin extends DarkConsolePlugin {
|
|||
$table->setHeaders(array('Error'));
|
||||
$table->setNoDataString('No errors.');
|
||||
|
||||
return hsprintf(
|
||||
'<div>'.
|
||||
'<div>%s</div>'.
|
||||
'<pre class="PhabricatorMonospaced">%s</pre>'.
|
||||
'</div>',
|
||||
$table->render(),
|
||||
phutil_implode_html('', $details));
|
||||
return '<div>'.
|
||||
'<div>'.$table->render().'</div>'.
|
||||
'<pre class="PhabricatorMonospaced">'.
|
||||
$details.'</pre>'.
|
||||
'</div>';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -42,14 +42,17 @@ final class DarkConsoleEventPlugin extends DarkConsolePlugin {
|
|||
|
||||
$out = array();
|
||||
|
||||
$out[] = hsprintf(
|
||||
$out[] =
|
||||
'<div class="dark-console-panel-header">'.
|
||||
'<h1>Registered Event Listeners</h1>'.
|
||||
'</div>');
|
||||
'</div>';
|
||||
|
||||
$rows = array();
|
||||
foreach ($data['listeners'] as $listener) {
|
||||
$rows[] = array($listener['id'], $listener['class']);
|
||||
$rows[] = array(
|
||||
phutil_escape_html($listener['id']),
|
||||
phutil_escape_html($listener['class']),
|
||||
);
|
||||
}
|
||||
|
||||
$table = new AphrontTableView($rows);
|
||||
|
@ -66,15 +69,15 @@ final class DarkConsoleEventPlugin extends DarkConsolePlugin {
|
|||
|
||||
$out[] = $table->render();
|
||||
|
||||
$out[] = hsprintf(
|
||||
$out[] =
|
||||
'<div class="dark-console-panel-header">'.
|
||||
'<h1>Event Log</h1>'.
|
||||
'</div>');
|
||||
'</div>';
|
||||
|
||||
$rows = array();
|
||||
foreach ($data['events'] as $event) {
|
||||
$rows[] = array(
|
||||
$event['type'],
|
||||
phutil_escape_html($event['type']),
|
||||
$event['stopped'] ? 'STOPPED' : null,
|
||||
);
|
||||
}
|
||||
|
@ -93,6 +96,6 @@ final class DarkConsoleEventPlugin extends DarkConsolePlugin {
|
|||
$out[] = $table->render();
|
||||
|
||||
|
||||
return phutil_implode_html("\n", $out);
|
||||
return implode("\n", $out);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,8 +43,8 @@ final class DarkConsoleRequestPlugin extends DarkConsolePlugin {
|
|||
$rows = array();
|
||||
foreach ($map as $key => $value) {
|
||||
$rows[] = array(
|
||||
$key,
|
||||
(is_array($value) ? json_encode($value) : $value),
|
||||
phutil_escape_html($key),
|
||||
phutil_escape_html(is_array($value) ? json_encode($value) : $value),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -62,6 +62,6 @@ final class DarkConsoleRequestPlugin extends DarkConsolePlugin {
|
|||
$out[] = $table->render();
|
||||
}
|
||||
|
||||
return phutil_implode_html("\n", $out);
|
||||
return implode("\n", $out);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -149,21 +149,20 @@ final class DarkConsoleServicesPlugin extends DarkConsolePlugin {
|
|||
$log = $data['log'];
|
||||
$results = array();
|
||||
|
||||
$results[] = hsprintf(
|
||||
$results[] =
|
||||
'<div class="dark-console-panel-header">'.
|
||||
'%s'.
|
||||
phutil_tag(
|
||||
'a',
|
||||
array(
|
||||
'href' => $data['analyzeURI'],
|
||||
'class' => $data['didAnalyze']
|
||||
? 'disabled button'
|
||||
: 'green button',
|
||||
),
|
||||
'Analyze Query Plans').
|
||||
'<h1>Calls to External Services</h1>'.
|
||||
'<div style="clear: both;"></div>'.
|
||||
'</div>',
|
||||
phutil_tag(
|
||||
'a',
|
||||
array(
|
||||
'href' => $data['analyzeURI'],
|
||||
'class' => $data['didAnalyze']
|
||||
? 'disabled button'
|
||||
: 'green button',
|
||||
),
|
||||
'Analyze Query Plans'));
|
||||
'</div>';
|
||||
|
||||
$page_total = $data['end'] - $data['start'];
|
||||
$totals = array();
|
||||
|
@ -225,18 +224,23 @@ final class DarkConsoleServicesPlugin extends DarkConsolePlugin {
|
|||
$row['explain']['reason']);
|
||||
}
|
||||
|
||||
$info = phutil_escape_html($info);
|
||||
break;
|
||||
case 'connect':
|
||||
$info = $row['host'].':'.$row['database'];
|
||||
$info = phutil_escape_html($info);
|
||||
break;
|
||||
case 'exec':
|
||||
$info = $row['command'];
|
||||
$info = phutil_escape_html($info);
|
||||
break;
|
||||
case 'conduit':
|
||||
$info = $row['method'];
|
||||
$info = phutil_escape_html($info);
|
||||
break;
|
||||
case 'http':
|
||||
$info = $row['uri'];
|
||||
$info = phutil_escape_html($info);
|
||||
break;
|
||||
default:
|
||||
$info = '-';
|
||||
|
@ -244,7 +248,7 @@ final class DarkConsoleServicesPlugin extends DarkConsolePlugin {
|
|||
}
|
||||
|
||||
$rows[] = array(
|
||||
$row['type'],
|
||||
phutil_escape_html($row['type']),
|
||||
'+'.number_format(1000 * ($row['begin'] - $data['start'])).' ms',
|
||||
number_format(1000000 * $row['duration']).' us',
|
||||
$info,
|
||||
|
@ -272,7 +276,7 @@ final class DarkConsoleServicesPlugin extends DarkConsolePlugin {
|
|||
|
||||
$results[] = $table->render();
|
||||
|
||||
return phutil_implode_html("\n", $results);
|
||||
return implode("\n", $results);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -51,52 +51,48 @@ final class DarkConsoleXHProfPlugin extends DarkConsolePlugin {
|
|||
'class' => 'bright-link',
|
||||
),
|
||||
'Installation Guide');
|
||||
return hsprintf(
|
||||
return
|
||||
'<div class="dark-console-no-content">'.
|
||||
'The "xhprof" PHP extension is not available. Install xhprof '.
|
||||
'to enable the XHProf console plugin. You can find instructions in '.
|
||||
'the %s.'.
|
||||
'</div>',
|
||||
$install_guide);
|
||||
'the '.$install_guide.'.'.
|
||||
'</div>';
|
||||
}
|
||||
|
||||
$result = array();
|
||||
|
||||
$header = hsprintf(
|
||||
$header =
|
||||
'<div class="dark-console-panel-header">'.
|
||||
'%s'.
|
||||
phutil_tag(
|
||||
'a',
|
||||
array(
|
||||
'href' => $profile_uri,
|
||||
'class' => $run
|
||||
? 'disabled button'
|
||||
: 'green button',
|
||||
),
|
||||
'Profile Page').
|
||||
'<h1>XHProf Profiler</h1>'.
|
||||
'</div>',
|
||||
phutil_tag(
|
||||
'a',
|
||||
array(
|
||||
'href' => $profile_uri,
|
||||
'class' => $run
|
||||
? 'disabled button'
|
||||
: 'green button',
|
||||
),
|
||||
'Profile Page'));
|
||||
'</div>';
|
||||
$result[] = $header;
|
||||
|
||||
if ($run) {
|
||||
$result[] = hsprintf(
|
||||
'<a href="/xhprof/profile/%s/" '.
|
||||
$result[] =
|
||||
'<a href="/xhprof/profile/'.$run.'/" '.
|
||||
'class="bright-link" '.
|
||||
'style="float: right; margin: 1em 2em 0 0;'.
|
||||
'font-weight: bold;" '.
|
||||
'target="_blank">Profile Permalink</a>'.
|
||||
'<iframe src="/xhprof/profile/%s/?frame=true"></iframe>',
|
||||
$run,
|
||||
$run);
|
||||
'<iframe src="/xhprof/profile/'.$run.'/?frame=true"></iframe>';
|
||||
} else {
|
||||
$result[] = hsprintf(
|
||||
$result[] =
|
||||
'<div class="dark-console-no-content">'.
|
||||
'Profiling was not enabled for this page. Use the button above '.
|
||||
'to enable it.'.
|
||||
'</div>');
|
||||
'</div>';
|
||||
}
|
||||
|
||||
return phutil_implode_html("\n", $result);
|
||||
return implode("\n", $result);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ final class Aphront403Response extends AphrontHTMLResponse {
|
|||
}
|
||||
$failure = new AphrontRequestFailureView();
|
||||
$failure->setHeader('403 Forbidden');
|
||||
$failure->appendChild(phutil_tag('p', array(), $forbidden_text));
|
||||
$failure->appendChild('<p>'.$forbidden_text.'</p>');
|
||||
|
||||
$view = new PhabricatorStandardPageView();
|
||||
$view->setTitle('403 Forbidden');
|
||||
|
|
|
@ -12,8 +12,7 @@ final class Aphront404Response extends AphrontHTMLResponse {
|
|||
public function buildResponseString() {
|
||||
$failure = new AphrontRequestFailureView();
|
||||
$failure->setHeader('404 Not Found');
|
||||
$failure->appendChild(phutil_tag('p', array(), pht(
|
||||
'The page you requested was not found.')));
|
||||
$failure->appendChild('<p>The page you requested was not found.</p>');
|
||||
|
||||
$view = new PhabricatorStandardPageView();
|
||||
$view->setTitle('404 Not Found');
|
||||
|
|
|
@ -13,7 +13,7 @@ final class AphrontWebpageResponse extends AphrontHTMLResponse {
|
|||
}
|
||||
|
||||
public function buildResponseString() {
|
||||
return hsprintf('%s', $this->content);
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -335,7 +335,7 @@ final class PhabricatorAuditListController extends PhabricatorAuditController {
|
|||
}
|
||||
|
||||
if ($handle) {
|
||||
$handle_name = $handle->getName();
|
||||
$handle_name = phutil_escape_html($handle->getName());
|
||||
} else {
|
||||
$handle_name = null;
|
||||
}
|
||||
|
@ -435,7 +435,7 @@ final class PhabricatorAuditListController extends PhabricatorAuditController {
|
|||
}
|
||||
|
||||
if ($handle) {
|
||||
$handle_name = $handle->getName();
|
||||
$handle_name = phutil_escape_html($handle->getName());
|
||||
} else {
|
||||
$handle_name = null;
|
||||
}
|
||||
|
|
|
@ -70,10 +70,10 @@ final class PhabricatorAuditCommitListView extends AphrontView {
|
|||
$rows[] = array(
|
||||
$commit_name,
|
||||
$author_name,
|
||||
$commit->getCommitData()->getSummary(),
|
||||
phutil_escape_html($commit->getCommitData()->getSummary()),
|
||||
PhabricatorAuditCommitStatusConstants::getStatusName(
|
||||
$commit->getAuditStatus()),
|
||||
phutil_implode_html(', ', $auditors),
|
||||
implode(', ', $auditors),
|
||||
phabricator_datetime($commit->getEpoch(), $this->user),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -129,7 +129,10 @@ final class PhabricatorAuditListView extends AphrontView {
|
|||
}
|
||||
|
||||
$reasons = $audit->getAuditReasons();
|
||||
$reasons = phutil_implode_html(phutil_tag('br'), $reasons);
|
||||
foreach ($reasons as $key => $reason) {
|
||||
$reasons[$key] = phutil_escape_html($reason);
|
||||
}
|
||||
$reasons = implode('<br />', $reasons);
|
||||
|
||||
$status_code = $audit->getAuditStatus();
|
||||
$status = PhabricatorAuditStatusConstants::getStatusName($status_code);
|
||||
|
@ -137,10 +140,10 @@ final class PhabricatorAuditListView extends AphrontView {
|
|||
$auditor_handle = $this->getHandle($audit->getAuditorPHID());
|
||||
$rows[] = array(
|
||||
$commit_name,
|
||||
$commit_desc,
|
||||
phutil_escape_html($commit_desc),
|
||||
$committed,
|
||||
$auditor_handle->renderLink(),
|
||||
$status,
|
||||
phutil_escape_html($status),
|
||||
$reasons,
|
||||
);
|
||||
|
||||
|
|
|
@ -16,8 +16,8 @@ final class PhabricatorDisabledUserController
|
|||
|
||||
$failure_view = new AphrontRequestFailureView();
|
||||
$failure_view->setHeader(pht('Account Disabled'));
|
||||
$failure_view->appendChild(phutil_tag('p', array(), pht(
|
||||
'Your account has been disabled.')));
|
||||
$failure_view->appendChild(
|
||||
'<p>'.pht('Your account has been disabled.').'</p>');
|
||||
|
||||
return $this->buildStandardPageResponse(
|
||||
$failure_view,
|
||||
|
|
|
@ -98,8 +98,10 @@ EOBODY;
|
|||
|
||||
$view = new AphrontRequestFailureView();
|
||||
$view->setHeader(pht('Check Your Email'));
|
||||
$view->appendChild(phutil_tag('p', array(), pht(
|
||||
'An email has been sent with a link you can use to login.')));
|
||||
$view->appendChild(
|
||||
'<p>'.pht(
|
||||
'An email has been sent with a link you can use to login.'
|
||||
).'</p>');
|
||||
return $this->buildStandardPageResponse(
|
||||
$view,
|
||||
array(
|
||||
|
@ -138,8 +140,8 @@ EOBODY;
|
|||
|
||||
$panel = new AphrontPanelView();
|
||||
$panel->setWidth(AphrontPanelView::WIDTH_FORM);
|
||||
$panel->appendChild(phutil_tag('h1', array(), pht(
|
||||
'Forgot Password / Email Login')));
|
||||
$panel->appendChild('
|
||||
<h1>'.pht('Forgot Password / Email Login').'</h1>');
|
||||
$panel->appendChild($email_auth);
|
||||
$panel->setNoBackground();
|
||||
|
||||
|
|
|
@ -50,16 +50,17 @@ final class PhabricatorEmailTokenController
|
|||
|
||||
$view = new AphrontRequestFailureView();
|
||||
$view->setHeader(pht('Unable to Login'));
|
||||
$view->appendChild(phutil_tag('p', array(), pht(
|
||||
'The authentication information in the link you clicked is '.
|
||||
$view->appendChild(
|
||||
'<p>'.pht('The authentication information in the link you clicked is '.
|
||||
'invalid or out of date. Make sure you are copy-and-pasting the '.
|
||||
'entire link into your browser. You can try again, or request '.
|
||||
'a new email.')));
|
||||
$view->appendChild(hsprintf(
|
||||
'a new email.').'</p>');
|
||||
$view->appendChild(
|
||||
'<div class="aphront-failure-continue">'.
|
||||
'<a class="button" href="/login/email/">%s</a>'.
|
||||
'</div>',
|
||||
pht('Send Another Email')));
|
||||
'<a class="button" href="/login/email/">'.
|
||||
pht('Send Another Email').
|
||||
'</a>'.
|
||||
'</div>');
|
||||
|
||||
return $this->buildStandardPageResponse(
|
||||
$view,
|
||||
|
|
|
@ -43,11 +43,12 @@ final class PhabricatorLDAPLoginController extends PhabricatorAuthController {
|
|||
$dialog = new AphrontDialogView();
|
||||
$dialog->setUser($current_user);
|
||||
$dialog->setTitle(pht('Already Linked to Another Account'));
|
||||
$dialog->appendChild(phutil_tag('p', array(), pht(
|
||||
'The LDAP account you just authorized is already '.
|
||||
$dialog->appendChild(
|
||||
'<p>'.pht('The LDAP account you just authorized is already '.
|
||||
'linked toanother Phabricator account. Before you can link it '.
|
||||
'to a different LDAP account, you must unlink the old '.
|
||||
'account.')));
|
||||
'account.').'</p>'
|
||||
);
|
||||
$dialog->addCancelButton('/settings/panel/ldap/');
|
||||
|
||||
return id(new AphrontDialogResponse())->setDialog($dialog);
|
||||
|
@ -61,8 +62,10 @@ final class PhabricatorLDAPLoginController extends PhabricatorAuthController {
|
|||
$dialog = new AphrontDialogView();
|
||||
$dialog->setUser($current_user);
|
||||
$dialog->setTitle(pht('Link LDAP Account'));
|
||||
$dialog->appendChild(phutil_tag('p', array(), pht(
|
||||
'Link your LDAP account to your Phabricator account?')));
|
||||
$dialog->appendChild(
|
||||
'<p>'.
|
||||
pht('Link your LDAP account to your Phabricator account?').
|
||||
'</p>');
|
||||
$dialog->addHiddenInput('username', $request->getStr('username'));
|
||||
$dialog->addHiddenInput('password', $request->getStr('password'));
|
||||
$dialog->addSubmitButton(pht('Link Accounts'));
|
||||
|
@ -131,10 +134,9 @@ final class PhabricatorLDAPLoginController extends PhabricatorAuthController {
|
|||
|
||||
$panel = new AphrontPanelView();
|
||||
$panel->setWidth(AphrontPanelView::WIDTH_FORM);
|
||||
$panel->appendChild(phutil_tag('h1', array(), pht('LDAP login')));
|
||||
$panel->appendChild('<h1>'.pht('LDAP login').'</h1>');
|
||||
$panel->appendChild($ldap_form);
|
||||
|
||||
$error_view = null;
|
||||
if (isset($errors) && count($errors) > 0) {
|
||||
$error_view = new AphrontErrorView();
|
||||
$error_view->setTitle(pht('Login Failed'));
|
||||
|
@ -143,7 +145,7 @@ final class PhabricatorLDAPLoginController extends PhabricatorAuthController {
|
|||
|
||||
return $this->buildStandardPageResponse(
|
||||
array(
|
||||
$error_view,
|
||||
isset($error_view) ? $error_view : null,
|
||||
$panel,
|
||||
),
|
||||
array(
|
||||
|
|
|
@ -18,9 +18,9 @@ final class PhabricatorLDAPUnlinkController extends PhabricatorAuthController {
|
|||
$dialog = new AphrontDialogView();
|
||||
$dialog->setUser($user);
|
||||
$dialog->setTitle(pht('Really unlink account?'));
|
||||
$dialog->appendChild(phutil_tag('p', array(), pht(
|
||||
'You will not be able to login using this account '.
|
||||
'once you unlink it. Continue?')));
|
||||
$dialog->appendChild(
|
||||
'<p>'.pht('You will not be able to login using this account '.
|
||||
'once you unlink it. Continue?').'</p>');
|
||||
$dialog->addSubmitButton(pht('Unlink Account'));
|
||||
$dialog->addCancelButton('/settings/panel/ldap/');
|
||||
|
||||
|
|
|
@ -29,8 +29,7 @@ final class PhabricatorLoginController
|
|||
$dialog = new AphrontDialogView();
|
||||
$dialog->setUser($user);
|
||||
$dialog->setTitle(pht('Login Required'));
|
||||
$dialog->appendChild(phutil_tag('p', array(), pht(
|
||||
'You must login to continue.')));
|
||||
$dialog->appendChild('<p>'.pht('You must login to continue.').'</p>');
|
||||
$dialog->addSubmitButton(pht('Login'));
|
||||
$dialog->addCancelButton('/', pht('Cancel'));
|
||||
|
||||
|
@ -247,7 +246,8 @@ final class PhabricatorLoginController
|
|||
$title = pht("Login or Register with %s", $provider_name);
|
||||
$body = pht('Login or register for Phabricator using your %s account.',
|
||||
$provider_name);
|
||||
$button = pht("Login or Register with %s", $provider_name);
|
||||
$button = pht("Login or Register with %s",
|
||||
phutil_escape_html($provider_name));
|
||||
} else {
|
||||
$title = pht("Login with %s", $provider_name);
|
||||
$body = hsprintf(
|
||||
|
@ -258,7 +258,7 @@ final class PhabricatorLoginController
|
|||
pht(
|
||||
'You can not use %s to register a new account.',
|
||||
$provider_name));
|
||||
$button = pht("Log in with %s", $provider_name);
|
||||
$button = pht("Log in with %s", phutil_escape_html($provider_name));
|
||||
}
|
||||
|
||||
$auth_form = new AphrontFormView();
|
||||
|
@ -299,7 +299,7 @@ final class PhabricatorLoginController
|
|||
return $this->buildApplicationPage(
|
||||
array(
|
||||
$error_view,
|
||||
phutil_safe_html($login_message),
|
||||
$login_message,
|
||||
$panel,
|
||||
),
|
||||
array(
|
||||
|
|
|
@ -49,18 +49,14 @@ final class PhabricatorLoginValidateController
|
|||
|
||||
$view = new AphrontRequestFailureView();
|
||||
$view->setHeader(pht('Login Failed'));
|
||||
$view->appendChild(hsprintf(
|
||||
'<p>%s</p>%s<p>%s</p>',
|
||||
pht('Login failed:'),
|
||||
$list,
|
||||
pht(
|
||||
'<strong>Clear your cookies</strong> and try again.',
|
||||
hsprintf(''))));
|
||||
$view->appendChild(hsprintf(
|
||||
$view->appendChild(
|
||||
'<p>'.pht('Login failed:').'</p>'.
|
||||
$list.
|
||||
'<p>'.pht('<strong>Clear your cookies</strong> and try again.').'</p>');
|
||||
$view->appendChild(
|
||||
'<div class="aphront-failure-continue">'.
|
||||
'<a class="button" href="/login/">%s</a>'.
|
||||
'</div>',
|
||||
pht('Try Again')));
|
||||
'<a class="button" href="/login/">'.pht('Try Again').'</a>'.
|
||||
'</div>');
|
||||
return $this->buildStandardPageResponse(
|
||||
$view,
|
||||
array(
|
||||
|
|
|
@ -46,8 +46,7 @@ final class PhabricatorLogoutController
|
|||
$dialog = id(new AphrontDialogView())
|
||||
->setUser($user)
|
||||
->setTitle(pht('Log out of Phabricator?'))
|
||||
->appendChild(phutil_tag('p', array(), pht(
|
||||
'Are you sure you want to log out?')))
|
||||
->appendChild('<p>'.pht('Are you sure you want to log out?').'</p>')
|
||||
->addSubmitButton(pht('Logout'))
|
||||
->addCancelButton('/');
|
||||
|
||||
|
|
|
@ -41,26 +41,31 @@ final class PhabricatorMustVerifyEmailController
|
|||
|
||||
$error_view = new AphrontRequestFailureView();
|
||||
$error_view->setHeader(pht('Check Your Email'));
|
||||
$error_view->appendChild(phutil_tag('p', array(), pht(
|
||||
'You must verify your email address to login. You should have a new '.
|
||||
$error_view->appendChild(
|
||||
'<p>'.
|
||||
pht('You must verify your email address to login. You should have a new '.
|
||||
'email message from Phabricator with verification instructions in your '.
|
||||
'inbox (%s).', phutil_tag('strong', array(), $email_address))));
|
||||
$error_view->appendChild(phutil_tag('p', array(), pht(
|
||||
'If you did not receive an email, you can click the button below '.
|
||||
'to try sending another one.')));
|
||||
$error_view->appendChild(hsprintf(
|
||||
'<div class="aphront-failure-continue">%s</div>',
|
||||
phabricator_form(
|
||||
$user,
|
||||
array(
|
||||
'action' => '/login/mustverify/',
|
||||
'method' => 'POST',
|
||||
),
|
||||
phutil_tag(
|
||||
'button',
|
||||
'inbox (%s).', phutil_tag('strong', array(), $email_address)).
|
||||
'</p>');
|
||||
$error_view->appendChild(
|
||||
'<p>'.
|
||||
pht('If you did not receive an email, you can click the button below '.
|
||||
'to try sending another one.').
|
||||
'</p>');
|
||||
$error_view->appendChild(
|
||||
'<div class="aphront-failure-continue">'.
|
||||
phabricator_form(
|
||||
$user,
|
||||
array(
|
||||
'action' => '/login/mustverify/',
|
||||
'method' => 'POST',
|
||||
),
|
||||
pht('Send Another Email')))));
|
||||
phutil_tag(
|
||||
'button',
|
||||
array(
|
||||
),
|
||||
pht('Send Another Email'))).
|
||||
'</div>');
|
||||
|
||||
|
||||
return $this->buildApplicationPage(
|
||||
|
|
|
@ -21,11 +21,11 @@ final class PhabricatorOAuthDiagnosticsController
|
|||
$client_id = $provider->getClientID();
|
||||
$client_secret = $provider->getClientSecret();
|
||||
$key = $provider->getProviderKey();
|
||||
$name = $provider->getProviderName();
|
||||
$name = phutil_escape_html($provider->getProviderName());
|
||||
|
||||
$res_ok = hsprintf('<strong style="color: #00aa00;">OK</strong>');
|
||||
$res_no = hsprintf('<strong style="color: #aa0000;">NO</strong>');
|
||||
$res_na = hsprintf('<strong style="color: #999999;">N/A</strong>');
|
||||
$res_ok = '<strong style="color: #00aa00;">OK</strong>';
|
||||
$res_no = '<strong style="color: #aa0000;">NO</strong>';
|
||||
$res_na = '<strong style="color: #999999;">N/A</strong>';
|
||||
|
||||
$results = array();
|
||||
$auth_key = $key . '.auth-enabled';
|
||||
|
@ -159,10 +159,10 @@ final class PhabricatorOAuthDiagnosticsController
|
|||
$rows = array();
|
||||
foreach ($results as $key => $result) {
|
||||
$rows[] = array(
|
||||
$key,
|
||||
phutil_escape_html($key),
|
||||
$result[0],
|
||||
$result[1],
|
||||
$result[2],
|
||||
phutil_escape_html($result[1]),
|
||||
phutil_escape_html($result[2]),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -186,11 +186,11 @@ final class PhabricatorOAuthDiagnosticsController
|
|||
|
||||
$panel_view = new AphrontPanelView();
|
||||
$panel_view->setHeader($title);
|
||||
$panel_view->appendChild(hsprintf(
|
||||
$panel_view->appendChild(
|
||||
'<p class="aphront-panel-instructions">These tests may be able to '.
|
||||
'help diagnose the root cause of problems you experience with %s '.
|
||||
'Authentication. Reload the page to run the tests again.</p>',
|
||||
$provider->getProviderName()));
|
||||
'help diagnose the root cause of problems you experience with '.
|
||||
$provider->getProviderName() .
|
||||
' Authentication. Reload the page to run the tests again.</p>');
|
||||
$panel_view->appendChild($table_view);
|
||||
|
||||
return $this->buildStandardPageResponse(
|
||||
|
|
|
@ -116,9 +116,10 @@ final class PhabricatorOAuthLoginController
|
|||
$dialog = new AphrontDialogView();
|
||||
$dialog->setUser($current_user);
|
||||
$dialog->setTitle(pht('Link %s Account', $provider_name));
|
||||
$dialog->appendChild(phutil_tag('p', array(), pht(
|
||||
'Link your %s account to your Phabricator account?',
|
||||
$provider_name)));
|
||||
$dialog->appendChild(
|
||||
pht(
|
||||
'<p>Link your %s account to your Phabricator account?</p>',
|
||||
phutil_escape_html($provider_name)));
|
||||
$dialog->addHiddenInput('confirm_token', $provider->getAccessToken());
|
||||
$dialog->addHiddenInput('expires', $oauth_info->getTokenExpires());
|
||||
$dialog->addHiddenInput('state', $this->oauthState);
|
||||
|
|
|
@ -34,9 +34,9 @@ final class PhabricatorOAuthUnlinkController extends PhabricatorAuthController {
|
|||
$dialog = new AphrontDialogView();
|
||||
$dialog->setUser($user);
|
||||
$dialog->setTitle(pht('Really unlink account?'));
|
||||
$dialog->appendChild(phutil_tag('p', array(), pht(
|
||||
'You will not be able to login using this account '.
|
||||
'once you unlink it. Continue?')));
|
||||
$dialog->appendChild(
|
||||
'<p>'.pht('You will not be able to login using this account '.
|
||||
'once you unlink it. Continue?').'</p>');
|
||||
$dialog->addSubmitButton(pht('Unlink Account'));
|
||||
$dialog->addCancelButton($provider->getSettingsPanelURI());
|
||||
|
||||
|
|
|
@ -77,12 +77,11 @@ final class PhabricatorOAuthFailureView extends AphrontView {
|
|||
$provider_name);
|
||||
}
|
||||
|
||||
$view->appendChild(hsprintf(
|
||||
$view->appendChild(
|
||||
'<div class="aphront-failure-continue">'.
|
||||
'%s<a href="/login/" class="button">%s</a>'.
|
||||
'</div>',
|
||||
$diagnose,
|
||||
pht('Continue')));
|
||||
$diagnose.
|
||||
'<a href="/login/" class="button">'.pht('Continue').'</a>'.
|
||||
'</div>');
|
||||
|
||||
return $view->render();
|
||||
}
|
||||
|
|
|
@ -203,9 +203,10 @@ abstract class PhabricatorController extends AphrontController {
|
|||
$view = new PhabricatorStandardPageView();
|
||||
$view->setRequest($request);
|
||||
$view->setController($this);
|
||||
$view->appendChild(hsprintf(
|
||||
'<div style="padding: 2em 0;">%s</div>',
|
||||
$response->buildResponseString()));
|
||||
$view->appendChild(
|
||||
'<div style="padding: 2em 0;">'.
|
||||
$response->buildResponseString().
|
||||
'</div>');
|
||||
$response = new AphrontWebpageResponse();
|
||||
$response->setContent($view->render());
|
||||
return $response;
|
||||
|
@ -276,7 +277,7 @@ abstract class PhabricatorController extends AphrontController {
|
|||
$items[] = $this->getHandle($phid)->renderLink();
|
||||
}
|
||||
|
||||
return phutil_implode_html($style_map[$style], $items);
|
||||
return array_interleave($style_map[$style], $items);
|
||||
}
|
||||
|
||||
protected function buildApplicationMenu() {
|
||||
|
|
|
@ -55,7 +55,9 @@ final class PhabricatorCalendarBrowseController
|
|||
$nav->appendChild(
|
||||
array(
|
||||
$this->getNoticeView(),
|
||||
hsprintf('<div style="padding: 20px;">%s</div>', $month_view->render()),
|
||||
'<div style="padding: 20px;">',
|
||||
$month_view,
|
||||
'</div>',
|
||||
));
|
||||
|
||||
return $this->buildApplicationPage(
|
||||
|
|
|
@ -94,7 +94,7 @@ final class PhabricatorCalendarViewStatusController
|
|||
} else {
|
||||
$no_data =
|
||||
pht('%s does not have any upcoming status events.',
|
||||
$this->getHandle($this->phid)->getName());
|
||||
phutil_escape_html($this->getHandle($this->phid)->getName()));
|
||||
}
|
||||
return $no_data;
|
||||
}
|
||||
|
@ -115,7 +115,7 @@ final class PhabricatorCalendarViewStatusController
|
|||
} else {
|
||||
$page_title = pht(
|
||||
'Upcoming Statuses for %s',
|
||||
$this->getHandle($this->phid)->getName()
|
||||
phutil_escape_html($this->getHandle($this->phid)->getName())
|
||||
);
|
||||
}
|
||||
return $page_title;
|
||||
|
|
|
@ -48,10 +48,9 @@ final class AphrontCalendarMonthView extends AphrontView {
|
|||
|
||||
$markup = array();
|
||||
|
||||
$empty_box = phutil_tag(
|
||||
'div',
|
||||
array('class' => 'aphront-calendar-day aphront-calendar-empty'),
|
||||
'');
|
||||
$empty_box =
|
||||
'<div class="aphront-calendar-day aphront-calendar-empty">'.
|
||||
'</div>';
|
||||
|
||||
for ($ii = 0; $ii < $empty; $ii++) {
|
||||
$markup[] = $empty_box;
|
||||
|
@ -80,10 +79,9 @@ final class AphrontCalendarMonthView extends AphrontView {
|
|||
} else {
|
||||
$show_events = array_fill_keys(
|
||||
array_keys($show_events),
|
||||
hsprintf(
|
||||
'<div class="aphront-calendar-event aphront-calendar-event-empty">'.
|
||||
' '.
|
||||
'</div>'));
|
||||
'<div class="aphront-calendar-event aphront-calendar-event-empty">'.
|
||||
' '.
|
||||
'</div>');
|
||||
}
|
||||
|
||||
foreach ($events as $event) {
|
||||
|
@ -102,42 +100,38 @@ final class AphrontCalendarMonthView extends AphrontView {
|
|||
|
||||
$holiday_markup = null;
|
||||
if ($holiday) {
|
||||
$name = $holiday->getName();
|
||||
$holiday_markup = phutil_tag(
|
||||
'div',
|
||||
array(
|
||||
'class' => 'aphront-calendar-holiday',
|
||||
'title' => $name,
|
||||
),
|
||||
$name);
|
||||
$name = phutil_escape_html($holiday->getName());
|
||||
$holiday_markup =
|
||||
'<div class="aphront-calendar-holiday" title="'.$name.'">'.
|
||||
$name.
|
||||
'</div>';
|
||||
}
|
||||
|
||||
$markup[] = hsprintf(
|
||||
'<div class="%s">'.
|
||||
'<div class="aphront-calendar-date-number">%s</div>'.
|
||||
'%s%s'.
|
||||
'</div>',
|
||||
$class,
|
||||
$day_number,
|
||||
$holiday_markup,
|
||||
phutil_implode_html("\n", $show_events));
|
||||
$markup[] =
|
||||
'<div class="'.$class.'">'.
|
||||
'<div class="aphront-calendar-date-number">'.
|
||||
$day_number.
|
||||
'</div>'.
|
||||
$holiday_markup.
|
||||
implode("\n", $show_events).
|
||||
'</div>';
|
||||
}
|
||||
|
||||
$table = array();
|
||||
$rows = array_chunk($markup, 7);
|
||||
foreach ($rows as $row) {
|
||||
$table[] = hsprintf('<tr>');
|
||||
$table[] = '<tr>';
|
||||
while (count($row) < 7) {
|
||||
$row[] = $empty_box;
|
||||
}
|
||||
foreach ($row as $cell) {
|
||||
$table[] = phutil_tag('p', array(), $cell);
|
||||
$table[] = '<td>'.$cell.'</td>';
|
||||
}
|
||||
$table[] = hsprintf('</tr>');
|
||||
$table[] = '</tr>';
|
||||
}
|
||||
$table = hsprintf(
|
||||
$table =
|
||||
'<table class="aphront-calendar-view">'.
|
||||
'%s'.
|
||||
$this->renderCalendarHeader($first).
|
||||
'<tr class="aphront-calendar-day-of-week-header">'.
|
||||
'<th>Sun</th>'.
|
||||
'<th>Mon</th>'.
|
||||
|
@ -147,10 +141,8 @@ final class AphrontCalendarMonthView extends AphrontView {
|
|||
'<th>Fri</th>'.
|
||||
'<th>Sat</th>'.
|
||||
'</tr>'.
|
||||
'%s'.
|
||||
'</table>',
|
||||
$this->renderCalendarHeader($first),
|
||||
phutil_implode_html("\n", $table));
|
||||
implode("\n", $table).
|
||||
'</table>';
|
||||
|
||||
return $table;
|
||||
}
|
||||
|
@ -181,15 +173,16 @@ final class AphrontCalendarMonthView extends AphrontView {
|
|||
"\xE2\x86\x92"
|
||||
);
|
||||
|
||||
$left_th = phutil_tag('th', array(), $prev_link);
|
||||
$right_th = phutil_tag('th', array(), $next_link);
|
||||
$left_th = '<th>'.$prev_link.'</th>';
|
||||
$right_th = '<th>'.$next_link.'</th>';
|
||||
}
|
||||
|
||||
return hsprintf(
|
||||
'<tr class="aphront-calendar-month-year-header">%s%s%s</tr>',
|
||||
$left_th,
|
||||
phutil_tag('th', array('colspan' => $colspan), $date->format('F Y')),
|
||||
$right_th);
|
||||
return
|
||||
'<tr class="aphront-calendar-month-year-header">'.
|
||||
$left_th.
|
||||
'<th colspan="'.$colspan.'">'.$date->format('F Y').'</th>'.
|
||||
$right_th.
|
||||
'</tr>';
|
||||
}
|
||||
|
||||
private function getNextYearAndMonth() {
|
||||
|
|
|
@ -94,6 +94,7 @@ final class PhabricatorChatLogChannelLogController
|
|||
require_celerity_resource('phabricator-chatlog-css');
|
||||
|
||||
$out = array();
|
||||
$out[] = '<table class="phabricator-chat-log">';
|
||||
foreach ($blocks as $block) {
|
||||
$author = $block['author'];
|
||||
$author = phutil_utf8_shorten($author, 18);
|
||||
|
@ -121,6 +122,7 @@ final class PhabricatorChatLogChannelLogController
|
|||
),
|
||||
array($author, $message, $timestamp));
|
||||
}
|
||||
$out[] = '</table>';
|
||||
|
||||
$form = id(new AphrontFormView())
|
||||
->setUser($user)
|
||||
|
@ -138,11 +140,12 @@ final class PhabricatorChatLogChannelLogController
|
|||
|
||||
return $this->buildStandardPageResponse(
|
||||
array(
|
||||
hsprintf(
|
||||
'<div class="phabricator-chat-log-panel">%s<br />%s%s</div>',
|
||||
$form,
|
||||
phutil_tag('table', array('class' => 'phabricator-chat-log'), $out),
|
||||
$pager),
|
||||
'<div class="phabricator-chat-log-panel">',
|
||||
$form,
|
||||
'<br />',
|
||||
implode("\n", $out),
|
||||
$pager,
|
||||
'</div>',
|
||||
),
|
||||
array(
|
||||
'title' => 'Channel Log',
|
||||
|
|
|
@ -346,7 +346,7 @@ final class PhabricatorConduitAPIController
|
|||
if ($request) {
|
||||
foreach ($request->getAllParameters() as $key => $value) {
|
||||
$param_rows[] = array(
|
||||
$key,
|
||||
phutil_escape_html($key),
|
||||
$this->renderAPIValue($value),
|
||||
);
|
||||
}
|
||||
|
@ -362,7 +362,7 @@ final class PhabricatorConduitAPIController
|
|||
$result_rows = array();
|
||||
foreach ($result as $key => $value) {
|
||||
$result_rows[] = array(
|
||||
$key,
|
||||
phutil_escape_html($key),
|
||||
$this->renderAPIValue($value),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -109,7 +109,7 @@ final class PhabricatorConduitConsoleController
|
|||
->setValue('Call Method'));
|
||||
|
||||
$panel = new AphrontPanelView();
|
||||
$panel->setHeader('Conduit API: '.$this->method);
|
||||
$panel->setHeader('Conduit API: '.phutil_escape_html($this->method));
|
||||
$panel->appendChild($form);
|
||||
$panel->setWidth(AphrontPanelView::WIDTH_FULL);
|
||||
|
||||
|
|
|
@ -59,11 +59,11 @@ final class PhabricatorConduitListController
|
|||
|
||||
$utils = new AphrontPanelView();
|
||||
$utils->setHeader('Utilities');
|
||||
$utils->appendChild(hsprintf(
|
||||
$utils->appendChild(
|
||||
'<ul>'.
|
||||
'<li><a href="/conduit/log/">Log</a> - Conduit Method Calls</li>'.
|
||||
'<li><a href="/conduit/token/">Token</a> - Certificate Install</li>'.
|
||||
'</ul>'));
|
||||
'</ul>');
|
||||
$utils->setWidth(AphrontPanelView::WIDTH_FULL);
|
||||
|
||||
$this->setShowSideNav(false);
|
||||
|
|
|
@ -65,9 +65,9 @@ final class PhabricatorConduitLogController
|
|||
}
|
||||
$rows[] = array(
|
||||
$call->getConnectionID(),
|
||||
$conn->getUserName(),
|
||||
$call->getMethod(),
|
||||
$call->getError(),
|
||||
phutil_escape_html($conn->getUserName()),
|
||||
phutil_escape_html($call->getMethod()),
|
||||
phutil_escape_html($call->getError()),
|
||||
number_format($call->getDuration()).' us',
|
||||
phabricator_datetime($call->getDateCreated(), $user),
|
||||
);
|
||||
|
|
|
@ -14,12 +14,13 @@ final class PhabricatorConfigAllController
|
|||
$key = $option->getKey();
|
||||
|
||||
if ($option->getMasked()) {
|
||||
$value = phutil_tag('em', array(), pht('Masked'));
|
||||
$value = '<em>'.pht('Masked').'</em>';
|
||||
} else if ($option->getHidden()) {
|
||||
$value = phutil_tag('em', array(), pht('Hidden'));
|
||||
$value = '<em>'.pht('Hidden').'</em>';
|
||||
} else {
|
||||
$value = PhabricatorEnv::getEnvConfig($key);
|
||||
$value = PhabricatorConfigJSON::prettyPrintJSON($value);
|
||||
$value = phutil_escape_html($value);
|
||||
}
|
||||
|
||||
$rows[] = array(
|
||||
|
|
|
@ -23,18 +23,20 @@ final class PhabricatorConfigResponse extends AphrontHTMLResponse {
|
|||
|
||||
$view = $this->view->render();
|
||||
|
||||
return hsprintf(
|
||||
'<!DOCTYPE html>'.
|
||||
'<html>'.
|
||||
'<head>'.
|
||||
'<meta charset="UTF-8" />'.
|
||||
'<title>Phabricator Setup</title>'.
|
||||
'%s'.
|
||||
'</head>'.
|
||||
'<body class="setup-fatal">%s</body>'.
|
||||
'</html>',
|
||||
$resources,
|
||||
$view);
|
||||
$template = <<<EOTEMPLATE
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Phabricator Setup</title>
|
||||
{$resources}
|
||||
</head>
|
||||
<body class="setup-fatal">
|
||||
{$view}
|
||||
</body>
|
||||
</html>
|
||||
EOTEMPLATE;
|
||||
|
||||
return $template;
|
||||
}
|
||||
|
||||
private function buildResources() {
|
||||
|
@ -47,12 +49,11 @@ final class PhabricatorConfigResponse extends AphrontHTMLResponse {
|
|||
|
||||
$resources = array();
|
||||
foreach ($css as $path) {
|
||||
$resources[] = phutil_tag(
|
||||
'style',
|
||||
array('type' => 'text/css'),
|
||||
Filesystem::readFile($webroot.'/rsrc/css/'.$path));
|
||||
$resources[] = '<style type="text/css">';
|
||||
$resources[] = Filesystem::readFile($webroot.'/rsrc/css/'.$path);
|
||||
$resources[] = '</style>';
|
||||
}
|
||||
return phutil_implode_html("\n", $resources);
|
||||
return implode("\n", $resources);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ final class PhabricatorSetupIssueView extends AphrontView {
|
|||
),
|
||||
array(
|
||||
phutil_tag('p', array(), $run_these),
|
||||
phutil_tag('pre', array(), phutil_implode_html("\n", $commands)),
|
||||
phutil_tag('pre', array(), array_interleave("\n", $commands)),
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -114,7 +114,7 @@ final class PhabricatorSetupIssueView extends AphrontView {
|
|||
array(
|
||||
'class' => 'setup-issue',
|
||||
),
|
||||
$this->renderSingleView(
|
||||
$this->renderHTMLView(
|
||||
array(
|
||||
$name,
|
||||
$description,
|
||||
|
@ -155,7 +155,7 @@ final class PhabricatorSetupIssueView extends AphrontView {
|
|||
'<tt>phabricator/ $</tt> ./bin/config set %s <em>value</em>',
|
||||
$key);
|
||||
}
|
||||
$update = phutil_tag('pre', array(), phutil_implode_html("\n", $update));
|
||||
$update = phutil_tag('pre', array(), array_interleave("\n", $update));
|
||||
} else {
|
||||
$update = array();
|
||||
foreach ($configs as $config) {
|
||||
|
@ -187,7 +187,7 @@ final class PhabricatorSetupIssueView extends AphrontView {
|
|||
array(
|
||||
'class' => 'setup-issue-config',
|
||||
),
|
||||
self::renderSingleView(
|
||||
self::renderHTMLView(
|
||||
array(
|
||||
$table_info,
|
||||
$table,
|
||||
|
@ -293,7 +293,7 @@ final class PhabricatorSetupIssueView extends AphrontView {
|
|||
array(
|
||||
'class' => 'setup-issue-config',
|
||||
),
|
||||
$this->renderSingleView(
|
||||
$this->renderHTMLView(
|
||||
array(
|
||||
$table_info,
|
||||
$table,
|
||||
|
|
|
@ -159,7 +159,8 @@ abstract class ConpherenceController extends PhabricatorController {
|
|||
$item->addClass('hide-unread-count');
|
||||
}
|
||||
|
||||
$nav->addCustomBlock($item->render());
|
||||
// TODO: [HTML] Clean this up when we clean up HTML stuff in Conpherence.
|
||||
$nav->addCustomBlock(phutil_safe_html($item->render()));
|
||||
}
|
||||
if (empty($conpherences) || $read) {
|
||||
$nav->addCustomBlock($this->getNoConpherencesBlock());
|
||||
|
|
|
@ -149,7 +149,7 @@ final class ConpherenceViewController extends
|
|||
->setMarkupEngine($engine)
|
||||
->render();
|
||||
}
|
||||
$transactions = phutil_implode_html(' ', $rendered_transactions);
|
||||
$transactions = implode(' ', $rendered_transactions);
|
||||
|
||||
$form =
|
||||
id(new AphrontFormView())
|
||||
|
@ -283,7 +283,7 @@ final class ConpherenceViewController extends
|
|||
'src' => $thumb
|
||||
),
|
||||
''),
|
||||
$file->getName(),
|
||||
phutil_escape_html($file->getName()),
|
||||
);
|
||||
}
|
||||
$header = id(new PhabricatorHeaderView())
|
||||
|
@ -292,7 +292,7 @@ final class ConpherenceViewController extends
|
|||
->setNoDataString(pht('No files attached to conpherence.'))
|
||||
->setHeaders(array('', pht('Name')))
|
||||
->setColumnClasses(array('', 'wide'));
|
||||
return hsprintf('%s%s', $header->render(), $table->render());
|
||||
return new PhutilSafeHTML($header->render() . $table->render());
|
||||
}
|
||||
|
||||
private function renderTaskWidgetPaneContent() {
|
||||
|
@ -328,7 +328,7 @@ final class ConpherenceViewController extends
|
|||
->setColumnClasses(array('', 'wide'));
|
||||
$content[] = $table->render();
|
||||
}
|
||||
return phutil_implode_html('', $content);
|
||||
return new PhutilSafeHTML(implode('', $content));
|
||||
}
|
||||
|
||||
private function renderCalendarWidgetPaneContent() {
|
||||
|
@ -416,7 +416,7 @@ final class ConpherenceViewController extends
|
|||
}
|
||||
}
|
||||
|
||||
return phutil_implode_html('', $content);
|
||||
return new PhutilSafeHTML(implode('', $content));
|
||||
}
|
||||
|
||||
private function getCalendarWidgetWeekTimestamps() {
|
||||
|
|
|
@ -50,18 +50,18 @@ final class ConpherenceTransaction extends PhabricatorApplicationTransaction {
|
|||
$title = pht(
|
||||
'%s renamed this conpherence from "%s" to "%s".',
|
||||
$this->renderHandleLink($author_phid),
|
||||
$old,
|
||||
$new);
|
||||
phutil_escape_html($old),
|
||||
phutil_escape_html($new));
|
||||
} else if ($old) {
|
||||
$title = pht(
|
||||
'%s deleted the conpherence name "%s".',
|
||||
$this->renderHandleLink($author_phid),
|
||||
$old);
|
||||
phutil_escape_html($old));
|
||||
} else {
|
||||
$title = pht(
|
||||
'%s named this conpherence "%s".',
|
||||
$this->renderHandleLink($author_phid),
|
||||
$new);
|
||||
phutil_escape_html($new));
|
||||
}
|
||||
return $title;
|
||||
case ConpherenceTransactionType::TYPE_FILES:
|
||||
|
|
|
@ -139,7 +139,7 @@ final class ConpherenceMenuItemView extends AphrontTagView {
|
|||
(int)$this->unreadCount);
|
||||
}
|
||||
|
||||
return $this->renderSingleView(
|
||||
return $this->renderHTMLView(
|
||||
array(
|
||||
$image,
|
||||
$title,
|
||||
|
|
|
@ -87,7 +87,7 @@ final class ConpherenceTransactionView extends AphrontView {
|
|||
array(
|
||||
'class' => $content_class
|
||||
),
|
||||
$this->renderSingleView($content))
|
||||
$this->renderHTMLView($content))
|
||||
);
|
||||
|
||||
return $transaction_view->render();
|
||||
|
|
|
@ -46,7 +46,7 @@ final class PhabricatorCountdownListController
|
|||
'Delete');
|
||||
}
|
||||
$rows[] = array(
|
||||
$timer->getID(),
|
||||
phutil_escape_html($timer->getID()),
|
||||
$handles[$timer->getAuthorPHID()]->renderLink(),
|
||||
phutil_tag(
|
||||
'a',
|
||||
|
|
|
@ -30,7 +30,7 @@ final class PhabricatorDaemonConsoleController
|
|||
$rows = array();
|
||||
foreach ($completed_info as $class => $info) {
|
||||
$rows[] = array(
|
||||
$class,
|
||||
phutil_escape_html($class),
|
||||
number_format($info['n']),
|
||||
number_format((int)($info['duration'] / $info['n'])).' us',
|
||||
);
|
||||
|
@ -127,7 +127,7 @@ final class PhabricatorDaemonConsoleController
|
|||
$rows = array();
|
||||
foreach ($queued as $row) {
|
||||
$rows[] = array(
|
||||
$row['taskClass'],
|
||||
phutil_escape_html($row['taskClass']),
|
||||
number_format($row['N']),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -72,40 +72,41 @@ final class PhabricatorWorkerTaskUpdateController
|
|||
case 'retry':
|
||||
if ($can_retry) {
|
||||
$dialog->setTitle('Really retry task?');
|
||||
$dialog->appendChild(phutil_tag('p', array(), pht(
|
||||
'The task will be put back in the queue and executed again.')));
|
||||
$dialog->appendChild(
|
||||
'<p>The task will be put back in the queue and executed '.
|
||||
'again.</p>');
|
||||
$dialog->addSubmitButton('Retry Task');
|
||||
} else {
|
||||
$dialog->setTitle('Can Not Retry');
|
||||
$dialog->appendChild(phutil_tag('p', array(), pht(
|
||||
'Only archived, unsuccessful tasks can be retried.')));
|
||||
$dialog->appendChild(
|
||||
'<p>Only archived, unsuccessful tasks can be retried.</p>');
|
||||
}
|
||||
break;
|
||||
case 'cancel':
|
||||
if ($can_cancel) {
|
||||
$dialog->setTitle('Really cancel task?');
|
||||
$dialog->appendChild(phutil_tag('p', array(), pht(
|
||||
'The work this task represents will never be performed if you '.
|
||||
'cancel it. Are you sure you want to cancel it?')));
|
||||
$dialog->appendChild(
|
||||
'<p>The work this task represents will never be performed if you '.
|
||||
'cancel it. Are you sure you want to cancel it?</p>');
|
||||
$dialog->addSubmitButton('Cancel Task');
|
||||
} else {
|
||||
$dialog->setTitle('Can Not Cancel');
|
||||
$dialog->appendChild(phutil_tag('p', array(), pht(
|
||||
'Only active tasks can be cancelled.')));
|
||||
$dialog->appendChild(
|
||||
'<p>Only active tasks can be cancelled.</p>');
|
||||
}
|
||||
break;
|
||||
case 'release':
|
||||
if ($can_release) {
|
||||
$dialog->setTitle('Really free task lease?');
|
||||
$dialog->appendChild(phutil_tag('p', array(), pht(
|
||||
'If the process which owns the task lease is still doing work '.
|
||||
$dialog->appendChild(
|
||||
'<p>If the process which owns the task lease is still doing work '.
|
||||
'on it, the work may be performed twice. Are you sure you '.
|
||||
'want to free the lease?')));
|
||||
'want to free the lease?</p>');
|
||||
$dialog->addSubmitButton('Free Lease');
|
||||
} else {
|
||||
$dialog->setTitle('Can Not Free Lease');
|
||||
$dialog->appendChild(phutil_tag('p', array(), pht(
|
||||
'Only active, leased tasks may have their leases freed.')));
|
||||
$dialog->appendChild(
|
||||
'<p>Only active, leased tasks may have their leases freed.</p>');
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -60,7 +60,7 @@ final class PhabricatorDaemonLogEventsView extends AphrontView {
|
|||
}
|
||||
|
||||
$row = array(
|
||||
$event->getLogType(),
|
||||
phutil_escape_html($event->getLogType()),
|
||||
phabricator_date($event->getEpoch(), $this->user),
|
||||
phabricator_time($event->getEpoch(), $this->user),
|
||||
phutil_escape_html_newlines($message.$more),
|
||||
|
|
|
@ -76,8 +76,8 @@ final class PhabricatorDaemonLogListView extends AphrontView {
|
|||
|
||||
$rows[] = array(
|
||||
$running,
|
||||
$log->getDaemon(),
|
||||
$log->getHost(),
|
||||
phutil_escape_html($log->getDaemon()),
|
||||
phutil_escape_html($log->getHost()),
|
||||
$log->getPID(),
|
||||
phabricator_date($epoch, $this->user),
|
||||
phabricator_time($epoch, $this->user),
|
||||
|
|
|
@ -60,9 +60,10 @@ final class DifferentialCommentSaveController extends DifferentialController {
|
|||
|
||||
if (strlen($comment) || $has_inlines) {
|
||||
$dialog->addSubmitButton(pht('Post as Comment'));
|
||||
$dialog->appendChild(phutil_tag('br'));
|
||||
$dialog->appendChild(phutil_tag('p', array(), pht(
|
||||
'Do you want to post your feedback anyway, as a normal comment?')));
|
||||
$dialog->appendChild('<br />');
|
||||
$dialog->appendChild(
|
||||
'<p>'.pht('Do you want to post your feedback anyway, as a normal '.
|
||||
'comment?').'</p>');
|
||||
}
|
||||
|
||||
return id(new AphrontDialogResponse())->setDialog($dialog);
|
||||
|
|
|
@ -25,21 +25,16 @@ final class DifferentialDiffViewController extends DifferentialController {
|
|||
'href' => PhabricatorEnv::getURI('/D'.$diff->getRevisionID()),
|
||||
),
|
||||
'D'.$diff->getRevisionID());
|
||||
$top_panel->appendChild(phutil_tag(
|
||||
'h1',
|
||||
array(),
|
||||
pht('This diff belongs to revision %s', $link)));
|
||||
$top_panel->appendChild(
|
||||
"<h1>".pht('This diff belongs to revision %s', $link)."</h1>");
|
||||
} else {
|
||||
$action_panel = new AphrontPanelView();
|
||||
$action_panel->setHeader('Preview Diff');
|
||||
$action_panel->setWidth(AphrontPanelView::WIDTH_WIDE);
|
||||
$action_panel->appendChild(hsprintf(
|
||||
'<p class="aphront-panel-instructions">%s</p>',
|
||||
pht(
|
||||
'Review the diff for correctness. When you are satisfied, either '.
|
||||
'<strong>create a new revision</strong> or <strong>update '.
|
||||
'an existing revision</strong>.',
|
||||
hsprintf(''))));
|
||||
$action_panel->appendChild(
|
||||
'<p class="aphront-panel-instructions">'.pht('Review the diff for '.
|
||||
'correctness. When you are satisfied, either <strong>create a new '.
|
||||
'revision</strong> or <strong>update an existing revision</strong>.'));
|
||||
|
||||
// TODO: implmenent optgroup support in AphrontFormSelectControl?
|
||||
$select = array();
|
||||
|
|
|
@ -386,15 +386,14 @@ final class DifferentialRevisionViewController extends DifferentialController {
|
|||
|
||||
$page_pane = id(new DifferentialPrimaryPaneView())
|
||||
->setID($pane_id)
|
||||
->appendChild(array(
|
||||
$comment_view->render(),
|
||||
$diff_history->render(),
|
||||
$warning,
|
||||
$local_view->render(),
|
||||
$toc_view->render(),
|
||||
$other_view,
|
||||
$changeset_view->render(),
|
||||
));
|
||||
->appendChild(
|
||||
$comment_view->render().
|
||||
$diff_history->render().
|
||||
$warning.
|
||||
$local_view->render().
|
||||
$toc_view->render().
|
||||
$other_view.
|
||||
$changeset_view->render());
|
||||
if ($comment_form) {
|
||||
$page_pane->appendChild($comment_form->render());
|
||||
}
|
||||
|
@ -858,12 +857,13 @@ final class DifferentialRevisionViewController extends DifferentialController {
|
|||
$handles = $this->loadViewerHandles($phids);
|
||||
$view->setHandles($handles);
|
||||
|
||||
return hsprintf(
|
||||
'%s<div class="differential-panel">%s</div>',
|
||||
return
|
||||
id(new PhabricatorHeaderView())
|
||||
->setHeader(pht('Open Revisions Affecting These Files'))
|
||||
->render(),
|
||||
$view->render());
|
||||
->render().
|
||||
'<div class="differential-panel">'.
|
||||
$view->render().
|
||||
'</div>';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -43,7 +43,7 @@ final class DifferentialSubscribeController extends DifferentialController {
|
|||
$dialog
|
||||
->setUser($user)
|
||||
->setTitle($title)
|
||||
->appendChild(phutil_tag('p', array(), $prompt))
|
||||
->appendChild('<p>'.$prompt.'</p>')
|
||||
->setSubmitURI($request->getRequestURI())
|
||||
->addSubmitButton($button)
|
||||
->addCancelButton('/D'.$revision->getID());
|
||||
|
|
|
@ -49,7 +49,7 @@ final class DifferentialBlameRevisionFieldSpecification
|
|||
return null;
|
||||
}
|
||||
$engine = PhabricatorMarkupEngine::newDifferentialMarkupEngine();
|
||||
return $engine->markupText($this->value);
|
||||
return phutil_safe_html($engine->markupText($this->value));
|
||||
}
|
||||
|
||||
public function shouldAppearOnConduitView() {
|
||||
|
|
|
@ -26,7 +26,7 @@ final class DifferentialCommitsFieldSpecification
|
|||
$links[] = $this->getHandle($commit_phid)->renderLink();
|
||||
}
|
||||
|
||||
return phutil_implode_html(phutil_tag('br'), $links);
|
||||
return array_interleave(phutil_tag('br'), $links);
|
||||
}
|
||||
|
||||
private function getCommitPHIDs() {
|
||||
|
|
|
@ -26,7 +26,7 @@ final class DifferentialDependenciesFieldSpecification
|
|||
$links[] = $this->getHandle($revision_phids)->renderLink();
|
||||
}
|
||||
|
||||
return phutil_implode_html(phutil_tag('br'), $links);
|
||||
return array_interleave(phutil_tag('br'), $links);
|
||||
}
|
||||
|
||||
private function getDependentRevisionPHIDs() {
|
||||
|
|
|
@ -26,7 +26,7 @@ final class DifferentialDependsOnFieldSpecification
|
|||
$links[] = $this->getHandle($revision_phids)->renderLink();
|
||||
}
|
||||
|
||||
return phutil_implode_html(phutil_tag('br'), $links);
|
||||
return array_interleave(phutil_tag('br'), $links);
|
||||
}
|
||||
|
||||
private function getDependentRevisionPHIDs() {
|
||||
|
|
|
@ -283,7 +283,7 @@ abstract class DifferentialFieldSpecification {
|
|||
$links[] = $handle->renderLink();
|
||||
}
|
||||
|
||||
return phutil_implode_html(', ', $links);
|
||||
return array_interleave(', ', $links);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ final class DifferentialManiphestTasksFieldSpecification
|
|||
$links[] = $this->getHandle($task_phid)->renderLink();
|
||||
}
|
||||
|
||||
return phutil_implode_html(phutil_tag('br'), $links);
|
||||
return array_interleave(phutil_tag('br'), $links);
|
||||
}
|
||||
|
||||
private function getManiphestTaskPHIDs() {
|
||||
|
|
|
@ -143,9 +143,10 @@ final class DifferentialReviewersFieldSpecification
|
|||
if ($other_reviewers) {
|
||||
$names = array();
|
||||
foreach ($other_reviewers as $reviewer => $_) {
|
||||
$names[] = $this->getHandle($reviewer)->getLinkName();
|
||||
$names[] = phutil_escape_html(
|
||||
$this->getHandle($reviewer)->getLinkName());
|
||||
}
|
||||
$suffix = javelin_tag(
|
||||
$suffix = ' '.javelin_tag(
|
||||
'abbr',
|
||||
array(
|
||||
'sigil' => 'has-tooltip',
|
||||
|
@ -158,12 +159,9 @@ final class DifferentialReviewersFieldSpecification
|
|||
} else {
|
||||
$suffix = null;
|
||||
}
|
||||
return hsprintf(
|
||||
'%s %s',
|
||||
$this->getHandle($primary_reviewer)->renderLink(),
|
||||
$suffix);
|
||||
return $this->getHandle($primary_reviewer)->renderLink().$suffix;
|
||||
} else {
|
||||
return phutil_tag('em', array(), 'None');
|
||||
return '<em>None</em>';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -113,7 +113,7 @@ final class DifferentialUnitFieldSpecification
|
|||
$userdata = idx($test, 'userdata');
|
||||
if ($userdata) {
|
||||
$engine = PhabricatorMarkupEngine::newDifferentialMarkupEngine();
|
||||
$userdata = $engine->markupText($userdata);
|
||||
$userdata = phutil_safe_html($engine->markupText($userdata));
|
||||
$rows[] = array(
|
||||
'style' => 'details',
|
||||
'value' => $userdata,
|
||||
|
|
|
@ -1092,7 +1092,7 @@ final class DifferentialChangesetParser {
|
|||
* indicator of how well tested a change is.
|
||||
*/
|
||||
public function renderModifiedCoverage() {
|
||||
$na = phutil_tag('em', array(), '-');
|
||||
$na = '<em>-</em>';
|
||||
|
||||
$coverage = $this->getCoverage();
|
||||
if (!$coverage) {
|
||||
|
|
|
@ -21,34 +21,27 @@ abstract class DifferentialChangesetHTMLRenderer
|
|||
return null;
|
||||
}
|
||||
} else {
|
||||
$none = $none;
|
||||
switch ($change) {
|
||||
|
||||
case DifferentialChangeType::TYPE_ADD:
|
||||
switch ($file) {
|
||||
case DifferentialChangeType::FILE_TEXT:
|
||||
$message = pht('This file was <strong>added</strong>.', $none);
|
||||
$message = pht('This file was <strong>added</strong>.');
|
||||
break;
|
||||
case DifferentialChangeType::FILE_IMAGE:
|
||||
$message = pht('This image was <strong>added</strong>.', $none);
|
||||
$message = pht('This image was <strong>added</strong>.');
|
||||
break;
|
||||
case DifferentialChangeType::FILE_DIRECTORY:
|
||||
$message = pht(
|
||||
'This directory was <strong>added</strong>.',
|
||||
$none);
|
||||
$message = pht('This directory was <strong>added</strong>.');
|
||||
break;
|
||||
case DifferentialChangeType::FILE_BINARY:
|
||||
$message = pht(
|
||||
'This binary file was <strong>added</strong>.',
|
||||
$none);
|
||||
$message = pht('This binary file was <strong>added</strong>.');
|
||||
break;
|
||||
case DifferentialChangeType::FILE_SYMLINK:
|
||||
$message = pht('This symlink was <strong>added</strong>.', $none);
|
||||
$message = pht('This symlink was <strong>added</strong>.');
|
||||
break;
|
||||
case DifferentialChangeType::FILE_SUBMODULE:
|
||||
$message = pht(
|
||||
'This submodule was <strong>added</strong>.',
|
||||
$none);
|
||||
$message = pht('This submodule was <strong>added</strong>.');
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
@ -56,30 +49,22 @@ abstract class DifferentialChangesetHTMLRenderer
|
|||
case DifferentialChangeType::TYPE_DELETE:
|
||||
switch ($file) {
|
||||
case DifferentialChangeType::FILE_TEXT:
|
||||
$message = pht('This file was <strong>deleted</strong>.', $none);
|
||||
$message = pht('This file was <strong>deleted</strong>.');
|
||||
break;
|
||||
case DifferentialChangeType::FILE_IMAGE:
|
||||
$message = pht('This image was <strong>deleted</strong>.', $none);
|
||||
$message = pht('This image was <strong>deleted</strong>.');
|
||||
break;
|
||||
case DifferentialChangeType::FILE_DIRECTORY:
|
||||
$message = pht(
|
||||
'This directory was <strong>deleted</strong>.',
|
||||
$none);
|
||||
$message = pht('This directory was <strong>deleted</strong>.');
|
||||
break;
|
||||
case DifferentialChangeType::FILE_BINARY:
|
||||
$message = pht(
|
||||
'This binary file was <strong>deleted</strong>.',
|
||||
$none);
|
||||
$message = pht('This binary file was <strong>deleted</strong>.');
|
||||
break;
|
||||
case DifferentialChangeType::FILE_SYMLINK:
|
||||
$message = pht(
|
||||
'This symlink was <strong>deleted</strong>.',
|
||||
$none);
|
||||
$message = pht('This symlink was <strong>deleted</strong>.');
|
||||
break;
|
||||
case DifferentialChangeType::FILE_SUBMODULE:
|
||||
$message = pht(
|
||||
'This submodule was <strong>deleted</strong>.',
|
||||
$none);
|
||||
$message = pht('This submodule was <strong>deleted</strong>.');
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
@ -250,9 +235,10 @@ abstract class DifferentialChangesetHTMLRenderer
|
|||
}
|
||||
}
|
||||
|
||||
return hsprintf(
|
||||
'<div class="differential-meta-notice">%s</div>',
|
||||
$message);
|
||||
return
|
||||
'<div class="differential-meta-notice">'.
|
||||
$message.
|
||||
'</div>';
|
||||
}
|
||||
|
||||
protected function renderPropertyChangeHeader() {
|
||||
|
@ -293,20 +279,15 @@ abstract class DifferentialChangesetHTMLRenderer
|
|||
}
|
||||
}
|
||||
|
||||
array_unshift($rows, hsprintf(
|
||||
'<tr class="property-table-header">'.
|
||||
'<th>%s</th>'.
|
||||
'<td class="oval">%s</td>'.
|
||||
'<td class="nval">%s</td>'.
|
||||
'</tr>',
|
||||
pht('Property Changes'),
|
||||
pht('Old Value'),
|
||||
pht('New Value')));
|
||||
|
||||
return phutil_tag(
|
||||
'table',
|
||||
array('class' => 'differential-property-table'),
|
||||
$rows);
|
||||
return
|
||||
'<table class="differential-property-table">'.
|
||||
'<tr class="property-table-header">'.
|
||||
'<th>'.pht('Property Changes').'</th>'.
|
||||
'<td class="oval">'.pht('Old Value').'</td>'.
|
||||
'<td class="nval">'.pht('New Value').'</td>'.
|
||||
'</tr>'.
|
||||
implode('', $rows).
|
||||
'</table>';
|
||||
}
|
||||
|
||||
public function renderShield($message, $force = 'default') {
|
||||
|
@ -371,6 +352,9 @@ abstract class DifferentialChangesetHTMLRenderer
|
|||
return null;
|
||||
}
|
||||
|
||||
// TODO: [HTML] After TwoUpRenderer gets refactored, fix this.
|
||||
$content = phutil_safe_html($content);
|
||||
|
||||
return javelin_tag(
|
||||
'table',
|
||||
array(
|
||||
|
|
|
@ -20,32 +20,32 @@ final class DifferentialChangesetOneUpRenderer
|
|||
switch ($type) {
|
||||
case 'old':
|
||||
case 'new':
|
||||
$out[] = hsprintf('<tr>');
|
||||
$out[] = '<tr>';
|
||||
if ($type == 'old') {
|
||||
if ($p['htype']) {
|
||||
$class = 'left old';
|
||||
} else {
|
||||
$class = 'left';
|
||||
}
|
||||
$out[] = hsprintf('<th>%s</th>', $p['line']);
|
||||
$out[] = hsprintf('<th></th>');
|
||||
$out[] = hsprintf('<td class="%s">%s</td>', $class, $p['render']);
|
||||
$out[] = '<th>'.$p['line'].'</th>';
|
||||
$out[] = '<th></th>';
|
||||
$out[] = '<td class="'.$class.'">'.$p['render'].'</td>';
|
||||
} else if ($type == 'new') {
|
||||
if ($p['htype']) {
|
||||
$class = 'right new';
|
||||
$out[] = hsprintf('<th />');
|
||||
$out[] = '<th />';
|
||||
} else {
|
||||
$class = 'right';
|
||||
$out[] = hsprintf('<th>%s</th>', $p['oline']);
|
||||
$out[] = '<th>'.$p['oline'].'</th>';
|
||||
}
|
||||
$out[] = hsprintf('<th>%s</th>', $p['line']);
|
||||
$out[] = hsprintf('<td class="%s">%s</td>', $class, $p['render']);
|
||||
$out[] = '<th>'.$p['line'].'</th>';
|
||||
$out[] = '<td class="'.$class.'">'.$p['render'].'</td>';
|
||||
}
|
||||
$out[] = hsprintf('</tr>');
|
||||
$out[] = '</tr>';
|
||||
break;
|
||||
case 'inline':
|
||||
$out[] = hsprintf('<tr><th /><th />');
|
||||
$out[] = hsprintf('<td>');
|
||||
$out[] = '<tr><th /><th />';
|
||||
$out[] = '<td>';
|
||||
|
||||
$inline = $this->buildInlineComment(
|
||||
$p['comment'],
|
||||
|
@ -53,16 +53,16 @@ final class DifferentialChangesetOneUpRenderer
|
|||
$inline->setBuildScaffolding(false);
|
||||
$out[] = $inline->render();
|
||||
|
||||
$out[] = hsprintf('</td></tr>');
|
||||
$out[] = '</td></tr>';
|
||||
break;
|
||||
default:
|
||||
$out[] = hsprintf('<tr><th /><th /><td>%s</td></tr>', $type);
|
||||
$out[] = '<tr><th /><th /><td>'.$type.'</td></tr>';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($out) {
|
||||
return $this->wrapChangeInTable(phutil_implode_html('', $out));
|
||||
return $this->wrapChangeInTable(implode('', $out));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -160,7 +160,7 @@ final class DifferentialChangesetTwoUpRenderer
|
|||
'colspan' => 2,
|
||||
'class' => 'show-more',
|
||||
),
|
||||
phutil_implode_html(
|
||||
array_interleave(
|
||||
" \xE2\x80\xA2 ", // Bullet
|
||||
$contents)),
|
||||
phutil_tag(
|
||||
|
@ -205,7 +205,7 @@ final class DifferentialChangesetTwoUpRenderer
|
|||
}
|
||||
}
|
||||
|
||||
$n_copy = hsprintf('<td class="copy" />');
|
||||
$n_copy = '<td class="copy" />';
|
||||
$n_cov = null;
|
||||
$n_colspan = 2;
|
||||
$n_classes = '';
|
||||
|
@ -224,7 +224,7 @@ final class DifferentialChangesetTwoUpRenderer
|
|||
$cov_class = $coverage[$n_num - 1];
|
||||
}
|
||||
$cov_class = 'cov-'.$cov_class;
|
||||
$n_cov = hsprintf('<td class="cov %s"></td>', $cov_class);
|
||||
$n_cov = '<td class="cov '.$cov_class.'"></td>';
|
||||
$n_colspan--;
|
||||
}
|
||||
|
||||
|
@ -242,7 +242,7 @@ final class DifferentialChangesetTwoUpRenderer
|
|||
$n_classes = $n_class;
|
||||
|
||||
if ($new_lines[$ii]['type'] == '\\' || !isset($copy_lines[$n_num])) {
|
||||
$n_copy = hsprintf('<td class="copy %s"></td>', $n_class);
|
||||
$n_copy = '<td class="copy '.$n_class.'"></td>';
|
||||
} else {
|
||||
list($orig_file, $orig_line, $orig_type) = $copy_lines[$n_num];
|
||||
$title = ($orig_type == '-' ? 'Moved' : 'Copied').' from ';
|
||||
|
@ -274,13 +274,13 @@ final class DifferentialChangesetTwoUpRenderer
|
|||
}
|
||||
|
||||
if ($o_num && $left_id) {
|
||||
$o_id = 'C'.$left_id.$left_char.'L'.$o_num;
|
||||
$o_id = ' id="C'.$left_id.$left_char.'L'.$o_num.'"';
|
||||
} else {
|
||||
$o_id = null;
|
||||
}
|
||||
|
||||
if ($n_num && $right_id) {
|
||||
$n_id = 'C'.$right_id.$right_char.'L'.$n_num;
|
||||
$n_id = ' id="C'.$right_id.$right_char.'L'.$n_num.'"';
|
||||
} else {
|
||||
$n_id = null;
|
||||
}
|
||||
|
@ -288,26 +288,20 @@ final class DifferentialChangesetTwoUpRenderer
|
|||
// NOTE: The Javascript is sensitive to whitespace changes in this
|
||||
// block!
|
||||
|
||||
$html[] = hsprintf(
|
||||
$html[] =
|
||||
'<tr>'.
|
||||
'%s'.
|
||||
'<td class="%s">%s</td>'.
|
||||
'%s'.
|
||||
'%s'.
|
||||
'<th'.$o_id.'>'.$o_num.'</th>'.
|
||||
'<td class="'.$o_classes.'">'.$o_text.'</td>'.
|
||||
'<th'.$n_id.'>'.$n_num.'</th>'.
|
||||
$n_copy.
|
||||
// NOTE: This is a unicode zero-width space, which we use as a hint
|
||||
// when intercepting 'copy' events to make sure sensible text ends
|
||||
// up on the clipboard. See the 'phabricator-oncopy' behavior.
|
||||
'<td class="%s" colspan="%s">'.
|
||||
"\xE2\x80\x8B%s".
|
||||
'<td class="'.$n_classes.'" colspan="'.$n_colspan.'">'.
|
||||
"\xE2\x80\x8B".$n_text.
|
||||
'</td>'.
|
||||
'%s'.
|
||||
'</tr>',
|
||||
phutil_tag('th', array('id' => $o_id), $o_num),
|
||||
$o_classes, $o_text,
|
||||
phutil_tag('th', array('id' => $n_id), $n_num),
|
||||
$n_copy,
|
||||
$n_classes, $n_colspan, $n_text,
|
||||
$n_cov);
|
||||
$n_cov.
|
||||
'</tr>';
|
||||
|
||||
if ($context_not_available && ($ii == $rows - 1)) {
|
||||
$html[] = $context_not_available;
|
||||
|
@ -357,7 +351,7 @@ final class DifferentialChangesetTwoUpRenderer
|
|||
}
|
||||
}
|
||||
|
||||
return $this->wrapChangeInTable(phutil_implode_html('', $html));
|
||||
return $this->wrapChangeInTable(implode('', $html));
|
||||
}
|
||||
|
||||
public function renderFileChange($old_file = null,
|
||||
|
@ -401,57 +395,51 @@ final class DifferentialChangesetTwoUpRenderer
|
|||
foreach ($this->getOldComments() as $on_line => $comment_group) {
|
||||
foreach ($comment_group as $comment) {
|
||||
$comment_html = $this->renderInlineComment($comment, $on_right = false);
|
||||
$html_old[] = hsprintf(
|
||||
$html_old[] =
|
||||
'<tr class="inline">'.
|
||||
'<th />'.
|
||||
'<td class="left">%s</td>'.
|
||||
'<td class="left">'.$comment_html.'</td>'.
|
||||
'<th />'.
|
||||
'<td class="right3" colspan="3" />'.
|
||||
'</tr>',
|
||||
$comment_html);
|
||||
'</tr>';
|
||||
}
|
||||
}
|
||||
foreach ($this->getNewComments() as $lin_line => $comment_group) {
|
||||
foreach ($comment_group as $comment) {
|
||||
$comment_html = $this->renderInlineComment($comment, $on_right = true);
|
||||
$html_new[] = hsprintf(
|
||||
$html_new[] =
|
||||
'<tr class="inline">'.
|
||||
'<th />'.
|
||||
'<td class="left" />'.
|
||||
'<th />'.
|
||||
'<td class="right3" colspan="3">%s</td>'.
|
||||
'</tr>',
|
||||
$comment_html);
|
||||
'<td class="right3" colspan="3">'.$comment_html.'</td>'.
|
||||
'</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
if (!$old) {
|
||||
$th_old = hsprintf('<th></th>');
|
||||
$th_old = '<th></th>';
|
||||
} else {
|
||||
$th_old = hsprintf('<th id="C%sOL1">1</th>', $vs);
|
||||
$th_old = '<th id="C'.$vs.'OL1">1</th>';
|
||||
}
|
||||
|
||||
if (!$new) {
|
||||
$th_new = hsprintf('<th></th>');
|
||||
$th_new = '<th></th>';
|
||||
} else {
|
||||
$th_new = hsprintf('<th id="C%sNL1">1</th>', $id);
|
||||
$th_new = '<th id="C'.$id.'NL1">1</th>';
|
||||
}
|
||||
|
||||
$output = hsprintf(
|
||||
$output =
|
||||
'<tr class="differential-image-diff">'.
|
||||
'%s'.
|
||||
'<td class="left differential-old-image">%s</td>'.
|
||||
'%s'.
|
||||
'<td class="right3 differential-new-image" colspan="3">%s</td>'.
|
||||
$th_old.
|
||||
'<td class="left differential-old-image">'.$old.'</td>'.
|
||||
$th_new.
|
||||
'<td class="right3 differential-new-image" colspan="3">'.
|
||||
$new.
|
||||
'</td>'.
|
||||
'</tr>'.
|
||||
'%s'.
|
||||
'%s',
|
||||
$th_old,
|
||||
$old,
|
||||
$th_new,
|
||||
$new,
|
||||
phutil_implode_html('', $html_old),
|
||||
phutil_implode_html('', $html_new));
|
||||
implode('', $html_old).
|
||||
implode('', $html_new);
|
||||
|
||||
$output = $this->wrapChangeInTable($output);
|
||||
|
||||
|
|
|
@ -155,35 +155,35 @@ final class DifferentialAddCommentView extends AphrontView {
|
|||
'inline' => 'inline-comment-preview',
|
||||
));
|
||||
|
||||
$warning_container = array();
|
||||
$warning_container = '<div id="warnings">';
|
||||
foreach ($warnings as $warning) {
|
||||
if ($warning) {
|
||||
$warning_container[] = $warning->render();
|
||||
$warning_container .= $warning->render();
|
||||
}
|
||||
}
|
||||
$warning_container .= '</div>';
|
||||
|
||||
$header = id(new PhabricatorHeaderView())
|
||||
->setHeader($is_serious ? pht('Add Comment') : pht('Leap Into Action'));
|
||||
|
||||
return hsprintf(
|
||||
'%s'.
|
||||
return
|
||||
id(new PhabricatorAnchorView())
|
||||
->setAnchorName('comment')
|
||||
->setNavigationMarker(true)
|
||||
->render().
|
||||
'<div class="differential-add-comment-panel">'.
|
||||
'%s%s%s'.
|
||||
$header->render().
|
||||
$form->render().
|
||||
$warning_container.
|
||||
'<div class="aphront-panel-preview aphront-panel-flush">'.
|
||||
'<div id="comment-preview">'.
|
||||
'<span class="aphront-panel-preview-loading-text">%s</span>'.
|
||||
'<span class="aphront-panel-preview-loading-text">'.
|
||||
pht('Loading comment preview...').
|
||||
'</span>'.
|
||||
'</div>'.
|
||||
'<div id="inline-comment-preview">'.
|
||||
'</div>'.
|
||||
'</div>'.
|
||||
'</div>',
|
||||
id(new PhabricatorAnchorView())
|
||||
->setAnchorName('comment')
|
||||
->setNavigationMarker(true)
|
||||
->render(),
|
||||
$header->render(),
|
||||
$form->render(),
|
||||
phutil_tag('div', array('id' => 'warnings'), $warning_container),
|
||||
pht('Loading comment preview...'));
|
||||
'</div>';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@ final class DifferentialChangesetDetailView extends AphrontView {
|
|||
'class' => $class,
|
||||
'id' => $id,
|
||||
),
|
||||
$this->renderSingleView(
|
||||
$this->renderHTMLView(
|
||||
array(
|
||||
id(new PhabricatorAnchorView())
|
||||
->setAnchorName($changeset->getAnchorName())
|
||||
|
@ -101,7 +101,7 @@ final class DifferentialChangesetDetailView extends AphrontView {
|
|||
$buttons,
|
||||
phutil_tag('h1', array(), $display_filename),
|
||||
phutil_tag('div', array('style' => 'clear: both'), ''),
|
||||
$this->renderChildren(),
|
||||
$this->renderHTMLChildren(),
|
||||
)));
|
||||
}
|
||||
|
||||
|
|
|
@ -187,7 +187,7 @@ final class DifferentialChangesetListView extends AphrontView {
|
|||
));
|
||||
}
|
||||
|
||||
return $this->renderSingleView(
|
||||
return $this->renderHTMLView(
|
||||
array(
|
||||
id(new PhabricatorHeaderView())
|
||||
->setHeader($this->getTitle())
|
||||
|
@ -221,20 +221,15 @@ final class DifferentialChangesetListView extends AphrontView {
|
|||
),
|
||||
array('Changes discarded. ', $link));
|
||||
|
||||
return array(
|
||||
'l' => hsprintf(
|
||||
'<table><tr>'.
|
||||
'<th></th><td>%s</td>'.
|
||||
'<th></th><td colspan="3"></td>'.
|
||||
'</tr></table>',
|
||||
$div),
|
||||
$template =
|
||||
'<table><tr>'.
|
||||
'<th></th><td>%s</td>'.
|
||||
'<th></th><td colspan="3">%s</td>'.
|
||||
'</tr></table>';
|
||||
|
||||
'r' => hsprintf(
|
||||
'<table><tr>'.
|
||||
'<th></th><td></td>'.
|
||||
'<th></th><td colspan="3">%s</td>'.
|
||||
'</tr></table>',
|
||||
$div),
|
||||
return array(
|
||||
'l' => sprintf($template, $div, ''),
|
||||
'r' => sprintf($template, '', $div),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -94,20 +94,22 @@ final class DifferentialDiffTableOfContentsView extends AphrontView {
|
|||
$meta[] = pht('Copied to multiple locations:');
|
||||
}
|
||||
foreach ($away as $path) {
|
||||
$meta[] = $path;
|
||||
$meta[] = phutil_escape_html($path);
|
||||
}
|
||||
$meta = phutil_implode_html(phutil_tag('br'), $meta);
|
||||
$meta = implode('<br />', $meta);
|
||||
} else {
|
||||
if ($type == DifferentialChangeType::TYPE_MOVE_AWAY) {
|
||||
$meta = pht('Moved to %s', reset($away));
|
||||
$meta = pht('Moved to %s', phutil_escape_html(reset($away)));
|
||||
} else {
|
||||
$meta = pht('Copied to %s', reset($away));
|
||||
$meta = pht('Copied to %s', phutil_escape_html(reset($away)));
|
||||
}
|
||||
}
|
||||
} else if ($type == DifferentialChangeType::TYPE_MOVE_HERE) {
|
||||
$meta = pht('Moved from %s', $changeset->getOldFile());
|
||||
$meta = pht('Moved from %s',
|
||||
phutil_escape_html($changeset->getOldFile()));
|
||||
} else if ($type == DifferentialChangeType::TYPE_COPY_HERE) {
|
||||
$meta = pht('Copied from %s', $changeset->getOldFile());
|
||||
$meta = pht('Copied from %s',
|
||||
phutil_escape_html($changeset->getOldFile()));
|
||||
} else {
|
||||
$meta = null;
|
||||
}
|
||||
|
@ -128,12 +130,12 @@ final class DifferentialDiffTableOfContentsView extends AphrontView {
|
|||
$pchar =
|
||||
($changeset->getOldProperties() === $changeset->getNewProperties())
|
||||
? null
|
||||
: hsprintf('<span title="%s">M</span>', pht('Properties Changed'));
|
||||
: '<span title="'.pht('Properties Changed').'">M</span>';
|
||||
|
||||
$fname = $changeset->getFilename();
|
||||
$cov = $this->renderCoverage($coverage, $fname);
|
||||
if ($cov === null) {
|
||||
$mcov = $cov = phutil_tag('em', array(), '-');
|
||||
$mcov = $cov = '<em>-</em>';
|
||||
} else {
|
||||
$mcov = phutil_tag(
|
||||
'div',
|
||||
|
@ -144,28 +146,27 @@ final class DifferentialDiffTableOfContentsView extends AphrontView {
|
|||
(isset($this->visibleChangesets[$id]) ? 'Loading...' : '?'));
|
||||
}
|
||||
|
||||
$rows[] = hsprintf(
|
||||
'<tr>'.
|
||||
'<td class="differential-toc-char" title="%s">%s</td>'.
|
||||
'<td class="differential-toc-prop">%s</td>'.
|
||||
'<td class="differential-toc-ftype">%s</td>'.
|
||||
'<td class="differential-toc-file">%s%s</td>'.
|
||||
'<td class="differential-toc-cov">%s</td>'.
|
||||
'<td class="differential-toc-mcov">%s</td>'.
|
||||
'</tr>',
|
||||
$chartitle, $char,
|
||||
$pchar,
|
||||
$desc,
|
||||
$link, $lines,
|
||||
$cov,
|
||||
$mcov);
|
||||
$rows[] =
|
||||
'<tr>'.
|
||||
phutil_tag(
|
||||
'td',
|
||||
array(
|
||||
'class' => 'differential-toc-char',
|
||||
'title' => $chartitle,
|
||||
),
|
||||
$char).
|
||||
'<td class="differential-toc-prop">'.$pchar.'</td>'.
|
||||
'<td class="differential-toc-ftype">'.$desc.'</td>'.
|
||||
'<td class="differential-toc-file">'.$link.$lines.'</td>'.
|
||||
'<td class="differential-toc-cov">'.$cov.'</td>'.
|
||||
'<td class="differential-toc-mcov">'.$mcov.'</td>'.
|
||||
'</tr>';
|
||||
if ($meta) {
|
||||
$rows[] = hsprintf(
|
||||
$rows[] =
|
||||
'<tr>'.
|
||||
'<td colspan="3"></td>'.
|
||||
'<td class="differential-toc-meta">%s</td>'.
|
||||
'</tr>',
|
||||
$meta);
|
||||
'<td class="differential-toc-meta">'.$meta.'</td>'.
|
||||
'</tr>';
|
||||
}
|
||||
if ($this->diff && $this->repository) {
|
||||
$paths[] =
|
||||
|
@ -200,13 +201,19 @@ final class DifferentialDiffTableOfContentsView extends AphrontView {
|
|||
),
|
||||
pht('Show All Context'));
|
||||
|
||||
$buttons = hsprintf(
|
||||
'<tr><td colspan="7">%s%s</td></tr>',
|
||||
$editor_link,
|
||||
$reveal_link);
|
||||
$buttons =
|
||||
'<tr><td colspan="7">'.
|
||||
$editor_link.$reveal_link.
|
||||
'</td></tr>';
|
||||
|
||||
return hsprintf(
|
||||
'%s%s'.
|
||||
return
|
||||
id(new PhabricatorAnchorView())
|
||||
->setAnchorName('toc')
|
||||
->setNavigationMarker(true)
|
||||
->render().
|
||||
id(new PhabricatorHeaderView())
|
||||
->setHeader(pht('Table of Contents'))
|
||||
->render().
|
||||
'<div class="differential-toc differential-panel">'.
|
||||
'<table>'.
|
||||
'<tr>'.
|
||||
|
@ -214,23 +221,17 @@ final class DifferentialDiffTableOfContentsView extends AphrontView {
|
|||
'<th></th>'.
|
||||
'<th></th>'.
|
||||
'<th>Path</th>'.
|
||||
'<th class="differential-toc-cov">%s</th>'.
|
||||
'<th class="differential-toc-mcov">%s</th>'.
|
||||
'<th class="differential-toc-cov">'.
|
||||
pht('Coverage (All)').
|
||||
'</th>'.
|
||||
'<th class="differential-toc-mcov">'.
|
||||
pht('Coverage (Touched)').
|
||||
'</th>'.
|
||||
'</tr>'.
|
||||
'%s%s'.
|
||||
implode("\n", $rows).
|
||||
$buttons.
|
||||
'</table>'.
|
||||
'</div>',
|
||||
id(new PhabricatorAnchorView())
|
||||
->setAnchorName('toc')
|
||||
->setNavigationMarker(true)
|
||||
->render(),
|
||||
id(new PhabricatorHeaderView())
|
||||
->setHeader(pht('Table of Contents'))
|
||||
->render(),
|
||||
pht('Coverage (All)'),
|
||||
pht('Coverage (Touched)'),
|
||||
phutil_implode_html("\n", $rows),
|
||||
$buttons);
|
||||
'</div>';
|
||||
}
|
||||
|
||||
private function renderCoverage(array $coverage, $file) {
|
||||
|
|
|
@ -55,7 +55,7 @@ final class DifferentialInlineCommentEditView extends AphrontView {
|
|||
'method' => 'POST',
|
||||
'sigil' => 'inline-edit-form',
|
||||
),
|
||||
$this->renderSingleView(
|
||||
$this->renderHTMLView(
|
||||
array(
|
||||
$this->renderInputs(),
|
||||
$this->renderBody(),
|
||||
|
@ -123,14 +123,14 @@ final class DifferentialInlineCommentEditView extends AphrontView {
|
|||
array(
|
||||
'class' => 'differential-inline-comment-edit-body',
|
||||
),
|
||||
$this->renderChildren());
|
||||
$this->renderHTMLChildren());
|
||||
|
||||
$edit = phutil_tag(
|
||||
'edit',
|
||||
array(
|
||||
'class' => 'differential-inline-comment-edit-buttons',
|
||||
),
|
||||
$this->renderSingleView(
|
||||
$this->renderHTMLView(
|
||||
array(
|
||||
$formatting,
|
||||
$buttons,
|
||||
|
@ -148,7 +148,7 @@ final class DifferentialInlineCommentEditView extends AphrontView {
|
|||
'length' => $this->length,
|
||||
),
|
||||
),
|
||||
$this->renderSingleView(
|
||||
$this->renderHTMLView(
|
||||
array(
|
||||
$title,
|
||||
$body,
|
||||
|
|
|
@ -178,7 +178,7 @@ final class DifferentialInlineCommentView extends AphrontView {
|
|||
$links = phutil_tag(
|
||||
'span',
|
||||
array('class' => 'differential-inline-comment-links'),
|
||||
phutil_implode_html(" \xC2\xB7 ", $links));
|
||||
array_interleave(" \xC2\xB7 ", $links));
|
||||
} else {
|
||||
$links = null;
|
||||
}
|
||||
|
|
|
@ -74,7 +74,7 @@ final class DifferentialLocalCommitsView extends AphrontView {
|
|||
}
|
||||
$parents[$k] = substr($parent, 0, 16);
|
||||
}
|
||||
$parents = phutil_implode_html(phutil_tag('br'), $parents);
|
||||
$parents = array_interleave(phutil_tag('br'), $parents);
|
||||
$row[] = phutil_tag('td', array(), $parents);
|
||||
|
||||
$author = nonempty(
|
||||
|
@ -114,31 +114,29 @@ final class DifferentialLocalCommitsView extends AphrontView {
|
|||
|
||||
|
||||
$headers = array();
|
||||
$headers[] = phutil_tag('th', array(), pht('Commit'));
|
||||
$headers[] = '<th>'.pht('Commit').'</th>';
|
||||
if ($has_tree) {
|
||||
$headers[] = phutil_tag('th', array(), pht('Tree'));
|
||||
$headers[] = '<th>'.pht('Tree').'</th>';
|
||||
}
|
||||
if ($has_local) {
|
||||
$headers[] = phutil_tag('th', array(), pht('Local'));
|
||||
$headers[] = '<th>'.pht('Local').'</th>';
|
||||
}
|
||||
$headers[] = phutil_tag('th', array(), pht('Parents'));
|
||||
$headers[] = phutil_tag('th', array(), pht('Author'));
|
||||
$headers[] = phutil_tag('th', array(), pht('Summary'));
|
||||
$headers[] = phutil_tag('th', array(), pht('Date'));
|
||||
$headers[] = '<th>'.pht('Parents').'</th>';
|
||||
$headers[] = '<th>'.pht('Author').'</th>';
|
||||
$headers[] = '<th>'.pht('Summary').'</th>';
|
||||
$headers[] = '<th>'.pht('Date').'</th>';
|
||||
|
||||
$headers = phutil_tag('tr', array(), $headers);
|
||||
$headers = '<tr>'.implode('', $headers).'</tr>';
|
||||
|
||||
$header = id(new PhabricatorHeaderView())
|
||||
->setHeader(pht('Local Commits'))
|
||||
->render();
|
||||
|
||||
return hsprintf(
|
||||
'%s'.
|
||||
return
|
||||
id(new PhabricatorHeaderView())
|
||||
->setHeader(pht('Local Commits'))
|
||||
->render().
|
||||
'<div class="differential-panel">'.
|
||||
'<table class="differential-local-commits-table">%s%s</table>'.
|
||||
'</div>',
|
||||
$header,
|
||||
$headers,
|
||||
phutil_implode_html("\n", $rows));
|
||||
'<table class="differential-local-commits-table">'.
|
||||
$headers.
|
||||
implode("\n", $rows).
|
||||
'</table>'.
|
||||
'</div>';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ final class DifferentialPrimaryPaneView extends AphrontView {
|
|||
|
||||
public function render() {
|
||||
|
||||
return phutil_tag(
|
||||
return phutil_render_tag(
|
||||
'div',
|
||||
array(
|
||||
'class' => 'differential-primary-pane',
|
||||
|
|
|
@ -187,12 +187,14 @@ final class DifferentialRevisionCommentListView extends AphrontView {
|
|||
$hidden = null;
|
||||
}
|
||||
|
||||
return javelin_tag(
|
||||
return javelin_render_tag(
|
||||
'div',
|
||||
array(
|
||||
'class' => 'differential-comment-list',
|
||||
'id' => $this->getID(),
|
||||
),
|
||||
array_merge($header, array($hidden), $visible));
|
||||
implode("\n", $header).
|
||||
$hidden.
|
||||
implode("\n", $visible));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -87,9 +87,10 @@ final class DifferentialRevisionCommentView extends AphrontView {
|
|||
$comment,
|
||||
PhabricatorInlineCommentInterface::MARKUP_FIELD_BODY);
|
||||
|
||||
$content = hsprintf(
|
||||
'<div class="phabricator-remarkup">%s</div>',
|
||||
$content);
|
||||
$content =
|
||||
'<div class="phabricator-remarkup">'.
|
||||
$content.
|
||||
'</div>';
|
||||
}
|
||||
|
||||
$inline_render = $this->renderInlineComments();
|
||||
|
@ -115,22 +116,19 @@ final class DifferentialRevisionCommentView extends AphrontView {
|
|||
array());
|
||||
|
||||
$verb = DifferentialAction::getActionPastTenseVerb($comment->getAction());
|
||||
$verb = phutil_escape_html($verb);
|
||||
|
||||
$actions = array();
|
||||
// TODO: i18n
|
||||
switch ($comment->getAction()) {
|
||||
case DifferentialAction::ACTION_ADDCCS:
|
||||
$actions[] = hsprintf(
|
||||
"%s added CCs: %s.",
|
||||
$author_link,
|
||||
$this->renderHandleList($added_ccs));
|
||||
$actions[] = "{$author_link} added CCs: ".
|
||||
$this->renderHandleList($added_ccs).".";
|
||||
$added_ccs = null;
|
||||
break;
|
||||
case DifferentialAction::ACTION_ADDREVIEWERS:
|
||||
$actions[] = hsprintf(
|
||||
"%s added reviewers: %s.",
|
||||
$author_link,
|
||||
$this->renderHandleList($added_reviewers));
|
||||
$actions[] = "{$author_link} added reviewers: ".
|
||||
$this->renderHandleList($added_reviewers).".";
|
||||
$added_reviewers = null;
|
||||
break;
|
||||
case DifferentialAction::ACTION_UPDATE:
|
||||
|
@ -142,48 +140,33 @@ final class DifferentialRevisionCommentView extends AphrontView {
|
|||
'href' => '/D'.$comment->getRevisionID().'?id='.$diff_id,
|
||||
),
|
||||
'Diff #'.$diff_id);
|
||||
$actions[] = hsprintf(
|
||||
"%s updated this revision to %s.",
|
||||
$author_link,
|
||||
$diff_link);
|
||||
$actions[] = "{$author_link} updated this revision to {$diff_link}.";
|
||||
} else {
|
||||
$actions[] = hsprintf(
|
||||
"%s %s this revision.",
|
||||
$author_link,
|
||||
$verb);
|
||||
$actions[] = "{$author_link} {$verb} this revision.";
|
||||
}
|
||||
break;
|
||||
default:
|
||||
$actions[] = hsprintf(
|
||||
"%s %s this revision.",
|
||||
$author_link,
|
||||
$verb);
|
||||
$actions[] = "{$author_link} {$verb} this revision.";
|
||||
break;
|
||||
}
|
||||
|
||||
if ($added_reviewers) {
|
||||
$actions[] = hsprintf(
|
||||
"%s added reviewers: %s.",
|
||||
$author_link,
|
||||
$this->renderHandleList($added_reviewers));
|
||||
$actions[] = "{$author_link} added reviewers: ".
|
||||
$this->renderHandleList($added_reviewers).".";
|
||||
}
|
||||
|
||||
if ($removed_reviewers) {
|
||||
$actions[] = hsprintf(
|
||||
"%s removed reviewers: %s.",
|
||||
$author_link,
|
||||
$this->renderHandleList($removed_reviewers));
|
||||
$actions[] = "{$author_link} removed reviewers: ".
|
||||
$this->renderHandleList($removed_reviewers).".";
|
||||
}
|
||||
|
||||
if ($added_ccs) {
|
||||
$actions[] = hsprintf(
|
||||
"%s added CCs: %s.",
|
||||
$author_link,
|
||||
$this->renderHandleList($added_ccs));
|
||||
$actions[] = "{$author_link} added CCs: ".
|
||||
$this->renderHandleList($added_ccs).".";
|
||||
}
|
||||
|
||||
foreach ($actions as $key => $action) {
|
||||
$actions[$key] = phutil_tag('div', array(), $action);
|
||||
$actions[$key] = '<div>'.$action.'</div>';
|
||||
}
|
||||
|
||||
$xaction_view = id(new PhabricatorTransactionView())
|
||||
|
@ -207,10 +190,11 @@ final class DifferentialRevisionCommentView extends AphrontView {
|
|||
}
|
||||
|
||||
if (!$hide_comments) {
|
||||
$xaction_view->appendChild(hsprintf(
|
||||
'<div class="differential-comment-core">%s%s</div>',
|
||||
$content,
|
||||
$this->renderSingleView($inline_render)));
|
||||
$xaction_view->appendChild(
|
||||
'<div class="differential-comment-core">'.
|
||||
$content.
|
||||
'</div>'.
|
||||
$this->renderSingleView($inline_render));
|
||||
}
|
||||
|
||||
return $xaction_view->render();
|
||||
|
@ -221,7 +205,7 @@ final class DifferentialRevisionCommentView extends AphrontView {
|
|||
foreach ($phids as $phid) {
|
||||
$result[] = $this->handles[$phid]->renderLink();
|
||||
}
|
||||
return phutil_implode_html(', ', $result);
|
||||
return implode(', ', $result);
|
||||
}
|
||||
|
||||
private function renderInlineComments() {
|
||||
|
|
|
@ -87,11 +87,7 @@ final class DifferentialRevisionDetailView extends AphrontView {
|
|||
}
|
||||
$properties->setHasKeyboardShortcuts(true);
|
||||
|
||||
return hsprintf(
|
||||
'%s%s%s',
|
||||
$header->render(),
|
||||
$actions->render(),
|
||||
$properties->render());
|
||||
return $header->render() . $actions->render() . $properties->render();
|
||||
}
|
||||
|
||||
private function renderHeader(DifferentialRevision $revision) {
|
||||
|
|
|
@ -128,18 +128,18 @@ final class DifferentialRevisionListView extends AphrontView {
|
|||
|
||||
} else if (array_key_exists($revision->getID(), $this->drafts)) {
|
||||
$src = '/rsrc/image/icon/fatcow/page_white_edit.png';
|
||||
$flag = hsprintf(
|
||||
'<a href="%s">%s</a>',
|
||||
'/D'.$revision->getID().'#comment-preview',
|
||||
phutil_tag(
|
||||
'img',
|
||||
array(
|
||||
'src' => celerity_get_resource_uri($src),
|
||||
'width' => 16,
|
||||
'height' => 16,
|
||||
'alt' => 'Draft',
|
||||
'title' => pht('Draft Comment'),
|
||||
)));
|
||||
$flag =
|
||||
'<a href="/D'.$revision->getID().'#comment-preview">'.
|
||||
phutil_tag(
|
||||
'img',
|
||||
array(
|
||||
'src' => celerity_get_resource_uri($src),
|
||||
'width' => 16,
|
||||
'height' => 16,
|
||||
'alt' => 'Draft',
|
||||
'title' => pht('Draft Comment'),
|
||||
)).
|
||||
'</a>';
|
||||
}
|
||||
|
||||
$row = array($flag);
|
||||
|
|
|
@ -177,8 +177,9 @@ final class DifferentialRevisionUpdateHistoryView extends AphrontView {
|
|||
DifferentialChangesetParser::WHITESPACE_SHOW_ALL => 'Show All',
|
||||
);
|
||||
|
||||
$select = '<select name="whitespace">';
|
||||
foreach ($options as $value => $label) {
|
||||
$options[$value] = phutil_tag(
|
||||
$select .= phutil_tag(
|
||||
'option',
|
||||
array(
|
||||
'value' => $value,
|
||||
|
@ -188,39 +189,34 @@ final class DifferentialRevisionUpdateHistoryView extends AphrontView {
|
|||
),
|
||||
$label);
|
||||
}
|
||||
$select = phutil_tag('select', array('name' => 'whitespace'), $options);
|
||||
$select .= '</select>';
|
||||
|
||||
array_unshift($rows, phutil_tag('tr', array(), array(
|
||||
phutil_tag('th', array(), pht('Diff')),
|
||||
phutil_tag('th', array(), pht('ID')),
|
||||
phutil_tag('th', array(), pht('Base')),
|
||||
phutil_tag('th', array(), pht('Description')),
|
||||
phutil_tag('th', array(), pht('Created')),
|
||||
phutil_tag('th', array(), pht('Lint')),
|
||||
phutil_tag('th', array(), pht('Unit')),
|
||||
)));
|
||||
|
||||
return hsprintf(
|
||||
'%s'.
|
||||
return
|
||||
id(new PhabricatorHeaderView())
|
||||
->setHeader(pht('Revision Update History'))
|
||||
->render() .
|
||||
'<div class="differential-revision-history differential-panel">'.
|
||||
'<form action="#toc">'.
|
||||
'<table class="differential-revision-history-table">'.
|
||||
'%s'.
|
||||
'<tr>'.
|
||||
'<th>'.pht('Diff').'</th>'.
|
||||
'<th>'.pht('ID').'</th>'.
|
||||
'<th>'.pht('Base').'</th>'.
|
||||
'<th>'.pht('Description').'</th>'.
|
||||
'<th>'.pht('Created').'</th>'.
|
||||
'<th>'.pht('Lint').'</th>'.
|
||||
'<th>'.pht('Unit').'</th>'.
|
||||
'</tr>'.
|
||||
implode("\n", $rows).
|
||||
'<tr>'.
|
||||
'<td colspan="9" class="diff-differ-submit">'.
|
||||
'<label>%s</label>'.
|
||||
'<button>%s</button>'.
|
||||
'<label>'.pht('Whitespace Changes: %s', $select).'</label>'.
|
||||
'<button>'.pht('Show Diff').'</button>'.
|
||||
'</td>'.
|
||||
'</tr>'.
|
||||
'</table>'.
|
||||
'</form>'.
|
||||
'</div>',
|
||||
id(new PhabricatorHeaderView())
|
||||
->setHeader(pht('Revision Update History'))
|
||||
->render(),
|
||||
phutil_implode_html("\n", $rows),
|
||||
pht('Whitespace Changes: %s', $select),
|
||||
pht('Show Diff'));
|
||||
'</div>';
|
||||
}
|
||||
|
||||
const STAR_NONE = 'none';
|
||||
|
|
|
@ -21,7 +21,7 @@ final class DiffusionBrowseController extends DiffusionController {
|
|||
$title = 'Tag: '.$drequest->getSymbolicCommit();
|
||||
|
||||
$tag_view = new AphrontPanelView();
|
||||
$tag_view->setHeader($title);
|
||||
$tag_view->setHeader(phutil_escape_html($title));
|
||||
$tag_view->appendChild(
|
||||
$this->markupText($drequest->getTagContent()));
|
||||
|
||||
|
@ -106,7 +106,7 @@ final class DiffusionBrowseController extends DiffusionController {
|
|||
|
||||
private function markupText($text) {
|
||||
$engine = PhabricatorMarkupEngine::newDiffusionMarkupEngine();
|
||||
$text = $engine->markupText($text);
|
||||
$text = phutil_safe_html($engine->markupText($text));
|
||||
|
||||
$text = phutil_tag(
|
||||
'div',
|
||||
|
|
|
@ -97,7 +97,8 @@ final class DiffusionCommitController extends DiffusionController {
|
|||
array(
|
||||
'class' => 'diffusion-commit-message phabricator-remarkup',
|
||||
),
|
||||
$engine->markupText($commit_data->getCommitMessage())));
|
||||
phutil_safe_html(
|
||||
$engine->markupText($commit_data->getCommitMessage()))));
|
||||
|
||||
$content[] = $top_anchor;
|
||||
$content[] = $headsup_view;
|
||||
|
@ -448,7 +449,9 @@ final class DiffusionCommitController extends DiffusionController {
|
|||
foreach ($parents as $parent) {
|
||||
$parent_links[] = $handles[$parent->getPHID()]->renderLink();
|
||||
}
|
||||
$props['Parents'] = phutil_implode_html(" \xC2\xB7 ", $parent_links);
|
||||
$props['Parents'] = array_interleave(
|
||||
" \xC2\xB7 ",
|
||||
$parent_links);
|
||||
}
|
||||
|
||||
$request = $this->getDiffusionRequest();
|
||||
|
@ -485,7 +488,7 @@ final class DiffusionCommitController extends DiffusionController {
|
|||
foreach ($task_phids as $phid) {
|
||||
$task_list[] = $handles[$phid]->renderLink();
|
||||
}
|
||||
$task_list = phutil_implode_html(phutil_tag('br'), $task_list);
|
||||
$task_list = array_interleave(phutil_tag('br'), $task_list);
|
||||
$props['Tasks'] = $task_list;
|
||||
}
|
||||
|
||||
|
@ -494,7 +497,7 @@ final class DiffusionCommitController extends DiffusionController {
|
|||
foreach ($proj_phids as $phid) {
|
||||
$proj_list[] = $handles[$phid]->renderLink();
|
||||
}
|
||||
$proj_list = phutil_implode_html(phutil_tag('br'), $proj_list);
|
||||
$proj_list = array_interleave(phutil_tag('br'), $proj_list);
|
||||
$props['Projects'] = $proj_list;
|
||||
}
|
||||
|
||||
|
@ -686,7 +689,7 @@ final class DiffusionCommitController extends DiffusionController {
|
|||
'inlineuri' => '/diffusion/inline/preview/'.$commit->getPHID().'/',
|
||||
));
|
||||
|
||||
$preview_panel = hsprintf(
|
||||
$preview_panel =
|
||||
'<div class="aphront-panel-preview aphront-panel-flush">
|
||||
<div id="audit-preview">
|
||||
<div class="aphront-panel-preview-loading-text">
|
||||
|
@ -695,24 +698,27 @@ final class DiffusionCommitController extends DiffusionController {
|
|||
</div>
|
||||
<div id="inline-comment-preview">
|
||||
</div>
|
||||
</div>');
|
||||
</div>';
|
||||
|
||||
// TODO: This is pretty awkward, unify the CSS between Diffusion and
|
||||
// Differential better.
|
||||
require_celerity_resource('differential-core-view-css');
|
||||
|
||||
return phutil_tag(
|
||||
return phutil_render_tag(
|
||||
'div',
|
||||
array(
|
||||
'id' => $pane_id,
|
||||
),
|
||||
hsprintf(
|
||||
'<div class="differential-add-comment-panel">%s%s%s</div>',
|
||||
phutil_render_tag(
|
||||
'div',
|
||||
array(
|
||||
'class' => 'differential-add-comment-panel',
|
||||
),
|
||||
id(new PhabricatorAnchorView())
|
||||
->setAnchorName('comment')
|
||||
->setNavigationMarker(true)
|
||||
->render(),
|
||||
$panel->render(),
|
||||
->render().
|
||||
$panel->render().
|
||||
$preview_panel));
|
||||
}
|
||||
|
||||
|
@ -932,7 +938,7 @@ final class DiffusionCommitController extends DiffusionController {
|
|||
$ref);
|
||||
}
|
||||
|
||||
return phutil_implode_html(', ', $ref_links);
|
||||
return array_interleave(', ', $ref_links);
|
||||
}
|
||||
|
||||
private function buildRawDiffResponse(DiffusionRequest $drequest) {
|
||||
|
|
|
@ -103,7 +103,7 @@ final class DiffusionExternalController extends DiffusionController {
|
|||
'href' => $href,
|
||||
),
|
||||
'r'.$repo->getCallsign().$commit->getCommitIdentifier()),
|
||||
$commit->loadCommitData()->getSummary(),
|
||||
phutil_escape_html($commit->loadCommitData()->getSummary()),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ final class DiffusionHomeController extends DiffusionController {
|
|||
'href' => $shortcut->getHref(),
|
||||
),
|
||||
$shortcut->getName()),
|
||||
$shortcut->getDescription(),
|
||||
phutil_escape_html($shortcut->getDescription()),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -130,7 +130,7 @@ final class DiffusionHomeController extends DiffusionController {
|
|||
'href' => '/diffusion/'.$repository->getCallsign().'/',
|
||||
),
|
||||
$repository->getName()),
|
||||
$repository->getDetail('description'),
|
||||
phutil_escape_html($repository->getDetail('description')),
|
||||
PhabricatorRepositoryType::getNameForRepositoryType(
|
||||
$repository->getVersionControlSystem()),
|
||||
$size,
|
||||
|
|
|
@ -71,10 +71,11 @@ final class DiffusionLintController extends DiffusionController {
|
|||
'<a href="%s">%s</a>',
|
||||
$drequest->generateURI(array('action' => 'lint')),
|
||||
$drequest->getCallsign()),
|
||||
ArcanistLintSeverity::getStringForSeverity($code['maxSeverity']),
|
||||
$code['code'],
|
||||
$code['maxName'],
|
||||
$code['maxDescription'],
|
||||
phutil_escape_html(ArcanistLintSeverity::getStringForSeverity(
|
||||
$code['maxSeverity'])),
|
||||
phutil_escape_html($code['code']),
|
||||
phutil_escape_html($code['maxName']),
|
||||
phutil_escape_html($code['maxDescription']),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -34,9 +34,10 @@ final class DiffusionLintDetailsController extends DiffusionController {
|
|||
$rows[] = array(
|
||||
$path,
|
||||
$line,
|
||||
ArcanistLintSeverity::getStringForSeverity($message['severity']),
|
||||
$message['name'],
|
||||
$message['description'],
|
||||
phutil_escape_html(ArcanistLintSeverity::getStringForSeverity(
|
||||
$message['severity'])),
|
||||
phutil_escape_html($message['name']),
|
||||
phutil_escape_html($message['description']),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -70,7 +71,7 @@ final class DiffusionLintDetailsController extends DiffusionController {
|
|||
|
||||
$content[] = id(new AphrontPanelView())
|
||||
->setHeader(
|
||||
($lint != '' ? $lint." \xC2\xB7 " : '').
|
||||
($lint != '' ? phutil_escape_html($lint)." \xC2\xB7 " : '').
|
||||
pht('%d Lint Message(s)', count($messages)))
|
||||
->setCaption($link)
|
||||
->appendChild($table)
|
||||
|
|
|
@ -68,7 +68,7 @@ final class DiffusionRepositoryController extends DiffusionController {
|
|||
'View Full Commit History');
|
||||
|
||||
$panel = new AphrontPanelView();
|
||||
$panel->setHeader(hsprintf("Recent Commits · %s", $all));
|
||||
$panel->setHeader("Recent Commits · {$all}");
|
||||
$panel->appendChild($history_table);
|
||||
$panel->setNoBackground();
|
||||
|
||||
|
@ -125,7 +125,9 @@ final class DiffusionRepositoryController extends DiffusionController {
|
|||
|
||||
$rows = array();
|
||||
foreach ($properties as $key => $value) {
|
||||
$rows[] = array($key, $value);
|
||||
$rows[] = array(
|
||||
phutil_escape_html($key),
|
||||
phutil_escape_html($value));
|
||||
}
|
||||
|
||||
$table = new AphrontTableView($rows);
|
||||
|
|
|
@ -81,8 +81,8 @@ final class DiffusionSymbolController extends DiffusionController {
|
|||
$project_name = '-';
|
||||
}
|
||||
|
||||
$file = $symbol->getPath();
|
||||
$line = $symbol->getLineNumber();
|
||||
$file = phutil_escape_html($symbol->getPath());
|
||||
$line = phutil_escape_html($symbol->getLineNumber());
|
||||
|
||||
$repo = $symbol->getRepository();
|
||||
if ($repo) {
|
||||
|
@ -101,17 +101,17 @@ final class DiffusionSymbolController extends DiffusionController {
|
|||
),
|
||||
$file.':'.$line);
|
||||
} else if ($file) {
|
||||
$location = $file.':'.$line;
|
||||
$location = phutil_escape_html($file.':'.$line);
|
||||
} else {
|
||||
$location = '?';
|
||||
}
|
||||
|
||||
$rows[] = array(
|
||||
$symbol->getSymbolType(),
|
||||
$symbol->getSymbolContext(),
|
||||
$symbol->getSymbolName(),
|
||||
$symbol->getSymbolLanguage(),
|
||||
$project_name,
|
||||
phutil_escape_html($symbol->getSymbolType()),
|
||||
phutil_escape_html($symbol->getSymbolContext()),
|
||||
phutil_escape_html($symbol->getSymbolName()),
|
||||
phutil_escape_html($symbol->getSymbolLanguage()),
|
||||
phutil_escape_html($project_name),
|
||||
$location,
|
||||
);
|
||||
}
|
||||
|
|
|
@ -119,14 +119,15 @@ abstract class DiffusionBrowseQuery {
|
|||
$readme_content = $highlighter
|
||||
->getHighlightFuture($readme_content)
|
||||
->resolve();
|
||||
$readme_content = phutil_escape_html_newlines($readme_content);
|
||||
$readme_content = nl2br($readme_content);
|
||||
$readme_content = phutil_safe_html($readme_content);
|
||||
|
||||
require_celerity_resource('syntax-highlighting-css');
|
||||
$class = 'remarkup-code';
|
||||
} else {
|
||||
// Markup extensionless files as remarkup so we get links and such.
|
||||
$engine = PhabricatorMarkupEngine::newDiffusionMarkupEngine();
|
||||
$readme_content = $engine->markupText($readme_content);
|
||||
$readme_content = phutil_safe_html($engine->markupText($readme_content));
|
||||
|
||||
$class = 'phabricator-remarkup';
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ final class DiffusionBrowseTableView extends DiffusionView {
|
|||
$committer = self::renderName($committer);
|
||||
}
|
||||
if ($author != $committer) {
|
||||
$author = hsprintf('%s/%s', $author, $committer);
|
||||
$author .= '/'.$committer;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -132,17 +132,24 @@ final class DiffusionBrowseTableView extends DiffusionView {
|
|||
$browse_text = $path->getPath().'/';
|
||||
$dir_slash = '/';
|
||||
|
||||
$browse_link = phutil_tag('strong', array(), $this->linkBrowse(
|
||||
$browse_link = '<strong>'.$this->linkBrowse(
|
||||
$base_path.$path->getPath().$dir_slash,
|
||||
array(
|
||||
'text' => $this->renderPathIcon('dir', $browse_text),
|
||||
)));
|
||||
'text' => $this->renderPathIcon(
|
||||
'dir',
|
||||
$browse_text),
|
||||
)).'</strong>';
|
||||
} else if ($file_type == DifferentialChangeType::FILE_SUBMODULE) {
|
||||
$browse_text = $path->getPath().'/';
|
||||
$browse_link = phutil_tag('strong', array(), $this->linkExternal(
|
||||
$path->getHash(),
|
||||
$path->getExternalURI(),
|
||||
$this->renderPathIcon('ext', $browse_text)));
|
||||
$browse_link =
|
||||
'<strong>'.
|
||||
$this->linkExternal(
|
||||
$path->getHash(),
|
||||
$path->getExternalURI(),
|
||||
$this->renderPathIcon(
|
||||
'ext',
|
||||
$browse_text)).
|
||||
'</strong>';
|
||||
} else {
|
||||
if ($file_type == DifferentialChangeType::FILE_SYMLINK) {
|
||||
$type = 'link';
|
||||
|
@ -183,7 +190,7 @@ final class DiffusionBrowseTableView extends DiffusionView {
|
|||
|
||||
$need_pull[$uri] = $dict;
|
||||
foreach ($dict as $k => $uniq) {
|
||||
$dict[$k] = phutil_tag('span', array('id' => $uniq), '');
|
||||
$dict[$k] = '<span id="'.$uniq.'"></span>';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -87,10 +87,10 @@ final class DiffusionCommentListView extends AphrontView {
|
|||
++$num;
|
||||
}
|
||||
|
||||
return phutil_tag(
|
||||
'div',
|
||||
array('class' => 'diffusion-comment-list'),
|
||||
$comments);
|
||||
return
|
||||
'<div class="diffusion-comment-list">'.
|
||||
$this->renderSingleView($comments).
|
||||
'</div>';
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -114,19 +114,17 @@ final class DiffusionCommentView extends AphrontView {
|
|||
$actions = array();
|
||||
if ($action == PhabricatorAuditActionConstants::ADD_CCS) {
|
||||
$rendered_ccs = $this->renderHandleList($added_ccs);
|
||||
$actions[] = hsprintf("%s added CCs: %s.", $author_link, $rendered_ccs);
|
||||
$actions[] = "{$author_link} added CCs: {$rendered_ccs}.";
|
||||
} else if ($action == PhabricatorAuditActionConstants::ADD_AUDITORS) {
|
||||
$rendered_auditors = $this->renderHandleList($added_auditors);
|
||||
$actions[] = hsprintf(
|
||||
"%s added auditors: %s.",
|
||||
$author_link,
|
||||
$rendered_auditors);
|
||||
$actions[] = "{$author_link} added auditors: ".
|
||||
"{$rendered_auditors}.";
|
||||
} else {
|
||||
$actions[] = hsprintf("%s %s this commit.", $author_link, $verb);
|
||||
$actions[] = "{$author_link} ".phutil_escape_html($verb)." this commit.";
|
||||
}
|
||||
|
||||
foreach ($actions as $key => $action) {
|
||||
$actions[$key] = phutil_tag('div', array(), $action);
|
||||
$actions[$key] = '<div>'.$action.'</div>';
|
||||
}
|
||||
|
||||
return $actions;
|
||||
|
@ -139,12 +137,13 @@ final class DiffusionCommentView extends AphrontView {
|
|||
if (!strlen($comment->getContent()) && empty($this->inlineComments)) {
|
||||
return null;
|
||||
} else {
|
||||
return hsprintf(
|
||||
'<div class="phabricator-remarkup">%s%s</div>',
|
||||
$engine->getOutput(
|
||||
$comment,
|
||||
PhabricatorAuditComment::MARKUP_FIELD_BODY),
|
||||
$this->renderSingleView($this->renderInlines()));
|
||||
return
|
||||
'<div class="phabricator-remarkup">'.
|
||||
$engine->getOutput(
|
||||
$comment,
|
||||
PhabricatorAuditComment::MARKUP_FIELD_BODY).
|
||||
$this->renderSingleView($this->renderInlines()).
|
||||
'</div>';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -187,7 +186,7 @@ final class DiffusionCommentView extends AphrontView {
|
|||
foreach ($phids as $phid) {
|
||||
$result[] = $this->handles[$phid]->renderLink();
|
||||
}
|
||||
return phutil_implode_html(', ', $result);
|
||||
return implode(', ', $result);
|
||||
}
|
||||
|
||||
private function renderClasses() {
|
||||
|
|
|
@ -51,7 +51,7 @@ final class DiffusionCommitChangeTableView extends DiffusionView {
|
|||
),
|
||||
$path);
|
||||
} else {
|
||||
$path_column = $path;
|
||||
$path_column = phutil_escape_html($path);
|
||||
}
|
||||
|
||||
$rows[] = array(
|
||||
|
|
|
@ -107,7 +107,7 @@ final class DiffusionHistoryTableView extends DiffusionView {
|
|||
} else {
|
||||
$committer = self::renderName($committer);
|
||||
}
|
||||
$author = hsprintf('%s/%s', $author, $committer);
|
||||
$author .= '/'.$committer;
|
||||
}
|
||||
|
||||
$commit = $history->getCommit();
|
||||
|
@ -118,7 +118,7 @@ final class DiffusionHistoryTableView extends DiffusionView {
|
|||
$path = null,
|
||||
$history->getCommitIdentifier());
|
||||
} else {
|
||||
$change = phutil_tag('em', array(), "Importing\xE2\x80\xA6");
|
||||
$change = "<em>Importing\xE2\x80\xA6</em>";
|
||||
}
|
||||
|
||||
$rows[] = array(
|
||||
|
|
|
@ -79,6 +79,7 @@ final class DiffusionTagListView extends DiffusionView {
|
|||
$description = $tag->getDescription();
|
||||
}
|
||||
}
|
||||
$description = phutil_escape_html($description);
|
||||
|
||||
$rows[] = array(
|
||||
$tag_link,
|
||||
|
|
|
@ -156,7 +156,7 @@ abstract class DiffusionView extends AphrontView {
|
|||
),
|
||||
$email->getDisplayName());
|
||||
}
|
||||
return hsprintf('%s', $name);
|
||||
return phutil_escape_html($name);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -50,7 +50,10 @@ final class DivinerListController extends PhabricatorController {
|
|||
$flavor);
|
||||
}
|
||||
|
||||
$out = phutil_tag('div', array('class' => 'aphront-directory-list'), $out);
|
||||
$out =
|
||||
'<div class="aphront-directory-list">'.
|
||||
implode("\n", $out).
|
||||
'</div>';
|
||||
|
||||
return $this->buildApplicationPage(
|
||||
$out,
|
||||
|
|
|
@ -44,7 +44,7 @@ abstract class DrydockController extends PhabricatorController {
|
|||
'href' => $lease_uri,
|
||||
),
|
||||
$log->getLeaseID()),
|
||||
$log->getMessage(),
|
||||
phutil_escape_html($log->getMessage()),
|
||||
phabricator_date($log->getEpoch(), $user),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -24,8 +24,8 @@ final class DrydockLeaseReleaseController extends DrydockController {
|
|||
$dialog = id(new AphrontDialogView())
|
||||
->setUser($user)
|
||||
->setTitle(pht('Lease Not Active'))
|
||||
->appendChild(phutil_tag('p', array(), pht(
|
||||
'You can only release "active" leases.')))
|
||||
->appendChild(
|
||||
'<p>'.pht('You can only release "active" leases.').'</p>')
|
||||
->addCancelButton($lease_uri);
|
||||
|
||||
return id(new AphrontDialogResponse())->setDialog($dialog);
|
||||
|
@ -35,10 +35,11 @@ final class DrydockLeaseReleaseController extends DrydockController {
|
|||
$dialog = id(new AphrontDialogView())
|
||||
->setUser($user)
|
||||
->setTitle(pht('Really release lease?'))
|
||||
->appendChild(phutil_tag('p', array(), pht(
|
||||
'Releasing a lease may cause trouble for the lease holder and '.
|
||||
'trigger cleanup of the underlying resource. It can not be '.
|
||||
'undone. Continue?')))
|
||||
->appendChild(
|
||||
'<p>'.pht(
|
||||
'Releasing a lease may cause trouble for the lease holder and '.
|
||||
'trigger cleanup of the underlying resource. It can not be '.
|
||||
'undone. Continue?').'</p>')
|
||||
->addSubmitButton(pht('Release Lease'))
|
||||
->addCancelButton($lease_uri);
|
||||
|
||||
|
|
|
@ -24,8 +24,8 @@ final class DrydockResourceCloseController extends DrydockController {
|
|||
$dialog = id(new AphrontDialogView())
|
||||
->setUser($user)
|
||||
->setTitle(pht('Resource Not Open'))
|
||||
->appendChild(phutil_tag('p', array(), pht(
|
||||
'You can only close "open" resources.')))
|
||||
->appendChild(
|
||||
'<p>'.pht('You can only close "open" resources.').'</p>')
|
||||
->addCancelButton($resource_uri);
|
||||
|
||||
return id(new AphrontDialogResponse())->setDialog($dialog);
|
||||
|
@ -35,9 +35,10 @@ final class DrydockResourceCloseController extends DrydockController {
|
|||
$dialog = id(new AphrontDialogView())
|
||||
->setUser($user)
|
||||
->setTitle(pht('Really close resource?'))
|
||||
->appendChild(phutil_tag('p', array(), pht(
|
||||
'Closing a resource releases all leases and destroys the '.
|
||||
'resource. It can not be undone. Continue?')))
|
||||
->appendChild(
|
||||
'<p>'.pht(
|
||||
'Closing a resource releases all leases and destroys the '.
|
||||
'resource. It can not be undone. Continue?').'</p>')
|
||||
->addSubmitButton(pht('Close Resource'))
|
||||
->addCancelButton($resource_uri);
|
||||
|
||||
|
|
|
@ -32,7 +32,10 @@ final class PhabricatorFactHomeController extends PhabricatorFactController {
|
|||
$name = $spec->getName();
|
||||
$value = $spec->formatValueForDisplay($user, $fact->getValueX());
|
||||
|
||||
$rows[] = array($name, $value);
|
||||
$rows[] = array(
|
||||
phutil_escape_html($name),
|
||||
phutil_escape_html($value),
|
||||
);
|
||||
}
|
||||
|
||||
$table = new AphrontTableView($rows);
|
||||
|
|
|
@ -40,8 +40,8 @@ final class PhabricatorFeedBuilder {
|
|||
|
||||
if ($date !== $last_date) {
|
||||
if ($last_date !== null) {
|
||||
$null_view->appendChild(hsprintf(
|
||||
'<div class="phabricator-feed-story-date-separator"></div>'));
|
||||
$null_view->appendChild(
|
||||
'<div class="phabricator-feed-story-date-separator"></div>');
|
||||
}
|
||||
$last_date = $date;
|
||||
$null_view->appendChild(
|
||||
|
@ -59,9 +59,10 @@ final class PhabricatorFeedBuilder {
|
|||
$null_view->appendChild($view);
|
||||
}
|
||||
|
||||
return id(new AphrontNullView())->appendChild(hsprintf(
|
||||
'<div class="phabricator-feed-frame">%s</div>',
|
||||
$null_view->render()));
|
||||
return id(new AphrontNullView())->appendChild(
|
||||
'<div class="phabricator-feed-frame">'.
|
||||
$null_view->render().
|
||||
'</div>');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -224,7 +224,7 @@ abstract class PhabricatorFeedStory implements PhabricatorPolicyInterface {
|
|||
foreach ($phids as $phid) {
|
||||
$list[] = $this->linkTo($phid);
|
||||
}
|
||||
return phutil_implode_html(', ', $list);
|
||||
return implode(', ', $list);
|
||||
}
|
||||
|
||||
final protected function linkTo($phid) {
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue