* task #41783, #task 41765, implement tutorial mode and add new tutorial task.

This commit is contained in:
Hao Sun
2021-08-26 08:45:03 +08:00
parent 6b275b3487
commit 4779bb64b3
17 changed files with 588 additions and 477 deletions

View File

@@ -105,11 +105,16 @@ class tutorial extends control
/* Check priv for tutorial. */
$hasPriv = false;
foreach($this->lang->tutorial->tasks as $taskName)
$moduleLower = strtolower($module);
foreach($this->lang->tutorial->tasks as $task)
{
$taskModule = strtolower($taskName['nav']['module']);
if($taskModule == strtolower($module)) $hasPriv = true;
if($hasPriv) break;
$taskModule = strtolower($task['nav']['module']);
$taskMenuModule = strtolower($task['nav']['menuModule']);
if($taskModule == $moduleLower or $taskMenuModule == $moduleLower)
{
$hasPriv = true;
break;
}
}
if(!$hasPriv and $module == 'my' and $method == 'index') $hasPriv = true;
if(!$hasPriv) die(js::locate('back'));