mirror of https://github.com/MISP/MISP
fix: add type dropdown in all generic forms.
parent
c947b5556c
commit
1bc44f5b0d
|
@ -17,26 +17,30 @@
|
|||
'class' => 'input',
|
||||
'empty' => __('(choose one)'),
|
||||
'options' => $categories,
|
||||
'stayInLine' => 1
|
||||
'stayInLine' => 1,
|
||||
'type' => 'dropdown'
|
||||
),
|
||||
array(
|
||||
'field' => 'type',
|
||||
'class' => 'input',
|
||||
'empty' => __('(choose category first)'),
|
||||
'options' => $types
|
||||
'options' => $types,
|
||||
'type' => 'dropdown'
|
||||
),
|
||||
array(
|
||||
'field' => 'distribution',
|
||||
'class' => 'input',
|
||||
'options' => $distributionLevels,
|
||||
'default' => isset($attribute['Attribute']['distribution']) ? $attribute['Attribute']['distribution'] : $initialDistribution,
|
||||
'stayInLine' => 1
|
||||
'stayInLine' => 1,
|
||||
'type' => 'dropdown'
|
||||
),
|
||||
array(
|
||||
'field' => 'sharing_group_id',
|
||||
'class' => 'input',
|
||||
'options' => $sharingGroups,
|
||||
'label' => __("Sharing Group")
|
||||
'label' => __("Sharing Group"),
|
||||
'type' => 'dropdown'
|
||||
),
|
||||
array(
|
||||
'field'=> 'value',
|
||||
|
|
|
@ -17,10 +17,10 @@ $fields = [
|
|||
[
|
||||
'field' => 'org_id',
|
||||
'label' => 'Owner Organisation',
|
||||
'type' => 'select',
|
||||
'options' => $dropdownData['org_id'],
|
||||
'class' => 'span6',
|
||||
'searchable' => 1
|
||||
'searchable' => 1,
|
||||
'type' => 'dropdown'
|
||||
],
|
||||
[
|
||||
'field' => 'description',
|
||||
|
|
|
@ -20,7 +20,8 @@
|
|||
array(
|
||||
'field' => 'widget',
|
||||
'class' => 'input span6',
|
||||
'options' => Hash::combine($data['widget_options'], '{s}.widget', '{s}.title')
|
||||
'options' => Hash::combine($data['widget_options'], '{s}.widget', '{s}.title'),
|
||||
'type' => 'dropdown'
|
||||
),
|
||||
array(
|
||||
'field' => 'width',
|
||||
|
|
|
@ -26,7 +26,8 @@
|
|||
'class' => 'input span6',
|
||||
'div' => 'input clear',
|
||||
'label' => __('Restrict to organisation'),
|
||||
'requirements' => $isSiteAdmin
|
||||
'requirements' => $isSiteAdmin,
|
||||
'type' => 'dropdown'
|
||||
),
|
||||
array(
|
||||
'field' => 'restrict_to_role_id',
|
||||
|
@ -34,7 +35,8 @@
|
|||
'class' => 'input span6',
|
||||
'div' => 'input clear',
|
||||
'label' => __('Restrict to role'),
|
||||
'requirements' => $isSiteAdmin
|
||||
'requirements' => $isSiteAdmin,
|
||||
'type' => 'dropdown'
|
||||
),
|
||||
array(
|
||||
'field' => 'restrict_to_permission_flag',
|
||||
|
@ -42,7 +44,8 @@
|
|||
'class' => 'input span6',
|
||||
'div' => 'input clear',
|
||||
'label' => __('Restrict to role permission flag'),
|
||||
'requirements' => $isSiteAdmin
|
||||
'requirements' => $isSiteAdmin,
|
||||
'type' => 'dropdown'
|
||||
),
|
||||
array(
|
||||
'field' => 'selectable',
|
||||
|
|
|
@ -48,7 +48,8 @@ if (!empty($data['fields'])) {
|
|||
[
|
||||
'fieldData' => $fieldData,
|
||||
'form' => $this->Form,
|
||||
'simpleFieldWhitelist' => $simpleFieldAllowedlist
|
||||
'simpleFieldWhitelist' => $simpleFieldAllowedlist,
|
||||
'modelForForm' => $modelForForm
|
||||
]
|
||||
);
|
||||
|
||||
|
|
|
@ -16,13 +16,15 @@
|
|||
'class' => 'input',
|
||||
'options' => $distributionLevels,
|
||||
'default' => isset($attribute['Attribute']['distribution']) ? $attribute['Attribute']['distribution'] : $initialDistribution,
|
||||
'stayInLine' => 1
|
||||
'stayInLine' => 1,
|
||||
'type' => 'dropdown'
|
||||
),
|
||||
array(
|
||||
'field' => 'sharing_group_id',
|
||||
'class' => 'input',
|
||||
'options' => $sharingGroups,
|
||||
'label' => __("Sharing Group")
|
||||
'label' => __("Sharing Group"),
|
||||
'type' => 'dropdown'
|
||||
),
|
||||
array(
|
||||
'field' => 'content',
|
||||
|
|
|
@ -24,25 +24,30 @@
|
|||
'class' => 'input',
|
||||
'options' => $distributionLevels,
|
||||
'default' => isset($event['Event']['distribution']) ? $event['Event']['distribution'] : $initialDistribution,
|
||||
'stayInLine' => 1
|
||||
'stayInLine' => 1,
|
||||
'type' => 'dropdown'
|
||||
),
|
||||
array(
|
||||
'field' => 'sharing_group_id',
|
||||
'class' => 'input',
|
||||
'options' => $sharingGroups,
|
||||
'label' => __("Sharing Group")
|
||||
'label' => __("Sharing Group"),
|
||||
'type' => 'dropdown'
|
||||
),
|
||||
array(
|
||||
'field' => 'threat_level_id',
|
||||
'class' => 'input',
|
||||
'options' => $threatLevels,
|
||||
'label' => __("Threat Level"),
|
||||
'stayInLine' => 1
|
||||
'stayInLine' => 1,
|
||||
'type' => 'dropdown'
|
||||
),
|
||||
array(
|
||||
'field' => 'analysis',
|
||||
'class' => 'input',
|
||||
'options' => $analysisLevels
|
||||
'options' => $analysisLevels,
|
||||
'stayInLine' => 1,
|
||||
'type' => 'dropdown'
|
||||
),
|
||||
array(
|
||||
'field' => 'info',
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
<?php
|
||||
$modelForForm = 'Feeds';
|
||||
$edit = $this->request->params['action'] === 'edit' ? true : false;
|
||||
echo $this->element('genericElements/Form/genericForm', [
|
||||
'data' => [
|
||||
'title' => $edit ? __('Edit MISP feed') : __('Add MISP feed'),
|
||||
'description' => __('Add a new MISP feed source.'),
|
||||
'model' => 'Feed',
|
||||
'fields' => [
|
||||
[
|
||||
'field' => 'enabled',
|
||||
|
|
|
@ -10,7 +10,8 @@ echo $this->element('genericElements/Form/genericForm', array(
|
|||
'label' => '<strong>' . __("Clusters' distribution:") . '</strong>',
|
||||
'options' => $distributionLevels,
|
||||
'selected' => array(1, 2, 3),
|
||||
'multiple' => 'checkbox',
|
||||
'multiple' => 'checkbox',
|
||||
'type' => 'dropdown'
|
||||
),
|
||||
'<br />',
|
||||
array(
|
||||
|
|
|
@ -29,12 +29,14 @@
|
|||
'field' => 'distribution',
|
||||
'options' => $distributionLevels,
|
||||
'default' => isset($cluster['GalaxyCluster']['distribution']) ? $cluster['GalaxyCluster']['distribution'] : $initialDistribution,
|
||||
'stayInLine' => 1
|
||||
'stayInLine' => 1,
|
||||
'type' => 'dropdown'
|
||||
),
|
||||
array(
|
||||
'field' => 'sharing_group_id',
|
||||
'options' => $sharingGroups,
|
||||
'label' => __("Sharing Group")
|
||||
'label' => __("Sharing Group"),
|
||||
'type' => 'dropdown'
|
||||
),
|
||||
array(
|
||||
'field' => 'referenced_galaxy_cluster_type',
|
||||
|
|
|
@ -32,12 +32,14 @@
|
|||
'field' => 'distribution',
|
||||
'options' => $distributionLevels,
|
||||
'default' => isset($cluster['GalaxyCluster']['distribution']) ? $cluster['GalaxyCluster']['distribution'] : $initialDistribution,
|
||||
'stayInLine' => 1
|
||||
'stayInLine' => 1,
|
||||
'type' => 'dropdown'
|
||||
),
|
||||
array(
|
||||
'field' => 'sharing_group_id',
|
||||
'options' => $sharingGroups,
|
||||
'label' => __("Sharing Group")
|
||||
'label' => __("Sharing Group"),
|
||||
'type' => 'dropdown'
|
||||
),
|
||||
!isset($forkedClusterMeta) ? '' : sprintf('<div id="fork_galaxy_preview" class="panel-container fork-cluster-preview"><h5>%s %s</h5>%s</div>',
|
||||
__('Forked Cluster data'),
|
||||
|
|
|
@ -57,6 +57,7 @@ echo $this->element('genericElements/Form/genericForm', [
|
|||
'options' => $countries,
|
||||
'class' => 'span4',
|
||||
'stayInLine' => 1,
|
||||
'type' => 'dropdown'
|
||||
],
|
||||
[
|
||||
'field' => 'sector',
|
||||
|
|
|
@ -14,7 +14,7 @@ $fields = [
|
|||
[
|
||||
'field' => 'permission',
|
||||
'label' => __('Permissions'),
|
||||
'type' => 'select',
|
||||
'type' => 'dropdown',
|
||||
'options' => $dropdownData['options'],
|
||||
'value' => '3',
|
||||
'class' => 'span3'
|
||||
|
|
|
@ -16,13 +16,15 @@ echo $this->element('genericElements/Form/genericForm', array(
|
|||
'class' => 'input',
|
||||
'empty' => __('(choose one)'),
|
||||
'options' => $categories,
|
||||
'stayInLine' => 1
|
||||
'stayInLine' => 1,
|
||||
'type' => 'dropdown'
|
||||
),
|
||||
array(
|
||||
'field' => 'type',
|
||||
'class' => 'input',
|
||||
'empty' => __('(choose category first)'),
|
||||
'options' => $types
|
||||
'options' => $types,
|
||||
'type' => 'dropdown'
|
||||
),
|
||||
array(
|
||||
'field'=> 'value',
|
||||
|
|
|
@ -65,14 +65,16 @@
|
|||
'class' => 'input-xxlarge',
|
||||
'required' => 1,
|
||||
'options' => $orgs,
|
||||
'default' => empty($suggestedOrg[0]) ? false : $suggestedOrg[0]
|
||||
'default' => empty($suggestedOrg[0]) ? false : $suggestedOrg[0],
|
||||
'type' => 'dropdown'
|
||||
),
|
||||
array(
|
||||
'field' => 'role_id',
|
||||
'label' => __('Role'),
|
||||
'class' => 'input-xxlarge',
|
||||
'required' => 1,
|
||||
'options' => $roles
|
||||
'options' => $roles,
|
||||
'type' => 'dropdown'
|
||||
)
|
||||
),
|
||||
'submit' => array(
|
||||
|
|
|
@ -19,16 +19,18 @@ echo $this->element('genericElements/Form/genericForm', array(
|
|||
'field' => 'type',
|
||||
'class' => 'input',
|
||||
'options' => $possibleTypes,
|
||||
'type' => 'dropdown'
|
||||
),
|
||||
array(
|
||||
'field' => 'category',
|
||||
'class' => 'input',
|
||||
'options' => $possibleCategories,
|
||||
'type' => 'dropdown'
|
||||
),
|
||||
array(
|
||||
'label' => __('Accepted attribute types'),
|
||||
'field' => 'matching_attributes',
|
||||
'type' => 'select',
|
||||
'type' => 'dropdown',
|
||||
'multiple' => 'multiple',
|
||||
),
|
||||
array(
|
||||
|
|
Loading…
Reference in New Issue