~ubuntu-branches/ubuntu/vivid/phabricator/vivid-proposed

« back to all changes in this revision

Viewing changes to phabricator/src/applications/almanac/view/AlmanacInterfaceTableView.php

  • Committer: Package Import Robot
  • Author(s): Richard Sellam
  • Date: 2015-01-29 00:15:58 UTC
  • mfrom: (0.16.1) (0.15.1) (0.12.2) (2.1.4 sid)
  • Revision ID: package-import@ubuntu.com-20150129001558-na84707j70qqla7z
Tags: 0~git20150129-1
* New snapshot release
* restricted access to local config file (closes: #775479)
* moved local config file to /var/lib/phabricator (closes: #775478)
* switched mysql-server dependency to recommends (closes: #773536)
* use /run instead of /var/run (closes: #775803)
* prevent package reinstall from overwritting local changes (closes: #776288)

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 
5
5
  private $interfaces;
6
6
  private $handles;
 
7
  private $canEdit;
7
8
 
8
9
  public function setHandles(array $handles) {
9
10
    $this->handles = $handles;
23
24
    return $this->interfaces;
24
25
  }
25
26
 
 
27
  public function setCanEdit($can_edit) {
 
28
    $this->canEdit = $can_edit;
 
29
    return $this;
 
30
  }
 
31
 
 
32
  public function getCanEdit() {
 
33
    return $this->canEdit;
 
34
  }
 
35
 
26
36
  public function render() {
27
37
    $interfaces = $this->getInterfaces();
28
38
    $handles = $this->getHandles();
29
39
    $viewer = $this->getUser();
30
40
 
 
41
    if ($this->getCanEdit()) {
 
42
      $button_class = 'small grey button';
 
43
    } else {
 
44
      $button_class = 'small grey button disabled';
 
45
    }
 
46
 
31
47
    $rows = array();
32
48
    foreach ($interfaces as $interface) {
33
49
      $rows[] = array(
38
54
        phutil_tag(
39
55
          'a',
40
56
          array(
41
 
            'class' => 'small grey button',
 
57
            'class' => $button_class,
42
58
            'href' => '/almanac/interface/edit/'.$interface->getID().'/',
43
59
          ),
44
60
          pht('Edit')),