* @access public * @modulegroup export_modules * @module export_choose_xslt * @package Export */ // +---------------------------------------------------------------------------+ // This file is part of Stud.IP // export_choose_xslt.inc.php // pages for choosing an xslt-script // // Copyright (c) 2002 Arne Schroeder // Suchi & Berg GmbH // +---------------------------------------------------------------------------+ // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or any later version. // +---------------------------------------------------------------------------+ // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // +---------------------------------------------------------------------------+ use Studip\Button, Studip\LinkButton; $perm->check('tutor'); require_once 'lib/export/export_xslt_vars.inc.php'; // Liste der XSLT-Skripts require_once 'lib/dates.inc.php'; // Datumsfunktionen /** * Checks given parameters * * This function checks the given parameters. If some are missing or refer to a XSL-file that * doesn't exist it returns false and adds a warning to export_error. * * @access public * @return boolean */ function CheckParamXSLT() { global $ex_type, $xml_file_id, $page, $o_mode, $format, $choose, $xslt_files, $export_o_modes, $export_ex_types, $export_error, $export_error_num; $mod_counter = 0; $page = (int)$page; if ($page === 1) { reset($xslt_files); foreach ($xslt_files as $val) { if ($val[$ex_type] && $val[$format]) { $mod_counter++; } } if ($mod_counter === 0 && $format !== "xml") { $export_error .= _("Für dieses Format sind keine Ausgabemodule installiert.
Bitte wählen Sie ein anderes Ausgabeformat.") . "
"; $page = 0; } if (!$format) { $page = 0; } reset($xslt_files); } if ($page === 2 && !$choose) { $page = 1; } if ( /*($xml_file_id != "") AND */ (in_array($ex_type, $export_ex_types)) && (in_array($o_mode, $export_o_modes))) { return true; } $export_error .= "" . _("Unzulässiger Seitenaufruf!") . "
"; $export_error_num++; return false; } $export_pagename = _("Konvertierung der Daten: "); $xslt_filename = mb_strlen(Request::get('xslt_filename')) ? basename(stripslashes(Request::get('xslt_filename'))) : $xslt_filename_default; if (!CheckParamXSLT()) { $export_pagename .= _('Es ist ein Fehler aufgetreten.'); $export_pagecontent .= MessageBox::error( _('Die Parameter, mit denen diese Seite aufgerufen wurde, sind fehlerhaft oder unvollständig.') ); } // Die Seiten 2 und 3 ueberspringen, wenn als Dateiformat XML gewaehlt wurde if ($format === "xml" && $page === 1) { $xml_file_id = ""; $o_mode = "file"; $page = 3; // Seite 1 : Auswahl des Dateiformats } elseif (!isset($page) || $page === 0) { $export_pagename .= _("Auswahl des Dateiformats"); unset($export_msg); unset($xml_printimage); unset($xml_printlink); unset($xml_printdesc); unset($xml_printcontent); $export_info = null; $export_pagecontent .= "
"; $export_pagecontent .= "
" . _("Bitte wählen Sie, in welchem Format die Daten ausgegeben werden sollen!") . ""; $export_pagecontent .= CSRFProtection::tokenTag(); $export_pagecontent .= "
"; $export_weiter_button = '
' . Button::create('<< ' . _('Zurück'), 'back'); $export_weiter_button .= Button::create(_('Weiter') . ' >>', 'next') . ""; $export_weiter_button .= "
"; // Seite 2 : Auswahl des XSLT-Scripts } elseif ($page === 1) { if (mb_strpos($choose, $format) === false) { unset($choose); } $export_pagename .= _("Auswahl des Ausgabemoduls"); $export_info = null; $export_pagecontent .= '
'; $export_pagecontent .= '
' . _('Ausgabemodul') . ''; $export_pagecontent .= CSRFProtection::tokenTag(); $export_pagecontent .= ""; $opt_num = 0; foreach ($xslt_files as $key => $val) { if ($val[$ex_type] && $val[$format]) { $export_pagecontent .= "