Passed
Push — devel-3.0 ( 2fc71e...3e43d6 )
by Rubén
03:39
created

ThemeIcons::getIconDisabled()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * sysPass
4
 *
5
 * @author    nuxsmin
6
 * @link      https://syspass.org
7
 * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org
8
 *
9
 * This file is part of sysPass.
10
 *
11
 * sysPass is free software: you can redistribute it and/or modify
12
 * it under the terms of the GNU General Public License as published by
13
 * the Free Software Foundation, either version 3 of the License, or
14
 * (at your option) any later version.
15
 *
16
 * sysPass is distributed in the hope that it will be useful,
17
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
 * GNU General Public License for more details.
20
 *
21
 * You should have received a copy of the GNU General Public License
22
 *  along with sysPass.  If not, see <http://www.gnu.org/licenses/>.
23
 */
24
25
namespace SP\Core\UI;
26
27
use SP\Html\Assets\FontIcon;
28
use SP\Html\Assets\IconInterface;
29
30
defined('APP_ROOT') || die();
31
32
/**
33
 * Class ThemeIconsBase para la implementación de los iconos del tema visual
34
 *
35
 * @package SP\Core
36
 */
37
class ThemeIcons
38
{
39
    /**
40
     * @var IconInterface[]
41
     */
42
    private $icons = [];
43
44
    /**
45
     * @return IconInterface
46
     */
47
    public function getIconWarning()
48
    {
49
        return $this->getIconByName('warning');
50
    }
51
52
    /**
53
     * @param string $name
54
     *
55
     * @return IconInterface
56
     */
57
    public function getIconByName(string $name)
58
    {
59
        if (isset($this->icons[$name])) {
60
            return $this->icons[$name];
61
        }
62
63
        return new FontIcon($name, 'mdl-color-text--indigo-A200');
64
    }
65
66
    /**
67
     * @return IconInterface
68
     */
69
    public function getIconDownload()
70
    {
71
        return $this->getIconByName('download');
72
    }
73
74
    /**
75
     * @return IconInterface
76
     */
77
    public function getIconClear()
78
    {
79
        return $this->getIconByName('clear');
80
    }
81
82
    /**
83
     * @return IconInterface
84
     */
85
    public function getIconPlay()
86
    {
87
        return $this->getIconByName('play');
88
    }
89
90
    /**
91
     * @return IconInterface
92
     */
93
    public function getIconHelp()
94
    {
95
        return $this->getIconByName('help');
96
    }
97
98
    /**
99
     * @return IconInterface
100
     */
101
    public function getIconPublicLink()
102
    {
103
        return $this->getIconByName('publicLink');
104
    }
105
106
    /**
107
     * @return IconInterface
108
     */
109
    public function getIconBack()
110
    {
111
        return $this->getIconByName('back');
112
    }
113
114
    /**
115
     * @return IconInterface
116
     */
117
    public function getIconRestore()
118
    {
119
        return $this->getIconByName('restore');
120
    }
121
122
    /**
123
     * @return IconInterface
124
     */
125
    public function getIconSave()
126
    {
127
        return $this->getIconByName('save');
128
    }
129
130
    /**
131
     * @return IconInterface
132
     */
133
    public function getIconUp()
134
    {
135
        return $this->getIconByName('up');
136
    }
137
138
    /**
139
     * @return IconInterface
140
     */
141
    public function getIconDown()
142
    {
143
        return $this->getIconByName('down');
144
    }
145
146
    /**
147
     * @return IconInterface
148
     */
149
    public function getIconViewPass()
150
    {
151
        return $this->getIconByName('viewPass');
152
    }
153
154
    /**
155
     * @return IconInterface
156
     */
157
    public function getIconCopy()
158
    {
159
        return $this->getIconByName('copy');
160
    }
161
162
    /**
163
     * @return IconInterface
164
     */
165
    public function getIconClipboard()
166
    {
167
        return $this->getIconByName('clipboard');
168
    }
169
170
    /**
171
     * @return IconInterface
172
     */
173
    public function getIconEmail()
174
    {
175
        return $this->getIconByName('email');
176
    }
177
178
    /**
179
     * @return IconInterface
180
     */
181
    public function getIconRefresh()
182
    {
183
        return $this->getIconByName('refresh');
184
    }
185
186
    /**
187
     * @return IconInterface
188
     */
189
    public function getIconEditPass()
190
    {
191
        return $this->getIconByName('editPass');
192
    }
193
194
    /**
195
     * @return IconInterface
196
     */
197
    public function getIconAppAdmin()
198
    {
199
        return $this->getIconByName('appAdmin');
200
    }
201
202
    /**
203
     * @return IconInterface
204
     */
205
    public function getIconAccAdmin()
206
    {
207
        return $this->getIconByName('accAdmin');
208
    }
209
210
    /**
211
     * @return IconInterface
212
     */
213
    public function getIconLdapUser()
214
    {
215
        return $this->getIconByName('ldapUser');
216
    }
217
218
    /**
219
     * @return IconInterface
220
     */
221
    public function getIconDisabled()
222
    {
223
        return $this->getIconByName('disabled');
224
    }
225
226
    /**
227
     * @return IconInterface
228
     */
229
    public function getIconNavPrev()
230
    {
231
        return $this->getIconByName('previous');
232
    }
233
234
    /**
235
     * @return IconInterface
236
     */
237
    public function getIconNavNext()
238
    {
239
        return $this->getIconByName('next');
240
    }
241
242
    /**
243
     * @return IconInterface
244
     */
245
    public function getIconNavFirst()
246
    {
247
        return $this->getIconByName('first');
248
    }
249
250
    /**
251
     * @return IconInterface
252
     */
253
    public function getIconNavLast()
254
    {
255
        return $this->getIconByName('last');
256
    }
257
258
    /**
259
     * @return IconInterface
260
     */
261
    public function getIconAdd()
262
    {
263
        return $this->getIconByName('add');
264
    }
265
266
    /**
267
     * @return IconInterface
268
     */
269
    public function getIconView()
270
    {
271
        return $this->getIconByName('view');
272
    }
273
274
    /**
275
     * @return IconInterface
276
     */
277
    public function getIconEdit()
278
    {
279
        return $this->getIconByName('edit');
280
    }
281
282
    /**
283
     * @return IconInterface
284
     */
285
    public function getIconDelete()
286
    {
287
        return $this->getIconByName('delete');
288
    }
289
290
    /**
291
     * @return IconInterface
292
     */
293
    public function getIconOptional()
294
    {
295
        return $this->getIconByName('optional');
296
    }
297
298
    /**
299
     * @return IconInterface
300
     */
301
    public function getIconCheck()
302
    {
303
        return $this->getIconByName('check');
304
    }
305
306
    /**
307
     * @return IconInterface
308
     */
309
    public function getIconSearch()
310
    {
311
        return $this->getIconByName('search');
312
    }
313
314
    /**
315
     * @return IconInterface
316
     */
317
    public function getIconAccount()
318
    {
319
        return $this->getIconByName('account');
320
    }
321
322
    /**
323
     * @return IconInterface
324
     */
325
    public function getIconGroup()
326
    {
327
        return $this->getIconByName('group');
328
    }
329
330
    /**
331
     * @return IconInterface
332
     */
333
    public function getIconSettings()
334
    {
335
        return $this->getIconByName('settings');
336
    }
337
338
    /**
339
     * @return IconInterface
340
     */
341
    public function getIconHeadline()
342
    {
343
        return $this->getIconByName('headline');
344
    }
345
346
    /**
347
     * @return IconInterface
348
     */
349
    public function getIconInfo()
350
    {
351
        return $this->getIconByName('info');
352
    }
353
354
    /**
355
     * @return IconInterface
356
     */
357
    public function getIconCritical()
358
    {
359
        return $this->getIconByName('critical');
360
    }
361
362
    /**
363
     * @return IconInterface
364
     */
365
    public function getIconEnabled()
366
    {
367
        return $this->getIconByName('enabled');
368
    }
369
370
    /**
371
     * @return IconInterface
372
     */
373
    public function getIconNotices()
374
    {
375
        return $this->getIconByName('notices');
376
    }
377
378
    /**
379
     * @return IconInterface
380
     */
381
    public function getIconRemove()
382
    {
383
        return $this->getIconByName('remove');
384
    }
385
386
    /**
387
     * @param string        $alias
388
     * @param IconInterface $icon
389
     */
390
    public function addIcon(string $alias, IconInterface $icon)
391
    {
392
        $this->icons[$alias] = $icon;
393
    }
394
}