', ''), $string); $string = str_replace(array('{/@+' . '+}', '{/@-' . '-}'), '', $string); // nl2br $string = nl2br($string); return $string; } // ################################################################### /** * Counts the spaces and replaces two or more ones * * @access private * * @param string Spaced string * * @return string  'd string */ function format_spaces($thestring) { if (strlen($thestring) >= 2) { $thestring = str_replace(' ', ' ', $thestring); } return $thestring; } // ################################################################### /** * Prints the file changed list * * @access public * * @public array List of file changes * @public string The repository * @public integer Current revision * * @return string Processed HTML */ function construct_file_changes($changes, $repos, $revision) { global $viewsvn; $files = ''; foreach ($changes AS $file) { switch ($file['action']) { case 'A': $class = 'file_add'; $tooltip = $viewsvn->lang->string('Added'); break; case 'D': $class = 'file_delete'; $tooltip = $viewsvn->lang->string('Deleted'); break; case 'M': $class = 'file_modify'; $tooltip = $viewsvn->lang->string('Modified'); break; case 'R': $class = 'file_replace'; $tooltip = $viewsvn->lang->string('Replaced'); break; } $show['from'] = (bool)$file['from']; if ($file['from']) { $class = 'file_move'; $tooltip = 'Moved/Copied'; preg_match('#(.*):([0-9]+)#', $file['from'], $matches); $link['from'] = $viewsvn->path . '/view.php/' . $repos . '/' . $matches[1] . Paths::fetch_rev_str(false, $matches[2]); } $link['file'] = $viewsvn->path . '/view.php/' . $repos . $file['value'] . Paths::fetch_rev_str(false, $revision); eval('$files .= "' . $viewsvn->template->fetch('file_change') . '";'); } return $files; } // ################################################################### /** * Generates a clean revision number * * @access public * * @param integer Revision number * * @return mixed Cleaned revision or HEAD */ function rev($revision) { if (($revision = intval($revision)) < 1) { $revision = 'HEAD'; } return $revision; } } /*=====================================================================*\ || ################################################################### || # $HeadURL$ || # $Id$ || ################################################################### \*=====================================================================*/ ?>