-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Extension.php
72 lines (63 loc) · 1.78 KB
/
Extension.php
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php
namespace Thoughtco\CustomerDisplay;
use DB;
use Event;
use Admin\Widgets\Form;
use System\Classes\BaseExtension;
use Thoughtco\CustomerDisplay\Models\Settings;
/**
* Extension Information File
**/
class Extension extends BaseExtension
{
public function boot()
{
// write default settings to database if missing
if (Settings::get('prep_status') === NULL){
Settings::set([
'prep_status' => 2,
'prep_color' => '#DDCC2C',
'ready_status' => 3,
'ready_color' => '#12D42B',
]);
}
}
public function registerPermissions()
{
return [
'Thoughtco.CustomerDisplay.View' => [
'description' => 'View orders ready to be collected by customers',
'group' => 'module',
],
];
}
public function registerNavigation()
{
return [
'sales' => [
'child' => [
'customerdisplay' => [
'priority' => 10,
'class' => 'pages',
'href' => admin_url('thoughtco/customerdisplay/summary'),
'title' => lang('lang:thoughtco.customerdisplay::default.text_title'),
'permission' => 'Thoughtco.CustomerDisplay.View',
],
],
],
];
}
public function registerSettings()
{
return [
'settings' => [
'label' => 'Customer Display Settings',
'icon' => 'fa fa-users',
'description' => 'Manage customer display settings.',
'model' => 'Thoughtco\CustomerDisplay\Models\Settings',
'permissions' => ['Thoughtco.CustomerDisplay.Manage'],
],
];
}
}
?>