mirror of https://github.com/MISP/MISP
Merge pull request #7902 from JakubOnderka/attribute-list-link
fix: [UI] Add link to full attributepull/7905/head
commit
7c77d1d6fc
|
@ -20,7 +20,12 @@ echo $this->element('/genericElements/IndexTable/index_table', [
|
|||
[
|
||||
'name' => __('Event'),
|
||||
'sort' => 'Attribute.event_id',
|
||||
'data_path' => 'Attribute.event_id'
|
||||
'data_path' => 'Attribute.event_id',
|
||||
'element' => 'attributeLink',
|
||||
'link_title_path' => 'Event.info',
|
||||
'url' => function (array $row) {
|
||||
return '/events/view/' . $row['Attribute']['event_id'] . '#focus:' . $row['Attribute']['uuid'];
|
||||
}
|
||||
],
|
||||
[
|
||||
'name' => __('Org'),
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
$object = Hash::extract($row, $field['data']['object']['value_path']);
|
||||
|
||||
$li = [];
|
||||
if (isset($object['Feed'])) {
|
||||
foreach ($object['Feed'] as $feed) {
|
||||
$relatedData = array(
|
||||
|
@ -46,23 +46,21 @@ if (isset($object['Feed'])) {
|
|||
h($feed['id'])
|
||||
);
|
||||
}
|
||||
echo "<li>$liContents</li>";
|
||||
$li[] = "<li>$liContents</li>";
|
||||
}
|
||||
}
|
||||
if (isset($object['Server'])) {
|
||||
foreach ($object['Server'] as $server) {
|
||||
$popover = '';
|
||||
foreach ($server as $k => $v) {
|
||||
if ($k == 'id') continue;
|
||||
if ($k === 'id') continue;
|
||||
if (is_array($v)) {
|
||||
foreach ($v as $k2 => $v2) {
|
||||
$v[$k2] = h($v2);
|
||||
}
|
||||
$v = implode('<br />', $v);
|
||||
$v = array_map('h', $v);
|
||||
$v = implode('<br>', $v);
|
||||
} else {
|
||||
$v = h($v);
|
||||
}
|
||||
$popover .= '<span class=\'bold black\'>' . Inflector::humanize(h($k)) . '</span>: <span class="blue">' . $v . '</span><br />';
|
||||
$popover .= '<span class=\'bold black\'>' . Inflector::humanize(h($k)) . '</span>: <span class="blue">' . $v . '</span><br>';
|
||||
}
|
||||
foreach ($server['event_uuids'] as $k => $event_uuid) {
|
||||
$liContents = '';
|
||||
|
@ -81,7 +79,11 @@ if (isset($object['Server'])) {
|
|||
'S' . h($server['id']) . ':' . ($k + 1)
|
||||
);
|
||||
}
|
||||
echo "<li>$liContents</li>";
|
||||
$li[] = "<li>$liContents</li>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($li)) {
|
||||
echo '<ul class="inline">' . implode('', $li) .'</ul>';
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
$data = Hash::get($row, $field['data_path']);
|
||||
$linkTitle = isset($field['link_title_path']) ? h(Hash::get($row, $field['link_title_path'])) : null;
|
||||
$url = is_callable($field['url']) ? $field['url']($row) : $field['url'];
|
||||
if ($url[0] === '/') {
|
||||
$url = $baseurl . $url;
|
||||
}
|
||||
echo "<a href=\"$url\"";
|
||||
if ($linkTitle) {
|
||||
echo " title=\"$linkTitle\"";
|
||||
}
|
||||
echo '>' . h($data) . '</a>';
|
Loading…
Reference in New Issue