From e532e3561f1b3a5f8fd7123c8d6f9cd75ad3fe5c Mon Sep 17 00:00:00 2001 From: iglocska Date: Thu, 25 Sep 2014 16:28:51 +0200 Subject: [PATCH] Moved the eventattributerow element back directly into eventattribute - Removed serious performance issue on large events --- app/View/Elements/eventattribute.ctp | 167 ++++++++++++++++++++++++++- 1 file changed, 166 insertions(+), 1 deletion(-) diff --git a/app/View/Elements/eventattribute.ctp b/app/View/Elements/eventattribute.ctp index d98626488..62a3f5c6f 100644 --- a/app/View/Elements/eventattribute.ctp +++ b/app/View/Elements/eventattribute.ctp @@ -89,7 +89,172 @@ $object): - echo $this->element('eventattributerow', array('object' => $object, 'mayModify' => $mayModify, 'mayPublish' => $mayPublish)); + + $extra = ''; + $extra2 = ''; + $extra3 = ''; + $currentType = 'denyForm'; + if ($object['objectType'] == 0 ) { + $currentType = 'Attribute'; + if ($object['hasChildren'] == 1) { + $extra = 'highlight1'; + $extra3 = 'highlightBlueSides highlightBlueTop'; + } + if (!$mayModify) $currentType = 'ShadowAttribute'; + } else $extra = 'highlight2'; + if ($object['objectType'] == 1) { + $extra2 = '1'; + $extra3 = 'highlightBlueSides'; + if (isset($object['firstChild'])) { + $extra3 .= ' highlightBlueTop'; + } + if (isset($object['lastChild'])) { + $extra3 .= ' highlightBlueBottom'; + } + } + ?> + + + + + + + + + +
+ +
+ + +
+
+ +
+ + +
+
+ +
+ + +
+ +
+ +
+ Html->link($filename, array('controller' => $t, 'action' => 'download', $object['id'])); + } else { + echo $this->Html->link($filenameHash[0], array('controller' => $t, 'action' => 'download', $object['id'])); + } + if (isset($filenameHash[1])) echo ' | ' . $filenameHash[1]; + } elseif (strpos($object['type'], '|') !== false) { + $filenameHash = explode('|', $object['value']); + echo h($filenameHash[0]); + if (isset($filenameHash[1])) echo ' | ' . $filenameHash[1]; + } elseif ('vulnerability' == $object['type']) { + if (! is_null(Configure::read('MISP.cveurl'))) { + $cveUrl = Configure::read('MISP.cveurl'); + } else { + $cveUrl = "http://www.google.com/search?q="; + } + echo $this->Html->link(h($sigDisplay), h($cveUrl) . h($sigDisplay), array('target' => '_blank')); + } elseif ('link' == $object['type']) { + echo $this->Html->link(h($sigDisplay), h($sigDisplay)); + } else { + $sigDisplay = str_replace("\r", '', $sigDisplay); + echo nl2br(h($sigDisplay)); + } + ?> +
+ + +
+
+   +
+ + + + + +
+
+ +
+ + + +
+
class="inline-field-solid" onClick="activateField('', '', 'distribution', );"> +   +
+ + + + + + + + + + + + + + +