Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phid/view/PHUIHandleTagListView.php
Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | return array( | ||||
'class' => 'phabricator-handle-tag-list', | 'class' => 'phabricator-handle-tag-list', | ||||
); | ); | ||||
} | } | ||||
protected function getTagContent() { | protected function getTagContent() { | ||||
$handles = $this->handles; | $handles = $this->handles; | ||||
// If the list is empty, we may render a "No Projects" tag. | // If the list is empty, we may render a "No Projects" tag. | ||||
if (!$handles) { | if (!count($handles)) { | ||||
if (strlen($this->noDataString)) { | if (strlen($this->noDataString)) { | ||||
$no_data_tag = $this->newPlaceholderTag() | $no_data_tag = $this->newPlaceholderTag() | ||||
->setName($this->noDataString); | ->setName($this->noDataString); | ||||
return $this->newItem($no_data_tag); | return $this->newItem($no_data_tag); | ||||
} | } | ||||
} | } | ||||
if ($this->limit) { | if ($this->limit && ($this->limit > count($handles))) { | ||||
if (!is_array($handles)) { | |||||
$handles = iterator_to_array($handles); | |||||
} | |||||
$handles = array_slice($handles, 0, $this->limit); | $handles = array_slice($handles, 0, $this->limit); | ||||
} | } | ||||
$list = array(); | $list = array(); | ||||
foreach ($handles as $handle) { | foreach ($handles as $handle) { | ||||
$tag = $handle->renderTag(); | $tag = $handle->renderTag(); | ||||
if ($this->showHovercards) { | if ($this->showHovercards) { | ||||
$tag->setPHID($handle->getPHID()); | $tag->setPHID($handle->getPHID()); | ||||
▲ Show 20 Lines • Show All 48 Lines • Show Last 20 Lines |