2020-05-29 13:41:58 +02:00
< ? php
2020-11-06 10:45:00 +01:00
echo $this -> element ( 'genericElements/Form/genericForm' , [
'data' => [
2020-06-04 10:05:45 +02:00
'title' => __ ( 'Add new encryption key' ),
2020-05-29 13:41:58 +02:00
'description' => __ ( 'Alignments indicate that an individual belongs to an organisation in one way or another. The type of relationship is defined by the type field.' ),
'model' => 'Organisations' ,
2020-11-06 10:45:00 +01:00
'fields' => [
[
2020-06-04 10:05:45 +02:00
'field' => 'owner_type' ,
'label' => __ ( 'Owner type' ),
'options' => array_combine ( array_keys ( $dropdownData ), array_keys ( $dropdownData )),
'type' => 'dropdown'
2020-11-06 10:45:00 +01:00
],
[
2020-06-04 10:05:45 +02:00
'field' => 'organisation_id' ,
'label' => __ ( 'Owner organisation' ),
2020-11-06 10:45:00 +01:00
'options' => $dropdownData [ 'organisation' ] ? ? [],
2020-06-04 10:05:45 +02:00
'type' => 'dropdown' ,
'stateDependence' => [
'source' => '#owner_type-field' ,
'option' => 'organisation'
]
2020-11-06 10:45:00 +01:00
],
[
2020-06-04 10:05:45 +02:00
'field' => 'individual_id' ,
'label' => __ ( 'Owner individual' ),
2020-11-06 10:45:00 +01:00
'options' => $dropdownData [ 'individual' ] ? ? [],
2020-06-04 10:05:45 +02:00
'type' => 'dropdown' ,
'stateDependence' => [
'source' => '#owner_type-field' ,
'option' => 'individual'
]
2020-11-06 10:45:00 +01:00
],
[
2020-05-29 13:41:58 +02:00
'field' => 'uuid' ,
'type' => 'uuid'
2020-11-06 10:45:00 +01:00
],
[
2020-05-29 13:41:58 +02:00
'field' => 'type' ,
2020-11-06 10:45:00 +01:00
'options' => [ 'pgp' => 'PGP' , 'smime' => 'S/MIME' ],
2020-06-04 10:05:45 +02:00
'type' => 'dropdown'
2020-11-06 10:45:00 +01:00
],
[
2020-05-29 13:41:58 +02:00
'field' => 'encryption_key' ,
'label' => __ ( 'Public key' ),
'type' => 'textarea' ,
'rows' => 8
2020-11-06 10:45:00 +01:00
],
[
'field' => 'revoked' ,
'label' => __ ( 'Revoked' ),
'type' => 'checkbox'
]
],
'submit' => [
2020-05-29 13:41:58 +02:00
'action' => $this -> request -> getParam ( 'action' )
2020-11-06 10:45:00 +01:00
]
]
]);