-
Notifications
You must be signed in to change notification settings - Fork 0
/
contextsensitivehelp.html
36 lines (26 loc) · 2.71 KB
/
contextsensitivehelp.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
---
layout: default
head_title: "LESK: Context sensitive help"
title: Context sensitive help
---
<div class="row">
<div class="12u">
<p>Context sensitive help can be enabled by setting the configuration option <code>APP_CONTEXT_HELP_AREA</code> to true. When context sensitive help is enabled, a question mark (?) appears in the top-right area of the Web application. The question mark is either dimmed and disabled or lit and enabled depending on whether context sensitive help is available or not. For example, on the homepage, the question mark will be dimmed and disabled but on the User edit page it will be lit and enabled. When clicked on, a small box will appear with the content of the context help inside. The help box can be dismissed by clicking anywhere outside the box.</p>
<p>To create a new context sensitive help box, simply create a blade file under the <code>resources/themes/default/views/context_help/</code> folder followed by a structure representing the name of your route. For example, the user edit page is accessed by the <code>admin.users.edit</code> route so create a blade page named <code>edit.blade.php</code> under <code>resources/themes/default/views/context_help/admin/users/</code> and it will automatically be loaded and shown when a user click on the question mark (?) icon.</p>
<p>A module can also create context sensitive help by following the same principle but they must also set the <strong>context</strong> parameter when they call the parent <strong>constructor</strong>, here is how the <a href="https://github.com/leskhq/LESK-Module_ActiveDirectoryInspector">Active Directory Inspector</a> module sets it, notice the 3rd parameter in the <code>parent::__construct()</code> call:</p>
<pre><code>...
/**
* Custom constructor to get a handle on the Application instance.
* @param Application $app
*/
public function __construct(Application $app, Audit $audit)
{
parent::__construct($app, $audit, "activedirectoryinspector");
$this->app = $app;
}
...
</code></pre>
<p>Once the context set, the context sensitive help for the <strong>home</strong> page is automatically loaded from <code>app/Modules/ActiveDirectoryInspector/Resources/views/context_help/activedirectoryinspector/home.blade.php</code>This path is generated using this formula: <code>app/Modules/<module namespace>/Resources/views/context_help/<route name>/<last part of route name>.blade.php</code></p>
</div>
</div>
{% include footer.html prev_page="lern" prev_title="LERN" next_page="deployingtoproduction" next_title="Deploying to production" %}