NewTorrent = $NewTorrent; $this->Torrent = $Torrent; $this->Error = $Error; $this->UploadForm = $UploadForm; $this->Categories = $Categories; $this->TorrentID = $TorrentID; # Formats # See classes/config.php $this->SeqFormats = $SeqFormats; $this->ProtFormats = $ProtFormats; $this->GraphXmlFormats = $GraphXmlFormats; $this->GraphTxtFormats = $GraphTxtFormats; $this->ImgFormats = $ImgFormats; $this->MapVectorFormats = $MapVectorFormats; $this->MapRasterFormats = $MapRasterFormats; $this->BinDocFormats = $BinDocFormats; $this->CpuGenFormats = $CpuGenFormats; $this->PlainFormats = $PlainFormats; $this->Resolutions = $Resolutions; # Quick constructor test if ($this->Torrent && $this->Torrent['GroupID']) { $this->Disabled = ' readonly="readonly"'; $this->DisabledFlag = true; } } /** * ==================== * = Twig-based class = * ==================== */ /** * render * * TorrentForm Twig wrapper. * Hopefully more pleasant. */ public function render() { $ENV = ENV::go(); $Twig = Twig::go(); /** * Upload notice */ if ($this->NewTorrent) { echo $Twig->render('torrent_form/notice.html'); } /** * Announce and source */ if ($this->NewTorrent) { $Announces = ANNOUNCE_URLS[0]; #$Announces = call_user_func_array('array_merge', ANNOUNCE_URLS); $TorrentPass = G::$LoggedUser['torrent_pass']; $TorrentSource = Users::get_upload_sources()[0]; echo $Twig->render( 'torrent_form/announce_source.html', [ 'announces' => $Announces, 'torrent_pass' => $TorrentPass, 'torrent_source' => $TorrentSource, ] ); } /** * Errors * (Twig unjustified) */ if ($this->Error) { echo <<
$this->Error
HTML; } /** * head * IMPORTANT! */ echo $this->head(); /** * upload_form * Where the fields are. */ echo $this->upload_form(); /** * foot */ echo $this->foot(); } # End render() /** * head * * Everything up to the main form tag open: *