Skip to content

Commit

Permalink
translation gui
Browse files Browse the repository at this point in the history
  • Loading branch information
vanilla-thunder committed Nov 3, 2020
1 parent d94a1f5 commit ca9ef09
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 26 deletions.
24 changes: 6 additions & 18 deletions Application/.ide-helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,11 @@

namespace VanillaThunder\DevUtils\Application\Extend;

class Email_parent extends \OxidEsales\Eshop\Core\Email
{
}
class Language_parent extends \OxidEsales\Eshop\Core\Language
{
}

class Order_parent extends \OxidEsales\Eshop\Application\Model\Order
{
}

class NavigationController_parent extends \OxidEsales\Eshop\Application\Controller\Admin\NavigationController
{
}

class ViewConfig_parent extends \OxidEsales\Eshop\Core\ViewConfig
{
}
class Email_parent extends \OxidEsales\Eshop\Core\Email {}
class Language_parent extends \OxidEsales\Eshop\Core\Language {}
class Order_parent extends \OxidEsales\Eshop\Application\Model\Order {}
class NavigationController_parent extends \OxidEsales\Eshop\Application\Controller\Admin\NavigationController {}
class UtilsView_parent extends \OxidEsales\Eshop\Core\UtilsView {}
class ViewConfig_parent extends \OxidEsales\Eshop\Core\ViewConfig {}


24 changes: 21 additions & 3 deletions Application/Controller/Admin/DevLogs.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,31 @@ public function getOxidLog()

$sShopDir = str_replace('source/','',$cfg->getConfigParam('sShopDir'));

$aData = file($sOxidLogPath);
//$sData = file_get_contents($sOxidLogPath);
// \[(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2})\](.+)(\n.+)?(?=\n\z|\[)
//preg_match_all("/\[(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2})\](.+)(\n.+)?(?=\n\z|\[)/gi",$sData,$aMatches);
//$aData = $aMatches;
//var_dump($sData);
//print "<pre>";

$aData = file($sOxidLogPath);
$aData = array_unique($aData);
$aData = array_slice($aData, -300);
$aData = str_replace(['\n',$sShopDir],["<br/>",""],$aData);
$aData = str_replace(['["[object]','\n',$sShopDir],["<br/>","<br/>",""],$aData);
foreach($aData as $index => $value)
{
//print "<hr/>".$value."<br/>";
preg_match("/^\[(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2})\]/mi", $value, $m);
if(empty($m)) {
$aData[$index-1] = explode("[stacktrace]", str_replace("\n", "", $aData[$index-1]).$value);
unset($aData[$index]);
}
else $aData[$index] = explode("[stacktrace]", $value);

}

//$time = filemtime($sExLog);
print json_encode(['status' => 'ok', 'log' => array_reverse($aData)]);
print json_encode(['status' => 'ok', 'log' => array_reverse(array_values($aData))]);
exit;
}

Expand Down
1 change: 1 addition & 0 deletions Application/views/admin/devutils__footer.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
[{ oxscript }]

<script>
M.AutoInit();
var app = angular.module('devApp', ['ngClipboard'[{$smarty.capture.appdep}] ]);
app.filter("html", ['$sce', function ($sce)
{
Expand Down
23 changes: 18 additions & 5 deletions Application/views/admin/devutils_logs.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
<td><i class="material-icons left">thumb_down</i> nothing left...</td>
</tr>
<tr class="my" ng-repeat="_e in oxidlog.log |filter:search.oxidlog:false |limitTo:30 track by $index">
<td class="p" ng-bind-html="_e |highlight:search.oxidlog |html"></td>
<td class="p" ng-bind-html="_e[0] |highlight:search.oxidlog |html"></td>
<td><button ng-click="stacktrace(_e)" class="btn"><i class="material-icons">playlist_play</i></button></td>
</tr>
</table>
</div>
Expand Down Expand Up @@ -87,7 +88,19 @@
</lx-tab>
</lx-tabs>
-->

<div id="stacktrace" class="modal">
<div class="modal-content">
<b ng-bind-html="exceptionmsg[0] |highlight:search.oxidlog |html"></b>
<p ng-bind-html="exceptionmsg[1] |highlight:search.oxidlog |html"></p>
</div>
<div class="modal-footer">
<a href="#!" clip-copy="exceptionmsg[0] + exceptionmsg[1] + '&#10; OXID [{$oView->getShopVersion()}] [{$oView->getShopFullEdition()}]'" class="waves-effect waves-green btn-flat clipboard">
copy to clipboard
</a>
<a href="#!" class="modal-close waves-effect waves-green btn-flat">close</a>
</div>
</div>

<lx-dialog class="dialog dialog--xl" id="exceptionmsg" auto-close="true">
<div class="dialog__header">
<div class="toolbar bgc-light-blue-500 pl++">
Expand All @@ -110,8 +123,6 @@
</lx-dialog>
<script>
[{capture assign="ng"}]
$('.tabs').tabs();
$scope.dialogs = {};
$scope.search = {
'oxidlog':'',
Expand Down Expand Up @@ -148,6 +159,7 @@
{
if (res.data.status = 'ok')
{
console.log(res.data);
$scope.oxidlog = res.data;
//LxNotificationService.success('OXID Log loaded');
}
Expand All @@ -160,9 +172,10 @@
$scope.getOxidLog();
$scope.exceptionmsg = [];
$scope.exception = function (log)
$scope.stacktrace = function (log)
{
$scope.exceptionmsg = log;
$('#stacktrace').modal('open');
//$scope.exceptionmsg = $scope.exceptionlog[parseInt(i)];
//LxDialogService.open('exceptionmsg');
};
Expand Down
11 changes: 11 additions & 0 deletions Application/views/admin/devutils_translations.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@

[{if $error}]<h1>[{$error|var_dump}]</h1>[{/if}]

<div class="fixed-action-btn">
<a class="btn-floating waves-effect waves-light" title="neue Übersetzung hinzufügen" ng-click="newTranslation()">
<i class="material-icons">add</i>
</a>
</div>

<div class="row">
<div class="card p+ mt+ red white-text" ng-if="response" ng-bind="response"></div>
<table class="striped">
Expand Down Expand Up @@ -106,6 +112,11 @@
$scope.getAllTranslations();
$scope.edit = {};
$scope.newTranslation = function ()
{
$scope.edit = {};
$('#editmodal').modal('open');
};
$scope.editTranslation = function (translation)
{
$scope.edit = translation;
Expand Down

0 comments on commit ca9ef09

Please sign in to comment.