* finish task #3915,3917,3955.
This commit is contained in:
@@ -78,9 +78,9 @@ class projectModel extends model
|
||||
if($project and $project->type == 'ops')
|
||||
{
|
||||
unset($this->lang->project->menu->story);
|
||||
unset($this->lang->project->menu->bug);
|
||||
unset($this->lang->project->menu->build);
|
||||
unset($this->lang->project->menu->testtask);
|
||||
unset($this->lang->project->subMenu->qa->bug);
|
||||
unset($this->lang->project->subMenu->qa->build);
|
||||
unset($this->lang->project->subMenu->qa->testtask);
|
||||
}
|
||||
|
||||
if($projects and !isset($projects[$projectID]) and !$this->checkPriv($project))
|
||||
@@ -118,6 +118,36 @@ class projectModel extends model
|
||||
foreach($this->lang->project->menu as $key => $menu)
|
||||
{
|
||||
$replace = $projectID;
|
||||
|
||||
/* Replace for dropdown submenu. */
|
||||
if(isset($this->lang->project->subMenu->$key))
|
||||
{
|
||||
$dropTitle = '';
|
||||
$hasActive = false;
|
||||
$replace = "<ul class='dropdown-menu'>";
|
||||
foreach($this->lang->project->subMenu->$key as $subMenuKey => $subMenuLink)
|
||||
{
|
||||
list($subMenuName, $subMenuModule, $subMenuMethod, $subMenuParams) = explode('|', $subMenuLink);
|
||||
if(!commonModel::hasPriv($subMenuModule, $subMenuMethod)) continue;
|
||||
|
||||
if(empty($dropTitle)) $dropTitle = $subMenuName;
|
||||
|
||||
$active = '';
|
||||
if($moduleName == $subMenuModule and $methodName == $subMenuMethod)
|
||||
{
|
||||
$active = "class='active'";
|
||||
$dropTitle = $subMenuName;
|
||||
}
|
||||
|
||||
$replace .= "<li $active>" . html::a(helper::createLink($subMenuModule, $subMenuMethod, sprintf($subMenuParams, $projectID)), $subMenuName) . '</li>';
|
||||
if($active) $hasActive = true;
|
||||
}
|
||||
$replace .= '</ul>';
|
||||
$replace = "<a data-toggle='dropdown'>$dropTitle <span class='caret'></span></a>" . $replace;
|
||||
|
||||
$this->lang->project->menu->$key['class'] = 'dropdown';
|
||||
if($hasActive) $this->lang->project->menu->$key['class'] .= ' active';
|
||||
}
|
||||
common::setMenuVars($this->lang->project->menu, $key, $replace);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user