finish api release.
This commit is contained in:
+140
-128
@@ -17,10 +17,10 @@
|
||||
<ul class='dropdown-menu api-version-menu'
|
||||
style='max-height:240px; max-width: 300px; overflow-y:auto'>
|
||||
<?php for($version = $api->version; $version > 0; $version--):?>
|
||||
<li>
|
||||
<a href='javascript:void(0)'
|
||||
data-url='<?php echo $this->createLink('api', 'index', "libID=0&moduleID=0&apiID=$apiID&version=$version");?>'>#<?php echo $version;?></a>
|
||||
</li>
|
||||
<li>
|
||||
<a href='javascript:void(0)'
|
||||
data-url='<?php echo $this->createLink('api', 'index', "libID=0&moduleID=0&apiID=$apiID&version=$version");?>'>#<?php echo $version;?></a>
|
||||
</li>
|
||||
<?php endfor;?>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -35,7 +35,7 @@
|
||||
$deleteURL = $this->createLink('api', 'delete', "apiID=$api->id&confirm=yes");
|
||||
echo html::a("javascript:ajaxDeleteApi(\"$deleteURL\", confirmDelete)", '<i class="icon-trash"></i>', '', "title='{$lang->api->delete}' class='btn btn-link'");
|
||||
}
|
||||
;?>
|
||||
;?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -43,121 +43,133 @@
|
||||
<h2 class="title" title="<?php echo $api->title;?>"><?php echo $api->title;?></h2>
|
||||
<div class="desc"><?php echo $api->desc;?></div>
|
||||
<?php if($api->params['header']):?>
|
||||
<h3 class="title"><?php echo $lang->api->header;?></h3>
|
||||
<table class="table table-data paramsTable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo $lang->api->req->name;?></th>
|
||||
<th><?php echo $lang->api->req->type;?></th>
|
||||
<th><?php echo $lang->api->req->required;?></th>
|
||||
<th><?php echo $lang->api->req->desc;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($api->params['header'] as $param):?>
|
||||
<tr>
|
||||
<td><?php echo $param['field'];?></td>
|
||||
<td>
|
||||
String
|
||||
</td>
|
||||
<td><?php echo $param['required'] ? '是' : '否';?></td>
|
||||
<td><?php echo $param['desc'];?></td>
|
||||
<tr>
|
||||
<?php endforeach;
|
||||
;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3 class="title"><?php echo $lang->api->header;?></h3>
|
||||
<table class="table table-data paramsTable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo $lang->api->req->name;?></th>
|
||||
<th><?php echo $lang->api->req->type;?></th>
|
||||
<th><?php echo $lang->api->req->required;?></th>
|
||||
<th><?php echo $lang->api->req->desc;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($api->params['header'] as $param):?>
|
||||
<tr>
|
||||
<td><?php echo $param['field'];?></td>
|
||||
<td>
|
||||
String
|
||||
</td>
|
||||
<td><?php echo $param['required'] ? '是' : '否';?></td>
|
||||
<td><?php echo $param['desc'];?></td>
|
||||
<tr>
|
||||
<?php endforeach;
|
||||
;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php endif;?>
|
||||
<?php if($api->params['query']):?>
|
||||
<h3 class="title"><?php echo $lang->api->query;?></h3>
|
||||
<table class="table table-data paramsTable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo $lang->api->req->name;?></th>
|
||||
<th><?php echo $lang->api->req->type;?></th>
|
||||
<th><?php echo $lang->api->req->required;?></th>
|
||||
<th><?php echo $lang->api->req->desc;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($api->params['query'] as $param):?>
|
||||
<tr>
|
||||
<td><?php echo $param['field'];?></td>
|
||||
<td>
|
||||
String
|
||||
</td>
|
||||
<td><?php echo $param['required'] ? '是' : '否';?></td>
|
||||
<td><?php echo $param['desc'];?></td>
|
||||
<tr>
|
||||
<?php endforeach;
|
||||
;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3 class="title"><?php echo $lang->api->query;?></h3>
|
||||
<table class="table table-data paramsTable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo $lang->api->req->name;?></th>
|
||||
<th><?php echo $lang->api->req->type;?></th>
|
||||
<th><?php echo $lang->api->req->required;?></th>
|
||||
<th><?php echo $lang->api->req->desc;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($api->params['query'] as $param):?>
|
||||
<tr>
|
||||
<td><?php echo $param['field'];?></td>
|
||||
<td>
|
||||
String
|
||||
</td>
|
||||
<td><?php echo $param['required'] ? '是' : '否';?></td>
|
||||
<td><?php echo $param['desc'];?></td>
|
||||
<tr>
|
||||
<?php endforeach;
|
||||
;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php endif;?>
|
||||
<?php
|
||||
function parseTree($data) {
|
||||
$str = '<tr>';
|
||||
$str .= '<td>'. $data['field'] .'</td>';
|
||||
$str .= '<td>'. $data['paramsType'] .'</td>';
|
||||
function parseTree($data, $level = 0)
|
||||
{
|
||||
$str = '<tr>';
|
||||
$field = '';
|
||||
for($i=0; $i < $level; $i++)
|
||||
{
|
||||
$field .= ' ';
|
||||
}
|
||||
$field .= $data['field'];
|
||||
$str .= '<td>' . $field . '</td>';
|
||||
$str .= '<td>' . $data['paramsType'] . '</td>';
|
||||
$require = $data['required'] ? '是' : '否';
|
||||
$str .= '<td>'. $require .'</td>';
|
||||
$str .= '<td>'. $data['desc'] .'</td>';
|
||||
$str .= '</tr>';
|
||||
if(isset($data['children']) && count($data['children']) > 0) {
|
||||
foreach($data['children'] as $item) {
|
||||
$str .= parseTree($item);
|
||||
$str .= '<td>' . $require . '</td>';
|
||||
$str .= '<td>' . $data['desc'] . '</td>';
|
||||
$str .= '</tr>';
|
||||
if(isset($data['children']) && count($data['children']) > 0)
|
||||
{
|
||||
$level++;
|
||||
foreach($data['children'] as $item)
|
||||
{
|
||||
$str .= parseTree($item, $level);
|
||||
}
|
||||
}
|
||||
return $str;
|
||||
}
|
||||
?>
|
||||
<?php if($api->params['params']):?>
|
||||
<h3 class="title"><?php echo $lang->api->params;?></h3>
|
||||
<table class="table table-data paramsTable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo $lang->api->req->name;?></th>
|
||||
<th><?php echo $lang->api->req->type;?></th>
|
||||
<th><?php echo $lang->api->req->required;?></th>
|
||||
<th><?php echo $lang->api->req->desc;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
foreach($api->params['params'] as $item) {
|
||||
echo parseTree($item);
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3 class="title"><?php echo $lang->api->params;?></h3>
|
||||
<table class="table table-data paramsTable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo $lang->api->req->name;?></th>
|
||||
<th><?php echo $lang->api->req->type;?></th>
|
||||
<th><?php echo $lang->api->req->required;?></th>
|
||||
<th><?php echo $lang->api->req->desc;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
foreach($api->params['params'] as $item)
|
||||
{
|
||||
echo parseTree($item);
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php endif;?>
|
||||
<?php if($api->paramsExample):?>
|
||||
<h3 class="title"><?php echo $lang->api->paramsExample;?></h3>
|
||||
<pre><code><?php echo $api->paramsExample;?></code></pre>
|
||||
<h3 class="title"><?php echo $lang->api->paramsExample;?></h3>
|
||||
<pre><code><?php echo $api->paramsExample;?></code></pre>
|
||||
<?php endif;?>
|
||||
<?php if($api->response):?>
|
||||
<h3 class="title"><?php echo $lang->api->response;?></h3>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo $lang->api->req->name;?></th>
|
||||
<th><?php echo $lang->api->req->type;?></th>
|
||||
<th><?php echo $lang->api->req->required;?></th>
|
||||
<th><?php echo $lang->api->req->desc;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
foreach($api->response as $item) {
|
||||
echo parseTree($item);
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3 class="title"><?php echo $lang->api->response;?></h3>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo $lang->api->req->name;?></th>
|
||||
<th><?php echo $lang->api->req->type;?></th>
|
||||
<th><?php echo $lang->api->req->required;?></th>
|
||||
<th><?php echo $lang->api->req->desc;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
foreach($api->response as $item)
|
||||
{
|
||||
echo parseTree($item);
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php endif;?>
|
||||
<?php if($api->responseExample):?>
|
||||
<h3><?php echo $lang->api->responseExample;?></h3>
|
||||
<pre><code><?php echo $api->responseExample;?></code></pre>
|
||||
<h3><?php echo $lang->api->responseExample;?></h3>
|
||||
<pre><code><?php echo $api->responseExample;?></code></pre>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -166,7 +178,7 @@
|
||||
<?php
|
||||
$canBeChanged = common::canBeChanged('api', $api);
|
||||
if($canBeChanged) $actionFormLink = $this->createLink('action', 'comment', "objectType=doc&objectID=$api->id");
|
||||
;?>
|
||||
;?>
|
||||
<?php include '../../common/view/action.html.php';?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -180,30 +192,30 @@
|
||||
<div class="detail-content">
|
||||
<table class="table table-data">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th class='c-lib'><?php echo $lang->api->lib;?></th>
|
||||
<td><?php echo $api->libName;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->doc->module;?></th>
|
||||
<td><?php echo $api->moduleName ? $api->moduleName : '/';?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->doc->addedDate;?></th>
|
||||
<td><?php echo $api->addedDate;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->api->owner;?></th>
|
||||
<td><?php echo zget($users, $api->owner, '');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->doc->editedBy;?></th>
|
||||
<td><?php echo zget($users, $api->editedBy, '');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->doc->editedDate;?></th>
|
||||
<td><?php echo $api->editedDate;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='c-lib'><?php echo $lang->api->lib;?></th>
|
||||
<td><?php echo $api->libName;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->doc->module;?></th>
|
||||
<td><?php echo $api->moduleName ? $api->moduleName : '/';?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->doc->addedDate;?></th>
|
||||
<td><?php echo $api->addedDate;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->api->owner;?></th>
|
||||
<td><?php echo zget($users, $api->owner, '');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->doc->editedBy;?></th>
|
||||
<td><?php echo zget($users, $api->editedBy, '');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->doc->editedDate;?></th>
|
||||
<td><?php echo $api->editedDate;?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user