<commit_before><?php
$tr_class = '';
if (empty($context)) {
    $context = 'event';
}
$linkClass = 'blue';
if ($event['Event']['id'] != $object['event_id']) {
    if (!$isSiteAdmin && $event['extensionEvents'][$object['event_id']]['Orgc']['id'] != $me['org_id']) {
        $mayModify = false;
    }
}
$editScope = ($isSiteAdmin || $mayModify) ? 'Attribute' : 'ShadowAttribute';
if (!empty($child)) {
    if ($child === 'last' && empty($object['ShadowAttribute'])) {
        $tr_class .= ' tableHighlightBorderBottom borderBlue';
    } else {
        $tr_class .= ' tableHighlightBorderCenter borderBlue';
    }
    if (!empty($object['ShadowAttribute'])) {
        $tr_class .= ' tableInsetOrangeFirst';
    }
} else {
    $child = false;
    if (!empty($object['ShadowAttribute'])) {
        $tr_class .= ' tableHighlightBorderTop borderOrange';
    }
}
if (!empty($object['deleted'])) {
    $tr_class .= ' deleted-attribute';
}
if (!empty($k)) {
    $tr_class .= ' row_' . h($k);
}

$objectId = (int) $object['id'];

$quickEdit = function($fieldName) use ($editScope, $object, $event) {
    if ($object['deleted']) {
        return ''; // deleted attributes are not editable
    }
    if ($editScope === 'ShadowAttribute') {
        return ''; // currently it is not supported to create proposals trough quick edit
    }
    if ($fieldName === 'value' && ($object['type'] === 'attachment' || $object['type'] === 'malware-sample')) {
        return '';
    }
    return " onmouseenter=\"quickEditHover(this, '$editScope', {$object['id']}, '$fieldName', {$event['Event']['id']});\"";
}

?>
<tr id="Attribute_<?= $objectId ?>_tr" data-primary-id="<?= $objectId ?>" class="<?php echo $tr_class; ?>" tabindex="0">
    <?php if (($mayModify || !empty($extended)) && empty($disable_multi_select)): ?>
      <td style="width:10px;" data-position="<?php echo 'attribute_' . $objectId ?>">
      <?php if ($mayModify):?>
          <input id="select_<?= $objectId ?>" class="select_attribute row_checkbox" type="checkbox" data-id="<?= $objectId ?>" aria-label="<?php echo __('Select attribute');?>">
      <?php endif; ?>
      </td>
    <?php endif; ?>
    <td class="short context hidden"><?= $objectId ?></td>
    <td class="short context hidden uuid quickSelect"><?php echo h($object['uuid']); ?></td>
    <td class="short context hidden">
        <?php echo $this->element('/Events/View/seen_field', array('object' => $object)); ?>
    </td>
    <td class="short timestamp"><?= $this->Time->date($object['timestamp']) ?></td>
    <?php
      if (!empty($extended)):
    ?>
      <td class="short">
        <?php
            $event_info = sprintf('title="%s%s"',
                __('Event info') . ':&#10;     ',
                $object['event_id'] != $event['Event']['id'] ? h($event['extensionEvents'][$object['event_id']]['info']) : h($event['Event']['info'])
            );
        ?>
        <?php echo '<a href="' . $baseurl . '/events/view/' . h($object['event_id']) . '" ' . $event_info . '>' . h($object['event_id']) . '</a>'; ?>
      </td>
    <?php
      endif;
    ?>
    <td class="short">
      <?php
        if (!empty($extended)):
          if ($object['event_id'] != $event['Event']['id']):
            $extensionOrg = $event['extensionEvents'][$object['event_id']]['Orgc'];
            echo $this->OrgImg->getOrgLogo($extensionOrg, 24);
          else:
            echo $this->OrgImg->getOrgLogo($event['Orgc'], 24);
          endif;
        endif;
      ?>
    </td>
    <td class="short"<?= $quickEdit('category') ?>>
      <div class="inline-field-solid">
        <?php echo h($object['category']); ?>
      </div>
    </td>
    <td class="short"<?= $quickEdit('type') ?>>
      <?php if (!empty($object['object_relation'])):?>
          <div class="bold"><?php echo h($object['object_relation']); ?>:</div>
      <?php endif; ?>
      <div class="inline-field-solid">
        <?php echo h($object['type']); ?>
      </div>
    </td>
    <td id="Attribute_<?= $objectId ?>_container" class="showspaces limitedWidth shortish"<?= $quickEdit('value') ?>>
      <div class="inline-field-solid">
        <?php
            if (Configure::read('Plugin.Enrichment_hover_enable') && isset($modules) && isset($modules['hover_type'][$object['type']])) {
                $commonDataFields = sprintf('data-object-type="Attribute" data-object-id="%s"', $objectId);
                $spanExtra = Configure::read('Plugin.Enrichment_hover_popover_only') ? '' : sprintf(' class="eventViewAttributeHover" %s', $commonDataFields);
                $popupButton = sprintf('<i class="fa fa-search-plus useCursorPointer eventViewAttributePopup noPrint" title="%s" %s></i>', __('Show hover enrichment'), $commonDataFields);
                echo sprintf(
                    '<span%s>%s</span> %s',
                    $spanExtra,
                    $this->element('/Events/View/value_field', array('object' => $object, 'linkClass' => $linkClass)),
                    $popupButton
                );
            } else {
                echo $this->element('/Events/View/value_field', array('object' => $object, 'linkClass' => $linkClass));
            }<commit_msg>chg: [UI] Link class is not required<commit_after><?php
$tr_class = '';
if (empty($context)) {
    $context = 'event';
}
if ($event['Event']['id'] != $object['event_id']) {
    if (!$isSiteAdmin && $event['extensionEvents'][$object['event_id']]['Orgc']['id'] != $me['org_id']) {
        $mayModify = false;
    }
}
$editScope = ($isSiteAdmin || $mayModify) ? 'Attribute' : 'ShadowAttribute';
if (!empty($child)) {
    if ($child === 'last' && empty($object['ShadowAttribute'])) {
        $tr_class .= ' tableHighlightBorderBottom borderBlue';
    } else {
        $tr_class .= ' tableHighlightBorderCenter borderBlue';
    }
    if (!empty($object['ShadowAttribute'])) {
        $tr_class .= ' tableInsetOrangeFirst';
    }
} else {
    $child = false;
    if (!empty($object['ShadowAttribute'])) {
        $tr_class .= ' tableHighlightBorderTop borderOrange';
    }
}
if (!empty($object['deleted'])) {
    $tr_class .= ' deleted-attribute';
}
if (!empty($k)) {
    $tr_class .= ' row_' . h($k);
}

$objectId = (int) $object['id'];

$quickEdit = function($fieldName) use ($editScope, $object, $event) {
    if ($object['deleted']) {
        return ''; // deleted attributes are not editable
    }
    if ($editScope === 'ShadowAttribute') {
        return ''; // currently it is not supported to create proposals trough quick edit
    }
    if ($fieldName === 'value' && ($object['type'] === 'attachment' || $object['type'] === 'malware-sample')) {
        return '';
    }
    return " onmouseenter=\"quickEditHover(this, '$editScope', {$object['id']}, '$fieldName', {$event['Event']['id']});\"";
}

?>
<tr id="Attribute_<?= $objectId ?>_tr" data-primary-id="<?= $objectId ?>" class="<?php echo $tr_class; ?>" tabindex="0">
    <?php if (($mayModify || !empty($extended)) && empty($disable_multi_select)): ?>
      <td style="width:10px;">
      <?php if ($mayModify):?>
          <input id="select_<?= $objectId ?>" class="select_attribute row_checkbox" type="checkbox" data-id="<?= $objectId ?>" aria-label="<?php echo __('Select attribute');?>">
      <?php endif; ?>
      </td>
    <?php endif; ?>
    <td class="short context hidden"><?= $objectId ?></td>
    <td class="short context hidden uuid quickSelect"><?php echo h($object['uuid']); ?></td>
    <td class="short context hidden">
        <?php echo $this->element('/Events/View/seen_field', array('object' => $object)); ?>
    </td>
    <td class="short timestamp"><?= $this->Time->date($object['timestamp']) ?></td>
    <?php
      if (!empty($extended)):
    ?>
      <td class="short">
        <?php
            $event_info = sprintf('title="%s%s"',
                __('Event info') . ':&#10;     ',
                $object['event_id'] != $event['Event']['id'] ? h($event['extensionEvents'][$object['event_id']]['info']) : h($event['Event']['info'])
            );
        ?>
        <?php echo '<a href="' . $baseurl . '/events/view/' . h($object['event_id']) . '" ' . $event_info . '>' . h($object['event_id']) . '</a>'; ?>
      </td>
    <?php
      endif;
    ?>
    <td class="short">
      <?php
        if (!empty($extended)):
          if ($object['event_id'] != $event['Event']['id']):
            $extensionOrg = $event['extensionEvents'][$object['event_id']]['Orgc'];
            echo $this->OrgImg->getOrgLogo($extensionOrg, 24);
          else:
            echo $this->OrgImg->getOrgLogo($event['Orgc'], 24);
          endif;
        endif;
      ?>
    </td>
    <td class="short"<?= $quickEdit('category') ?>>
      <div class="inline-field-solid">
        <?php echo h($object['category']); ?>
      </div>
    </td>
    <td class="short"<?= $quickEdit('type') ?>>
      <?php if (!empty($object['object_relation'])):?>
          <div class="bold"><?php echo h($object['object_relation']); ?>:</div>
      <?php endif; ?>
      <div class="inline-field-solid">
        <?php echo h($object['type']); ?>
      </div>
    </td>
    <td id="Attribute_<?= $objectId ?>_container" class="showspaces limitedWidth shortish"<?= $quickEdit('value') ?>>
      <div class="inline-field-solid">
        <?php
            $value = $this->element('/Events/View/value_field', array('object' => $object));
            if (Configure::read('Plugin.Enrichment_hover_enable') && isset($modules) && isset($modules['hover_type'][$object['type']])) {
                $commonDataFields = sprintf('data-object-type="Attribute" data-object-id="%s"', $objectId);
                $spanExtra = Configure::read('Plugin.Enrichment_hover_popover_only') ? '' : sprintf(' class="eventViewAttributeHover" %s', $commonDataFields);
                $popupButton = sprintf('<i class="fa fa-search-plus useCursorPointer eventViewAttributePopup noPrint" title="%s" %s></i>', __('Show hover enrichment'), $commonDataFields);
                echo sprintf(
                    '<span%s>%s</span> %s',
                    $spanExtra,
                    $value,
                    $popupButton
                );
            } else {
                echo $value;
            }
{'fraction_non_alphanumeric': 0.22026734814232357, 'fraction_numerical': 0.0017692156477295065, 'mean_word_length': 3.0059055118110236, 'pattern_counts': {'":': 0, '<': 132, '<?xml version=': 0, '>': 154, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2971874', 'n_tokens_mistral': 3149, 'n_tokens_neox': 3118, 'n_words': 610}