* @access public * @modulegroup export_modules * @module export_linking_functions * @package Export */ require_once 'lib/export/export_config.inc.php'; use Studip\Button, Studip\LinkButton; /** * Generates a form that can be put into Stud.IP-pages to link to the export-module. * * This function returns a string with a HTML-form that links to the export-module. * It passes the given parameters in order to allow to jump to a specific part of the export-module. * * @access public * @param string $range_id export-range * @param string $ex_type type of data to be exported * @param string $filename filename for data-file * @param string $format file-format for export * @param string $filter grouping-category for export * @return string */ function export_form($range_id, $ex_type = "", $filename = "", $format = "", $filter = "") { global $output_formats, $xslt_filename; $filename = $xslt_filename; require_once ("lib/export/export_xslt_vars.inc.php"); $export_string = "
"; $export_string .= CSRFProtection::tokenTag(); $export_string .= "
      "; $export_string .= " "._("Diese Daten exportieren: ") . ""; $export_string .= ""; $export_string .= ""; $export_string .= ""; $export_string .= ""; $export_string .= ""; $export_string .= ""; $export_string .= ""; $export_string .= "
"; $export_string .= "
"; return $export_string; } /** * Generates a form that can be put into the sidebar to link to the export-module. * * This function returns a string with a HTML-form that links to the export-module. * It passes the given parameters in order to allow to jump to a specific part of the export-module. * * @access public * @param string $range_id export-range * @param string $ex_type type of data to be exported * @param string $filename filename for data-file * @param string $format file-format for export * @param string $filter grouping-category for export * @return string */ function export_form_sidebar($range_id, $ex_type = "", $filename = "", $format = "", $filter = "") { global $output_formats, $xslt_filename; $filename = $xslt_filename; require_once ("lib/export/export_xslt_vars.inc.php"); $export_string = "
"; $export_string .= CSRFProtection::tokenTag(); $export_string .= ""; $export_string .= Button::create(_('Export'), 'export', ['title' => _('Daten Exportieren')]); $export_string .= ""; $export_string .= ""; $export_string .= ""; $export_string .= ""; $export_string .= ""; $export_string .= ""; $export_string .= "
"; return $export_string; } /** * Generates a link to the export-module that can be put into Stud.IP-pages. * * This function returns a string with a link to the export-module. * It passes the given parameters in order to allow to jump to a specific part of the export-module. * * @access public * @param string $range_id export-range * @param string $ex_type type of data to be exported * @param string $filename filename for data-file * @param string $format file-format for export * @param string $choose xslt-Script for transformation * @param string $filter grouping-category for export * @return string */ function export_link($range_id, $ex_type = "", $filename = "", $format = "", $choose = "", $filter = "", $content = "", $o_mode = 'processor') { global $i_page; $export_string = ' $range_id, 'ex_type' => $ex_type, 'xslt_filename' => $filename, 'format' => $format, 'choose' => $choose, 'o_mode' => $o_mode, 'filter' => $filter, 'jump' => $i_page ] ); } elseif ($ex_type != "") { $export_string .= URLHelper::getLink( 'export.php', [ 'range_id' => $range_id, 'ex_type' => $ex_type, 'xslt_filename' => $filename, 'o_mode' => 'choose', 'filter' => $filter ] ); } else { $export_string .= URLHelper::getLink( 'export.php', [ 'range_id' => $range_id, 'o_mode' => 'start' ] ); } $export_string .= '">' . ($content ? $content : _("Diese Daten exportieren")); $export_string .= ''; return $export_string; } /** * Generates a Button with a link to the export-module that can be put into Stud.IP-pages. * * This function returns a string containing an export-button with a link to the export-module. * It passes the given parameters in order to allow to jump to a specific part of the export-module. * * @access public * @param string $range_id export-range * @param string $ex_type type of data to be exported * @param string $filename filename for data-file * @param string $format file-format for export * @param string $choose xslt-Script for transformation * @param string $filter grouping-category for export * @return string */ function export_button($range_id, $ex_type = "", $filename = "", $format = "", $choose = "", $filter = "") { global $i_page; if ($choose != "") { $parameters = [ 'range_id' => $range_id, 'ex_type' => $ex_type, 'xslt_filename' => $filename, 'format' => $format, 'choose' => $choose, 'o_mode' => 'processor', 'filter' => $filter, 'jump' => $i_page ]; } elseif ($ex_type != "") { $parameters = [ 'range_id' => $range_id, 'ex_type' => $ex_type, 'xslt_filename' => $filename, 'o_mode' => 'choose', 'filter' => $filter, ]; } else { $parameters = [ 'range_id' => $range_id, 'o_mode' => 'start', ]; } return Studip\LinkButton::create(_('Export'), URLHelper::getURL('export.php', $parameters)); }