1) { exec("rm -rf $path"); $result = false; break; } [$home,$name] = my_explode(' (',urldecode($_POST['name'])); $name = rtrim($name,')'); $i = 0; $place = "$plugins/lang-$file.xml"; $child = ['LanguageURL','Language','LanguageLocal','LanguagePack','Author','Name','TemplateURL','Version','Icon','Description','Changes']; $value = ['',$name,$home,$file,$_SERVER['HTTP_HOST'],"$name translation",$place,date('Y.m.d',time()),'','','']; // create a corresponding XML file $xml = new SimpleXMLElement(''); foreach ($child as $key) $xml->addChild($key,$value[$i++]); // saved as file (not link) $xml->asXML($place); // return list of installed language packs $installed = []; foreach (glob("$docroot/languages/*",GLOB_ONLYDIR) as $dir) $installed[] = basename($dir); exit(implode(',',$installed)); } break; case 'rm': $file = basename($file); $path = "$docroot/languages/$file"; if ($result = is_dir($path)) { exec("rm -rf $path"); @unlink("$docroot/webGui/javascript/translate.$file.js"); @unlink("$boot/lang-$file.xml"); @unlink("$plugins/lang-$file.xml"); @unlink("$tmp/lang-$file.xml"); @unlink("$boot/dynamix/lang-$file.zip"); // return list of installed language packs $installed = []; foreach (glob("$docroot/languages/*",GLOB_ONLYDIR) as $dir) $installed[] = basename($dir); exit(implode(',',$installed)); } break; } exit($result ? 'OK 200' : 'Internal Error 500'); ?>