Example #1
0
function printTagCheckboxTable($input_name, $preselect, $neg_preselect, $taglist, $realm = '')
{
    foreach ($taglist as $taginfo) {
        foreach (buildTagCheckboxRows($input_name, $preselect, $neg_preselect, $taginfo, $realm) as $row) {
            $tag_class = isset($taginfo['id']) && isset($taginfo['refcnt']) ? getTagClassName($row['input_value']) : '';
            echo "<tr class='{$row['tr_class']}'><td class='{$row['td_class']}' style='padding-left: " . $row['level'] * 16 . "px;'>";
            echo "<label><input type=checkbox class='{$row['input_class']}' name='{$row['input_name']}[]' value='{$row['input_value']}'";
            if (array_key_exists('input_extraattrs', $row)) {
                echo ' ' . $row['input_extraattrs'];
            }
            echo '> <span class="' . $tag_class . '">' . $row['text_tagname'] . '</span>';
            if (array_key_exists('text_refcnt', $row)) {
                echo " <i>({$row['text_refcnt']})</i>";
            }
            echo '</label></td></tr>';
        }
    }
}
Example #2
0
function serializeTags($chain, $baseurl = '')
{
    global $taglist;
    $tmp = array();
    usort($chain, 'cmpTags');
    foreach ($chain as $taginfo) {
        $title = '';
        if (isset($taginfo['user']) and isset($taginfo['time'])) {
            $title = htmlspecialchars($taginfo['user'] . ', ' . formatAge($taginfo['time']), ENT_QUOTES);
        }
        if (isset($taginfo['parent_id'])) {
            $parent_info = array();
            foreach ($taglist[$taginfo['id']]['trace'] as $tag_id) {
                $parent_info[] = $taglist[$tag_id]['tag'];
            }
            $parent_info[] = $taginfo['tag'];
            if (strlen($title)) {
                $title .= "\n";
            }
            $title .= implode(" →  ", $parent_info);
            # right arrow
        }
        if (strlen($title)) {
            $title = "title='{$title}'";
        }
        $class = '';
        if (isset($taginfo['id'])) {
            $class = 'class="' . getTagClassName($taginfo['id']) . '"';
        }
        $href = '';
        if ($baseurl == '') {
            $tag = 'span';
        } else {
            $tag = 'a';
            $href = "href='{$baseurl}cft[]={$taginfo['id']}'";
        }
        $tmp[] = "<{$tag} {$href} {$title} {$class}>" . $taginfo['tag'] . "</{$tag}>";
    }
    return implode(', ', $tmp);
}
Example #3
0
function serializeTags($chain, $baseurl = '')
{
    $tmp = array();
    usort($chain, 'cmpTags');
    foreach ($chain as $taginfo) {
        $title = '';
        if (isset($taginfo['user']) and isset($taginfo['time'])) {
            $title = 'title="' . htmlspecialchars($taginfo['user'] . ', ' . formatAge($taginfo['time']), ENT_QUOTES) . '"';
        }
        $class = '';
        if (isset($taginfo['id'])) {
            $class = 'class="' . getTagClassName($taginfo['id']) . '"';
        }
        $href = '';
        if ($baseurl == '') {
            $tag = 'span';
        } else {
            $tag = 'a';
            $href = "href='{$baseurl}cft[]={$taginfo['id']}'";
        }
        $tmp[] = "<{$tag} {$href} {$title} {$class}>" . $taginfo['tag'] . "</{$tag}>";
    }
    return implode(', ', $tmp);
}