From fb160e115dee9d701dc8ac4da85c6fce351351b9 Mon Sep 17 00:00:00 2001 From: Catouse Date: Tue, 26 Apr 2016 15:54:12 +0800 Subject: [PATCH] * improve tutorial UI. --- module/common/model.php | 54 ++++++++++++++++++++++++----- module/custom/config.php | 4 --- module/custom/model.php | 31 ++++++++++++----- module/tutorial/control.php | 18 ++++++++++ module/tutorial/view/index.html.php | 2 +- 5 files changed, 86 insertions(+), 23 deletions(-) diff --git a/module/common/model.php b/module/common/model.php index 4747557660..54856080ae 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -298,7 +298,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'"); @@ -372,6 +372,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. * @@ -397,19 +423,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"; } @@ -475,9 +501,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 "