Chora::showAuthorName PHP Method

showAuthorName() public static method

Convert a commit-name into whatever the user wants.
public static showAuthorName ( string $name, $fullname = false ) : string
$name string Account name.
return string The transformed name.
    public static function showAuthorName($name, $fullname = false)
    {
        try {
            $users = $GLOBALS['VC']->getUsers($GLOBALS['chora_conf']['cvsusers']);
            if (isset($users[$name])) {
                return '<a href="' . ($GLOBALS['registry']->hasMethod('mail/compose') ? $GLOBALS['registry']->call('mail/compose', array(array('to' => $users[$name]['mail']))) : 'mailto:' . htmlspecialchars($users[$name]['mail'])) . '">' . htmlspecialchars($fullname ? $users[$name]['name'] : $name) . '</a>' . ($fullname ? ' <em>' . htmlspecialchars($name) . '</em>' : '');
            }
        } catch (Horde_Vcs_Exception $e) {
        }
        return htmlspecialchars($name);
    }

Usage Example

Esempio n. 1
0
        $rev = $row[$i];
        //        if ($VC->isValidRevision($rev) && ($VC->sizeof($rev) % 2)) {
        if ($VC->isValidRevision($rev)) {
            /* This is a branch point, so put the info out. */
            $bg = isset($branch_colors[$rev]) ? $branch_colors[$rev] : '#e9e9e9';
            $symname = $fl->branches[$rev];
            require CHORA_TEMPLATES . '/history/branch_cell.inc';
        } elseif (preg_match('|^:|', $rev)) {
            /* This is a continuation cell, so render it with the
             * branch colour. */
            //            $bgbr = $VC->strip(preg_replace('|^\:|', '', $rev), 1);
            $bg = isset($branch_colors[$bgbr]) ? $branch_colors[$bgbr] : '#e9e9e9';
            require CHORA_TEMPLATES . '/history/blank.inc';
        } elseif ($VC->isValidRevision($rev)) {
            /* This cell contains a revision, so render it. */
            //            $bgbr = $VC->strip($rev, 1);
            $bg = isset($branch_colors[$bgbr]) ? $branch_colors[$bgbr] : '#e9e9e9';
            $log = $fl->getLog($rev);
            $author = Chora::showAuthorName($log->getAuthor());
            $date = strftime('%e %b %Y', $log->getDate());
            $lines = $log->getChanges();
            require CHORA_TEMPLATES . '/history/rev.inc';
        } else {
            /* Exhausted other possibilities, just show a blank cell. */
            require CHORA_TEMPLATES . '/history/blank.inc';
        }
    }
    echo '</tr>';
}
require CHORA_TEMPLATES . '/history/footer.inc';
$page_output->footer();
All Usage Examples Of Chora::showAuthorName