File: 1023_fix-icon-labelling-with-default-theme.patch

package info (click to toggle)
gosa 2.8~git20230203.10abe45%2Bdfsg-19
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 33,108 kB
  • sloc: php: 32,102; javascript: 10,836; pascal: 3,776; xml: 3,135; sh: 852; python: 162; makefile: 45; perl: 2
file content (35 lines) | stat: -rw-r--r-- 888 bytes parent folder | download | duplicates (2)
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
Description: Properly render labelled icons if default materialize CSS theme is used.
Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>

--- a/include/functions.inc
+++ b/include/functions.inc
@@ -3663,6 +3663,14 @@
   global $BASE_DIR;
   $label= null;
 
+  /* Extract labels from path */
+  preg_match("/(.*\.png)\[(.*)\]$/", $path, $matches);
+
+  if (count($matches) == 3) {
+    $path = $matches[1];
+    $label= $matches[2];
+  }
+
   $theme = getThemeName();
 
   switch ($theme) {
@@ -3694,14 +3702,6 @@
         return "";
       }
 
-      /* Extract labels from path */
-      preg_match("/(.*\.png)\[(.*)\]$/", $path, $matches);
-
-      if (count($matches) == 3) {
-        $path = $matches[1];
-        $label= $matches[2];
-      }
-
       $baseImage = str_replace('['.$label.']', '', $path);
       if (!array_key_exists($baseImage, $styles)) {
         return "";