* Modify api view page style.
This commit is contained in:
+14
-12
@@ -224,24 +224,26 @@ $filter->doc->default->cookie['from'] = 'code';
|
||||
$filter->doc->default->cookie['product'] = 'int';
|
||||
$filter->doc->default->cookie['preProductID'] = 'int';
|
||||
$filter->doc->default->cookie['lastProject'] = 'int';
|
||||
$filter->doc->default->cookie['docSpaceParam'] = 'string';
|
||||
$filter->doc->showfiles->cookie['docFilesViewType'] = 'code';
|
||||
$filter->doc->tablecontents->cookie['preProductID'] = 'int';
|
||||
$filter->doc->tablecontents->cookie['preBranch'] = 'reg::word';
|
||||
$filter->doc->productspace->cookie['pagerDocTablecontents'] = 'int';
|
||||
$filter->doc->projectspace->cookie['pagerDocTablecontents'] = 'int';
|
||||
|
||||
$filter->api->default->cookie['objectType'] = 'string';
|
||||
$filter->api->default->cookie['objectID'] = 'int';
|
||||
$filter->api->index->get['libID'] = 'int';
|
||||
$filter->api->index->get['module'] = 'int';
|
||||
$filter->api->index->get['apiID'] = 'int';
|
||||
$filter->api->index->get['version'] = 'int';
|
||||
$filter->api->create->get['libID'] = 'int';
|
||||
$filter->api->create->get['module'] = 'int';
|
||||
$filter->api->create->get['apiID'] = 'int';
|
||||
$filter->api->edit->get['libID'] = 'int';
|
||||
$filter->api->edit->get['module'] = 'int';
|
||||
$filter->api->edit->get['apiID'] = 'int';
|
||||
$filter->api->default->cookie['objectType'] = 'string';
|
||||
$filter->api->default->cookie['objectID'] = 'int';
|
||||
$filter->api->default->cookie['docSpaceParam'] = 'string';
|
||||
$filter->api->index->get['libID'] = 'int';
|
||||
$filter->api->index->get['module'] = 'int';
|
||||
$filter->api->index->get['apiID'] = 'int';
|
||||
$filter->api->index->get['version'] = 'int';
|
||||
$filter->api->create->get['libID'] = 'int';
|
||||
$filter->api->create->get['module'] = 'int';
|
||||
$filter->api->create->get['apiID'] = 'int';
|
||||
$filter->api->edit->get['libID'] = 'int';
|
||||
$filter->api->edit->get['module'] = 'int';
|
||||
$filter->api->edit->get['apiID'] = 'int';
|
||||
|
||||
$filter->file->download->cookie[$config->sessionVar] = 'code';
|
||||
|
||||
|
||||
+33
-7
@@ -41,8 +41,11 @@ class api extends control
|
||||
*/
|
||||
public function index($libID = 0, $moduleID = 0, $apiID = 0, $version = 0, $release = 0, $appendLib = 0, $browseType = '', $param = 0)
|
||||
{
|
||||
$this->session->set('spaceType', 'api', 'doc');
|
||||
$this->session->set('structList', $this->app->getURI(true), 'doc');
|
||||
if(!$apiID)
|
||||
{
|
||||
$this->session->set('spaceType', 'api', 'doc');
|
||||
$this->session->set('structList', inLink('index', "libID=$libID&moduleID=$moduleID"), 'doc');
|
||||
}
|
||||
|
||||
$this->setMenu($libID);
|
||||
$objectType = $this->objectType;
|
||||
@@ -151,6 +154,8 @@ class api extends control
|
||||
*/
|
||||
public function view($libID, $apiID, $moduleID = 0, $release = 0, $version = 0)
|
||||
{
|
||||
$from = strpos($this->server->http_referer, 'space') ? 'doc' : 'api';
|
||||
|
||||
$this->setMenu($libID);
|
||||
|
||||
/* Get all api doc libraries. */
|
||||
@@ -188,6 +193,25 @@ class api extends control
|
||||
$crumbs[] = html::a(inLink($methodName, $linkParams), $module->name);
|
||||
}
|
||||
|
||||
$objectID = $this->objectID;
|
||||
if(strpos($this->server->http_referer, 'space'))
|
||||
{
|
||||
$docParam = json_decode($this->cookie->docSpaceParam);
|
||||
$type = $docParam->type;
|
||||
$objectID = $docParam->objectID;
|
||||
$libID = $docParam->libID;
|
||||
$moduleID = $docParam->moduleID;
|
||||
$browseType = $docParam->browseType;
|
||||
$param = $docParam->param;
|
||||
list($libs, $libID, $object, $objectID, $objectDropdown) = $this->doc->setMenuByType($type, $objectID, $libID);
|
||||
|
||||
$libTree = $this->doc->getLibTree($libID, $libs, $type, $moduleID, $objectID, $browseType, $param);
|
||||
}
|
||||
else
|
||||
{
|
||||
$objectDropdown = $this->generateLibsDropMenu($libs[$libID], $release);
|
||||
$libTree = $this->doc->getLibTree($libID, $libs, 'api', $moduleID);
|
||||
}
|
||||
$this->view->title = $this->lang->api->pageTitle;
|
||||
$this->view->libs = $libs;
|
||||
$this->view->isRelease = $release > 0;
|
||||
@@ -197,11 +221,10 @@ class api extends control
|
||||
$this->view->crumbs = $crumbs;
|
||||
$this->view->moduleID = $moduleID;
|
||||
$this->view->objectType = $type;
|
||||
$this->view->objectID = $this->objectID;
|
||||
$this->view->objectID = $objectID;
|
||||
$this->view->users = $this->user->getPairs('noclosed,noletter');
|
||||
$this->view->libTree = $this->doc->getLibTree($libID, $libs, 'api', $moduleID);
|
||||
$this->view->moduleTree = $this->doc->getApiModuleTree($libID, $apiID, $release, $moduleID);
|
||||
$this->view->objectDropdown = $this->generateLibsDropMenu($libs[$libID], $release);
|
||||
$this->view->libTree = $libTree;
|
||||
$this->view->objectDropdown = $objectDropdown;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -756,7 +779,10 @@ class api extends control
|
||||
$this->lang->doc->menu->api['exclude'] = 'api-' . $this->app->rawMethod;
|
||||
$this->lang->doc->menu->{$this->session->spaceType}['subModule'] = 'api';
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$this->lang->doc->menu->{$this->session->spaceType}['alias'] .= ',' . $this->app->rawMethod;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<div id="mainMenu" class="clearfix">
|
||||
<div id="leftBar" class="btn-toolbar pull-left">
|
||||
<?php echo $objectDropdown;?>
|
||||
<?php $gobackLink = $this->session->docList ? $this->session->apiList : inlink('index', "libID=$libID&moduleID=$moduleID");?>
|
||||
<?php $gobackLink = $this->session->structList ? $this->session->structList : inlink('index', "libID=$libID&moduleID=$moduleID");?>
|
||||
<?php echo html::a($gobackLink, "<i class='icon-back'></i> " . $lang->goback, '', "class='btn btn-link'");?>
|
||||
</div>
|
||||
<div class="btn-toolbar pull-right">
|
||||
@@ -27,7 +27,8 @@
|
||||
if($libTree and common::hasPriv('api', 'releases')) echo html::a($this->createLink('api', 'releases', "libID=$libID", 'html', true), "<i class='icon-version muted'> </i>" . $lang->api->releases, '', "class='btn btn-link iframe' data-width='800px'");
|
||||
if($libTree and common::hasPriv('api', 'createRelease')) echo html::a($this->createLink('api', 'createRelease', "libID=$libID"), "<i class='icon-publish muted'> </i>" . $lang->api->createRelease, '', "class='btn btn-link iframe' data-width='800px'");
|
||||
if($libTree and common::hasPriv('api', 'export') and $config->edition != 'open') echo html::a($this->createLink('api', 'export', "libID=$libID&version=$version&release=$release&moduleID=$moduleID", 'html', true), "<i class='icon-export muted'> </i>" . $lang->export, '', "class='btn btn-link export' data-width='480px' id='export'");
|
||||
if(common::hasPriv('api', 'createLib')) echo html::a($this->createLink('api', 'createLib', "type=" . ($objectType ? $objectType : 'nolink') . "&objectID=$objectID"), '<i class="icon icon-plus"></i> ' . $lang->api->createLib, '', 'class="btn btn-secondary iframe" data-width="800px"');
|
||||
if($objectType == 'api' and common::hasPriv('api', 'createLib')) echo html::a($this->createLink('api', 'createLib', "type=" . ($objectType ? $objectType : 'nolink') . "&objectID=$objectID"), '<i class="icon icon-plus"></i> ' . $lang->api->createLib, '', 'class="btn btn-secondary iframe" data-width="800px"');
|
||||
if($objectType != 'api' and common::hasPriv('doc', 'createLib')) echo html::a($this->createLink('doc', 'createLib', "type=" . ($objectType ? $objectType : 'nolink') . "&objectID=$objectID"), '<i class="icon icon-plus"></i> ' . $lang->api->createLib, '', 'class="btn btn-secondary iframe" data-width="800px"');
|
||||
if($libTree and common::hasPriv('api', 'create')) echo html::a($this->createLink('api', 'create', "libID=$libID&moduleID=$moduleID"), '<i class="icon icon-plus"></i> ' . $lang->api->createApi, '', 'class="btn btn-primary"');
|
||||
?>
|
||||
</div>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
.block-docmycollection .doc-list > .doc-box > .btn.no-priv p {pointer-events: none;}
|
||||
.block-docmycollection .doc-list > .doc-box .date-interval {float: right; padding: 8px 0 8px 12px;}
|
||||
.block-docmycollection .doc-list > .doc-box > .btn > h4 {padding-right: 5px;}
|
||||
.block-docmycollection .doc-list > .doc-box .file-icon {margin-right: 2px;}
|
||||
.block-docmycollection .doc-list > .doc-box .file-icon {margin-right: 2px; margin-bottom: 2px;}
|
||||
.block-docmycollection .doc-list > .doc-box .plug-title {height: 16px; overflow: hidden;}
|
||||
|
||||
.block-docmycollection.block-sm .doc-list > .doc-box {flex: 0 1 100%;}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
.block-docrecentupdate .doc-list > .doc-box > .btn.no-priv p {pointer-events: none;}
|
||||
.block-docrecentupdate .doc-list > .doc-box .date-interval {float: right; padding: 8px 0 8px 12px;}
|
||||
.block-docrecentupdate .doc-list > .doc-box > .btn > h4 {padding-right: 5px;}
|
||||
.block-docrecentupdate .doc-list > .doc-box .file-icon {margin-right: 2px;}
|
||||
.block-docrecentupdate .doc-list > .doc-box .file-icon {margin-right: 2px; margin-bottom: 2px;}
|
||||
.block-docrecentupdate .doc-list > .doc-box .plug-title {height: 16px; overflow: hidden;}
|
||||
|
||||
.block-docrecentupdate.block-sm .doc-list > .doc-box {flex: 0 1 100%;}
|
||||
|
||||
@@ -502,7 +502,7 @@ $lang->doc->menu->dashboard = array('link' => "{$lang->dashboard}|doc|index");
|
||||
$lang->doc->menu->my = array('link' => "{$lang->doc->mySpace}|doc|mySpace|type=mine", 'alias' => 'myspace');
|
||||
$lang->doc->menu->product = array('link' => "{$lang->doc->productSpace}|doc|productSpace|", 'alias' => 'productspace');
|
||||
$lang->doc->menu->project = array('link' => "{$lang->doc->projectSpace}|doc|projectSpace|", 'alias' => 'projectspace');
|
||||
$lang->doc->menu->api = array('link' => "{$lang->doc->apiSpace}|api|index", 'alias' => 'api');
|
||||
$lang->doc->menu->api = array('link' => "{$lang->doc->apiSpace}|api|index", 'alias' => '', 'exclude' => 'index,view');
|
||||
$lang->doc->menu->custom = array('link' => "{$lang->doc->teamSpace}|doc|teamSpace|", 'alias' => 'teamspace');
|
||||
|
||||
$lang->doc->dividerMenu = ',product,';
|
||||
|
||||
@@ -1182,7 +1182,7 @@ class commonModel extends model
|
||||
if(isset($menuItem->link['module'])) $module = $menuItem->link['module'];
|
||||
if(isset($menuItem->link['method'])) $method = $menuItem->link['method'];
|
||||
}
|
||||
if($module == $currentModule and ($method == $currentMethod or strpos(",$alias,", ",$currentMethod,") !== false) and strpos(",$exclude,", ",$currentMethod,") === false)
|
||||
if($module == $currentModule and ($method == $currentMethod or strpos(",$alias,", ",$currentMethod,") !== false) and strpos(",$exclude,", ",$currentModule-$currentMethod,") === false)
|
||||
{
|
||||
$activeMenu = $menuItem->name;
|
||||
$active = 'active';
|
||||
|
||||
@@ -1273,6 +1273,15 @@ class doc extends control
|
||||
$this->session->set('spaceType', $type, 'doc');
|
||||
$this->session->set('docList', $uri, 'doc');
|
||||
|
||||
$docSpaceParam = new stdclass();
|
||||
$docSpaceParam->type = $type;
|
||||
$docSpaceParam->objectID = $objectID;
|
||||
$docSpaceParam->libID = $libID;
|
||||
$docSpaceParam->moduleID = $moduleID;
|
||||
$docSpaceParam->browseType = $browseType;
|
||||
$docSpaceParam->param = $param;
|
||||
setCookie("docSpaceParam", json_encode($docSpaceParam), $this->config->cookieLife, $this->config->webRoot, '', false, true);
|
||||
|
||||
if($moduleID) $libID = $this->tree->getById($moduleID)->root;
|
||||
$isFirstLoad = $libID == 0 ? true : false;
|
||||
if(empty($browseType)) $browseType = 'all';
|
||||
|
||||
@@ -312,7 +312,7 @@ $(function()
|
||||
if(isFirstLoad) ele.data('zui.tree').collapse();
|
||||
|
||||
var $leaf = ele.find('li.active > a');
|
||||
if($leaf.length && $('#fileTree').height() >= $('#sideBar').height()) $('#sideBar')[0].scrollTop = $($leaf[$leaf.length - 1]).offset().top - 100;
|
||||
if($leaf.length && $('#fileTree').height() >= $('#sideBar').height() && $($leaf[$leaf.length - 1]).offset().top > $('#sideBar').height()) $('#sideBar')[0].scrollTop = $($leaf[$leaf.length - 1]).offset().top - 200;
|
||||
|
||||
ele.on('click', '.icon-drop', function(e)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user