* [task#120262,0.5h,1h] Add the function of getSwitcher for roadmap browse.
This commit is contained in:
@@ -2078,4 +2078,21 @@ class productModel extends model
|
||||
/* 4. Clear actions older than 30 days. */
|
||||
$this->loadModel('action')->cleanActions();
|
||||
}
|
||||
|
||||
public function getSwitcher(int $productID = 0, string $extra = ''): string
|
||||
{
|
||||
$currentProductName = $productID ? $this->getByID($productID)->name : $this->lang->productCommon;
|
||||
|
||||
list($locateModule, $locateMethod) = $this->productTao->computeLocate4DropMenu();
|
||||
|
||||
$fromModule = $this->app->tab == 'qa' ? 'qa' : '';
|
||||
$dropMenuModule = $this->app->tab == 'qa' ? 'product' : $this->app->tab;
|
||||
$dropMenuLink = helper::createLink($dropMenuModule, 'ajaxGetDropMenu', "objectID=$productID&module=$locateModule&method=$locateMethod&extra=$extra&from=$fromModule");
|
||||
|
||||
$output = "<div class='btn-group header-btn' id='swapper'><button data-toggle='dropdown' type='button' class='btn' id='currentItem' title='{$currentProductName}'><span class='text'>{$currentProductName}</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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user