Internal attributes are now handled by the new backend setup for attribute tags

This commit is contained in:
2025-03-16 13:58:13 +11:00
parent 85c7132b30
commit 1470170928
8 changed files with 66 additions and 5 deletions

View File

@@ -30,7 +30,7 @@ abstract class Schema extends Attribute
while (! feof($f)) {
$line = trim(fgets($f));
if (! $line OR preg_match('/^#/',$line))
if ((! $line) || preg_match('/^#/',$line))
continue;
$fields = explode(':',$line);
@@ -41,12 +41,24 @@ abstract class Schema extends Attribute
'desc'=>Arr::get($fields,3,__('No description available, can you help with one?')),
]);
}
fclose($f);
return $result;
});
return Arr::get(($array ? $array->get($string) : []),$key);
return Arr::get(($array ? $array->get($string) : []),
$key,
__('No description available, can you help with one?'));
}
public function __get(string $key): mixed
{
return match ($key) {
// Schema items shouldnt have language tags, so our values should only have 1 key
'values'=>collect($this->values->first()),
default => parent::__get($key),
};
}
public function render(bool $edit=FALSE,bool $old=FALSE,bool $new=FALSE): View