]> _ Git - cubist_cms-back.git/commitdiff
wait #7208 @0:05
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 25 Nov 2024 11:29:44 +0000 (12:29 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 25 Nov 2024 11:29:44 +0000 (12:29 +0100)
src/app/CubistCrudPanel.php

index 9b99c5643fd9fbbd2d0ea5da7216278ad25eb208..c8b8aedf8be2ce39dcdc71a2c0641e5c27c26fa9 100644 (file)
@@ -157,6 +157,20 @@ class CubistCrudPanel extends CrudPanel
         $this->modifyField($name, ['default' => $value, 'value' => $value]);
     }
 
+    public function fields()
+    {
+        $res = $this->overwriteFieldNamesFromDotNotationToArray($this->getOperationSetting('fields') ?? []);
+        if (is_bool($this->getCurrentEntry())) {
+            return $res;
+        }
+        foreach ($res as $k => $v) {
+            if (isset($v['hint'])) {
+                $res[$k]['hint'] = str_replace('$id', $this->getCurrentEntry()->id, $v['hint']);
+            }
+        }
+        return $res;
+    }
+
     public function getEntryOrModel()
     {
         if (null === $this->entry) {