/** * Set the menu. * * @param array $products * @param int $productID * @access public * @return void */ public function setMenu($products, $productID) { $this->loadModel('product')->setMenu($products, $productID); $selectHtml = $this->product->select($products, $productID, 'testtask', 'browse'); foreach ($this->lang->testtask->menu as $key => $value) { $replace = $key == 'product' ? $selectHtml : $productID; common::setMenuVars($this->lang->testtask->menu, $key, $replace); } }
/** * Set menu. * * @param array $products * @param int $productID * @access public * @return void */ public function setMenu($products, $productID, $branch = 0) { $this->loadModel('product')->setMenu($products, $productID, $branch); $selectHtml = $this->product->select($products, $productID, 'bug', 'browse', '', $branch); foreach ($this->lang->bug->menu as $key => $menu) { $replace = $key == 'product' ? $selectHtml : $productID; common::setMenuVars($this->lang->bug->menu, $key, $replace); } }
/** * Set the menu. * * @param array $users user pairs * @param string $account current account * @access public * @return void */ public function setMenu($users, $account) { $methodName = $this->app->getMethodName(); $selectHtml = html::select('account', $users, $account, "onchange=\"switchAccount(this.value, '{$methodName}')\""); foreach ($this->lang->user->menu as $key => $value) { $replace = $key == 'account' ? $selectHtml : $account; common::setMenuVars($this->lang->user->menu, $key, $replace); } }
/** * Set menus * * @param array $libs * @param int $libID * @param string $extra * @access public * @return void */ public function setMenu($libs, $libID, $extra = '') { $currentModule = $this->app->getModuleName(); $currentMethod = $this->app->getMethodName(); $selectHtml = html::select('libID', $libs, $libID, "onchange=\"switchDocLib(this.value, '{$currentModule}', '{$currentMethod}', '{$extra}');\""); common::setMenuVars($this->lang->doc->menu, 'list', $selectHtml . $this->lang->arrow); foreach ($this->lang->doc->menu as $key => $menu) { if ($key != 'list') { common::setMenuVars($this->lang->doc->menu, $key, $libID); } } }
/** * Set menu. * * @param array $projects * @param int $projectID * @access public * @return void */ public function setMenu($projects, $projectID) { /* Check the privilege. */ if ($projects and !isset($projects[$projectID]) and !$this->checkPriv($this->getById($projectID))) { echo js::alert($this->lang->project->accessDenied); die(js::locate('back')); } $moduleName = $this->app->getModuleName(); $methodName = $this->app->getMethodName(); $selectHtml = $this->select($projects, $projectID, $moduleName, $methodName); foreach ($this->lang->project->menu as $key => $menu) { $replace = $key == 'list' ? $selectHtml : $projectID; common::setMenuVars($this->lang->project->menu, $key, $replace); } }
/** * Set menus * * @param array $libs * @param int $libID * @param string $extra * @access public * @return void */ public function setMenu($libs, $libID, $extra = '') { $currentModule = $this->app->getModuleName(); $currentMethod = $this->app->getMethodName(); $selectHtml = "<div class='dropdown'>" . html::a('javascript:;', $libs[$libID] . " <span class='caret'></span>", '', "data-toggle='dropdown'") . "<ul class='dropdown-menu'>"; foreach ($libs as $key => $value) { $class = $libID == $key ? 'active' : ''; $selectHtml .= "<li class='{$class}'>" . html::a("javascript:switchDocLib(\"{$key}\", \"{$currentModule}\", \"{$currentMethod}\", \"{$extra}\");", $value) . '</li>'; } $selectHtml .= '</ul></div>'; common::setMenuVars($this->lang->doc->menu, 'list', $selectHtml); foreach ($this->lang->doc->menu as $key => $menu) { if ($key != 'list') { common::setMenuVars($this->lang->doc->menu, $key, $libID); } } }
/** * Set menu. * * @param array $products * @param int $productID * @param string $extra * @access public * @return void */ public function setMenu($products, $productID, $extra = '') { /* Has access privilege?. */ if ($products and !isset($products[$productID]) and !$this->checkPriv($this->getById($productID))) { echo js::alert($this->lang->product->accessDenied); die(js::locate('back')); } $currentModule = $this->app->getModuleName(); $currentMethod = $this->app->getMethodName(); /* init currentModule and currentMethod for report and story. */ if ($currentModule == 'story' and $currentMethod != 'create' and $currentMethod != 'batchcreate') { $currentModule = 'product'; } if ($currentMethod == 'report') { $currentMethod = 'browse'; } $selectHtml = $this->select($products, $productID, $currentModule, $currentMethod, $extra); foreach ($this->lang->product->menu as $key => $menu) { $replace = $key == 'list' ? $selectHtml : $productID; common::setMenuVars($this->lang->product->menu, $key, $replace); } }
/** * Set menu. * * @param array $projects * @param int $projectID * @param string $extra * @access public * @return void */ public function setMenu($projects, $projectID, $extra = '') { /* Check the privilege. */ $project = $this->getById($projectID); /* Unset story, bug, build and testtask if type is ops. */ 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); } if ($projects and !isset($projects[$projectID]) and !$this->checkPriv($project)) { echo js::alert($this->lang->project->accessDenied); die(js::locate('back')); } $moduleName = $this->app->getModuleName(); $methodName = $this->app->getMethodName(); if ($this->cookie->projectMode == 'noclosed' and $project->status == 'done') { setcookie('projectMode', 'all'); $this->cookie->projectMode = 'all'; } $selectHtml = $this->select($projects, $projectID, $moduleName, $methodName, $extra); foreach ($this->lang->project->menu as $key => $menu) { $replace = $key == 'list' ? $selectHtml : $projectID; common::setMenuVars($this->lang->project->menu, $key, $replace); } }
/** * Set menu. * * @param int $dept * @access public * @return void */ public function setMenu($dept = 0) { common::setMenuVars($this->lang->company->menu, 'name', array($this->app->company->name)); common::setMenuVars($this->lang->company->menu, 'addUser', array($dept)); common::setMenuVars($this->lang->company->menu, 'batchAddUser', array($dept)); }