added a new configuration item code_folder_readme

This commit is contained in:
hyung-hwan 2015-04-09 09:33:04 +00:00
parent 83f1fa989a
commit 07a5b937f5
3 changed files with 41 additions and 16 deletions

View File

@ -238,3 +238,11 @@ svn_min_commit_message_length = "0"
svn_restricted_topdirs = ""
svn_restriction_allowed_subdir_depth_min = 0
svn_restriction_allowed_subdir_depth_max = 0
;------------------------------------------------------------------------------
; List of README files to show in the code folder view.
; The first file found is shown. You can specify multiple file name
; separated by a comma.
;------------------------------------------------------------------------------
code_folder_readme = "README.wiki,README.txt,README";

View File

@ -110,13 +110,18 @@ class Code extends Controller
$data['readme_text'] = '';
$data['readme_file'] = '';
foreach (array('README.wiki', 'README.txt', 'README') as $rf)
foreach (explode(',', CODEPOT_CODE_FOLDER_README) as $rf)
{
$rf = trim($rf);
if (strlen($rf) > 0)
{
$readme = $this->subversion->getFile ($projectid, $path . '/' . $rf, $rev);
if ($readme !== FALSE)
{
$data['readme_text'] = $readme['content'];
$data['readme_file'] = $rf;
break;
}
}
}
$this->load->view ($this->VIEW_FOLDER, $data);
@ -576,13 +581,18 @@ class Code extends Controller
$data['readme_text'] = '';
$data['readme_file'] = '';
foreach (array('README.wiki', 'README.txt', 'README') as $rf)
foreach (explode(',', CODEPOT_CODE_FOLDER_README) as $rf)
{
$rf = trim($rf);
if (strlen($rf) > 0)
{
$readme = $this->subversion->getFile ($projectid, $path . '/' . $rf, $rev);
if ($readme !== FALSE)
{
$data['readme_text'] = $readme['content'];
$data['readme_file'] = $rf;
break;
}
}
}
$this->load->view ($this->VIEW_FOLDER, $data);
@ -648,13 +658,18 @@ class Code extends Controller
$data['readme_text'] = '';
$data['readme_file'] = '';
foreach (array('README.wiki', 'README.txt', 'README') as $rf)
foreach (explode(',', CODEPOT_CODE_FOLDER_README) as $rf)
{
$rf = trim($rf);
if (strlen($rf) > 0)
{
$readme = $this->subversion->getFile ($projectid, $path . '/' . $rf, $rev);
if ($readme !== FALSE)
{
$data['readme_text'] = $readme['content'];
$data['readme_file'] = $rf;
break;
}
}
}
$this->load->view ($this->VIEW_FOLDER, $data);

View File

@ -87,7 +87,9 @@ function load_ini ($file)
array ('svn_min_commit_message_length', 'integer', 0),
array ('svn_restricted_topdirs', 'string', ''),
array ('svn_restriction_allowed_subdir_depth_min', 'integer', 0),
array ('svn_restriction_allowed_subdir_depth_max', 'integer', 0)
array ('svn_restriction_allowed_subdir_depth_max', 'integer', 0),
array ('code_folder_readme', 'string', 'README')
);
foreach ($xcfgs as $x)