getExtensionById('taoMediaManager'); $file = array_shift($params); $destinationClassUri = count($params) > 0 ? array_shift($params) : MediaService::ROOT_CLASS_URI; $service = MediaService::singleton(); $uri = $service->createMediaInstance($file, $destinationClassUri, DEFAULT_LANG, basename($file)); if ($uri !== false) { $report = new Report(Report::TYPE_SUCCESS, __('Media imported')); $report->setData($uri); } else { $report = new Report(Report::TYPE_ERROR, __('Unable to import')); } return $report; } }