mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-30 09:14:09 +02:00
parent
8715006f7e
commit
1e694f2d1b
30
library/Director/Web/Hook/DataTypeHook.php
Normal file
30
library/Director/Web/Hook/DataTypeHook.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Icinga\Module\Director\Web\Hook;
|
||||
|
||||
use Icinga\Module\Director\Web\Form\QuickForm;
|
||||
|
||||
abstract class DataTypeHook
|
||||
{
|
||||
public function getName()
|
||||
{
|
||||
$parts = explode('\\', get_class($this));
|
||||
$class = preg_replace('/DataType/', '', array_pop($parts));
|
||||
|
||||
if (array_shift($parts) === 'Icinga' && array_shift($parts) === 'Module') {
|
||||
$module = array_shift($parts);
|
||||
if ($module !== 'Director') {
|
||||
return sprintf('%s (%s)', $class, $module);
|
||||
}
|
||||
}
|
||||
|
||||
return $class;
|
||||
}
|
||||
|
||||
public static function getFormat()
|
||||
{
|
||||
return 'string';
|
||||
}
|
||||
|
||||
abstract public function getFormElement(QuickForm $form);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user