Changeset View
Changeset View
Standalone View
Standalone View
src/view/layout/PhabricatorActionView.php
<?php | <?php | ||||
final class PhabricatorActionView extends AphrontView { | final class PhabricatorActionView extends AphrontView { | ||||
private $name; | private $name; | ||||
private $icon; | private $icon; | ||||
private $iconSheet; | private $iconSheet; | ||||
private $href; | private $href; | ||||
private $disabled; | private $disabled; | ||||
private $workflow; | private $workflow; | ||||
private $renderAsForm; | private $renderAsForm; | ||||
private $download; | private $download; | ||||
private $objectURI; | private $objectURI; | ||||
epriestley: Can't we get rid of this and just use $this->download instead? | |||||
public function setObjectURI($object_uri) { | public function setObjectURI($object_uri) { | ||||
$this->objectURI = $object_uri; | $this->objectURI = $object_uri; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getObjectURI() { | public function getObjectURI() { | ||||
return $this->objectURI; | return $this->objectURI; | ||||
} | } | ||||
Show All 12 Lines | final class PhabricatorActionView extends AphrontView { | ||||
} | } | ||||
/** | /** | ||||
* If the user is not logged in and the action is relatively complicated, | * If the user is not logged in and the action is relatively complicated, | ||||
* give them a generic login link that will re-direct to the page they're | * give them a generic login link that will re-direct to the page they're | ||||
* viewing. | * viewing. | ||||
*/ | */ | ||||
public function getHref() { | public function getHref() { | ||||
if ($this->workflow || $this->renderAsForm) { | if (($this->workflow || $this->renderAsForm) && !$this->download) { | ||||
Not Done Inline ActionsCan we use the existing download flag for this instead of introducing a new flag? epriestley: Can we use the existing `download` flag for this instead of introducing a new flag? | |||||
if (!$this->user || !$this->user->isLoggedIn()) { | if (!$this->user || !$this->user->isLoggedIn()) { | ||||
return id(new PhutilURI('/auth/start/')) | return id(new PhutilURI('/auth/start/')) | ||||
->setQueryParam('next', (string)$this->getObjectURI()); | ->setQueryParam('next', (string)$this->getObjectURI()); | ||||
} | } | ||||
} | } | ||||
return $this->href; | return $this->href; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 130 Lines • Show Last 20 Lines |
Can't we get rid of this and just use $this->download instead?