diff --git a/module/common/model.php b/module/common/model.php index 8a7bf0a4df..4c7b5514c4 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -294,7 +294,7 @@ class commonModel extends model if($app->company->website) echo html::a($app->company->website, $lang->company->website, '_blank'); if($app->company->backyard) echo html::a($app->company->backyard, $lang->company->backyard, '_blank'); - echo html::a(helper::createLink('tutorial', 'start'), $lang->tutorial, '', "class='iframe' data-width='800' data-headerless='true'"); + if(!commonModel::isTutorialMode()) echo html::a(helper::createLink('tutorial', 'start'), $lang->tutorial, '', "class='iframe' data-width='800' data-headerless='true'"); echo html::a(helper::createLink('misc', 'feature'), $lang->feature, '', "class='iframe' data-width='1200' data-headerless='true'"); echo html::a('javascript:;', $lang->help, '', "class='open-help-tab'"); echo html::a(helper::createLink('misc', 'about'), $lang->aboutZenTao, '', "class='about iframe' data-width='900' data-headerless='true' data-class='modal-about'"); @@ -343,6 +343,32 @@ class commonModel extends model $this->lang->menu = $menu; } + /** + * Create menu item link + * + * @param object $menuItemLink + * @param boolean $isTutorialMode + * @access public + * @return string + */ + public static function createMenuLink($menuItem) + { + $link = $menuItem->link; + if(is_array($menuItem->link)) + { + $vars = isset($menuItem->link['vars']) ? $menuItem->link['vars'] : ''; + if(isset($menuItem->tutorial) && $menuItem->tutorial) + { + $link = helper::createLink('tutorial', 'wizard', "module={$menuItem->link['module']}&method={$menuItem->link['method']}¶ms=$vars"); + } + else + { + $link = helper::createLink($menuItem->link['module'], $menuItem->link['method'], $vars); + } + } + return $link; + } + /** * Print the main menu. * @@ -368,19 +394,19 @@ class commonModel extends model } /* Print all main menus. */ - $menu = customModel::getMainMenu(); - $activeName = $app->getViewType() == 'mhtml' ? 'ui-btn-active' : 'active'; + $menu = customModel::getMainMenu(); + $activeName = $app->getViewType() == 'mhtml' ? 'ui-btn-active' : 'active'; echo "\n"; } @@ -446,9 +472,9 @@ class commonModel extends model } /* get current module and method. */ - $currentModule = $app->getModuleName(); - $currentMethod = $app->getMethodName(); - $menu = customModel::getModuleMenu($moduleName); + $currentModule = $app->getModuleName(); + $currentMethod = $app->getMethodName(); + $menu = customModel::getModuleMenu($moduleName); /* The beginning of the menu. */ echo "