* finish task #2800,2799.
This commit is contained in:
+22
-22
@@ -38,7 +38,7 @@ class doc extends control
|
||||
{
|
||||
$products[] = $this->lang->doc->systemLibs['product'];
|
||||
|
||||
$this->doc->setMenu(array($this->lang->doclib->select));
|
||||
$this->doc->setMenu();
|
||||
|
||||
$products = $this->doc->getLimitLibs('product', '9');
|
||||
$projects = $this->doc->getLimitLibs('project', '9');
|
||||
@@ -114,7 +114,7 @@ class doc extends control
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->doc->setMenu($this->libs, $libID, $moduleID);
|
||||
$this->doc->setMenu($libID, $moduleID);
|
||||
}
|
||||
$this->session->set('docList', $this->app->getURI(true));
|
||||
|
||||
@@ -291,7 +291,6 @@ class doc extends control
|
||||
|
||||
$lib = $this->doc->getLibByID($libID);
|
||||
$type = $lib->product ? 'product' : ($lib->project ? 'project' : 'custom');
|
||||
$this->libs = $this->doc->getLibs($type);
|
||||
|
||||
/* According the from, set menus. */
|
||||
if($this->from == 'product')
|
||||
@@ -310,11 +309,11 @@ class doc extends control
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->doc->setMenu($this->libs, $libID, $moduleID);
|
||||
$this->doc->setMenu($libID, $moduleID);
|
||||
}
|
||||
|
||||
$this->view->title = $this->libs[$libID] . $this->lang->colon . $this->lang->doc->create;
|
||||
$this->view->position[] = html::a($this->createLink('doc', 'browse', "libID=$libID"), $this->libs[$libID]);
|
||||
$this->view->title = $lib->name . $this->lang->colon . $this->lang->doc->create;
|
||||
$this->view->position[] = html::a($this->createLink('doc', 'browse', "libID=$libID"), $lib->name);
|
||||
$this->view->position[] = $this->lang->doc->create;
|
||||
|
||||
$this->view->libID = $libID;
|
||||
@@ -364,15 +363,13 @@ class doc extends control
|
||||
|
||||
$lib = $this->doc->getLibByID($libID);
|
||||
$type = $lib->product ? 'product' : ($lib->project ? 'project' : 'custom');
|
||||
$this->libs = $this->doc->getLibs($type);
|
||||
$this->doc->setMenu($this->libs, $libID, $doc->module);
|
||||
$this->doc->setMenu($libID, $doc->module);
|
||||
|
||||
$this->view->title = $this->libs[$libID] . $this->lang->colon . $this->lang->doc->edit;
|
||||
$this->view->position[] = html::a($this->createLink('doc', 'browse', "libID=$libID"), $this->libs[$libID]);
|
||||
$this->view->title = $lib->name . $this->lang->colon . $this->lang->doc->edit;
|
||||
$this->view->position[] = html::a($this->createLink('doc', 'browse', "libID=$libID"), $lib->name);
|
||||
$this->view->position[] = $this->lang->doc->edit;
|
||||
|
||||
$this->view->doc = $doc;
|
||||
$this->view->libs = $this->libs;
|
||||
$this->view->moduleOptionMenu = $this->tree->getOptionMenu($libID, 'doc', $startModuleID = 0);
|
||||
$this->view->type = $type;
|
||||
$this->view->groups = $this->loadModel('group')->getPairs();
|
||||
@@ -403,13 +400,12 @@ class doc extends control
|
||||
/* Check priv when lib is product or project. */
|
||||
$lib = $this->doc->getLibByID($doc->lib);
|
||||
$type = $lib->product ? 'product' : ($lib->project ? 'project' : 'custom');
|
||||
$this->libs = $this->doc->getLibs($type);
|
||||
|
||||
/* Set menu. */
|
||||
$this->doc->setMenu($this->libs, $doc->lib, $doc->module);
|
||||
$this->doc->setMenu($doc->lib, $doc->module);
|
||||
|
||||
$this->view->title = "DOC #$doc->id $doc->title - " . $this->libs[$doc->lib];
|
||||
$this->view->position[] = html::a($this->createLink('doc', 'browse', "libID=$doc->lib"), $this->libs[$doc->lib]);
|
||||
$this->view->title = "DOC #$doc->id $doc->title - " . $lib->name;
|
||||
$this->view->position[] = html::a($this->createLink('doc', 'browse', "libID=$doc->lib"), $lib->name);
|
||||
$this->view->position[] = $this->lang->doc->view;
|
||||
|
||||
$this->view->doc = $doc;
|
||||
@@ -478,13 +474,12 @@ class doc extends control
|
||||
/* Check priv when lib is product or project. */
|
||||
$lib = $this->doc->getLibByID($newDoc->lib);
|
||||
$type = $lib->product ? 'product' : ($lib->project ? 'project' : 'custom');
|
||||
$this->libs = $this->doc->getLibs($type);
|
||||
|
||||
/* Set menu. */
|
||||
$this->doc->setMenu($this->libs, $newDoc->lib, $newDoc->module);
|
||||
$this->doc->setMenu($newDoc->lib, $newDoc->module);
|
||||
|
||||
$this->view->title = "DOC #$newDoc->id $newDoc->title - " . $this->libs[$newDoc->lib];
|
||||
$this->view->position[] = html::a($this->createLink('doc', 'browse', "libID=$newDoc->lib"), $this->libs[$newDoc->lib]);
|
||||
$this->view->title = "DOC #$newDoc->id $newDoc->title - " . $lib->name;
|
||||
$this->view->position[] = html::a($this->createLink('doc', 'browse', "libID=$newDoc->lib"), $lib->name);
|
||||
$this->view->position[] = $this->lang->doc->view;
|
||||
|
||||
$this->view->newDoc = $newDoc;
|
||||
@@ -617,16 +612,19 @@ class doc extends control
|
||||
public function allLibs($type, $product = '', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
{
|
||||
$libName = isset($this->lang->doc->systemLibs[$type]) ? $this->lang->doc->systemLibs[$type] : $this->lang->doc->custom;
|
||||
$crumb = html::a(inlink('allLibs', "type=$type&product=$product"), $this->lang->doc->libTypeList[$type]);
|
||||
if($product)
|
||||
{
|
||||
$this->view->product = $this->product->getById($product);
|
||||
$libName = $this->view->product->name;
|
||||
$crumb = html::a(inlink('objectLibs', "type=product&objectID=$product"), $this->view->product->name);
|
||||
$crumb .= $this->lang->arrow . html::a(inlink('allLibs', "type=$type&product=$product"), $this->lang->doclib->main[$type]);
|
||||
}
|
||||
|
||||
$this->view->title = $libName;
|
||||
$this->view->position[] = $libName;
|
||||
|
||||
$this->doc->setMenu(array($product ? $libName : $this->lang->doclib->select), 0);
|
||||
$this->doc->setMenu($libID = 0, $moduleID = 0, $crumb);
|
||||
|
||||
/* Load pager. */
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
@@ -679,7 +677,8 @@ class doc extends control
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->doc->setMenu(array($object->name), 0);
|
||||
$crumb = html::a(inlink('objectLibs', "type=$type&objectID=$objectID"), $object->name);
|
||||
$this->doc->setMenu($libID = 0, $moduleID = 0, $crumb);
|
||||
}
|
||||
|
||||
/* Load pager. */
|
||||
@@ -728,7 +727,8 @@ class doc extends control
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->doc->setMenu(array($this->lang->doclib->select), 0);
|
||||
$crumb = html::a(inlink('objectLibs', "type=$type&objectID=$objectID"), $object->name);
|
||||
$this->doc->setMenu($libID = 0, $moduleID = 0, $crumb);
|
||||
}
|
||||
|
||||
$this->view->title = $object->name;
|
||||
|
||||
+20
-22
@@ -22,28 +22,10 @@ class docModel extends model
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function setMenu($libs, $libID = 0, $moduleID = 0)
|
||||
public function setMenu($libID = 0, $moduleID = 0, $crumb = '')
|
||||
{
|
||||
if($libID)
|
||||
{
|
||||
$lib = $this->getLibById($libID);
|
||||
if(!$this->checkPriv($lib))
|
||||
{
|
||||
echo(js::alert($this->lang->doc->accessDenied));
|
||||
die(js::locate('back'));
|
||||
}
|
||||
|
||||
if($lib->product or $lib->project)
|
||||
{
|
||||
$table = $lib->product ? TABLE_PRODUCT : TABLE_PROJECT;
|
||||
$objectID = $lib->product ? $lib->product : $lib->project;
|
||||
$object = $this->dao->select('id,name')->from($table)->where('id')->eq($objectID)->fetch();
|
||||
if($object) $libs[$libID] = $object->name . ' / ' . $lib->name;
|
||||
}
|
||||
}
|
||||
|
||||
$this->app->loadLang('project');
|
||||
$selectHtml = "<a id='currentItem' data-lib-id='$libID' href=\"javascript:showLibMenu()\">{$libs[$libID]} <span class='icon-caret-down'></span></a>";
|
||||
$selectHtml = "<a id='currentItem' data-lib-id='$libID' href=\"javascript:showLibMenu()\">{$this->lang->doclib->all} <span class='icon-caret-down'></span></a>";
|
||||
$selectHtml .= "<div id='dropMenu'>";
|
||||
$selectHtml .= "<i class='icon icon-spin icon-spinner'></i>";
|
||||
$selectHtml .= "<div id='libMenu'>";
|
||||
@@ -54,7 +36,7 @@ class docModel extends model
|
||||
$selectHtml .= "<div class='lib-menu-group' id='libMenuCustomGroup'><div class='lib-menu-list-heading' data-type='custom'>{$this->lang->doc->libTypeList['custom']}<i class='icon icon-remove'></i></div><div class='lib-menu-list clearfix'></div></div>";
|
||||
$selectHtml .= "</div></div></div>";
|
||||
common::setMenuVars($this->lang->doc->menu, 'list', $selectHtml);
|
||||
common::setMenuVars($this->lang->doc->menu, 'crumb', $this->getCrumbs($libID, $moduleID));
|
||||
common::setMenuVars($this->lang->doc->menu, 'crumb', $crumb ? $crumb : $this->getCrumbs($libID, $moduleID));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1155,8 +1137,24 @@ class docModel extends model
|
||||
{
|
||||
if(empty($libID)) return '';
|
||||
|
||||
$lib = $this->getLibById($libID);
|
||||
if(!$this->checkPriv($lib))
|
||||
{
|
||||
echo(js::alert($this->lang->doc->accessDenied));
|
||||
die(js::locate('back'));
|
||||
}
|
||||
|
||||
if($lib->product or $lib->project)
|
||||
{
|
||||
$table = $lib->product ? TABLE_PRODUCT : TABLE_PROJECT;
|
||||
$objectID = $lib->product ? $lib->product : $lib->project;
|
||||
$object = $this->dao->select('id,name')->from($table)->where('id')->eq($objectID)->fetch();
|
||||
$lib->name = $object->name . ' / ' . $lib->name;
|
||||
}
|
||||
|
||||
|
||||
$parents = $moduleID ? $this->loadModel('tree')->getParents($moduleID) : array();
|
||||
$crumb = html::a(helper::createLink('doc', 'browse', "libID=$libID&browseType=all¶m=0&orderBy=id_desc"), ' / ');
|
||||
$crumb = html::a(helper::createLink('doc', 'browse', "libID=$libID&browseType=all¶m=0&orderBy=id_desc"), $lib->name);
|
||||
foreach($parents as $module) $crumb .= $this->lang->arrow . html::a(helper::createLink('doc', 'browse', "libID=$libID&browseType=byModule¶m=$module->id&orderBy=id_desc"), $module->name);
|
||||
return $crumb;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<div id='featurebar'><strong><?php echo isset($lang->doc->systemLibs[$type]) ? $lang->doc->systemLibs[$type] : $lang->doc->custom?></strong></div>
|
||||
<div id='libs'>
|
||||
<?php if(($type == 'project' or $type == 'product')):?>
|
||||
<div class='row'>
|
||||
|
||||
@@ -94,7 +94,7 @@ class tree extends control
|
||||
elseif(strpos($viewType, 'doc') !== false)
|
||||
{
|
||||
$type = $lib->product ? 'product' : ($lib->project ? 'project' : 'custom');
|
||||
$this->doc->setMenu($this->doc->getLibs($type), $rootID, $currentModuleID);
|
||||
$this->doc->setMenu($rootID, $currentModuleID);
|
||||
$this->lang->tree->menu = $this->lang->doc->menu;
|
||||
$this->lang->tree->menuOrder = $this->lang->doc->menuOrder;
|
||||
$this->lang->set('menugroup.tree', 'doc');
|
||||
|
||||
Reference in New Issue
Block a user