die(json_encode($res));
}
+ public static function convertXlsxToKeyValueJson($args)
+ {
+ new PHPExcel();
+
+ $reader = new PHPExcel_Reader_Excel2007();
+ $xls = $reader->load($_FILES['file']['tmp_name']);
+
+ $res = [];
+ foreach ($xls->getAllSheets() as $sheet) {
+ $lines = $sheet->toArray();
+ foreach ($lines as $line) {
+ if (null === $line[0]) {
+ continue;
+ }
+ $k = trim($line[0]);
+ if (!$k) {
+ continue;
+ }
+ $v = trim($line[1]);
+ $res[$k] = $v;
+ }
+ break;
+ }
+
+ ob_end_clean();
+
+ header('Content-Type: application/json');
+ die(json_encode($res));
+ }
+
public static function excelTranslation($args)
{
$name = $_REQUEST['name'] ?? 'translations';
exit;
}
+
public static function articles($args)
{
global $core;