From: Vincent Vanwaelscappel Date: Mon, 25 Nov 2024 11:29:44 +0000 (+0100) Subject: wait #7208 @0:05 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=6bc5668333e15b36943df6b63fb5fbfdeae4836b;p=cubist_cms-back.git wait #7208 @0:05 --- diff --git a/src/app/CubistCrudPanel.php b/src/app/CubistCrudPanel.php index 9b99c56..c8b8aed 100644 --- a/src/app/CubistCrudPanel.php +++ b/src/app/CubistCrudPanel.php @@ -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) {