Video support
This commit is contained in:
@@ -3,17 +3,17 @@
|
||||
class Uploader extends UploadHandler
|
||||
{
|
||||
/**
|
||||
* Pictures Management
|
||||
* @var Picture
|
||||
* Medias Management
|
||||
* @var Media
|
||||
*/
|
||||
private $oPicture;
|
||||
private $oMedia;
|
||||
|
||||
public $sBody;
|
||||
|
||||
function __construct(&$oPicture)
|
||||
function __construct(&$oMedia)
|
||||
{
|
||||
$this->error_messages['wrong_project_mode'] = 'Le projet n\'est pas en mode "blog".';
|
||||
$this->oPicture = &$oPicture;
|
||||
$this->oMedia = &$oMedia;
|
||||
$this->sBody = '';
|
||||
parent::__construct(array('image_versions'=>array(), 'accept_file_types'=>'/\.(gif|jpe?g|png|mov)$/i'));
|
||||
}
|
||||
@@ -22,7 +22,7 @@ class Uploader extends UploadHandler
|
||||
$bResult = parent::validate($uploaded_file, $file, $error, $index);
|
||||
|
||||
//Check project mode
|
||||
if(!$this->oPicture->isProjectModeValid()) {
|
||||
if(!$this->oMedia->isProjectModeValid()) {
|
||||
$file->error = $this->get_error_message('wrong_project_mode');
|
||||
$bResult = false;
|
||||
}
|
||||
@@ -34,7 +34,7 @@ class Uploader extends UploadHandler
|
||||
$file = parent::handle_file_upload($uploaded_file, $name, $size, $type, $error, $index, $content_range);
|
||||
|
||||
if(empty($file->error)) {
|
||||
$sError = $this->oPicture->addPic($file->name);
|
||||
$sError = $this->oMedia->addMedia($file->name);
|
||||
if($sError!='') {
|
||||
$file->error = $this->get_error_message($sError);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user