Skip to content

Instantly share code, notes, and snippets.

@mcfdn
Created October 23, 2012 16:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcfdn/3939735 to your computer and use it in GitHub Desktop.
Save mcfdn/3939735 to your computer and use it in GitHub Desktop.
Form_Jquery_File_Upload
<?php
/**
* This is aimed for use with jQueryFileUpload
*
* @link https://github.com/blueimp/jQuery-File-Upload
* @author James McFadden <james@jamesmcfadden.co.uk>
*/
class Form_Jquery_File_Upload extends Form_Upload
{
function init()
{
$this->resolveDependencies();
$this->setAttrib('id', 'fileupload');
$this->addElement(
'file',
'Photo'
);
$this->addElement(
'Button',
'Start',
array(
'label' => 'Start Upload',
'class' => 'btn btn-primary start',
'escape' => false
)
);
$this->addElement(
'Button',
'Cancel',
array(
'label' => 'Cancel Upload',
'class' => 'btn btn-warning cancel',
'escape' => false
)
);
$this->addElement(
'Button',
'Delete',
array(
'label' => 'Delete',
'class' => 'btn btn-danger delete',
'escape' => false
)
);
}
private function resolveDependencies()
{
// Include your jQueryFileUpload scripts here
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment