1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 22:10:55 +01:00

Remove some unused Aphront classes

Summary: These classes aren't used anywhere.

Test Plan: `grep`

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D12564
This commit is contained in:
Joshua Spence 2015-04-27 21:18:09 +10:00
parent bcb957bc8a
commit a1403183df
4 changed files with 0 additions and 195 deletions

View file

@ -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',
),
''),
));
}
}

View file

@ -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')));
}
}

View file

@ -1,13 +0,0 @@
<?php
final class AphrontFormSectionControl extends AphrontFormControl {
protected function getCustomControlClass() {
return 'aphront-form-control-section';
}
protected function renderInput() {
return $this->getValue();
}
}

View file

@ -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;
}
}