From 58b6e2cac641eec62209a91fe6beb2e9cefd418a Mon Sep 17 00:00:00 2001
From: vrana '.pht('The LDAP account you just authorized is already '.
+ $dialog->appendChild(phutil_tag('p', array(), 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.').' '.
- pht('Link your LDAP account to your Phabricator account?').
- ' '.pht('You will not be able to login using this account '.
- 'once you unlink it. Continue?').' '.pht('You must login to continue.').' '.pht('Are you sure you want to log out?').' Link your %s account to your Phabricator account? '.pht('You will not be able to login using this account '.
- 'once you unlink it. Continue?').' The task will be put back in the queue and executed '.
- 'again. '.pht('Do you want to post your feedback anyway, as a normal '.
- 'comment?').' '.$prompt.' '.pht('You can only release "active" leases.').' '.pht(
- 'Releasing a lease may cause trouble for the lease holder and '.
- 'trigger cleanup of the underlying resource. It can not be '.
- 'undone. Continue?').' '.pht('You can only close "open" resources.').' '.pht(
- 'Closing a resource releases all leases and destroys the '.
- 'resource. It can not be undone. Continue?').' '.pht('Really disable the much-beloved image macro %s? '.
- 'It will be sorely missed.', phutil_escape_html($macro->getName())).
- ' This system does not have PHPExcel installed. This software '.
'component is required to export tasks to Excel. Have your system '.
'administrator install it from:
');
- $dialog->appendChild(
- ''.
- implode('', $rows).
- '
';
+ $table = phutil_tag(
+ 'table',
+ array('class' => 'keyboard-shortcut-help'),
+ $rows);
$dialog = id(new AphrontDialogView())
->setUser($user)
diff --git a/src/applications/macro/controller/PhabricatorMacroDisableController.php b/src/applications/macro/controller/PhabricatorMacroDisableController.php
index 3e9e44aa9e..2dbe854d0c 100644
--- a/src/applications/macro/controller/PhabricatorMacroDisableController.php
+++ b/src/applications/macro/controller/PhabricatorMacroDisableController.php
@@ -43,10 +43,10 @@ final class PhabricatorMacroDisableController
$dialog
->setUser($request->getUser())
->setTitle(pht('Really disable macro?'))
- ->appendChild(
- '
Your PHP "include_path" needs to be updated to include the '. - 'PHPExcel Classes/ directory.
'); + 'PHPExcel Classes/ directory.')); $dialog->addCancelButton('/maniphest/'); return id(new AphrontDialogResponse())->setDialog($dialog); @@ -59,8 +59,8 @@ final class ManiphestExportController extends ManiphestController { $dialog->setUser($user); $dialog->setTitle('Export Tasks to Excel'); - $dialog->appendChild( - 'Do you want to export the query results to Excel?
'); + $dialog->appendChild(phutil_tag('p', array(), pht( + 'Do you want to export the query results to Excel?'))); $dialog->addCancelButton('/maniphest/'); $dialog->addSubmitButton('Export to Excel'); diff --git a/src/applications/oauthserver/controller/client/PhabricatorOAuthClientDeleteController.php b/src/applications/oauthserver/controller/client/PhabricatorOAuthClientDeleteController.php index 49601ce66f..ae3f85a3ac 100644 --- a/src/applications/oauthserver/controller/client/PhabricatorOAuthClientDeleteController.php +++ b/src/applications/oauthserver/controller/client/PhabricatorOAuthClientDeleteController.php @@ -37,9 +37,8 @@ extends PhabricatorOAuthClientBaseController { $dialog = new AphrontDialogView(); $dialog->setUser($current_user); $dialog->setTitle($title); - $dialog->appendChild( - 'Are you sure you want to delete this client?
' - ); + $dialog->appendChild(phutil_tag('p', array(), pht( + 'Are you sure you want to delete this client?'))); $dialog->addSubmitButton(); $dialog->addCancelButton($client->getEditURI()); return id(new AphrontDialogResponse())->setDialog($dialog); diff --git a/src/applications/oauthserver/controller/clientauthorization/PhabricatorOAuthClientAuthorizationDeleteController.php b/src/applications/oauthserver/controller/clientauthorization/PhabricatorOAuthClientAuthorizationDeleteController.php index 11b66df39a..4f366c53d9 100644 --- a/src/applications/oauthserver/controller/clientauthorization/PhabricatorOAuthClientAuthorizationDeleteController.php +++ b/src/applications/oauthserver/controller/clientauthorization/PhabricatorOAuthClientAuthorizationDeleteController.php @@ -46,9 +46,8 @@ extends PhabricatorOAuthClientAuthorizationBaseController { $dialog = new AphrontDialogView(); $dialog->setUser($current_user); $dialog->setTitle($title); - $dialog->appendChild( - 'Are you sure you want to delete this client authorization?
' - ); + $dialog->appendChild(phutil_tag('p', array(), pht( + 'Are you sure you want to delete this client authorization?'))); $dialog->addSubmitButton(); $dialog->addCancelButton($authorization->getEditURI()); return id(new AphrontDialogResponse())->setDialog($dialog); diff --git a/src/applications/phame/controller/blog/PhameBlogDeleteController.php b/src/applications/phame/controller/blog/PhameBlogDeleteController.php index eb6f4695a8..e6d9b4dff6 100644 --- a/src/applications/phame/controller/blog/PhameBlogDeleteController.php +++ b/src/applications/phame/controller/blog/PhameBlogDeleteController.php @@ -41,7 +41,7 @@ final class PhameBlogDeleteController extends PhameController { ->appendChild( pht( 'Really delete the blog "%s"? It will be gone forever.', - phutil_escape_html($blog->getName()))) + $blog->getName())) ->addSubmitButton(pht('Delete')) ->addCancelButton($cancel_uri); diff --git a/src/applications/phame/controller/post/PhamePostDeleteController.php b/src/applications/phame/controller/post/PhamePostDeleteController.php index 26719ff61c..8faa715a5e 100644 --- a/src/applications/phame/controller/post/PhamePostDeleteController.php +++ b/src/applications/phame/controller/post/PhamePostDeleteController.php @@ -41,7 +41,7 @@ final class PhamePostDeleteController extends PhameController { ->appendChild( pht( 'Really delete the post "%s"? It will be gone forever.', - phutil_escape_html($post->getTitle()))) + $post->getTitle())) ->addSubmitButton(pht('Delete')) ->addCancelButton($cancel_uri); diff --git a/src/applications/phame/controller/post/PhamePostNotLiveController.php b/src/applications/phame/controller/post/PhamePostNotLiveController.php index c2b4983736..885bc3b1a9 100644 --- a/src/applications/phame/controller/post/PhamePostNotLiveController.php +++ b/src/applications/phame/controller/post/PhamePostNotLiveController.php @@ -25,16 +25,16 @@ final class PhamePostNotLiveController extends PhameController { $reasons = array(); if (!$post->getBlog()) { - $reasons[] = - ''.pht('You can not view the live version of this post because it '. + $reasons[] = phutil_tag('p', array(), pht( + 'You can not view the live version of this post because it '. 'is not associated with a blog. Move the post to a blog in order to '. - 'view it live.').'
'; + 'view it live.')); } if ($post->isDraft()) { - $reasons[] = - ''.pht('You can not view the live version of this post because it '. - 'is still a draft. Use "Preview/Publish" to publish the post.').'
'; + $reasons[] = phutil_tag('p', array(), pht( + 'You can not view the live version of this post because it '. + 'is still a draft. Use "Preview/Publish" to publish the post.')); } if ($reasons) { diff --git a/src/applications/phame/controller/post/PhamePostUnpublishController.php b/src/applications/phame/controller/post/PhamePostUnpublishController.php index efc8153dab..f70cff773c 100644 --- a/src/applications/phame/controller/post/PhamePostUnpublishController.php +++ b/src/applications/phame/controller/post/PhamePostUnpublishController.php @@ -45,7 +45,7 @@ final class PhamePostUnpublishController extends PhameController { pht( 'The post "%s" will no longer be visible to other users until you '. 'republish it.', - phutil_escape_html($post->getTitle()))) + $post->getTitle())) ->addSubmitButton(pht('Unpublish')) ->addCancelButton($cancel_uri); diff --git a/src/applications/phriction/controller/PhrictionEditController.php b/src/applications/phriction/controller/PhrictionEditController.php index 42ace421a3..83b0b30ddb 100644 --- a/src/applications/phriction/controller/PhrictionEditController.php +++ b/src/applications/phriction/controller/PhrictionEditController.php @@ -108,8 +108,8 @@ final class PhrictionEditController $dialog = new AphrontDialogView(); $dialog->setUser($user); $dialog->setTitle(pht('No Edits')); - $dialog->appendChild( - ''.pht('You did not make any changes to the document.').'
'); + $dialog->appendChild(phutil_tag('p', array(), pht( + 'You did not make any changes to the document.'))); $dialog->addCancelButton($request->getRequestURI()); return id(new AphrontDialogResponse())->setDialog($dialog); @@ -122,8 +122,8 @@ final class PhrictionEditController $dialog = new AphrontDialogView(); $dialog->setUser($user); $dialog->setTitle(pht('Empty Page')); - $dialog->appendChild( - ''.pht('You can not create an empty document.').'
'); + $dialog->appendChild(phutil_tag('p', array(), pht( + 'You can not create an empty document.'))); $dialog->addCancelButton($request->getRequestURI()); return id(new AphrontDialogResponse())->setDialog($dialog); diff --git a/src/applications/ponder/controller/PonderAnswerSaveController.php b/src/applications/ponder/controller/PonderAnswerSaveController.php index 85a311bcc6..9f505a3287 100644 --- a/src/applications/ponder/controller/PonderAnswerSaveController.php +++ b/src/applications/ponder/controller/PonderAnswerSaveController.php @@ -23,7 +23,8 @@ final class PonderAnswerSaveController extends PonderController { $dialog = new AphrontDialogView(); $dialog->setUser($request->getUser()); $dialog->setTitle('Empty answer'); - $dialog->appendChild('Your answer must not be empty.
'); + $dialog->appendChild(phutil_tag('p', array(), pht( + 'Your answer must not be empty.'))); $dialog->addCancelButton('/Q'.$question_id); return id(new AphrontDialogResponse())->setDialog($dialog); diff --git a/src/applications/ponder/controller/PonderCommentSaveController.php b/src/applications/ponder/controller/PonderCommentSaveController.php index 125fee9a52..54bbc8a2ba 100644 --- a/src/applications/ponder/controller/PonderCommentSaveController.php +++ b/src/applications/ponder/controller/PonderCommentSaveController.php @@ -32,7 +32,8 @@ final class PonderCommentSaveController extends PonderController { $dialog = new AphrontDialogView(); $dialog->setUser($request->getUser()); $dialog->setTitle('Empty comment'); - $dialog->appendChild('Your comment must not be empty.
'); + $dialog->appendChild(phutil_tag('p', array(), pht( + 'Your comment must not be empty.'))); $dialog->addCancelButton('/Q'.$question_id); return id(new AphrontDialogResponse())->setDialog($dialog); diff --git a/src/applications/project/controller/PhabricatorProjectUpdateController.php b/src/applications/project/controller/PhabricatorProjectUpdateController.php index 9d11fd16a1..2c8b6319e2 100644 --- a/src/applications/project/controller/PhabricatorProjectUpdateController.php +++ b/src/applications/project/controller/PhabricatorProjectUpdateController.php @@ -62,9 +62,9 @@ final class PhabricatorProjectUpdateController $dialog = new AphrontDialogView(); $dialog->setUser($user); $dialog->setTitle('Really leave project?'); - $dialog->appendChild( - 'Your tremendous contributions to this project will be sorely '. - 'missed. Are you sure you want to leave?
'); + $dialog->appendChild(phutil_tag('p', array(), pht( + 'Your tremendous contributions to this project will be sorely '. + 'missed. Are you sure you want to leave?'))); $dialog->addCancelButton($project_uri); $dialog->addSubmitButton('Leave Project'); break; diff --git a/src/applications/settings/panel/PhabricatorSettingsPanelConduit.php b/src/applications/settings/panel/PhabricatorSettingsPanelConduit.php index d4ccec4194..7c9199e279 100644 --- a/src/applications/settings/panel/PhabricatorSettingsPanelConduit.php +++ b/src/applications/settings/panel/PhabricatorSettingsPanelConduit.php @@ -26,9 +26,9 @@ final class PhabricatorSettingsPanelConduit $dialog->setSubmitURI($this->getPanelURI()); $dialog->addSubmitButton('Regenerate'); $dialog->addCancelbutton($this->getPanelURI()); - $dialog->appendChild( - 'Really destroy the old certificate? Any established '. - 'sessions will be terminated.'); + $dialog->appendChild(phutil_tag('p', array(), pht( + 'Really destroy the old certificate? Any established '. + 'sessions will be terminated.'))); return id(new AphrontDialogResponse()) ->setDialog($dialog); diff --git a/src/applications/settings/panel/PhabricatorSettingsPanelEmailAddresses.php b/src/applications/settings/panel/PhabricatorSettingsPanelEmailAddresses.php index 86a0d10dbc..fee269f09d 100644 --- a/src/applications/settings/panel/PhabricatorSettingsPanelEmailAddresses.php +++ b/src/applications/settings/panel/PhabricatorSettingsPanelEmailAddresses.php @@ -191,9 +191,9 @@ final class PhabricatorSettingsPanelEmailAddresses ->setUser($user) ->addHiddenInput('new', 'verify') ->setTitle('Verification Email Sent') - ->appendChild( - '
A verification email has been sent. Click the link in the '. - 'email to verify your address.
') + ->appendChild(phutil_tag('p', array(), pht( + 'A verification email has been sent. Click the link in the '. + 'email to verify your address.'))) ->setSubmitURI($uri) ->addSubmitButton('Done'); @@ -264,9 +264,9 @@ final class PhabricatorSettingsPanelEmailAddresses ->setUser($user) ->addHiddenInput('delete', $email_id) ->setTitle("Really delete address '{$address}'?") - ->appendChild( - 'Are you sure you want to delete this address? You will no '. - 'longer be able to use it to login.
') + ->appendChild(phutil_tag('p', array(), pht( + 'Are you sure you want to delete this address? You will no '. + 'longer be able to use it to login.'))) ->addSubmitButton('Delete') ->addCancelButton($uri); diff --git a/src/applications/settings/panel/PhabricatorSettingsPanelSSHKeys.php b/src/applications/settings/panel/PhabricatorSettingsPanelSSHKeys.php index 133c45ec9c..d7a96c3611 100644 --- a/src/applications/settings/panel/PhabricatorSettingsPanelSSHKeys.php +++ b/src/applications/settings/panel/PhabricatorSettingsPanelSSHKeys.php @@ -240,7 +240,7 @@ final class PhabricatorSettingsPanelSSHKeys $user = $request->getUser(); - $name = phutil_escape_html($key->getName()); + $name = phutil_tag('strong', array(), $key->getName()); if ($request->isDialogFormPost()) { $key->delete(); @@ -252,10 +252,10 @@ final class PhabricatorSettingsPanelSSHKeys ->setUser($user) ->addHiddenInput('delete', $key->getID()) ->setTitle('Really delete SSH Public Key?') - ->appendChild( - 'The key "'.$name.'" will be permanently deleted, '. - 'and you will not longer be able to use the corresponding private key '. - 'to authenticate.
') + ->appendChild(phutil_tag('p', array(), pht( + 'The key "%s" will be permanently deleted, and you will not longer be '. + 'able to use the corresponding private key to authenticate.', + $name))) ->addSubmitButton('Delete Public Key') ->addCancelButton($this->getPanelURI()); diff --git a/src/applications/transactions/response/PhabricatorApplicationTransactionNoEffectResponse.php b/src/applications/transactions/response/PhabricatorApplicationTransactionNoEffectResponse.php index 9c1caab76e..fe63299d1b 100644 --- a/src/applications/transactions/response/PhabricatorApplicationTransactionNoEffectResponse.php +++ b/src/applications/transactions/response/PhabricatorApplicationTransactionNoEffectResponse.php @@ -57,7 +57,8 @@ final class PhabricatorApplicationTransactionNoEffectResponse ->setTitle($title); foreach ($xactions as $xaction) { - $dialog->appendChild(''.$xaction->getNoEffectDescription().'
'); + $dialog->appendChild( + phutil_tag('p', array(), $xaction->getNoEffectDescription())); } $dialog->appendChild($tail); diff --git a/src/infrastructure/diff/PhabricatorInlineCommentController.php b/src/infrastructure/diff/PhabricatorInlineCommentController.php index 99fe0b70da..3a8ad2f1ad 100644 --- a/src/infrastructure/diff/PhabricatorInlineCommentController.php +++ b/src/infrastructure/diff/PhabricatorInlineCommentController.php @@ -71,7 +71,7 @@ abstract class PhabricatorInlineCommentController $dialog->setTitle('Really delete this comment?'); $dialog->addHiddenInput('id', $this->getCommentID()); $dialog->addHiddenInput('op', 'delete'); - $dialog->appendChild('Delete this inline comment?
'); + $dialog->appendChild(hsprintf('Delete this inline comment?
')); $dialog->addCancelButton('#'); $dialog->addSubmitButton('Delete'); diff --git a/src/view/AphrontDialogView.php b/src/view/AphrontDialogView.php index 04122e0027..78e3a4170f 100644 --- a/src/view/AphrontDialogView.php +++ b/src/view/AphrontDialogView.php @@ -99,7 +99,6 @@ final class AphrontDialogView extends AphrontView { ), $this->cancelText); } - $buttons = implode('', $buttons); if (!$this->user) { throw new Exception( @@ -131,6 +130,14 @@ final class AphrontDialogView extends AphrontView { ); $hidden_inputs = array(); + $hidden_inputs[] = phutil_tag( + 'input', + array( + 'type' => 'hidden', + 'name' => '__dialog__', + 'value' => '1', + )); + foreach ($this->hidden as $desc) { list($key, $value) = $desc; $hidden_inputs[] = javelin_tag( @@ -142,37 +149,30 @@ final class AphrontDialogView extends AphrontView { 'sigil' => 'aphront-dialog-application-input' )); } - $hidden_inputs = implode("\n", $hidden_inputs); - $hidden_inputs = - ''. - $hidden_inputs; - if (!$this->renderAsForm) { - $buttons = phabricator_render_form( + $buttons = array(phabricator_form( $this->user, $form_attributes, - $hidden_inputs.$buttons); + array_merge($hidden_inputs, $buttons))); } - $content = - hsprintf(''. - $this->instructions. - '
'; + $instructions = phutil_tag( + 'p', + array('class' => 'phabricator-object-selector-instructions'), + $this->instructions); } - $search_box = phabricator_render_form( + $search_box = phabricator_form( $user, array( 'method' => 'POST', 'action' => $this->submitURI, 'id' => $search_id, ), - '| - - | -- - | -
| %s | +%s | +