die(json_encode($res));
}
+ public static function excelTranslation($args)
+ {
+ $name = $_REQUEST['name'] ?? 'translations';
+
+ $str = json_decode($_REQUEST['str']);
+ $data = [];
+ foreach ($str as $item) {
+ $data[] = [$item, ''];
+ }
+
+ $tmp = CubeIT_Files::tempnam();
+ CubeIT_Excel::simple($name, $data, ['Original text', 'Translation'], $tmp);
+
+ $n = $name . '.xlsx';
+
+ header('Content-Disposition: attachment; filename=' . $n);
+ header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
+ ob_end_clean();
+ readfile($tmp);
+ unlink($tmp);
+ exit;
+ }
+
public static function quizUpdater($args)
{
global $core;
$template = new ZipArchive();
$template->open($temp);
- $data = simplexml_load_string($uploaded->getFromName('data.xml'), "SimpleXMLElement", LIBXML_NOERROR | LIBXML_ERR_NONE);
+ $data = simplexml_load_string($uploaded->getFromName('data.xml'), "SimpleXMLElement", LIBXML_NOERROR | LIBXML_ERR_NONE);
$quizTitle = (string)$data->xpath('/quiz/title')[0];
// Replace assets