Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14743938
D12564.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
5 KB
Referenced Files
None
Subscribers
None
D12564.id.diff
View Options
diff --git a/src/view/form/control/AphrontFormCropControl.php b/src/view/form/control/AphrontFormCropControl.php
deleted file mode 100644
--- a/src/view/form/control/AphrontFormCropControl.php
+++ /dev/null
@@ -1,94 +0,0 @@
-<?php
-
-final class AphrontFormCropControl extends AphrontFormControl {
-
- private $width = 50;
- private $height = 50;
-
- public function setHeight($height) {
- $this->height = $height;
- return $this;
- }
- public function getHeight() {
- return $this->height;
- }
-
- public function setWidth($width) {
- $this->width = $width;
- return $this;
- }
- public function getWidth() {
- return $this->width;
- }
-
- protected function getCustomControlClass() {
- return 'aphront-form-crop';
- }
-
- protected function renderInput() {
- $file = $this->getValue();
-
- if ($file === null) {
- return phutil_tag(
- 'img',
- array(
- 'src' => PhabricatorUser::getDefaultProfileImageURI(),
- ),
- '');
- }
-
- $c_id = celerity_generate_unique_node_id();
- $metadata = $file->getMetadata();
- $scale = PhabricatorImageTransformer::getScaleForCrop(
- $file,
- $this->getWidth(),
- $this->getHeight());
-
- Javelin::initBehavior(
- 'aphront-crop',
- array(
- 'cropBoxID' => $c_id,
- 'width' => $this->getWidth(),
- 'height' => $this->getHeight(),
- 'scale' => $scale,
- 'imageH' => $metadata[PhabricatorFile::METADATA_IMAGE_HEIGHT],
- 'imageW' => $metadata[PhabricatorFile::METADATA_IMAGE_WIDTH],
- ));
-
- return javelin_tag(
- 'div',
- array(
- 'id' => $c_id,
- 'sigil' => 'crop-box',
- 'mustcapture' => true,
- 'class' => 'crop-box',
- ),
- array(
- javelin_tag(
- 'img',
- array(
- 'src' => $file->getBestURI(),
- 'class' => 'crop-image',
- 'sigil' => 'crop-image',
- ),
- ''),
- javelin_tag(
- 'input',
- array(
- 'type' => 'hidden',
- 'name' => 'image_x',
- 'sigil' => 'crop-x',
- ),
- ''),
- javelin_tag(
- 'input',
- array(
- 'type' => 'hidden',
- 'name' => 'image_y',
- 'sigil' => 'crop-y',
- ),
- ''),
- ));
- }
-
-}
diff --git a/src/view/form/control/AphrontFormImageControl.php b/src/view/form/control/AphrontFormImageControl.php
deleted file mode 100644
--- a/src/view/form/control/AphrontFormImageControl.php
+++ /dev/null
@@ -1,36 +0,0 @@
-<?php
-
-final class AphrontFormImageControl extends AphrontFormControl {
-
- protected function getCustomControlClass() {
- return 'aphront-form-control-image';
- }
-
- protected function renderInput() {
- $id = celerity_generate_unique_node_id();
-
- return hsprintf(
- '%s<div style="clear: both;">%s%s</div>',
- phutil_tag(
- 'input',
- array(
- 'type' => 'file',
- 'name' => $this->getName(),
- )),
- phutil_tag(
- 'input',
- array(
- 'type' => 'checkbox',
- 'name' => 'default_image',
- 'class' => 'default-image',
- 'id' => $id,
- )),
- phutil_tag(
- 'label',
- array(
- 'for' => $id,
- ),
- pht('Use Default Image instead')));
- }
-
-}
diff --git a/src/view/form/control/AphrontFormSectionControl.php b/src/view/form/control/AphrontFormSectionControl.php
deleted file mode 100644
--- a/src/view/form/control/AphrontFormSectionControl.php
+++ /dev/null
@@ -1,13 +0,0 @@
-<?php
-
-final class AphrontFormSectionControl extends AphrontFormControl {
-
- protected function getCustomControlClass() {
- return 'aphront-form-control-section';
- }
-
- protected function renderInput() {
- return $this->getValue();
- }
-
-}
diff --git a/src/view/form/control/AphrontFormToggleButtonsControl.php b/src/view/form/control/AphrontFormToggleButtonsControl.php
deleted file mode 100644
--- a/src/view/form/control/AphrontFormToggleButtonsControl.php
+++ /dev/null
@@ -1,52 +0,0 @@
-<?php
-
-final class AphrontFormToggleButtonsControl extends AphrontFormControl {
-
- private $baseURI;
- private $param;
-
- private $buttons;
-
- public function setBaseURI(PhutilURI $uri, $param) {
- $this->baseURI = $uri;
- $this->param = $param;
- return $this;
- }
-
- public function setButtons(array $buttons) {
- $this->buttons = $buttons;
- return $this;
- }
-
- protected function getCustomControlClass() {
- return 'aphront-form-control-togglebuttons';
- }
-
- protected function renderInput() {
- if (!$this->baseURI) {
- throw new Exception('Call setBaseURI() before render()!');
- }
-
- $selected = $this->getValue();
-
- $out = array();
- foreach ($this->buttons as $value => $label) {
- if ($value == $selected) {
- $more = ' toggle-selected toggle-fixed';
- } else {
- $more = null;
- }
-
- $out[] = phutil_tag(
- 'a',
- array(
- 'class' => 'toggle'.$more,
- 'href' => $this->baseURI->alter($this->param, $value),
- ),
- $label);
- }
-
- return $out;
- }
-
-}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Jan 22, 4:11 AM (19 h, 35 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7026647
Default Alt Text
D12564.id.diff (5 KB)
Attached To
Mode
D12564: Remove some unused Aphront classes
Attached
Detach File
Event Timeline
Log In to Comment