Page MenuHomestyx hydra

No OneTemporary

diff --git a/src/applications/conpherence/ConpherenceTransactionRenderer.php b/src/applications/conpherence/ConpherenceTransactionRenderer.php
index 1b14f5f0d6..54801332d2 100644
--- a/src/applications/conpherence/ConpherenceTransactionRenderer.php
+++ b/src/applications/conpherence/ConpherenceTransactionRenderer.php
@@ -1,191 +1,177 @@
<?php
final class ConpherenceTransactionRenderer {
public static function renderTransactions(
PhabricatorUser $user,
ConpherenceThread $conpherence,
$full_display = true,
$marker_type = 'older') {
$transactions = $conpherence->getTransactions();
$oldest_transaction_id = 0;
$newest_transaction_id = 0;
$too_many = ConpherenceThreadQuery::TRANSACTION_LIMIT + 1;
if (count($transactions) == $too_many) {
if ($marker_type == 'olderandnewer') {
$last_transaction = end($transactions);
$first_transaction = reset($transactions);
unset($transactions[$last_transaction->getID()]);
unset($transactions[$first_transaction->getID()]);
$oldest_transaction_id = $last_transaction->getID();
$newest_transaction_id = $first_transaction->getID();
} else if ($marker_type == 'newer') {
$first_transaction = reset($transactions);
unset($transactions[$first_transaction->getID()]);
$newest_transaction_id = $first_transaction->getID();
} else if ($marker_type == 'older') {
$last_transaction = end($transactions);
unset($transactions[$last_transaction->getID()]);
$oldest_transaction = end($transactions);
$oldest_transaction_id = $oldest_transaction->getID();
}
// we need **at least** the newer marker in this mode even if
// we didn't get a full set of transactions
} else if ($marker_type == 'olderandnewer') {
$first_transaction = reset($transactions);
unset($transactions[$first_transaction->getID()]);
$newest_transaction_id = $first_transaction->getID();
}
$transactions = array_reverse($transactions);
$handles = $conpherence->getHandles();
$rendered_transactions = array();
$engine = id(new PhabricatorMarkupEngine())
->setViewer($user)
->setContextObject($conpherence);
foreach ($transactions as $key => $transaction) {
if ($transaction->shouldHide()) {
unset($transactions[$key]);
continue;
}
if ($transaction->getComment()) {
$engine->addObject(
$transaction->getComment(),
PhabricatorApplicationTransactionComment::MARKUP_FIELD_COMMENT);
}
}
$engine->process();
// we're going to insert a dummy date marker transaction for breaks
// between days. some setup required!
$previous_transaction = null;
$date_marker_transaction = id(new ConpherenceTransaction())
->setTransactionType(ConpherenceTransactionType::TYPE_DATE_MARKER)
->makeEphemeral();
$date_marker_transaction_view = id(new ConpherenceTransactionView())
->setUser($user)
->setConpherenceTransaction($date_marker_transaction)
->setConpherenceThread($conpherence)
->setHandles($handles)
->setMarkupEngine($engine);
$transaction_view_template = id(new ConpherenceTransactionView())
->setUser($user)
->setConpherenceThread($conpherence)
->setHandles($handles)
- ->setMarkupEngine($engine);
+ ->setMarkupEngine($engine)
+ ->setFullDisplay($full_display);
foreach ($transactions as $transaction) {
if ($previous_transaction) {
$previous_day = phabricator_format_local_time(
$previous_transaction->getDateCreated(),
$user,
'Ymd');
$current_day = phabricator_format_local_time(
$transaction->getDateCreated(),
$user,
'Ymd');
// date marker transaction time!
if ($previous_day != $current_day) {
$date_marker_transaction->setDateCreated(
$transaction->getDateCreated());
$date_marker_transaction->setID($previous_transaction->getID());
$rendered_transactions[] = $date_marker_transaction_view->render();
}
}
$transaction_view = id(clone $transaction_view_template)
->setConpherenceTransaction($transaction);
- if ($full_display) {
- $transaction_view
- ->setAnchor(
- $transaction->getID(),
- phabricator_time($transaction->getDateCreated(), $user));
- $transaction_view->setContentSource($transaction->getContentSource());
- $transaction_view->setShowImages(true);
- } else {
- $transaction_view
- ->setEpoch(
- $transaction->getDateCreated(),
- '/'.$conpherence->getMonogram().'#'.$transaction->getID())
- ->setTimeOnly(true);
- $transaction_view->setShowImages(false);
- }
$rendered_transactions[] = $transaction_view->render();
$previous_transaction = $transaction;
}
$latest_transaction_id = $transaction->getID();
return array(
'transactions' => $rendered_transactions,
'latest_transaction' => $transaction,
'latest_transaction_id' => $latest_transaction_id,
'oldest_transaction_id' => $oldest_transaction_id,
'newest_transaction_id' => $newest_transaction_id,
);
}
public static function renderMessagePaneContent(
array $transactions,
$oldest_transaction_id,
$newest_transaction_id) {
$oldscrollbutton = '';
if ($oldest_transaction_id) {
$oldscrollbutton = javelin_tag(
'a',
array(
'href' => '#',
'mustcapture' => true,
'sigil' => 'show-older-messages',
'class' => 'conpherence-show-more-messages',
'meta' => array(
'oldest_transaction_id' => $oldest_transaction_id,
),
),
pht('Show Older Messages'));
$oldscrollbutton = javelin_tag(
'div',
array(
'sigil' => 'conpherence-transaction-view',
'meta' => array(
'id' => $oldest_transaction_id - 0.5,
),
),
$oldscrollbutton);
}
$newscrollbutton = '';
if ($newest_transaction_id) {
$newscrollbutton = javelin_tag(
'a',
array(
'href' => '#',
'mustcapture' => true,
'sigil' => 'show-newer-messages',
'class' => 'conpherence-show-more-messages',
'meta' => array(
'newest_transaction_id' => $newest_transaction_id,
),
),
pht('Show Newer Messages'));
$newscrollbutton = javelin_tag(
'div',
array(
'sigil' => 'conpherence-transaction-view',
'meta' => array(
'id' => $newest_transaction_id + 0.5,
),
),
$newscrollbutton);
}
return hsprintf(
'%s%s%s',
$oldscrollbutton,
$transactions,
$newscrollbutton);
}
}
diff --git a/src/applications/conpherence/query/ConpherenceThreadSearchEngine.php b/src/applications/conpherence/query/ConpherenceThreadSearchEngine.php
index f2a2d920bd..d647248c87 100644
--- a/src/applications/conpherence/query/ConpherenceThreadSearchEngine.php
+++ b/src/applications/conpherence/query/ConpherenceThreadSearchEngine.php
@@ -1,481 +1,479 @@
<?php
final class ConpherenceThreadSearchEngine
extends PhabricatorApplicationSearchEngine {
public function getResultTypeDescription() {
return pht('Threads');
}
public function getApplicationClassName() {
return 'PhabricatorConpherenceApplication';
}
public function buildSavedQueryFromRequest(AphrontRequest $request) {
$saved = new PhabricatorSavedQuery();
$saved->setParameter(
'participantPHIDs',
$this->readUsersFromRequest($request, 'participants'));
$saved->setParameter('fulltext', $request->getStr('fulltext'));
$saved->setParameter(
'threadType',
$request->getStr('threadType'));
return $saved;
}
public function buildQueryFromSavedQuery(PhabricatorSavedQuery $saved) {
$query = id(new ConpherenceThreadQuery())
->needParticipantCache(true);
$participant_phids = $saved->getParameter('participantPHIDs', array());
if ($participant_phids && is_array($participant_phids)) {
$query->withParticipantPHIDs($participant_phids);
}
$fulltext = $saved->getParameter('fulltext');
if (strlen($fulltext)) {
$query->withFulltext($fulltext);
}
$thread_type = $saved->getParameter('threadType');
if (idx($this->getTypeOptions(), $thread_type)) {
switch ($thread_type) {
case 'rooms':
$query->withIsRoom(true);
break;
case 'messages':
$query->withIsRoom(false);
break;
case 'both':
$query->withIsRoom(null);
break;
}
}
return $query;
}
public function buildSearchForm(
AphrontFormView $form,
PhabricatorSavedQuery $saved) {
$participant_phids = $saved->getParameter('participantPHIDs', array());
$fulltext = $saved->getParameter('fulltext');
$form
->appendControl(
id(new AphrontFormTokenizerControl())
->setDatasource(new PhabricatorPeopleDatasource())
->setName('participants')
->setLabel(pht('Participants'))
->setValue($participant_phids))
->appendControl(
id(new AphrontFormTextControl())
->setName('fulltext')
->setLabel(pht('Contains Words'))
->setValue($fulltext))
->appendControl(
id(new AphrontFormSelectControl())
->setLabel(pht('Type'))
->setName('threadType')
->setOptions($this->getTypeOptions())
->setValue($saved->getParameter('threadType')));
}
protected function getURI($path) {
return '/conpherence/search/'.$path;
}
protected function getBuiltinQueryNames() {
$names = array();
$names = array(
'all' => pht('All Rooms'),
);
if ($this->requireViewer()->isLoggedIn()) {
$names['participant'] = pht('Joined Rooms');
$names['messages'] = pht('All Messages');
}
return $names;
}
public function buildSavedQueryFromBuiltin($query_key) {
$query = $this->newSavedQuery();
$query->setQueryKey($query_key);
switch ($query_key) {
case 'all':
$query->setParameter('threadType', 'rooms');
return $query;
case 'participant':
$query->setParameter('threadType', 'rooms');
return $query->setParameter(
'participantPHIDs',
array($this->requireViewer()->getPHID()));
case 'messages':
$query->setParameter('threadType', 'messages');
return $query->setParameter(
'participantPHIDs',
array($this->requireViewer()->getPHID()));
}
return parent::buildSavedQueryFromBuiltin($query_key);
}
protected function getRequiredHandlePHIDsForResultList(
array $conpherences,
PhabricatorSavedQuery $query) {
$recent = mpull($conpherences, 'getRecentParticipantPHIDs');
return array_unique(array_mergev($recent));
}
protected function renderResultList(
array $conpherences,
PhabricatorSavedQuery $query,
array $handles) {
assert_instances_of($conpherences, 'ConpherenceThread');
$viewer = $this->requireViewer();
$policy_objects = ConpherenceThread::loadPolicyObjects(
$viewer,
$conpherences);
$engines = array();
$fulltext = $query->getParameter('fulltext');
if (strlen($fulltext) && $conpherences) {
$context = $this->loadContextMessages($conpherences, $fulltext);
$author_phids = array();
foreach ($context as $phid => $messages) {
$conpherence = $conpherences[$phid];
$engine = id(new PhabricatorMarkupEngine())
->setViewer($viewer)
->setContextObject($conpherence);
foreach ($messages as $group) {
foreach ($group as $message) {
$xaction = $message['xaction'];
if ($xaction) {
$author_phids[] = $xaction->getAuthorPHID();
$engine->addObject(
$xaction->getComment(),
PhabricatorApplicationTransactionComment::MARKUP_FIELD_COMMENT);
}
}
}
$engine->process();
$engines[$phid] = $engine;
}
$handles = $viewer->loadHandles($author_phids);
$handles = iterator_to_array($handles);
} else {
$context = array();
}
$list = new PHUIObjectItemListView();
$list->setUser($viewer);
foreach ($conpherences as $conpherence_phid => $conpherence) {
$created = phabricator_date($conpherence->getDateCreated(), $viewer);
$title = $conpherence->getDisplayTitle($viewer);
$monogram = $conpherence->getMonogram();
if ($conpherence->getIsRoom()) {
$icon_name = $conpherence->getPolicyIconName($policy_objects);
} else {
$icon_name = 'fa-envelope-o';
}
$icon = id(new PHUIIconView())
->setIconFont($icon_name);
$item = id(new PHUIObjectItemView())
->setObjectName($conpherence->getMonogram())
->setHeader($title)
->setHref('/'.$conpherence->getMonogram())
->setObject($conpherence)
->addIcon('none', $created)
->addIcon(
'none',
pht('Messages: %d', $conpherence->getMessageCount()))
->addAttribute(
array(
$icon,
' ',
pht(
'Last updated %s',
phabricator_datetime($conpherence->getDateModified(), $viewer)),
));
$messages = idx($context, $conpherence_phid);
if ($messages) {
foreach ($messages as $group) {
$rows = array();
foreach ($group as $message) {
$xaction = $message['xaction'];
if (!$xaction) {
continue;
}
- $history_href = '/'.$monogram.'#'.$xaction->getID();
-
$view = id(new ConpherenceTransactionView())
->setUser($viewer)
->setHandles($handles)
->setMarkupEngine($engines[$conpherence_phid])
->setConpherenceThread($conpherence)
->setConpherenceTransaction($xaction)
- ->setEpoch($xaction->getDateCreated(), $history_href)
+ ->setFullDisplay(false)
->addClass('conpherence-fulltext-result');
if ($message['match']) {
$view->addClass('conpherence-fulltext-match');
}
$rows[] = $view;
}
$box = id(new PHUIBoxView())
->appendChild($rows)
->addClass('conpherence-fulltext-results');
$item->appendChild($box);
}
}
$list->addItem($item);
}
return $list;
}
private function getTypeOptions() {
return array(
'rooms' => pht('Rooms'),
'messages' => pht('Messages'),
'both' => pht('Both'),
);
}
private function loadContextMessages(array $threads, $fulltext) {
$phids = mpull($threads, 'getPHID');
// We want to load a few messages for each thread in the result list, to
// show some of the actual content hits to help the user find what they
// are looking for.
// This method is trying to batch this lookup in most cases, so we do
// between one and "a handful" of queries instead of one per thread in
// most cases. To do this:
//
// - Load a big block of results for all of the threads.
// - If we didn't get a full block back, we have everything that matches
// the query. Sort it out and exit.
// - Otherwise, some threads had a ton of hits, so we might not be
// getting everything we want (we could be getting back 1,000 hits for
// the first thread). Remove any threads which we have enough results
// for and try again.
// - Repeat until we have everything or every thread has enough results.
//
// In the worst case, we could end up degrading to one query per thread,
// but this is incredibly unlikely on real data.
// Size of the result blocks we're going to load.
$limit = 1000;
// Number of messages we want for each thread.
$want = 3;
$need = $phids;
$hits = array();
while ($need) {
$rows = id(new ConpherenceFulltextQuery())
->withThreadPHIDs($need)
->withFulltext($fulltext)
->setLimit($limit)
->execute();
foreach ($rows as $row) {
$hits[$row['threadPHID']][] = $row;
}
if (count($rows) < $limit) {
break;
}
foreach ($need as $key => $phid) {
if (count($hits[$phid]) >= $want) {
unset($need[$key]);
}
}
}
// Now that we have all the fulltext matches, throw away any extras that we
// aren't going to render so we don't need to do lookups on them.
foreach ($hits as $phid => $rows) {
if (count($rows) > $want) {
$hits[$phid] = array_slice($rows, 0, $want);
}
}
// For each fulltext match, we want to render a message before and after
// the match to give it some context. We already know the transactions
// before each match because the rows have a "previousTransactionPHID",
// but we need to do one more query to figure out the transactions after
// each match.
// Collect the transactions we want to find the next transactions for.
$after = array();
foreach ($hits as $phid => $rows) {
foreach ($rows as $row) {
$after[] = $row['transactionPHID'];
}
}
// Look up the next transactions.
if ($after) {
$after_rows = id(new ConpherenceFulltextQuery())
->withPreviousTransactionPHIDs($after)
->execute();
} else {
$after_rows = array();
}
// Build maps from PHIDs to the previous and next PHIDs.
$prev_map = array();
$next_map = array();
foreach ($after_rows as $row) {
$next_map[$row['previousTransactionPHID']] = $row['transactionPHID'];
}
foreach ($hits as $phid => $rows) {
foreach ($rows as $row) {
$prev = $row['previousTransactionPHID'];
if ($prev) {
$prev_map[$row['transactionPHID']] = $prev;
$next_map[$prev] = $row['transactionPHID'];
}
}
}
// Now we're going to collect the actual transaction PHIDs, in order, that
// we want to show for each thread.
$groups = array();
foreach ($hits as $thread_phid => $rows) {
$rows = ipull($rows, null, 'transactionPHID');
$done = array();
foreach ($rows as $phid => $row) {
if (isset($done[$phid])) {
continue;
}
$done[$phid] = true;
$group = array();
// Walk backward, finding all the previous results. We can just keep
// going until we run out of results because we've only loaded things
// that we want to show.
$prev = $phid;
while (true) {
if (!isset($prev_map[$prev])) {
// No previous transaction, so we're done.
break;
}
$prev = $prev_map[$prev];
if (isset($rows[$prev])) {
$match = true;
$done[$prev] = true;
} else {
$match = false;
}
$group[] = array(
'phid' => $prev,
'match' => $match,
);
}
if (count($group) > 1) {
$group = array_reverse($group);
}
$group[] = array(
'phid' => $phid,
'match' => true,
);
$next = $phid;
while (true) {
if (!isset($next_map[$next])) {
break;
}
$next = $next_map[$next];
if (isset($rows[$next])) {
$match = true;
$done[$next] = true;
} else {
$match = false;
}
$group[] = array(
'phid' => $next,
'match' => $match,
);
}
$groups[$thread_phid][] = $group;
}
}
// Load all the actual transactions we need.
$xaction_phids = array();
foreach ($groups as $thread_phid => $group) {
foreach ($group as $list) {
foreach ($list as $item) {
$xaction_phids[] = $item['phid'];
}
}
}
if ($xaction_phids) {
$xactions = id(new ConpherenceTransactionQuery())
->setViewer($this->requireViewer())
->withPHIDs($xaction_phids)
->needComments(true)
->execute();
$xactions = mpull($xactions, null, 'getPHID');
} else {
$xactions = array();
}
foreach ($groups as $thread_phid => $group) {
foreach ($group as $key => $list) {
foreach ($list as $lkey => $item) {
$xaction = idx($xactions, $item['phid']);
if ($xaction->shouldHide()) {
continue;
}
$groups[$thread_phid][$key][$lkey]['xaction'] = $xaction;
}
}
}
// TODO: Sort the groups chronologically?
return $groups;
}
}
diff --git a/src/applications/conpherence/view/ConpherenceTransactionView.php b/src/applications/conpherence/view/ConpherenceTransactionView.php
index 2dba770e54..a7a311ce28 100644
--- a/src/applications/conpherence/view/ConpherenceTransactionView.php
+++ b/src/applications/conpherence/view/ConpherenceTransactionView.php
@@ -1,301 +1,280 @@
<?php
final class ConpherenceTransactionView extends AphrontView {
private $conpherenceThread;
private $conpherenceTransaction;
private $handles;
private $markupEngine;
- private $epoch;
- private $epochHref;
- private $contentSource;
- private $anchorName;
- private $anchorText;
+ private $fullDisplay;
private $classes = array();
private $timeOnly;
- private $showImages = true;
public function setConpherenceThread(ConpherenceThread $t) {
$this->conpherenceThread = $t;
return $this;
}
private function getConpherenceThread() {
return $this->conpherenceThread;
}
public function setConpherenceTransaction(ConpherenceTransaction $tx) {
$this->conpherenceTransaction = $tx;
return $this;
}
private function getConpherenceTransaction() {
return $this->conpherenceTransaction;
}
public function setHandles(array $handles) {
assert_instances_of($handles, 'PhabricatorObjectHandle');
$this->handles = $handles;
return $this;
}
public function getHandles() {
return $this->handles;
}
public function setMarkupEngine(PhabricatorMarkupEngine $markup_engine) {
$this->markupEngine = $markup_engine;
return $this;
}
private function getMarkupEngine() {
return $this->markupEngine;
}
- public function setEpoch($epoch, $epoch_href = null) {
- $this->epoch = $epoch;
- $this->epochHref = $epoch_href;
+ public function setFullDisplay($bool) {
+ $this->fullDisplay = $bool;
return $this;
}
- public function setContentSource(PhabricatorContentSource $source) {
- $this->contentSource = $source;
- return $this;
- }
-
- private function getContentSource() {
- return $this->contentSource;
- }
-
- public function setAnchor($anchor_name, $anchor_text) {
- $this->anchorName = $anchor_name;
- $this->anchorText = $anchor_text;
- return $this;
+ private function getFullDisplay() {
+ return $this->fullDisplay;
}
public function addClass($class) {
$this->classes[] = $class;
return $this;
}
- public function setTimeOnly($time) {
- $this->timeOnly = $time;
- return $this;
- }
-
- public function setShowImages($bool) {
- $this->showImages = $bool;
- return $this;
- }
-
- private function getShowImages() {
- return $this->showImages;
- }
-
public function render() {
- $user = $this->getUser();
- if (!$user) {
+ $viewer = $this->getUser();
+ if (!$viewer) {
throw new Exception(pht('Call setUser() before render()!'));
}
require_celerity_resource('conpherence-transaction-css');
$transaction = $this->getConpherenceTransaction();
switch ($transaction->getTransactionType()) {
case ConpherenceTransactionType::TYPE_DATE_MARKER:
return javelin_tag(
'div',
array(
'class' => 'conpherence-transaction-view date-marker',
'sigil' => 'conpherence-transaction-view',
'meta' => array(
'id' => $transaction->getID() + 0.5,
),
),
array(
phutil_tag(
'span',
array(
'class' => 'date',
),
phabricator_format_local_time(
$transaction->getDateCreated(),
- $user,
+ $viewer,
'M jS, Y')),
));
break;
}
$info = $this->renderTransactionInfo();
$actions = $this->renderTransactionActions();
$image = $this->renderTransactionImage();
$content = $this->renderTransactionContent();
$classes = implode(' ', $this->classes);
- $transaction_id = $this->anchorName ? 'anchor-'.$this->anchorName : null;
+ $transaction_dom_id = null;
+ if ($this->getFullDisplay()) {
+ $transaction_dom_id = 'anchor-'.$transaction->getID();
+ }
$header = phutil_tag_div(
'conpherence-transaction-header grouped',
array($actions, $info));
return javelin_tag(
'div',
array(
'class' => 'conpherence-transaction-view '.$classes,
- 'id' => $transaction_id,
+ 'id' => $transaction_dom_id,
'sigil' => 'conpherence-transaction-view',
'meta' => array(
'id' => $transaction->getID(),
),
),
array(
$image,
phutil_tag_div('conpherence-transaction-detail grouped',
array($header, $content)),
));
}
private function renderTransactionInfo() {
+ $viewer = $this->getUser();
+ $thread = $this->getConpherenceThread();
+ $transaction = $this->getConpherenceTransaction();
$info = array();
- if ($this->getContentSource()) {
+ if ($this->getFullDisplay() && $transaction->getContentSource()) {
$content_source = id(new PhabricatorContentSourceView())
- ->setContentSource($this->getContentSource())
- ->setUser($this->user)
+ ->setContentSource($transaction->getContentSource())
+ ->setUser($viewer)
->render();
if ($content_source) {
$info[] = $content_source;
}
}
- if ($this->epoch) {
- if ($this->timeOnly) {
- $epoch = phabricator_time($this->epoch, $this->user);
- } else {
- $epoch = phabricator_datetime($this->epoch, $this->user);
- }
- if ($this->epochHref) {
- $epoch = phutil_tag(
- 'a',
- array(
- 'href' => $this->epochHref,
- 'class' => 'epoch-link',
- ),
- $epoch);
- }
- $info[] = $epoch;
- }
-
- if ($this->anchorName) {
+ Javelin::initBehavior('phabricator-tooltips');
+ $tip = phabricator_datetime($transaction->getDateCreated(), $viewer);
+ $label = phabricator_time($transaction->getDateCreated(), $viewer);
+ $width = 360;
+ if ($this->getFullDisplay()) {
Javelin::initBehavior('phabricator-watch-anchor');
-
$anchor = id(new PhabricatorAnchorView())
- ->setAnchorName($this->anchorName)
+ ->setAnchorName($transaction->getID())
->render();
$info[] = hsprintf(
'%s%s',
$anchor,
- phutil_tag(
+ javelin_tag(
'a',
array(
- 'href' => '#'.$this->anchorName,
+ 'href' => '#'.$transaction->getID(),
'class' => 'anchor-link',
+ 'sigil' => 'has-tooltip',
+ 'meta' => array(
+ 'tip' => $tip,
+ 'size' => $width,
+ ),
),
- $this->anchorText));
+ $label));
+ } else {
+ $href = '/'.$thread->getMonogram().'#'.$transaction->getID();
+ $info[] = javelin_tag(
+ 'a',
+ array(
+ 'href' => $href,
+ 'class' => 'epoch-link',
+ 'sigil' => 'has-tooltip',
+ 'meta' => array(
+ 'tip' => $tip,
+ 'size' => $width,
+ ),
+ ),
+ $label);
}
$info = phutil_implode_html(" \xC2\xB7 ", $info);
return phutil_tag(
'span',
array(
'class' => 'conpherence-transaction-info',
),
$info);
}
private function renderTransactionActions() {
$transaction = $this->getConpherenceTransaction();
switch ($transaction->getTransactionType()) {
case PhabricatorTransactions::TYPE_COMMENT:
$handles = $this->getHandles();
$author = $handles[$transaction->getAuthorPHID()];
$actions = array($author->renderLink());
break;
default:
$actions = null;
break;
}
return $actions;
}
private function renderTransactionImage() {
$image = null;
- if ($this->getShowImages()) {
+ if ($this->getFullDisplay()) {
$transaction = $this->getConpherenceTransaction();
switch ($transaction->getTransactionType()) {
case PhabricatorTransactions::TYPE_COMMENT:
$handles = $this->getHandles();
$author = $handles[$transaction->getAuthorPHID()];
$image_uri = $author->getImageURI();
$image = phutil_tag(
'span',
array(
'class' => 'conpherence-transaction-image',
'style' => 'background-image: url('.$image_uri.');',
));
break;
}
}
return $image;
}
private function renderTransactionContent() {
$transaction = $this->getConpherenceTransaction();
$content = null;
$content_class = null;
$content = null;
$handles = $this->getHandles();
switch ($transaction->getTransactionType()) {
case ConpherenceTransactionType::TYPE_FILES:
$content = $transaction->getTitle();
break;
case ConpherenceTransactionType::TYPE_TITLE:
case ConpherenceTransactionType::TYPE_PICTURE:
case ConpherenceTransactionType::TYPE_PICTURE_CROP:
case ConpherenceTransactionType::TYPE_PARTICIPANTS:
case PhabricatorTransactions::TYPE_VIEW_POLICY:
case PhabricatorTransactions::TYPE_EDIT_POLICY:
case PhabricatorTransactions::TYPE_JOIN_POLICY:
case PhabricatorTransactions::TYPE_EDGE:
$content = $transaction->getTitle();
$this->addClass('conpherence-edited');
break;
case PhabricatorTransactions::TYPE_COMMENT:
$this->addClass('conpherence-comment');
$author = $handles[$transaction->getAuthorPHID()];
$comment = $transaction->getComment();
$content = $this->getMarkupEngine()->getOutput(
$comment,
PhabricatorApplicationTransactionComment::MARKUP_FIELD_COMMENT);
$content_class = 'conpherence-message';
- break;
+ break;
}
$this->appendChild(
phutil_tag(
'div',
array(
'class' => $content_class,
),
$content));
return phutil_tag_div(
'conpherence-transaction-content',
$this->renderChildren());
}
}

File Metadata

Mime Type
text/x-diff
Expires
Tue, Dec 2, 3:30 PM (13 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
432190
Default Alt Text
(31 KB)

Event Timeline