Name = 'Export'; $this->Version = '1.0'; $this->Creator = 'Chronos'; $this->License = 'GNU/GPL'; $this->Description = 'Allow parametric export of translated texts to various supported output formats'; $this->Dependencies = array('Translation'); } function DoStart(): void { $this->System->RegisterPage(['export'], 'PageExport'); $this->System->RegisterPage(['export', 'progress'], 'PageExportProgress'); Core::Cast($this->System)->RegisterMenuItem(array( 'Title' => 'Exporty', 'Hint' => 'Zde si můžete stáhnout přeložené texty', 'Link' => $this->System->Link('/export/'), 'Permission' => LICENCE_ANONYMOUS, 'Icon' => '', ), 2); } function GetTaskProgress($TaskId) { $Output = ''; $DbResult = $this->Database->query('SELECT * FROM `ExportTask` '. 'LEFT JOIN `Export` ON `Export`.`Id` = `ExportTask`.`Export` WHERE '. '((`Export`.`OutputType` = 9) OR (`Export`.`OutputType` = 10)) AND '. '(`TimeFinish` IS NULL) OR (`Export` ='.$TaskId.') ORDER BY `TimeQueued`'); // `Export`='.$Export->Id while ($Task = $DbResult->fetch_assoc()) { $Export = ''.$Task['Export'].''; if ($TaskId == $Task['Export']) $Export = ''.$Export.' (tento)'; // Show progress bar $Output .= ' Export '.$Export.':