* task #7129, add program swapper menu to header.

This commit is contained in:
Catouse
2020-05-07 14:50:59 +08:00
parent 8b45bf767d
commit 97474dcac5
4 changed files with 36 additions and 12 deletions
+14 -8
View File
@@ -118,7 +118,8 @@ class projectModel extends model
}
$projectIndex .= '</ul></div></div>';
$projectIndex .= $selectHtml;
$this->lang->programSwapper = $selectHtml;
}
$this->lang->modulePageNav = $projectIndex;
@@ -168,18 +169,23 @@ class projectModel extends model
*/
public function select($projects, $projectID, $buildID, $currentModule, $currentMethod, $extra = '')
{
if(!$projectID) return;
$isMobile = $this->app->viewType == 'mhtml';
setCookie("lastProject", $projectID, $this->config->cookieLife, $this->config->webRoot, '', false, true);
$currentProject = $this->getById($projectID);
$currentProjectName = '';
if($projectID)
{
setCookie("lastProject", $projectID, $this->config->cookieLife, $this->config->webRoot, '', false, true);
$currentProject = $this->getById($projectID);
$currentProjectName = $currentProject->name;
}
else if($isMobile) return;
else $currentProjectName = $this->lang->project->allProjects;
$dropMenuLink = helper::createLink('project', 'ajaxGetDropMenu', "objectID=$projectID&module=$currentModule&method=$currentMethod&extra=$extra");
$output = "<div class='btn-group angle-btn'><div class='btn-group'><button data-toggle='dropdown' type='button' class='btn btn-limit' id='currentItem' title='{$currentProject->name}'>{$currentProject->name} <span class='caret'></span></button><div id='dropMenu' class='dropdown-menu search-list' data-ride='searchList' data-url='$dropMenuLink'>";
$output = "<div class='btn-group' id='swapper'><button data-toggle='dropdown' type='button' class='btn btn-limit' id='currentItem' title='{$currentProjectName}'>{$currentProjectName} <i class='icon icon-swap'></i></button><div id='dropMenu' class='dropdown-menu search-list' data-ride='searchList' data-url='$dropMenuLink'>";
$output .= '<div class="input-control search-box has-icon-left has-icon-right search-example"><input type="search" class="form-control search-input" /><label class="input-control-icon-left search-icon"><i class="icon icon-search"></i></label><a class="input-control-icon-right search-clear-btn"><i class="icon icon-close icon-sm"></i></a></div>';
$output .= "</div></div></div>";
if($isMobile) $output = "<a id='currentItem' href=\"javascript:showSearchMenu('project', '$projectID', '$currentModule', '$currentMethod', '$extra')\">{$currentProject->name} <span class='icon-caret-down'></span></a><div id='currentItemDropMenu' class='hidden affix enter-from-bottom layer'></div>";
$output .= "</div></div>";
if($isMobile) $output = "<a id='currentItem' href=\"javascript:showSearchMenu('project', '$projectID', '$currentModule', '$currentMethod', '$extra')\">{$currentProjectName} <span class='icon-caret-down'></span></a><div id='currentItemDropMenu' class='hidden affix enter-from-bottom layer'></div>";
return $output;
}