* Optimize code for review code.

This commit is contained in:
wangyuting2
2022-11-04 06:35:21 +00:00
parent 74c7882fc6
commit 0cefde5d28
18 changed files with 137 additions and 142 deletions
+11 -11
View File
@@ -29,37 +29,37 @@
</tr>
</thead>
<tbody>
<?php foreach($this->config->admin->module as $module => $options):?>
<?php if(strpos(",$disabledFeatures,", ",$module,") !== false) continue;?>
<?php foreach($config->featureGroup as $group => $features):?>
<?php if(strpos(",$disabledFeatures,", ",$group,") !== false) continue;?>
<?php $hasData = false;?>
<?php foreach($options as $option):?>
<?php $code = $module . ucfirst($option);?>
<?php foreach($features as $feature):?>
<?php $code = $group . ucfirst($feature);?>
<?php if(strpos(",$disabledFeatures,", ",$code,") !== false) continue;?>
<?php $hasData = true;?>
<?php endForeach;?>
<?php if($hasData):?>
<tr>
<td class='text-right'><?php echo $lang->admin->setModule->{$module};?></td>
<td class='text-right'><?php echo $lang->admin->setModule->{$group};?></td>
<td>
<?php foreach($options as $option):?>
<?php $code = $module . ucfirst($option);?>
<?php foreach($features as $feature):?>
<?php $code = $group. ucfirst($feature);?>
<?php if(strpos(",$disabledFeatures,", ",$code,") !== false) continue;?>
<?php if(strpos(",$closedFeatures,", ",$code,") !== false) continue;?>
<div class='group-item'>
<?php echo html::checkbox("module[{$code}]", array('1' => $lang->admin->setModule->{$option}), '1', "data-code='{$code}'", 'inline');?>
<?php echo html::checkbox("module[{$code}]", array('1' => $lang->admin->setModule->{$feature}), '1', "data-code='{$code}'", 'inline');?>
<?php echo html::hidden("module[{$code}][]", '1', 'disabled');?>
</div>
<?php endForeach;?>
</td>
<td>
<?php foreach($options as $option):?>
<?php $code = $module . ucfirst($option);?>
<?php foreach($features as $feature):?>
<?php $code = $group . ucfirst($feature);?>
<?php if(strpos(",$disabledFeatures,", ",$code,") !== false) continue;?>
<?php if(strpos(",$closedFeatures,", ",$code,") === false) continue;?>
<div class='group-item'>
<?php echo html::checkbox("module[{$code}]", array('1' => $lang->admin->setModule->{$option}), '0', "data-code='{$code}'", 'inline');?>
<?php echo html::checkbox("module[{$code}]", array('1' => $lang->admin->setModule->{$feature}), '0', "data-code='{$code}'", 'inline');?>
<?php echo html::hidden("module[{$code}][]", '0');?>
</div>
<?php endForeach;?>