mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-17 09:18:44 +01:00
Introduce ModularTransactionType::isRenderingTargetExternal
Summary: This is just some housekeeping - see note in D16287. Basically, "isTextMode" doesn't convey enough information. Test Plan: `git grep isTextMode | grep -v Remarkup`, and visit all callsites; There are 4 of them left. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D17063
This commit is contained in:
parent
f277de1d02
commit
8b7e99f68c
1 changed files with 12 additions and 2 deletions
|
@ -227,7 +227,7 @@ abstract class PhabricatorModularTransactionType
|
||||||
// server's settings, or the user may later refer back to it after
|
// server's settings, or the user may later refer back to it after
|
||||||
// changing timezones.
|
// changing timezones.
|
||||||
|
|
||||||
if ($this->isTextMode()) {
|
if ($this->isRenderingTargetExternal()) {
|
||||||
$offset = $viewer->getTimeZoneOffsetInHours();
|
$offset = $viewer->getTimeZoneOffsetInHours();
|
||||||
if ($offset >= 0) {
|
if ($offset >= 0) {
|
||||||
$display = pht('%s (UTC+%d)', $display, $offset);
|
$display = pht('%s (UTC+%d)', $display, $offset);
|
||||||
|
@ -277,7 +277,17 @@ abstract class PhabricatorModularTransactionType
|
||||||
return !strlen($value);
|
return !strlen($value);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function isTextMode() {
|
/**
|
||||||
|
* When rendering to external targets (Email/Asana/etc), we need to include
|
||||||
|
* more information that users can't obtain later.
|
||||||
|
*/
|
||||||
|
final protected function isRenderingTargetExternal() {
|
||||||
|
// Right now, this is our best proxy for this:
|
||||||
|
return $this->isTextMode();
|
||||||
|
// "TARGET_TEXT" means "EMail" and "TARGET_HTML" means "Web".
|
||||||
|
}
|
||||||
|
|
||||||
|
final protected function isTextMode() {
|
||||||
$target = $this->getStorage()->getRenderingTarget();
|
$target = $this->getStorage()->getRenderingTarget();
|
||||||
return ($target == PhabricatorApplicationTransaction::TARGET_TEXT);
|
return ($target == PhabricatorApplicationTransaction::TARGET_TEXT);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue