Skip to content

Commit

Permalink
Merge pull request #49 from gaertnermarkus/master
Browse files Browse the repository at this point in the history
WIP: updating checkconsistency frontend
  • Loading branch information
keywan-ghadami-oxid authored Jan 3, 2019
2 parents 8d46061 + 7016a0e commit 0acb8a5
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 233 deletions.
8 changes: 2 additions & 6 deletions Controller/CheckConsistency.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use OxidEsales\Eshop\Core\Module\ModuleList as ModuleList;
use OxidEsales\Eshop\Core\Module\Module as Module;
use OxidEsales\Eshop\Core\SeoEncoder;
use OxidCommunity\ModuleInternals\Core\InternalModule;
use OxidEsales\Eshop\Core\Request;

class CheckConsistency extends \OxidEsales\Eshop\Application\Controller\FrontendController
{
Expand All @@ -24,7 +24,7 @@ public function init()
$oConfig = Registry::get(Config::class);

$redirectUrl = $oConfig->getShopUrl();
$sKey = $oConfig->getRequestParameter('key');
$sKey = Registry::get(Request::class)('key');

//todo: add Exeception / Logging
if((bool)$oConfig->getConfigParam('blACActiveCompleteCheck') == false )
Expand Down Expand Up @@ -54,7 +54,6 @@ public function render()
foreach($aModules as $sModId => $sTitle)
{
$oModule->load($sModId);

$aModule = $oModule->checkState($sTitle);

$aModuleChecks[$sModId] = $aModule;
Expand All @@ -78,7 +77,6 @@ public function render()
*/
protected function _getActiveModules(array $aDisabledModules, array $aModulePaths)
{

$oConfig = Registry::get(Config::class);
$aModulePaths = array_flip($aModulePaths);
$aActiveModules = array_diff($aModulePaths,$aDisabledModules);
Expand Down Expand Up @@ -116,6 +114,4 @@ protected function _getActiveModules(array $aDisabledModules, array $aModulePath

return $aActiveModules;
}


}
315 changes: 88 additions & 227 deletions views/flow/tpl/checkconsistency.tpl
Original file line number Diff line number Diff line change
@@ -1,245 +1,106 @@
<html>

<body>
<style>
span.state.sok {color:green;}
span.state.swarning {color:orange;}
span.state.serror {color:red;}
span.state.sfatalm {color:red;text-decoration:line-through;}
span.state.sfatals {color:red;text-decoration:underline;}
button.fix {position: absolute;top:0; right: 0;}
.actions i {margin-right:20px;display:inline_blocks;}
h3 {
font-size: 14px;
font-weight: bold;
margin: 7px 0 10px 0;
padding-top: 7px;
border-top: 1px solid #ddd;
}
.actions{border-top: 1px solid #ddd;background: #eee;}
.checks:nth-of-type(even){
background: #eee;
}
</style>
[{foreach from=$aModules key=ModulId item=ModId}]
<div class="checks">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Pragma" content="no-cache">
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
</head>

<h2>[{oxmultilang ident="AC_MI_MODULE"}]: [{$ModId.title}]</h2>
[{if $ModId.aVersions|@count > 0}]
<div style="position: relative;">
<h3>[{oxmultilang ident="AC_MI_VERSION"}]:</h3>
[{assign var="_ok" value=1}]
[{foreach from=$ModId.aVersions key=sVersion item=iState}]
<span class="state [{$sState.$iState}]">[{$sVersion}]</span>
[{if $iState < 1 && $iState != -2 }][{assign var="_ok" value=0}][{/if}]
[{/foreach}]
[{*if !$_ok}]
<button class="fix" onclick="module_internals_fix('fix_version')">[{oxmultilang ident="AC_MI_FIXBTN"}]</button>
[{/if*}]
<br>
</div>
[{/if}]
<body>
<style>
span.state.sok {color:green;}
span.state.swarning {color:orange;}
span.state.serror {color:red;}
span.state.sfatalm {color:red;text-decoration:line-through;}
span.state.sfatals {color:red;text-decoration:underline;}
button.fix {position: absolute;top:0; right: 0;}
.actions i {margin-right:20px;display:inline_blocks;}
h3 {
font-size: 14px;
font-weight: bold;
margin: 7px 0 10px 0;
padding-top: 7px;
border-top: 1px solid #ddd;
}
.actions{border-top: 1px solid #ddd;background: #eee;}
.checks:nth-of-type(even){
background: #eee;
}
</style>
[{foreach from=$aModules key=ModulId item=ModId}]
<div class="checks">
<h2>[{oxmultilang ident="AC_MI_MODULE"}]: [{$ModId.title}]</h2>
[{if $aControllers|@count > 0}]
<div style="position: relative;">
<h3>[{oxmultilang ident="AC_MI_CONTROLLER"}]:</h3>
<table>
[{assign var="_ok" value=1}]
[{foreach from=$aControllers key=sClass item=aModules}]
<tr>
<td style="vertical-align: top;"><b>[{$sClass}]</b></td>
<td>
[{foreach from=$aModules key=sModule item=iState}]
<span class="state [{$sState.$iState}]">[{$sModule}]</span>
[{if $iState < 1 && $iState != -2 }][{assign var="_ok" value=0}][{/if}]
[{/foreach}]
</td>
</tr>
[{/foreach}]
</table>
[{*if !$_ok}]
<button class="fix" onclick="module_internals_fix('fix_extend')">[{oxmultilang ident="AC_MI_FIXBTN"}]</button>
[{/if*}]
<br>
</div>
[{/if}]
[{include file="items.tpl" title="AC_MI_VERSION" items=$ModId.aVersions}]
[{include file="items.tpl" title="AC_MI_CONTROLLER" items=$ModId.aControllers}]
[{if $ModId.aExtended|@count > 0}]
<div style="position: relative;">
<h3>[{oxmultilang ident="AC_MI_EXTEND"}]:</h3>
<table>
[{assign var="_ok" value=1}]
[{foreach from=$ModId.aExtended key=sClass item=aModules}]
<tr>
<td style="vertical-align: top;"><b>[{$sClass}]</b></td>
<td>
[{foreach from=$aModules key=sModule item=iState}]
<span class="state [{$sState.$iState}]">[{$sModule}]</span>
[{if $iState < 1 && $iState != -2 }][{assign var="_ok" value=0}][{/if}]
[{/foreach}]
</td>
</tr>
[{/foreach}]
</table>
[{*if !$_ok}]
<button class="fix" onclick="module_internals_fix('fix_extend')">[{oxmultilang ident="AC_MI_FIXBTN"}]</button>
[{/if*}]
<br>
</div>
[{/if}]
[{include file="items.tpl" title="AC_MI_EXTEND" items=$ModId.aExtended}]
[{if $ModId.aFiles|@count > 0}]
<div style="position: relative;">
<h3>[{oxmultilang ident="AC_MI_FILES"}]:</h3>
<table>
[{assign var="_ok" value=1}]
[{foreach from=$ModId.aFiles key=sClass item=aFiles}]
<tr>
<td style="vertical-align: top;"><b>[{$sClass}]</b></td>
<td>
[{foreach from=$aFiles key=sFile item=iState}]
<span class="state [{$sState.$iState}]">[{$sFile}]</span>
[{if $iState < 1 && $iState != -2 }][{assign var="_ok" value=0}][{/if}]
[{/foreach}]
</td>
</tr>
[{/foreach}]
</table>
[{*if !$_ok}]
<button class="fix" onclick="module_internals_fix('fix_files')">[{oxmultilang ident="AC_MI_FIXBTN"}]</button>
[{/if*}]
<br>
</div>
[{/if}]
[{include file="items.tpl" title="AC_MI_FILES" items=$ModId.aFiles}]
[{if $ModId.aBlocks|@count > 0}]
<div style="position: relative;">
<h3>[{oxmultilang ident="AC_MI_BLOCKS"}]:</h3>
<table>
[{assign var="_ok" value=1}]
[{foreach from=$ModId.aBlocks key=sTemplate item=aFiles}]
<tr>
[{assign var="_tstate" value=1}]
[{foreach from=$aFiles key=sFile item=aStates}]
[{if $aStates.template < $_tstate}]
[{assign var="_tstate" value=$aStates.template}]
[{/if}]
[{if $ModId.aBlocks|@count > 0}]
<div style="position: relative;">
<h3>[{oxmultilang ident="AC_MI_BLOCKS"}]</h3>
<table class="box">
<tr><th>Active</th><th>Template</th><th>Blockname</th><th>File</th></tr>
[{foreach from=$ModId.aBlocks item=i}]
<tr>
<td style="width:20px;" class="[{if $i.active}]active[{/if}]">[{$i.active}]</td>
<td><span class="state [{$i.t_state}]">[{$i.template}]</span></td>
<td><span class="state [{$i.b_state}]">[{$i.block}]</span></td>
<td>
<div>
<span class="state [{$i.state}]">[{$i.file}]</span>
</div>
</td>
<td>
[{* no action
<button onclick="module_internals_fix('block','[{$i.id}]')">
[{if $i.active}]
[{oxmultilang ident="AC_MI_DEACTIVATEBTN"}]
[{else}]
[{oxmultilang ident="AC_MI_ACTIVATEBTN"}]
[{/if}]
</button>
*}]
</td>
</tr>
[{/foreach}]
<td style="vertical-align: top;"><b><span class="state [{$sState.$_tstate}]">[{$sTemplate}]</span></b></td>
<td>
[{foreach from=$aFiles key=sFile item=aStates}]
[{assign var="_state" value=$aStates.file}]
<div>
<span class="state [{$sState.$_state}]">[{$sFile}]</span>
[{if $_state < 1 && $_state != -2 }][{assign var="_ok" value=0}][{/if}]
</div>
[{/foreach}]
</td>
</tr>
[{/foreach}]
</table>
[{*if !$_ok}]
<button class="fix" onclick="module_internals_fix('fix_blocks')">[{oxmultilang ident="AC_MI_FIXBTN"}]</button>
[{/if*}]
<br>
</div>
[{/if}]
</table>
<br>
</div>
[{/if}]
[{if $ModId.aTemplates|@count > 0}]
<div style="position: relative;">
<h3>[{oxmultilang ident="AC_MI_TEMPLATES"}]:</h3>
<table>
[{assign var="_ok" value=1}]
[{foreach from=$ModId.aTemplates key=sTemplate item=aFiles}]
<tr>
<td style="vertical-align: top;"><b>[{$sTemplate}]</b></td>
<td>
[{foreach from=$aFiles key=sFile item=iState}]
<span class="state [{$sState.$iState}]">[{$sFile}]</span>
[{if $iState < 1 && $iState != -2 }][{assign var="_ok" value=0}][{/if}]
[{/foreach}]
</td>
</tr>
[{/foreach}]
</table>
[{*if !$_ok}]
<button class="fix" onclick="module_internals_fix('fix_templates')">[{oxmultilang ident="AC_MI_FIXBTN"}]</button>
[{/if*}]
<br>
</div>
[{/if}]
[{include file="items.tpl" title="AC_MI_TEMPLATES" items=$ModId.aTemplates}]
[{if $ModId.aSettings|@count > 0}]
<div style="position: relative;">
<h3>[{oxmultilang ident="AC_MI_SETTINGS"}]:</h3>
<table>
[{assign var="_ok" value=1}]
[{foreach from=$ModId.aSettings key=sName item=iState}]
<tr>
<td style="vertical-align: top;"><b>[{$sName}]</b></td>
<td>
<div>
<span class="state [{$sState.$iState}]">[{$sName}]</span>
[{if $iState < 1 && $iState != -2 }][{assign var="_ok" value=0}][{/if}]
</div>
</td>
</tr>
[{/foreach}]
</table>
[{*if !$_ok}]
<button class="fix" onclick="module_internals_fix('fix_settings')">[{oxmultilang ident="AC_MI_FIXBTN"}]</button>
[{/if*}]
<br>
</div>
[{/if}]
[{include file="items.tpl" title="AC_MI_SETTINGS" items=$ModId.aSettings}]
[{if $ModId.aEvents|@count > 0}]
<div style="position: relative;">
<h3>[{oxmultilang ident="AC_MI_EVENTS"}]:</h3>
<table>
[{assign var="_ok" value=1}]
[{foreach from=$ModId.aEvents key=sEvent item=aCallbacks}]
<tr>
<td style="vertical-align: top;"><b>[{$sEvent}]</b></td>
<td>
[{foreach from=$aCallbacks key=sCallback item=iState}]
<span class="state [{$sState.$iState}]">[{$sCallback}]</span>
[{if $iState < 1 && $iState != -2 }][{assign var="_ok" value=0}][{/if}]
[{/foreach}]
</td>
</tr>
[{/foreach}]
</table>
[{*if !$_ok}]
<button class="fix" onclick="module_internals_fix('fix_events')">[{oxmultilang ident="AC_MI_FIXBTN"}]</button>
[{/if*}]
<br>
[{include file="items.tpl" title="AC_MI_EVENTS" items=$ModId.aEvents}]
[{if $ModId.aEvents|@count == 0
&& $ModId.aSettings|@count == 0
&& $ModId.aControllers|@count == 0
&& $ModId.aTemplates|@count == 0
&& $ModId.aBlocks|@count == 0
&& $ModId.aFiles|@count == 0
&& $ModId.aExtended|@count == 0
&& $ModId.aVersions|@count == 0
}]
-
[{/if}]
</div>
[{/if}]
[{/foreach}]
[{if $ModId.aEvents|@count == 0
&& $ModId.aSettings|@count == 0
&& $ModId.aControllers|@count == 0
&& $ModId.aTemplates|@count == 0
&& $ModId.aBlocks|@count == 0
&& $ModId.aFiles|@count == 0
&& $ModId.aExtended|@count == 0
&& $ModId.aVersions|@count == 0
}]
-
[{/if}]
<div class="actions">
<b>[{oxmultilang ident="AC_LEGEND"}] : </b>
<span class="state sok">[{oxmultilang ident="AC_STATE_OK"}]</span> <i>[{oxmultilang ident="AC_STATE_OK_LABEL"}]</i>
<span class="state swarning">[{oxmultilang ident="AC_STATE_WA"}]</span> <i>[{oxmultilang ident="AC_STATE_WA_LABEL"}]</i>
<span class="state serror">[{oxmultilang ident="AC_STATE_ER"}]</span> <i>[{oxmultilang ident="AC_STATE_ER_LABEL"}]</i>
<span class="state sfatalm">[{oxmultilang ident="AC_STATE_FM"}]</span> <i>[{oxmultilang ident="AC_STATE_FM_LABEL"}]</i>
<span class="state sfatals">[{oxmultilang ident="AC_STATE_FS"}]</span> <i>[{oxmultilang ident="AC_STATE_FS_LABEL"}]</i>
</div>
[{/foreach}]
<div class="actions">
<b>[{oxmultilang ident="AC_LEGEND"}] : </b>
<span class="state sok">[{oxmultilang ident="AC_STATE_OK"}]</span> <i>[{oxmultilang ident="AC_STATE_OK_LABEL"}]</i>
<span class="state swarning">[{oxmultilang ident="AC_STATE_WA"}]</span> <i>[{oxmultilang ident="AC_STATE_WA_LABEL"}]</i>
<span class="state serror">[{oxmultilang ident="AC_STATE_ER"}]</span> <i>[{oxmultilang ident="AC_STATE_ER_LABEL"}]</i>
<span class="state sfatalm">[{oxmultilang ident="AC_STATE_FM"}]</span> <i>[{oxmultilang ident="AC_STATE_FM_LABEL"}]</i>
<span class="state sfatals">[{oxmultilang ident="AC_STATE_FS"}]</span> <i>[{oxmultilang ident="AC_STATE_FS_LABEL"}]</i>
</div>
</body>
</html>

0 comments on commit 0acb8a5

Please sign in to comment.