2011-11-26 10:45:31 +01:00
|
|
|
<div class="events form">
|
2012-08-22 16:04:55 +02:00
|
|
|
<?php echo $this->Form->create('Event', array('type' => 'file'));?>
|
2011-11-26 10:45:31 +01:00
|
|
|
<fieldset>
|
2012-03-16 14:13:31 +01:00
|
|
|
<legend><?php echo __('Add Event'); ?></legend>
|
2012-09-18 15:30:32 +02:00
|
|
|
<?php
|
|
|
|
echo $this->Form->input('date');
|
|
|
|
if ('true' == Configure::read('CyDefSIG.sync')) {
|
2012-10-17 14:45:26 +02:00
|
|
|
if ('true' == Configure::read('CyDefSIG.private')) {
|
2012-10-23 12:16:16 +02:00
|
|
|
echo $this->Form->input('distribution', array('label' => 'Distribution', 'selected' => 'All',
|
2012-10-23 11:28:39 +02:00
|
|
|
'between' => $this->Html->div('forminfo', '', array('id' => 'EventDistributionDiv'))
|
|
|
|
));
|
2012-10-17 14:45:26 +02:00
|
|
|
} else {
|
|
|
|
echo $this->Form->input('private', array(
|
2012-09-24 16:02:01 +02:00
|
|
|
'before' => $this->Html->div('forminfo', isset($eventDescriptions['private']['formdesc']) ? $eventDescriptions['private']['formdesc'] : $eventDescriptions['private']['desc']),));
|
2012-10-17 14:45:26 +02:00
|
|
|
}
|
2012-09-18 15:30:32 +02:00
|
|
|
}
|
|
|
|
echo $this->Form->input('risk', array(
|
2012-09-19 11:05:10 +02:00
|
|
|
'before' => $this->Html->div('forminfo', isset($eventDescriptions['risk']['formdesc']) ? $eventDescriptions['risk']['formdesc'] : $eventDescriptions['risk']['desc'])));
|
2012-09-18 15:30:32 +02:00
|
|
|
echo $this->Form->input('info');
|
2012-09-24 16:02:01 +02:00
|
|
|
echo $this->Form->input('Event.submittedfile', array(
|
|
|
|
'label' => '<b>GFI sandbox</b>',
|
|
|
|
'between' => '<br />',
|
|
|
|
'type' => 'file',
|
|
|
|
'before' => $this->Html->div('forminfo', isset($eventDescriptions['submittedfile']['formdesc']) ? $eventDescriptions['submittedfile']['formdesc'] : $eventDescriptions['submittedfile']['desc'])));
|
2012-04-01 18:41:47 +02:00
|
|
|
|
2012-10-23 11:28:39 +02:00
|
|
|
// link an onchange event to the form elements
|
|
|
|
$this->Js->get('#EventDistribution')->event('change', 'showFormInfo("#EventDistribution")');
|
|
|
|
|
2012-09-18 15:30:32 +02:00
|
|
|
?>
|
2011-11-26 10:45:31 +01:00
|
|
|
</fieldset>
|
|
|
|
<?php echo $this->Form->end(__('Submit', true));?>
|
|
|
|
</div>
|
|
|
|
<div class="actions">
|
|
|
|
<ul>
|
2012-09-18 15:30:32 +02:00
|
|
|
<?php echo $this->element('actions_menu'); ?>
|
2011-11-26 10:45:31 +01:00
|
|
|
|
|
|
|
</ul>
|
2012-09-24 16:02:01 +02:00
|
|
|
</div>
|
2012-10-23 11:28:39 +02:00
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
//
|
|
|
|
//Generate tooltip information
|
|
|
|
//
|
|
|
|
var formInfoValues = new Array();
|
|
|
|
<?php
|
|
|
|
foreach ($distributionDescriptions as $type => $def) {
|
|
|
|
$info = isset($def['formdesc']) ? $def['formdesc'] : $def['desc'];
|
|
|
|
echo "formInfoValues['" . addslashes($type) . "'] = \"" . addslashes($info) . "\";\n"; // as we output JS code we need to add slashes
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
|
|
|
|
function showFormInfo(id) {
|
|
|
|
idDiv = id+'Div';
|
|
|
|
// LATER use nice animations
|
|
|
|
//$(idDiv).hide('fast');
|
|
|
|
// change the content
|
|
|
|
var value = $(id).val(); // get the selected value
|
|
|
|
$(idDiv).html(formInfoValues[value]); // search in a lookup table
|
|
|
|
// show it again
|
|
|
|
$(idDiv).fadeIn('slow');
|
|
|
|
}
|
|
|
|
|
|
|
|
// hide the formInfo things
|
|
|
|
$('#EventDistributionDiv').hide();
|
|
|
|
</script>
|
|
|
|
<?php echo $this->Js->writeBuffer();
|