* [refac bug #55065] Revert program setMenu method.

This commit is contained in:
wangyidong
2024-09-10 16:19:51 +08:00
committed by 孙广明
parent 7c38101924
commit a411701410
+44
View File
@@ -1415,4 +1415,48 @@ class programModel extends model
{
return $this->dao->select('id, name')->from(TABLE_PRODUCT)->where('program')->eq($programID)->andWhere('deleted')->eq('0')->fetchPairs();
}
/*
* Set program menu.
*
* @param int $programID
* @access public
* @return void
*/
public function setMenu($programID)
{
$this->lang->switcherMenu = $this->getSwitcher($programID);
common::setMenuVars('program', $programID);
}
/*
* Get program swapper.
*
* @param int $programID
* @access private
* @return string
*/
public function getSwitcher($programID = 0)
{
$currentProgramName = '';
$currentModule = $this->app->moduleName;
$currentMethod = $this->app->methodName;
if($programID)
{
helper::setCookie("lastProgram", $programID, $this->config->cookieLife, $this->config->webRoot, '', false, true);
$currentProgram = $this->getById($programID);
$currentProgramName = $currentProgram->name;
}
else
{
$currentProgramName = $this->lang->program->all;
}
$dropMenuLink = helper::createLink('program', 'ajaxGetDropMenu', "objectID=$programID&module=$currentModule&method=$currentMethod");
$output = "<div class='btn-group header-btn' id='swapper'><button data-toggle='dropdown' type='button' class='btn' id='currentItem' title='{$currentProgramName}'><span class='text'>{$currentProgramName}</span> <span class='caret' style='margin-bottom: -1px'></span></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>";
return $output;
}
}