TextColour->getTextColour($tag['Tag']['colour']); $aClass = 'tag nowrap'; $aText = trim($tag['Tag']['name']); $aTextModified = null; if (isset($tag_display_style)) { if ($tag_display_style == 1) { // default behaviour, do nothing for now } else if ($tag_display_style == 2) { $separator_pos = strpos($aText, ':'); if ($separator_pos !== false) { $aTextModified = substr($aText, $separator_pos + 1); $value_pos = strpos($aTextModified, '='); if ($value_pos !== false) { $aTextModified = substr($aTextModified, $value_pos + 1); $aTextModified = trim($aTextModified, '"'); } $aTextModified = h($aTextModified); } } else if ($tag_display_style === 0 || $tag_display_style === '0') { $aTextModified = ' '; } } $aText = h($aText); $span_scope = !empty($hide_global_scope) ? '' : sprintf( '', 'black-white tag', !empty($tag['local']) ? __('Local tag') : __('Global tag'), !empty($tag['local']) ? __('Local tag') : __('Global tag'), !empty($tag['local']) ? 'user' : 'globe-americas' ); $span_relationship_type = empty($tag['relationship_type']) ? '' : sprintf( '%s:', h($tag['relationship_type']), h($tag['relationship_type']), h($tag['relationship_type']) ); if (!empty($tag['Tag']['id'])) { $span_tag = sprintf( '%s', $baseurl . $searchUrl . intval($tag['Tag']['id']), $aStyle, $aClass, isset($aTextModified) ? ' title="' . $aText . '"' : '', intval($tag['Tag']['id']), isset($aTextModified) ? $aTextModified : $aText ); } else { $span_tag = sprintf( '%s', $aStyle, $aClass, $aText ); } $span_delete = ''; $span_relationship = ''; if ($canModifyAllTags || ($canModifyLocalTags && $tag['Tag']['local'])) { $span_relationship = sprintf( '', 'black-white tag noPrint modal-open', __('Modify Tag Relationship'), __('Modify relationship for tag %s', h($tag['Tag']['name'])), sprintf( '%s/tags/modifyTagRelationship/%s/%s', $baseurl, h($scope), h($tag['id']) ) ); $span_delete = sprintf( 'x', 'black-white tag useCursorPointer noPrint', __('Remove tag'), "button", "0", __('Remove tag %s', h($tag['Tag']['name'])), sprintf( "removeObjectTagPopup(this, '%s', %s, %s)", $scope, $id, intval($tag['Tag']['id']) ) ); } echo '' . $span_scope . $span_relationship_type . $span_tag . $span_relationship . $span_delete . ' ';