* Code for task #90971.

This commit is contained in:
caoyanyi
2023-04-10 16:13:54 +08:00
parent 18a60f895c
commit e164c7be4d
6 changed files with 52 additions and 0 deletions

View File

@@ -169,12 +169,32 @@ class api extends control
$this->view->actions = $apiID ? $this->action->getList('api', $apiID) : array();
}
/* Crumbs links array. */
$lib = zget($libs, $libID);
$type = $lib->product ? 'product' : ($lib->project ? 'project' : 'unlink');
$methodName = $type != 'unlink' ? $type . 'Space' : 'index';
if($this->app->tab == 'doc') $methodName = 'index';
$linkObject = zget($lib, $type, 0);
$linkParams = "libID=$lib->id";
if($methodName != 'index') $linkParams = "objectID=$linkObject&$linkParams";
$crumbs[] = html::a(inLink($methodName, $linkParams), html::image("static/svg/interface.svg") . $lib->name);
$moduleList = $this->loadModel('tree')->getParents($api->module);
foreach($moduleList as $module)
{
$linkParams .= "&moduleID=$module->id";
$crumbs[] = html::a(inLink($methodName, $linkParams), $module->name);
}
$this->view->title = $this->lang->api->pageTitle;
$this->view->libs = $libs;
$this->view->isRelease = $release > 0;
$this->view->release = $release;
$this->view->libID = $libID;
$this->view->apiID = $apiID;
$this->view->crumbs = $crumbs;
$this->view->users = $this->user->getPairs('noclosed,noletter');
$this->view->moduleTree = $this->doc->getApiModuleTree($libID, $apiID, $release, $moduleID);
$this->view->objectDropdown = $this->generateLibsDropMenu($libs[$libID], $release);

View File

@@ -159,3 +159,7 @@ form .table-data, #content .table-data {border: 1px solid #e2e2e3;}
.paramsTable th {text-align: left!important; font-size: 14px;}
.paramsTable td {text-align: left;}
.info .version, .info .crumbs {float: left;}
.info .crumbs {font-size: 13px; margin-top: 5px; font-weight: normal;}
.info .crumbs img {margin-right: 3px;}

View File

@@ -20,6 +20,7 @@
</ul>
</div>
</div>
<div class="crumbs"><?php echo implode(' > ', $crumbs);?></div>
</div>
<div class="actions">
<?php echo html::a("javascript:fullScreen()", '<span class="icon-fullscreen"></span>', '', "title='{$lang->fullscreen}' class='btn btn-link fullscreen-btn'");?>

View File

@@ -1218,6 +1218,27 @@ class doc extends control
$doc = $docID ? $doc : '';
$spaceType = $objectType . 'Space';
/* Crumbs links array. */
$methodName = in_array($type, array('product', 'project')) ? $objectType . 'Space' : 'tableContents';
$linkObject = zget($lib, $type, 0);
if($this->app->tab == 'execution' and $objectType == 'execution') $linkObject = zget($lib, 'execution', 0);
$linkParams = "objectID=$linkObject&libID=$lib->id";
if($this->app->tab == 'execution' or $objectType == 'custom')
{
$linkParams = "objectType=$objectType&$linkParams";
$methodName = 'tableContents';
}
$crumbs[] = html::a(inLink($methodName, $linkParams), html::image("static/svg/wiki-file-lib.svg") . $lib->name);
$moduleList = $this->loadModel('tree')->getParents($doc->module);
foreach($moduleList as $module)
{
$linkParams .= "&moduleID=$module->id";
$crumbs[] = html::a(inLink($methodName, $linkParams), $module->name);
}
$this->view->title = isset($this->lang->doc->{$spaceType}) ? $this->lang->doc->{$spaceType} : $this->lang->doc->common;
$this->view->docID = $docID;
$this->view->doc = $doc;
@@ -1227,6 +1248,7 @@ class doc extends control
$this->view->objectType = $objectType;
$this->view->type = $type;
$this->view->libID = $libID;
$this->view->crumbs = $crumbs;
$this->view->lib = isset($libs[$libID]) ? $libs[$libID] : new stdclass();
$this->view->libs = $this->doc->getLibsByObject($type, $objectID);
$this->view->canBeChanged = common::canModify($type, $object); // Determines whether an object is editable.

View File

@@ -56,3 +56,7 @@
.flex-content > #history {flex: 0 0 302px; position: relative;}
.flex-content > #history > #closeIcon {position: absolute; right: 10px; top: 10px;}
.panel {margin-bottom: 0;}
.info .version, .info .crumbs {float: left;}
.info .crumbs {font-size: 13px; margin-top: 5px; font-weight: normal;}
.info .crumbs img {margin-right: 3px;}

View File

@@ -28,6 +28,7 @@
</div>
<div class="user"></div>
<div class="time"></div>
<div class="crumbs"><?php echo implode(' > ', $crumbs);?></div>
</div>
<div class="actions">
<span class='text'><?php echo$lang->doc->diff?></span>