Total Complexity | 7 |
Total Lines | 74 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
19 | abstract class AbstractLibrary |
||
20 | { |
||
21 | /** |
||
22 | * The dialog library helper |
||
23 | * |
||
24 | * @var LibraryHelper |
||
25 | */ |
||
26 | private $xHelper = null; |
||
27 | |||
28 | /** |
||
29 | * Get the library name |
||
30 | * |
||
31 | * @return string |
||
32 | */ |
||
33 | abstract public function getName(): string; |
||
34 | |||
35 | /** |
||
36 | * Get the helper |
||
37 | * |
||
38 | * @return LibraryHelper |
||
39 | */ |
||
40 | public function helper(): LibraryHelper |
||
41 | { |
||
42 | return $this->xHelper ?: $this->xHelper = dialog()->getLibraryHelper($this->getName()); |
||
43 | } |
||
44 | |||
45 | /** |
||
46 | * Get the library base URI |
||
47 | * |
||
48 | * @return string |
||
49 | */ |
||
50 | public function getUri(): string |
||
51 | { |
||
52 | return ''; |
||
53 | } |
||
54 | |||
55 | /** |
||
56 | * Get the CSS header code and file includes |
||
57 | * |
||
58 | * @return string |
||
59 | */ |
||
60 | public function getJs(): string |
||
61 | { |
||
62 | return ''; |
||
63 | } |
||
64 | |||
65 | /** |
||
66 | * Get the javascript header code and file includes |
||
67 | * |
||
68 | * @return string |
||
69 | */ |
||
70 | public function getCss(): string |
||
73 | } |
||
74 | |||
75 | /** |
||
76 | * Get the javascript code to be printed into the page |
||
77 | * |
||
78 | * @return string |
||
79 | */ |
||
80 | public function getScript(): string |
||
81 | { |
||
82 | return ''; |
||
83 | } |
||
84 | |||
85 | /** |
||
86 | * Get the javascript code to be executed on page load |
||
87 | * |
||
88 | * @return string |
||
89 | */ |
||
90 | public function getReadyScript(): string |
||
93 | } |
||
94 | } |
||
95 |