[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/applications/conpherence/view/ -> ConpherencePeopleWidgetView.php (source)

   1  <?php
   2  
   3  final class ConpherencePeopleWidgetView extends ConpherenceWidgetView {
   4  
   5    public function render() {
   6      $conpherence = $this->getConpherence();
   7      $widget_data = $conpherence->getWidgetData();
   8      $user = $this->getUser();
   9      $conpherence = $this->getConpherence();
  10      $participants = $conpherence->getParticipants();
  11      $handles = $conpherence->getHandles();
  12  
  13      $body = array();
  14      // future proof by using participants to iterate through handles;
  15      // we may have non-people handles sooner or later
  16      foreach ($participants as $user_phid => $participant) {
  17        $handle = $handles[$user_phid];
  18        $remove_html = '';
  19        if ($user_phid == $user->getPHID()) {
  20          $remove_html = javelin_tag(
  21            'a',
  22            array(
  23              'class' => 'remove',
  24              'sigil' => 'remove-person',
  25              'meta' => array(
  26                'remove_person' => $handle->getPHID(),
  27                'action' => 'remove_person',
  28              ),
  29            ),
  30            hsprintf('<span class="close-icon">&times;</span>'));
  31        }
  32        $body[] = phutil_tag(
  33          'div',
  34          array(
  35            'class' => 'person-entry grouped',
  36          ),
  37          array(
  38            phutil_tag(
  39              'a',
  40              array(
  41                'class' => 'pic',
  42              ),
  43              phutil_tag(
  44                'img',
  45                array(
  46                  'src' => $handle->getImageURI(),
  47                ),
  48                '')),
  49            $handle->renderLink(),
  50            $remove_html,
  51          ));
  52      }
  53  
  54      return $body;
  55    }
  56  
  57  }


Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1