/**
  * 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);
 }
 /**
  * Renders JavaScript body of function.
  */
 public function renderInitJavaScript(MultipleFileUpload $upload)
 {
     $tpl = $this->createTemplate(dirname(__FILE__) . "/initJS.js");
     $tpl->token = $upload->getToken();
     $tpl->sizeLimit = $upload->maxFileSize;
     $tpl->maxFiles = $upload->maxFiles;
     // TODO: make creation of link nicer!
     $baseUrl = Environment::getContext()->httpRequest->url->baseUrl;
     $tpl->uploadLink = $baseUrl . "?token=" . $tpl->token . "&uploader=plupload";
     $tpl->id = $this->getHtmlIdFlashCompatible($upload);
     return $tpl->__toString(TRUE);
 }