Changeset View
Changeset View
Standalone View
Standalone View
src/applications/slowvote/query/PhabricatorSlowvoteSearchEngine.php
| Show First 20 Lines • Show All 149 Lines • ▼ Show 20 Lines | foreach ($polls as $poll) { | ||||
| ->setObjectName('V'.$poll->getID()) | ->setObjectName('V'.$poll->getID()) | ||||
| ->setHeader($poll->getQuestion()) | ->setHeader($poll->getQuestion()) | ||||
| ->setHref('/V'.$poll->getID()) | ->setHref('/V'.$poll->getID()) | ||||
| ->setDisabled($poll->getIsClosed()) | ->setDisabled($poll->getIsClosed()) | ||||
| ->addIcon('none', $date_created); | ->addIcon('none', $date_created); | ||||
| $description = $poll->getDescription(); | $description = $poll->getDescription(); | ||||
| if (strlen($description)) { | if (strlen($description)) { | ||||
| $item->addAttribute(phutil_utf8_shorten($poll->getDescription(), 120)); | $item->addAttribute(id(new PhutilUTF8StringTruncator()) | ||||
| ->setMaximumGlyphs(120) | |||||
| ->truncateString($poll->getDescription())); | |||||
| } | } | ||||
| if ($author) { | if ($author) { | ||||
| $item->addByline(pht('Author: %s', $author)); | $item->addByline(pht('Author: %s', $author)); | ||||
| } | } | ||||
| $list->addItem($item); | $list->addItem($item); | ||||
| } | } | ||||
| return $list; | return $list; | ||||
| } | } | ||||
| } | } | ||||