9 namespace Fossology\UI\Page;
14 use Symfony\Component\HttpFoundation\Request;
15 use Symfony\Component\HttpFoundation\Response;
19 const NAME =
"admin_custom_text_to_csv";
21 function __construct()
23 parent::__construct(self::NAME, array(
24 self::TITLE =>
"Admin Custom Text CSV Export",
25 self::MENU_LIST =>
"Admin::Text Management::Export::CSV Export All",
26 self::REQUIRES_LOGIN =>
true,
35 protected function handle(Request $request)
37 $confirmed = $request->get(
'confirmed',
false);
38 $referer = $request->headers->get(
'referer');
39 $fileName =
"fossology-custom-text-export-" . date(
"YMj-Gis") .
'.csv';
42 $downloadUrl =
"?mod=" . self::NAME .
"&cp_pk=" . $request->get(
'cp_pk') .
"&confirmed=true";
46 $customTextExport = $GLOBALS[
'container']->get(
'app.custom_text_export');
47 $content = $customTextExport->export(intval($request->get(
'cp_pk')));
52 register_plugin(
new AdminCustomTextToCSV());
Contains the constants and helpers for authentication of user.
static getDownloadConfirmationResponse($downloadUrl, $fileName, $referer)
static getDownloadResponse($content, $fileName, $contentType='text/csv')