fix code style

This commit is contained in:
thanatos
2021-09-23 15:05:22 +08:00
parent 1787e7a86c
commit ec628d33f1
+12 -27
View File
@@ -34,24 +34,14 @@
<div id="mainContent" class="main-content">
<div class='center-block'>
<div class='main-header'>
<?php if($edit): ?>
<h2>
<span class='label label-id'><?php echo $api->id;?></span>
<?php echo html::a($this->createLink('api', 'index', "libID=0&moduleID=0&apiID=$api->id"), $api->title, '', "title='$api->title'");?>
<small> <?php echo $lang->arrow . ' ' . $lang->api->edit;?></small>
</h2>
<div
class='pull-right'><?php echo html::a('###', $lang->save, '', 'id="top-submit" class="btn btn-primary"');?></div>
<?php else: ?>
<h2><?php echo $lang->api->create; ?></h2>
<?php endif;?>
</div>
<form class="load-indicator main-form form-ajax" id="dataform" method='post' enctype='multipart/form-data'>
<table class='table table-form'>
<tbody>
<tr>
<th class='w-110px'><?php echo $lang->api->lib; ?></th>
<td> <?php echo html::select('lib', $libs, $api->lib ? $api->lib : $libID, "class='form-control chosen' onchange=loadDocModule(this.value)"); ?> </td>
<td> <?php echo html::select('lib', $libs, $libID, "class='form-control chosen' onchange=loadDocModule(this.value)"); ?> </td>
<td></td>
</tr>
<tr>
@@ -85,12 +75,12 @@
<th><?php echo $lang->api->requestType; ?></th>
<td>
<span
id='moduleBox'><?php echo html::select('requestType', $lang->api->requestTypeOptions, $api->requestType ? $api->requestType : 'application/json', "class='form-control chosen'"); ?></span>
id='moduleBox'><?php echo html::select('requestType', $lang->api->requestTypeOptions, 'application/json', "class='form-control chosen'"); ?></span>
</td>
</tr>
<tr>
<th><?php echo $lang->api->status; ?></th>
<td><?php echo html::radio('status', $lang->api->statusOptions, $api->status ? $api->status : apiModel::STATUS_DOING); ?></td>
<td><?php echo html::radio('status', $lang->api->statusOptions, apiModel::STATUS_DOING); ?></td>
</tr>
<tr>
<th>
@@ -98,17 +88,13 @@
</th>
<td>
<div class='input-group'>
<?php echo html::select('owner', $allUsers, $api->owner ? $api->owner : $user, "class='form-control chosen'"); ?>
<?php echo html::select('owner', $allUsers, $user, "class='form-control chosen'"); ?>
</div>
</td>
</tr>
<tr>
<th><?php echo $lang->api->params; ?></th>
<td colspan='2' id='paramDiv'>
<?php
$params = $api->params ? $api->params : ['']
?>
<?php foreach($params as $param):?>
<div class="row row-no-gutters col-custom">
<div class='col-md-3 col-lg-2'>
<div class="table-row">
@@ -148,13 +134,13 @@
<div class='col-md-3 col-lg-2'>
<div class="table-row">
<span class='input-group-addon w-60px'><?php echo $lang->api->default; ?></span>
<?php echo html::input('params[0][default]', $param->default, "class='form-control'"); ?>
<?php echo html::input('params[0][default]', '', "class='form-control'"); ?>
</div>
</div>
<div class='col-md-3 col-lg-2'>
<div class="table-row">
<span class='input-group-addon w-50px'><?php echo $lang->api->desc; ?></span>
<?php echo html::textarea('params[0][desc]', $param->desc, "class='form-control' style='height:32px'"); ?>
<?php echo html::textarea('params[0][desc]', '', "class='form-control' style='height:32px'"); ?>
</div>
</div>
<div class='col-md-3 col-lg-2'>
@@ -163,7 +149,6 @@
<span class='input-group-addon w-40px'><a onclick='deleteItem(this)'><i class='icon icon-close'></i></a></span>
</div>
</div>
<?php endforeach;?>
</td>
</tr>
<tr>
@@ -173,27 +158,27 @@
<div class='col-md-3 col-lg-2'>
<div class="table-row">
<span class='input-group-addon w-50px'><?php echo $lang->api->res->name; ?></span>
<?php echo html::input("response[name]", $api->response['name'], "class='form-control'"); ?>
<?php echo html::input("response[name]", '', "class='form-control'"); ?>
</div>
</div>
<div class='col-md-3 col-lg-2'>
<div class="table-row">
<span class='input-group-addon w-50px'><?php echo $lang->api->res->desc; ?></span>
<?php echo html::input("response[desc]", $api->response['desc'], "class='form-control'"); ?>
<?php echo html::input("response[desc]", '', "class='form-control'"); ?>
</div>
</div>
<div class='col-md-3 col-lg-2'>
<div class="table-row">
<span
class='input-group-addon w-50px'><?php echo $lang->api->res->type; ?></span>
<?php echo html::select('response[type]', $lang->api->allParamsTypeOptions, $api->response['type'], "class='form-control' onchange='changeType(this);'"); ?>
<?php echo html::select('response[type]', $lang->api->allParamsTypeOptions, '', "class='form-control' onchange='changeType(this);'"); ?>
</div>
</div>
<div
class='col-md-3 col-lg-2 typeCustom <?php echo $api->response['type'] == apiModel::PARAMS_TYPE_CUSTOM ? '' : 'hidden' ?>'>
class="col-md-3 col-lg-2 typeCustom hidden">
<div class="table-row">
<input type="hidden" class="custom" name="response[custom]"
value="<?php echo htmlspecialchars($api->response['custom']) ?>">
value="">
<button type="button" data-toggle="modal" data-target="#customType"
class="btn btn-wide customType" style="width: 80px;background: #eee">
<?php echo $lang->api->customType ?>
@@ -207,7 +192,7 @@
<th><?php echo $lang->api->desc; ?></th>
<td colspan='2'>
<div
class='contenthtml'><?php echo html::textarea('desc', $api->desc, "style='width:100%;height:200px'"); ?></div>
class='contenthtml'><?php echo html::textarea('desc', '', "style='width:100%;height:200px'"); ?></div>
</td>
</tr>
<tr>