Path: blob/master/src/applications/calendar/view/PhabricatorCalendarImportLogView.php
12256 views
<?php12final class PhabricatorCalendarImportLogView extends AphrontView {34private $logs = array();5private $showImportSources = false;67public function setLogs(array $logs) {8assert_instances_of($logs, 'PhabricatorCalendarImportLog');9$this->logs = $logs;10return $this;11}1213public function getLogs() {14return $this->logs;15}1617public function setShowImportSources($show_import_sources) {18$this->showImportSources = $show_import_sources;19return $this;20}2122public function getShowImportSources() {23return $this->showImportSources;24}2526public function render() {27return $this->newTable();28}2930public function newTable() {31$viewer = $this->getViewer();32$logs = $this->getLogs();3334$show_sources = $this->getShowImportSources();3536$rows = array();37foreach ($logs as $log) {38$icon = $log->getDisplayIcon($viewer);39$color = $log->getDisplayColor($viewer);40$name = $log->getDisplayType($viewer);41$description = $log->getDisplayDescription($viewer);4243$rows[] = array(44$log->getID(),45($show_sources46? $viewer->renderHandle($log->getImport()->getPHID())47: null),48id(new PHUIIconView())->setIcon($icon, $color),49$name,50phutil_escape_html_newlines($description),51phabricator_datetime($log->getDateCreated(), $viewer),52);53}5455$table = id(new AphrontTableView($rows))56->setHeaders(57array(58pht('ID'),59pht('Source'),60null,61pht('Type'),62pht('Message'),63pht('Date'),64))65->setColumnVisibility(66array(67true,68$show_sources,69))70->setColumnClasses(71array(72'top',73'top',74'top',75'top pri',76'top wide',77'top',78));7980return $table;81}8283}848586