本文整理汇总了PHP中common::setMenuVars方法的典型用法代码示例。如果您正苦于以下问题:PHP common::setMenuVars方法的具体用法?PHP common::setMenuVars怎么用?PHP common::setMenuVars使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common
的用法示例。
在下文中一共展示了common::setMenuVars方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setMenu
/**
* 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);
}
}
示例2: setMenu
/**
* 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);
}
}
示例3: setMenu
/**
* 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);
}
}
示例4: setMenu
/**
* 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);
}
}
}
示例5: setMenu
/**
* 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);
}
}
示例6: setMenu
/**
* 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);
}
}