1 | <?php namespace Arcanedev\LogViewer\Utilities; |
||
14 | class LogMenu implements LogMenuInterface |
||
15 | { |
||
16 | /* ------------------------------------------------------------------------------------------------ |
||
17 | | Properties |
||
18 | | ------------------------------------------------------------------------------------------------ |
||
19 | */ |
||
20 | /** |
||
21 | * The config repository instance. |
||
22 | * |
||
23 | * @var \Illuminate\Contracts\Config\Repository |
||
24 | */ |
||
25 | protected $config; |
||
26 | |||
27 | /** |
||
28 | * The log styler instance. |
||
29 | * |
||
30 | * @var \Arcanedev\LogViewer\Contracts\LogStylerInterface |
||
31 | */ |
||
32 | private $styler; |
||
33 | |||
34 | /* ------------------------------------------------------------------------------------------------ |
||
35 | | Constructor |
||
36 | | ------------------------------------------------------------------------------------------------ |
||
37 | */ |
||
38 | /** |
||
39 | * Create the LogMenu instance. |
||
40 | * |
||
41 | * @param \Illuminate\Contracts\Config\Repository $config |
||
42 | * @param \Arcanedev\LogViewer\Contracts\LogStylerInterface $styler |
||
43 | */ |
||
44 | 27 | public function __construct(Repository $config, LogStylerInterface $styler) |
|
49 | |||
50 | /* ------------------------------------------------------------------------------------------------ |
||
51 | | Getters & Setters |
||
52 | | ------------------------------------------------------------------------------------------------ |
||
53 | */ |
||
54 | /** |
||
55 | * Set the config instance. |
||
56 | * |
||
57 | * @param \Illuminate\Contracts\Config\Repository $config |
||
58 | * |
||
59 | * @return self |
||
60 | */ |
||
61 | 27 | public function setConfig(Repository $config) |
|
67 | |||
68 | /** |
||
69 | * Set the log styler instance. |
||
70 | * |
||
71 | * @param \Arcanedev\LogViewer\Contracts\LogStylerInterface $styler |
||
72 | * |
||
73 | * @return self |
||
74 | */ |
||
75 | 27 | public function setLogStyler(LogStylerInterface $styler) |
|
81 | |||
82 | /* ------------------------------------------------------------------------------------------------ |
||
83 | | Main Functions |
||
84 | | ------------------------------------------------------------------------------------------------ |
||
85 | */ |
||
86 | /** |
||
87 | * Make log menu. |
||
88 | * |
||
89 | * @param \Arcanedev\LogViewer\Entities\Log $log |
||
90 | * @param bool $trans |
||
91 | * |
||
92 | * @return array |
||
93 | */ |
||
94 | 24 | public function make(Log $log, $trans = true) |
|
108 | |||
109 | /* ------------------------------------------------------------------------------------------------ |
||
110 | | Check Functions |
||
111 | | ------------------------------------------------------------------------------------------------ |
||
112 | */ |
||
113 | /** |
||
114 | * Check if the icons are enabled. |
||
115 | * |
||
116 | * @return bool |
||
117 | */ |
||
118 | 24 | private function isIconsEnabled() |
|
122 | |||
123 | /* ------------------------------------------------------------------------------------------------ |
||
124 | | Other Functions |
||
125 | | ------------------------------------------------------------------------------------------------ |
||
126 | */ |
||
127 | /** |
||
128 | * Get config. |
||
129 | * |
||
130 | * @param string $key |
||
131 | * @param mixed|null $default |
||
132 | * |
||
133 | * @return mixed |
||
134 | */ |
||
135 | 24 | private function config($key, $default = null) |
|
139 | } |
||
140 |