Пример #1
0
 /**
  * Returns html string to display
  * @return string
  */
 public function html()
 {
     $t_string = $this->tag ? lang_get('timeline_issue_tagged') : lang_get('timeline_issue_untagged');
     $t_tag_row = tag_get_by_name($this->tag_name);
     $t_html = $this->html_start();
     $t_html .= '<div class="action">' . sprintf($t_string, user_get_name($this->user_id), string_get_bug_view_link($this->issue_id), $t_tag_row ? tag_get_link($t_tag_row) : $this->tag_name) . '</div>';
     $t_html .= $this->html_end();
     return $t_html;
 }
Пример #2
0
/**
 * Display a tag hyperlink.
 * If a bug ID is passed, the tag link will include a detach link if the
 * user has appropriate privileges.
 * @param array   $p_tag_row Tag row.
 * @param integer $p_bug_id  The bug ID to display.
 * @return boolean
 */
function tag_display_link(array $p_tag_row, $p_bug_id = 0)
{
    static $s_security_token = null;
    if (is_null($s_security_token)) {
        $s_security_token = htmlspecialchars(form_security_param('tag_detach'));
    }
    echo tag_get_link($p_tag_row);
    if (isset($p_tag_row['user_attached']) && auth_get_current_user_id() == $p_tag_row['user_attached'] || auth_get_current_user_id() == $p_tag_row['user_id']) {
        $t_detach = config_get('tag_detach_own_threshold');
    } else {
        $t_detach = config_get('tag_detach_threshold');
    }
    if ($p_bug_id > 0 && access_has_bug_level($t_detach, $p_bug_id)) {
        $t_tooltip = string_html_specialchars(sprintf(lang_get('tag_detach'), string_display_line($p_tag_row['name'])));
        echo '<a href="tag_detach.php?bug_id=' . $p_bug_id . '&amp;tag_id=' . $p_tag_row['id'] . $s_security_token . '"><img src="images/delete.png" class="delete-icon" title="' . $t_tooltip . '" alt="X"/></a>';
    }
    return true;
}