Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): Failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/monara/public_html/test.athavaneng.com/themes.php on line 99
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 226
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 227
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 228
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 229
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 230
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 231
.
/**
* prints the form to export the items as xml-file
*
* @author Andreas Grabs
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
* @package mod_feedback
*/
require_once("../../config.php");
require_once("lib.php");
// get parameters
$id = required_param('id', PARAM_INT);
$action = optional_param('action', false, PARAM_ALPHA);
$url = new moodle_url('/mod/feedback/export.php', array('id'=>$id));
if ($action !== false) {
$url->param('action', $action);
}
$PAGE->set_url($url);
if (! $cm = get_coursemodule_from_id('feedback', $id)) {
throw new \moodle_exception('invalidcoursemodule');
}
if (! $course = $DB->get_record("course", array("id"=>$cm->course))) {
throw new \moodle_exception('coursemisconf');
}
if (! $feedback = $DB->get_record("feedback", array("id"=>$cm->instance))) {
throw new \moodle_exception('invalidcoursemodule');
}
$context = context_module::instance($cm->id);
require_login($course, true, $cm);
require_capability('mod/feedback:edititems', $context);
if ($action == 'exportfile') {
if (!$exportdata = feedback_get_xml_data($feedback->id)) {
throw new \moodle_exception('nodata');
}
@feedback_send_xml_data($exportdata, 'feedback_'.$feedback->id.'.xml');
exit;
}
redirect('view.php?id='.$id);
exit;
function feedback_get_xml_data($feedbackid) {
global $DB;
$space = ' ';
//get all items of the feedback
if (!$items = $DB->get_records('feedback_item', array('feedback'=>$feedbackid), 'position')) {
return false;
}
//writing the header of the xml file including the charset of the currrent used language
$data = ''."\n";
$data .= ''."\n";
$data .= $space.''."\n";
//writing all the items
foreach ($items as $item) {
//start of item
$data .= $space.$space.'- '."\n";
//start of itemid
$data .= $space.$space.$space.''."\n";
//start of CDATA
$data .= $space.$space.$space.$space.'id;
//end of CDATA
$data .= ']]>'."\n";
//end of itemid
$data .= $space.$space.$space.''."\n";
//start of itemtext
$data .= $space.$space.$space.''."\n";
//start of CDATA
$data .= $space.$space.$space.$space.'name;
//end of CDATA
$data .= ']]>'."\n";
//end of itemtext
$data .= $space.$space.$space.''."\n";
//start of itemtext
$data .= $space.$space.$space.''."\n";
//start of CDATA
$data .= $space.$space.$space.$space.'label;
//end of CDATA
$data .= ']]>'."\n";
//end of itemtext
$data .= $space.$space.$space.''."\n";
//start of presentation
$data .= $space.$space.$space.''."\n";
//start of CDATA
$data .= $space.$space.$space.$space.'presentation;
//end of CDATA
$data .= ']]>'."\n";
//end of presentation
$data .= $space.$space.$space.''."\n";
//start of options
$data .= $space.$space.$space.''."\n";
//start of CDATA
$data .= $space.$space.$space.$space.'options;
//end of CDATA
$data .= ']]>'."\n";
//end of options
$data .= $space.$space.$space.''."\n";
//start of dependitem
$data .= $space.$space.$space.''."\n";
//start of CDATA
$data .= $space.$space.$space.$space.'dependitem;
//end of CDATA
$data .= ']]>'."\n";
//end of dependitem
$data .= $space.$space.$space.''."\n";
//start of dependvalue
$data .= $space.$space.$space.''."\n";
//start of CDATA
$data .= $space.$space.$space.$space.'dependvalue;
//end of CDATA
$data .= ']]>'."\n";
//end of dependvalue
$data .= $space.$space.$space.''."\n";
//end of item
$data .= $space.$space.'
'."\n";
}
//writing the footer of the xml file
$data .= $space.''."\n";
$data .= ''."\n";
return $data;
}
function feedback_send_xml_data($data, $filename) {
@header('Content-Type: application/xml; charset=UTF-8');
@header('Content-Disposition: attachment; filename="'.$filename.'"');
print($data);
}