<commit_before><?php
    if (!empty($required_taxonomies)) {
        foreach ($required_taxonomies as $k => $v) {
            foreach ($tags as $tag) {
                $temp_tag = explode(':', $tag['Tag']['name']);
                if (count($temp_tag) > 1) {
                    if ($temp_tag[0] == $v) {
                        unset($required_taxonomies[$k]);
                        break;
                    }
                }
            }
        }
        if (!empty($required_taxonomies)) {
            echo sprintf(
                'Missing taxonomies: <span class="red bold">%s</span><br />',
                implode(', ', $required_taxonomies)
            );
        }
    }
?>
<span style="display:inline-block;">
    <?php
        $full = $isAclTagger && $tagAccess && empty($static_tags_only);
        $tagData = "";
        foreach ($tags as $tag) {
            if (empty($tag['Tag'])) {
                $tag['Tag'] = $tag;
            }
            if (empty($tag['Tag']['colour'])) {
                $tag['Tag']['colour'] = '#0088cc';
            }
            $aStyle = 'display:inline-block; background-color:' . h($tag['Tag']['colour']) . ';color:' . $this->TextColour->getTextColour($tag['Tag']['colour']) . ';';
            $aClass = $full ? 'tagFirstHalf' : 'tag';
            $aText = h($tag['Tag']['name']);
            if (!empty($tag['Tag']['id'])) {
                $aSearchTagUrl = $baseurl . '/events/index/searchtag: ' . h($tag['Tag']['id']);
                $span1 = sprintf('<a href="%s" style="%s" class="%s">%s</a>', $aSearchTagUrl, $aStyle, $aClass, $aText);
            } else {
                $aSpan1 = sprintf('<span style="%s" class="%s">%s</span>', $aStyle, $aClass, $aText);
            }
            $span2 = '';
            if ($full) {
                $spanClass = "tagSecondHalf useCursorPointer noPrint";
                $spanTitle = __('Remove tag');
                $spanRole = "button";
                $spanTabIndex = "0";
                $spanAriaLabel = __('Remove tag %s', h($tag['Tag']['name']));
                $spanOnClick = "removeObjectTagPopup(this, 'event', '" . h($event['Event']['id']) . "', '" . h($tag['Tag']['id']) . "')";
                $span2 = sprintf('<span class="%s" title="%s" role="%s" tabindex="%s" aria-label="%s" onClick="%s">x</span>', $spanClass, $spanTitle, $spanRole, $spanTabIndex, $spanAriaLabel, $spanOnClick);
            }
            $tagData .= '<span style="white-space:nowrap;">' . $span1 . $span2 . '</span>  ';
        }
        $buttonData = "&nbsp;";
        if ($full) {
            $buttonVars = array(
                'addTagButton',
                __('Add a tag'),
                'button',
                '0',
                __('Add a tag'),
                'btn btn-inverse noPrint',
                'line-height:10px; padding: 4px 4px;',
                'popoverPopup(this, \'' . h($event['Event']['id']) . '\', \'tags\', \'selectTaxonomy\');'
            );
            $buttonData = vsprintf('<button id="%s" title="%s" role ="%s" tabindex="%s" aria-label="%s" class="%s" style="%s" onClick="%s">+</button>', $buttonVars);
        }
        $tagData .= $buttonData;
    ?>
        <span style="padding:1px; display:flex; display: inline-block; margin-right:2px;word-wrap:break-word;"><?php echo $tagData; ?></span>
</span>
<commit_msg>fix: [ajaxTypes] copy pasta fixed<commit_after><?php
    if (!empty($required_taxonomies)) {
        foreach ($required_taxonomies as $k => $v) {
            foreach ($tags as $tag) {
                $temp_tag = explode(':', $tag['Tag']['name']);
                if (count($temp_tag) > 1) {
                    if ($temp_tag[0] == $v) {
                        unset($required_taxonomies[$k]);
                        break;
                    }
                }
            }
        }
        if (!empty($required_taxonomies)) {
            echo sprintf(
                'Missing taxonomies: <span class="red bold">%s</span><br />',
                implode(', ', $required_taxonomies)
            );
        }
    }
?>
<span style="display:inline-block;">
    <?php
        $full = $isAclTagger && $tagAccess && empty($static_tags_only);
        $tagData = "";
        foreach ($tags as $tag) {
            if (empty($tag['Tag'])) {
                $tag['Tag'] = $tag;
            }
            if (empty($tag['Tag']['colour'])) {
                $tag['Tag']['colour'] = '#0088cc';
            }
            $aStyle = 'display:inline-block; background-color:' . h($tag['Tag']['colour']) . ';color:' . $this->TextColour->getTextColour($tag['Tag']['colour']) . ';';
            $aClass = $full ? 'tagFirstHalf' : 'tag';
            $aText = h($tag['Tag']['name']);
            if (!empty($tag['Tag']['id'])) {
                $aSearchTagUrl = $baseurl . '/events/index/searchtag: ' . h($tag['Tag']['id']);
                $span1 = sprintf('<a href="%s" style="%s" class="%s">%s</a>', $aSearchTagUrl, $aStyle, $aClass, $aText);
            } else {
                $span1 = sprintf('<span style="%s" class="%s">%s</span>', $aStyle, $aClass, $aText);
            }
            $span2 = '';
            if ($full) {
                $spanClass = "tagSecondHalf useCursorPointer noPrint";
                $spanTitle = __('Remove tag');
                $spanRole = "button";
                $spanTabIndex = "0";
                $spanAriaLabel = __('Remove tag %s', h($tag['Tag']['name']));
                $spanOnClick = "removeObjectTagPopup(this, 'event', '" . h($event['Event']['id']) . "', '" . h($tag['Tag']['id']) . "')";
                $span2 = sprintf('<span class="%s" title="%s" role="%s" tabindex="%s" aria-label="%s" onClick="%s">x</span>', $spanClass, $spanTitle, $spanRole, $spanTabIndex, $spanAriaLabel, $spanOnClick);
            }
            $tagData .= '<span style="white-space:nowrap;">' . $span1 . $span2 . '</span>  ';
        }
        $buttonData = "&nbsp;";
        if ($full) {
            $buttonVars = array(
                'addTagButton',
                __('Add a tag'),
                'button',
                '0',
                __('Add a tag'),
                'btn btn-inverse noPrint',
                'line-height:10px; padding: 4px 4px;',
                'popoverPopup(this, \'' . h($event['Event']['id']) . '\', \'tags\', \'selectTaxonomy\');'
            );
            $buttonData = vsprintf('<button id="%s" title="%s" role ="%s" tabindex="%s" aria-label="%s" class="%s" style="%s" onClick="%s">+</button>', $buttonVars);
        }
        $tagData .= $buttonData;
    ?>
        <span style="padding:1px; display:flex; display: inline-block; margin-right:2px;word-wrap:break-word;"><?php echo $tagData; ?></span>
</span>

{'fraction_non_alphanumeric': 0.2096557890031292, 'fraction_numerical': 0.005960363582178513, 'mean_word_length': 1.8332629801604052, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 51, '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': '945500', 'n_tokens_mistral': 2129, 'n_tokens_neox': 2071, 'n_words': 370}