Browse code

[Update] Add classes for member fields to templates

Sebastian Zoglowek authored on23/05/2022 22:50:21
Showing3 changed files
... ...
@@ -58,11 +58,11 @@ abstract class ModuleMemberExtension extends Module
58 58
                     {
59 59
                         if (\is_array(($arrValue = StringUtil::deserialize($varValue))))
60 60
                         {
61
-                            $arrFields[] = implode(",", $arrValue);
61
+                            $arrFields[$field] = implode(",", $arrValue);
62 62
                         }
63 63
                         else
64 64
                         {
65
-                            $arrFields[] = $varValue;
65
+                            $arrFields[$field] = $varValue;
66 66
                         }
67 67
                     }
68 68
             }
... ...
@@ -5,8 +5,8 @@
5 5
         </figure>
6 6
     <?php endif; ?>
7 7
     <ul>
8
-        <?php foreach ($this->fields as $field): ?>
9
-            <li><?=$field?></li>
8
+        <?php foreach ($this->fields as $k => $v): ?>
9
+            <li class="<?= $k ?>"><?= $v ?></li>
10 10
         <?php endforeach; ?>
11 11
     </ul>
12 12
     <?php if($this->link): ?>
... ...
@@ -5,8 +5,8 @@
5 5
         </figure>
6 6
     <?php endif; ?>
7 7
     <ul>
8
-        <?php foreach ($this->fields as $field): ?>
9
-            <li><?=$field?></li>
8
+        <?php foreach ($this->fields as $k => $v): ?>
9
+            <li class="<?= $k ?>"><?= $v ?></li>
10 10
         <?php endforeach; ?>
11 11
     </ul>
12 12
 </div>