Rev 1086 | Rev 1131 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1086 | Rev 1116 | ||
---|---|---|---|
Line 23... | Line 23... | ||
23 | \defined('INSIDE_OIDPLUS') or die; |
23 | \defined('INSIDE_OIDPLUS') or die; |
24 | // phpcs:enable PSR1.Files.SideEffects |
24 | // phpcs:enable PSR1.Files.SideEffects |
25 | 25 | ||
26 | class OIDplusObjectTypePluginAid extends OIDplusObjectTypePlugin { |
26 | class OIDplusObjectTypePluginAid extends OIDplusObjectTypePlugin { |
27 | 27 | ||
- | 28 | /** |
|
- | 29 | * @return string |
|
- | 30 | */ |
|
28 | public static function getObjectTypeClassName() { |
31 | public static function getObjectTypeClassName(): string { |
29 | return OIDplusAid::class; |
32 | return OIDplusAid::class; |
30 | } |
33 | } |
31 | 34 | ||
- | 35 | /** |
|
- | 36 | * @param string $id |
|
- | 37 | * @return bool |
|
- | 38 | */ |
|
32 | public function implementsFeature($id) { |
39 | public function implementsFeature(string $id): bool { |
33 | if (strtolower($id) == '1.3.6.1.4.1.37476.2.5.2.3.6') return true; // gridGeneratorLinks |
40 | if (strtolower($id) == '1.3.6.1.4.1.37476.2.5.2.3.6') return true; // gridGeneratorLinks |
34 | return false; |
41 | return false; |
35 | } |
42 | } |
36 | 43 | ||
- | 44 | /** |
|
37 | public function gridGeneratorLinks($objParent) { // Interface 1.3.6.1.4.1.37476.2.5.2.3.6 |
45 | * Implements interface 1.3.6.1.4.1.37476.2.5.2.3.6 |
- | 46 | * @param $objParent |
|
- | 47 | * @return string |
|
38 | 48 | */ |
|
- | 49 | public function gridGeneratorLinks($objParent): string { |
|
39 | if ($objParent->isRoot()) { |
50 | if ($objParent->isRoot()) { |
40 | return '<br><a href="javascript:OIDplusObjectTypePluginAid.generateRandomAID()">('._L('Generate a random AID - not unique!').')</a>'. |
51 | return '<br><a href="javascript:OIDplusObjectTypePluginAid.generateRandomAID()">('._L('Generate a random AID - not unique!').')</a>'. |
41 | '<br><a href="https://oidplus.viathinksoft.com/oidplus/?goto=aid%3AD276000186F" target="_blank">('._L('Request a free AID from ViaThinkSoft').')</a>'; |
52 | '<br><a href="https://oidplus.viathinksoft.com/oidplus/?goto=aid%3AD276000186F" target="_blank">('._L('Request a free AID from ViaThinkSoft').')</a>'; |
42 | } else { |
53 | } else { |
43 | return ''; |
54 | return ''; |
44 | } |
55 | } |
45 | } |
56 | } |
46 | 57 | ||
- | 58 | /** |
|
- | 59 | * @param string $static_node_id |
|
- | 60 | * @param bool $throw_exception |
|
- | 61 | * @return string |
|
- | 62 | */ |
|
47 | public static function prefilterQuery($static_node_id, $throw_exception) { |
63 | public static function prefilterQuery(string $static_node_id, bool $throw_exception): string { |
48 | if (str_starts_with($static_node_id,'aid:')) { |
64 | if (str_starts_with($static_node_id,'aid:')) { |
49 | $static_node_id = str_replace(' ', '', $static_node_id); |
65 | $static_node_id = str_replace(' ', '', $static_node_id); |
50 | 66 | ||
51 | $tmp = explode(':',$static_node_id,2); |
67 | $tmp = explode(':',$static_node_id,2); |
52 | if (isset($tmp[1])) $tmp[1] = strtoupper($tmp[1]); |
68 | if (isset($tmp[1])) $tmp[1] = strtoupper($tmp[1]); |