Changeset View
Changeset View
Standalone View
Standalone View
src/applications/macro/controller/PhabricatorMacroViewController.php
| Show First 20 Lines • Show All 132 Lines • ▼ Show 20 Lines | if ($macro->getIsDisabled()) { | ||||
| id(new PhabricatorActionView()) | id(new PhabricatorActionView()) | ||||
| ->setName(pht('Archive Macro')) | ->setName(pht('Archive Macro')) | ||||
| ->setHref($this->getApplicationURI('/disable/'.$macro->getID().'/')) | ->setHref($this->getApplicationURI('/disable/'.$macro->getID().'/')) | ||||
| ->setWorkflow(true) | ->setWorkflow(true) | ||||
| ->setDisabled(!$can_manage) | ->setDisabled(!$can_manage) | ||||
| ->setIcon('fa-ban')); | ->setIcon('fa-ban')); | ||||
| } | } | ||||
| if ($macro->getFile()->getMimeType() === 'image/gif') { | |||||
| $view->addAction( | |||||
| id(new PhabricatorActionView()) | |||||
| ->setName(pht('Automatically Resize')) | |||||
| ->setHref( | |||||
| $this->getApplicationURI('/originalsize/'.$macro->getID().'/')) | |||||
| ->setWorkflow(true) | |||||
| ->setDisabled(true) | |||||
| ->setIcon('fa-compress')); | |||||
| } else if ($macro->getUseOriginalSize()) { | |||||
| $view->addAction( | |||||
| id(new PhabricatorActionView()) | |||||
| ->setName(pht('Automatically Resize')) | |||||
| ->setHref( | |||||
| $this->getApplicationURI('/originalsize/'.$macro->getID().'/')) | |||||
| ->setWorkflow(true) | |||||
| ->setDisabled(!$can_manage) | |||||
| ->setIcon('fa-compress')); | |||||
| } else { | |||||
| $view->addAction( | |||||
| id(new PhabricatorActionView()) | |||||
| ->setName(pht('Use Original Size')) | |||||
| ->setHref( | |||||
| $this->getApplicationURI('/originalsize/'.$macro->getID().'/')) | |||||
| ->setWorkflow(true) | |||||
| ->setDisabled(!$can_manage) | |||||
| ->setIcon('fa-expand')); | |||||
| } | |||||
| return $view; | return $view; | ||||
| } | } | ||||
| private function buildPropertyView( | private function buildPropertyView( | ||||
| PhabricatorFileImageMacro $macro, | PhabricatorFileImageMacro $macro, | ||||
| PhabricatorActionListView $actions) { | PhabricatorActionListView $actions) { | ||||
| $viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
| Show All 27 Lines | |||||