1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-11 01:04:16 +02:00
This commit is contained in:
Ryan Cramer
2022-05-27 11:00:58 -04:00
parent 2cf811f76c
commit f0bc888355

View File

@@ -1539,12 +1539,13 @@ abstract class Fieldtype extends WireData implements Module {
*
*/
public function get($key) {
if($key == 'name') return $this->className();
if($key == 'shortName') {
if($key === 'name') return $this->className();
if($key === 'shortName') {
return str_replace('Fieldtype', '', $this->className());
} else if($key == 'longName' && method_exists($this, 'getModuleInfo')) {
$info = $this->getModuleInfo($this);
return $info['title'];
} else if($key === 'longName') {
$title = $this->wire()->modules->getModuleInfoProperty($this, 'title');
if(empty($title)) $title = $this->get('shortName');
return $title;
}
return parent::get($key);
}