Skip to content

Commit

Permalink
response fix
Browse files Browse the repository at this point in the history
  • Loading branch information
vanilla-thunder committed Sep 25, 2020
1 parent 032df74 commit d94a1f5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
9 changes: 2 additions & 7 deletions Application/Controller/Admin/DevTranslations.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ class DevTranslations extends \OxidEsales\Eshop\Application\Controller\Admin\Adm
{
protected $_sThisTemplate = 'devutils_translations.tpl';

private function _getCustLangFilePath()
{

}

public function getAllTranslations()
{
$oConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
Expand All @@ -56,7 +51,7 @@ public function getAllTranslations()
unset($aAllTranslations["charset"]);
ksort($aAllTranslations);

print json_encode($aAllTranslations);
print json_encode(["status" => "ok", "data" => $aAllTranslations]);
exit;
}

Expand All @@ -72,7 +67,7 @@ public function getTranslations()
$aTranslations = [];
foreach ($aLang as $key => $value) $aTranslations[] = ["key" => $key, "value" => $value];

print json_encode($aTranslations);
print json_encode(["status" => "ok", "data" => $aTranslations]);
exit;
}

Expand Down
4 changes: 2 additions & 2 deletions Application/views/admin/devutils_translations.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
$http.get("[{ $oViewConf->getSelfLink()|oxaddparams:"cl=devtranslations&fnc=getTranslations"|replace:"&":"&" }]")
.then(function (res)
{
if (res.data.status === 'ok') $scope.translations = res.data;
if (res.data.status === 'ok') $scope.translations = res.data.data;
else if (res.data.status === 'error') $scope.response = res.data.msg;
else $scope.response = "Übersetzungen konnten nicht geladen werden, bitte prüfe deine Fehler Logs."
$scope.loading--;
Expand All @@ -97,7 +97,7 @@
$http.get("[{ $oViewConf->getSelfLink()|oxaddparams:"cl=devtranslations&fnc=getAllTranslations"|replace:"&":"&" }]")
.then(function (res)
{
if (res.data.status === 'ok') $scope.allTranslations = res.data;
if (res.data.status === 'ok') $scope.allTranslations = res.data.data;
else if (res.data.status === 'error') $scope.response = res.data.msg;
else $scope.response = "Übersetzungen konnten nicht geladen werden, bitte prüfe deine Fehler Logs."
$scope.loading--;
Expand Down

0 comments on commit d94a1f5

Please sign in to comment.