2012-06-26 08:14:15 -07:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class AphrontFormImageControl extends AphrontFormControl {
|
|
|
|
|
|
|
|
protected function getCustomControlClass() {
|
|
|
|
return 'aphront-form-control-image';
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function renderInput() {
|
|
|
|
$id = celerity_generate_unique_node_id();
|
|
|
|
|
|
|
|
return
|
2013-01-17 18:39:02 -08:00
|
|
|
phutil_tag(
|
2012-06-26 08:14:15 -07:00
|
|
|
'input',
|
|
|
|
array(
|
|
|
|
'type' => 'file',
|
|
|
|
'name' => $this->getName(),
|
|
|
|
'class' => 'image',
|
|
|
|
)).
|
2012-07-26 16:25:56 -04:00
|
|
|
'<div style="clear: both;">'.
|
2013-01-17 18:39:02 -08:00
|
|
|
phutil_tag(
|
2012-06-26 08:14:15 -07:00
|
|
|
'input',
|
|
|
|
array(
|
|
|
|
'type' => 'checkbox',
|
|
|
|
'name' => 'default_image',
|
|
|
|
'class' => 'default-image',
|
|
|
|
'id' => $id,
|
|
|
|
)).
|
|
|
|
phutil_render_tag(
|
|
|
|
'label',
|
|
|
|
array(
|
|
|
|
'for' => $id,
|
|
|
|
),
|
2012-07-26 16:25:56 -04:00
|
|
|
'Use Default Image instead').
|
|
|
|
'</div>';
|
2012-06-26 08:14:15 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|