本文整理匯總了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);
}
}