1 | <?php |
||
21 | class IconUtility |
||
22 | { |
||
23 | /** |
||
24 | * Add the given icon to the TCA table type. |
||
25 | * |
||
26 | * @param string $table |
||
27 | * @param string $type |
||
28 | * @param string $icon |
||
29 | */ |
||
30 | public static function addTcaTypeIcon($table, $type, $icon): void |
||
44 | |||
45 | /** |
||
46 | * Get the relative path of the extension icon. |
||
47 | * |
||
48 | * @param string $extensionKey |
||
49 | * @param bool $extSyntax Get the EXT: Syntax instead of a rel Path |
||
50 | * |
||
51 | * @return string |
||
52 | */ |
||
53 | public static function getByExtensionKey($extensionKey, $extSyntax = false) |
||
66 | |||
67 | /** |
||
68 | * Get the absolute table icon for the given model name. |
||
69 | * |
||
70 | * @param string $modelClassName |
||
71 | * @param bool $extSyntax Get the EXT: Syntax instead of a rel Path |
||
72 | * |
||
73 | * @return string |
||
74 | */ |
||
75 | public static function getByModelName($modelClassName, $extSyntax = false) |
||
94 | |||
95 | /** |
||
96 | * Get the file extension (svg,png,gif) of the absolute path. The path is |
||
97 | * without file extension but incl. the dot. e.g.: |
||
98 | * "/test/icon.". |
||
99 | * |
||
100 | * @param string $absolutePathWithoutExtension |
||
101 | * |
||
102 | * @return string |
||
103 | */ |
||
104 | public static function getIconFileExtension($absolutePathWithoutExtension) |
||
120 | |||
121 | /** |
||
122 | * Return the right relative path. |
||
123 | * |
||
124 | * @param string $extensionKey |
||
125 | * @param string $path |
||
126 | * @param bool $extSyntax |
||
127 | * |
||
128 | * @return string |
||
129 | */ |
||
130 | protected static function returnRelativeIconPath($extensionKey, $path, $extSyntax = false) |
||
139 | } |
||
140 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: