/** * Renders JavaScript body of function. */ public function renderInitJavaScript(MultipleFileUpload $upload) { $tpl = $this->createTemplate(dirname(__FILE__) . "/initJS.js"); $tpl->sizeLimit = ini_get('upload_max_filesize') . 'B'; $tpl->token = $upload->getToken(); $tpl->maxFiles = $upload->maxFiles; $tpl->backLink = (string) $upload->form->action; $tpl->swfuId = $upload->getHtmlId() . "-swfuBox"; $tpl->simUploadFiles = $upload->simUploadThreads; return $tpl->__toString(TRUE); }
/** * Renders JavaScript body of function. */ public function renderInitJavaScript(MultipleFileUpload $upload) { $tpl = $this->createTemplate(dirname(__FILE__) . "/initJS.latte"); $tpl->sizeLimit = $upload->maxFileSize; $tpl->token = $upload->getToken(); $tpl->maxFiles = $upload->maxFiles; $tpl->backLink = (string) $upload->form->action; $tpl->uploadifyId = $upload->getHtmlId() . "-uploadifyBox"; $tpl->simUploadFiles = $upload->simUploadThreads; return $tpl->__toString(TRUE); }
/** * This is reaction to flash related bug. * Flash has problems with "-" in ids. So * solution is simple, replace "-" with "_" * * @param MultipleFileUpload $upload * @return type */ function getHtmlIdFlashCompatible(MultipleFileUpload $upload) { return str_replace("-", "_", $upload->getHtmlId() . "-box"); }