in['path'], -1, PREG_SPLIT_NO_EMPTY); $input =& BSRegister::Get('input'); $html = '[' . $input->in['repos'] . ']: '; if (empty($path)) { return $html . '/'; } $build = ''; foreach ($path AS $part) { $build .= '/' . $part; $html .= '/ ' . $part . ' '; } return $html; } // ################################################################### /** * Formats an array of properties into a compiled HTML template * * @param array Array of properties * * @return string Compiled HTML property list */ function FormatPropList($props) { if (sizeof($props) < 0) { return ''; } foreach ($props AS $propname => $propval) { $data = sprintf(_('Property %1$s set to %2$s'), $propname, $propval); eval('$proplist .= "' . BSRegister::Get('template')->fetch('property') . '";'); } return $proplist; } // ################################################################### /** * Formats a SVN log message * * @param string Unformatted log message * * @return string Output-ready log message */ function FormatLogMessage($message) { global $viewsvn; $message = BSRegister::Get('input')->entityEncode($message); // TODO - fix the revision links // $message = preg_replace('#r([0-9]+)#e', '"maincontrol->href_struct("diff.php" . Paths::fetch_rev_str(true, "\1", 0), "/") . "\">r\1"', $message); $list = false; $lines = explode("\n", $message); $message = ''; foreach ($lines AS $line) { if (preg_match('#^\s*?(\*|\-)\s?(.*)#', $line, $matches)) { if ($list) { $message .= '
  • ' . $matches[2] . '
  • '; } else { $message .= ''; $message .= $line; } else { $message .= $line; $message .= '
    '; } $list = false; } $message .= "\n"; } if ($list) { $message .= ''; } $message = preg_replace('#(
    )*$#', '', $message); return $message; } // ################################################################### /** * Parses a date from SVN into something more human-friendly * * @param string Date string * * @return string Formatted and readable date string */ function FormatSvnDate($string) { // 2005-01-23T20:42:53.703057Z return preg_replace('#(....)\-(..)\-(..)T(..):(..):(..).(.*)Z#e', 'gmdate("r", mktime(\4, \5, \6, \2, \3, \1))', $string); } /*=====================================================================*\ || ################################################################### || # $HeadURL$ || # $Id$ || ################################################################### \*=====================================================================*/ ?>