/** * Gets the SwatHtmlHeadEntry objects needed by this uploader * * @return SwatHtmlHeadEntrySet the SwatHtmlHeadEntry objects needed by * this uploader. * * @see SwatUIObject::getHtmlHeadEntrySet() */ public function getHtmlHeadEntrySet() { $this->createEmbeddedWidgets(); $set = parent::getHtmlHeadEntrySet(); $set->addEntrySet($this->progress_bar->getHtmlHeadEntrySet()); return $set; }
protected function createImage(SwatFileEntry $file) { $class_name = SwatDBClassMap::get('BlorgFileImage'); $image = new $class_name(); $image->setDatabase($this->app->db); $image->setFileBase('../images'); try { $image->process($file->getTempFileName()); } catch (SiteInvalidImageException $e) { $image = null; } return $image; }
protected function createBlorgFile(SwatFileEntry $file, $path) { $now = new SwatDate(); $now->toUTC(); $class_name = SwatDBClassMap::get('BlorgFile'); $blorg_file = new $class_name(); $blorg_file->setDatabase($this->app->db); $blorg_file->setFileBase($path); $blorg_file->createFileBase($path); $blorg_file->visible = false; $blorg_file->filename = $file->getUniqueFileName($path); $blorg_file->mime_type = $file->getMimeType(); $blorg_file->filesize = $file->getSize(); $blorg_file->createdate = $now; $blorg_file->instance = $this->app->getInstanceId(); $blorg_file->save(); $file->saveFile($path, $blorg_file->filename); return $blorg_file->id; }