2013-02-06 23:03:52 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class ConpherenceFormDragAndDropUploadControl extends AphrontFormControl {
|
|
|
|
|
|
|
|
private $dropID;
|
|
|
|
|
|
|
|
public function setDropID($drop_id) {
|
|
|
|
$this->dropID = $drop_id;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
public function getDropID() {
|
|
|
|
return $this->dropID;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function getCustomControlClass() {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function renderInput() {
|
|
|
|
|
|
|
|
$drop_id = celerity_generate_unique_node_id();
|
|
|
|
Javelin::initBehavior('conpherence-drag-and-drop-photo',
|
|
|
|
array(
|
|
|
|
'target' => $drop_id,
|
|
|
|
'form_pane' => 'conpherence-form',
|
|
|
|
'upload_uri' => '/file/dropupload/',
|
|
|
|
'activated_class' => 'conpherence-dialogue-upload-photo',
|
2013-02-19 22:33:10 +01:00
|
|
|
));
|
2013-02-06 23:03:52 +01:00
|
|
|
require_celerity_resource('conpherence-update-css');
|
|
|
|
|
|
|
|
return phutil_tag(
|
|
|
|
'div',
|
|
|
|
array(
|
|
|
|
'id' => $drop_id,
|
|
|
|
'class' => 'conpherence-dialogue-drag-photo',
|
|
|
|
),
|
2013-02-19 22:33:10 +01:00
|
|
|
pht('Drag and drop an image here to upload it.'));
|
2013-02-06 23:03:52 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|