3 final class AlmanacInterfaceTableView
extends AphrontView
{
8 public function setInterfaces(array $interfaces) {
9 $this->interfaces
= $interfaces;
13 public function getInterfaces() {
14 return $this->interfaces
;
17 public function setCanEdit($can_edit) {
18 $this->canEdit
= $can_edit;
22 public function getCanEdit() {
23 return $this->canEdit
;
26 public function render() {
27 $interfaces = $this->getInterfaces();
28 $viewer = $this->getUser();
30 $can_edit = $this->getCanEdit();
33 $button_class = 'small button button-grey';
35 $button_class = 'small button button-grey disabled';
38 $handles = $viewer->loadHandles(mpull($interfaces, 'getNetworkPHID'));
41 foreach ($interfaces as $interface) {
44 $handles->renderHandle($interface->getNetworkPHID()),
45 $interface->getAddress(),
46 $interface->getPort(),
50 'class' => $button_class,
51 'href' => '/almanac/interface/edit/'.$interface->getID().'/',
52 'sigil' => ($can_edit ?
null : 'workflow'),
58 'class' => $button_class,
59 'href' => '/almanac/interface/delete/'.$interface->getID().'/',
60 'sigil' => 'workflow',
66 $table = id(new AphrontTableView($rows))