added a new configuration item code_folder_readme
This commit is contained in:
parent
83f1fa989a
commit
07a5b937f5
@ -238,3 +238,11 @@ svn_min_commit_message_length = "0"
|
|||||||
svn_restricted_topdirs = ""
|
svn_restricted_topdirs = ""
|
||||||
svn_restriction_allowed_subdir_depth_min = 0
|
svn_restriction_allowed_subdir_depth_min = 0
|
||||||
svn_restriction_allowed_subdir_depth_max = 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";
|
||||||
|
@ -110,13 +110,18 @@ class Code extends Controller
|
|||||||
|
|
||||||
$data['readme_text'] = '';
|
$data['readme_text'] = '';
|
||||||
$data['readme_file'] = '';
|
$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);
|
$readme = $this->subversion->getFile ($projectid, $path . '/' . $rf, $rev);
|
||||||
if ($readme !== FALSE)
|
if ($readme !== FALSE)
|
||||||
{
|
{
|
||||||
$data['readme_text'] = $readme['content'];
|
$data['readme_text'] = $readme['content'];
|
||||||
$data['readme_file'] = $rf;
|
$data['readme_file'] = $rf;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->load->view ($this->VIEW_FOLDER, $data);
|
$this->load->view ($this->VIEW_FOLDER, $data);
|
||||||
@ -576,13 +581,18 @@ class Code extends Controller
|
|||||||
|
|
||||||
$data['readme_text'] = '';
|
$data['readme_text'] = '';
|
||||||
$data['readme_file'] = '';
|
$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);
|
$readme = $this->subversion->getFile ($projectid, $path . '/' . $rf, $rev);
|
||||||
if ($readme !== FALSE)
|
if ($readme !== FALSE)
|
||||||
{
|
{
|
||||||
$data['readme_text'] = $readme['content'];
|
$data['readme_text'] = $readme['content'];
|
||||||
$data['readme_file'] = $rf;
|
$data['readme_file'] = $rf;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->load->view ($this->VIEW_FOLDER, $data);
|
$this->load->view ($this->VIEW_FOLDER, $data);
|
||||||
@ -648,13 +658,18 @@ class Code extends Controller
|
|||||||
|
|
||||||
$data['readme_text'] = '';
|
$data['readme_text'] = '';
|
||||||
$data['readme_file'] = '';
|
$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);
|
$readme = $this->subversion->getFile ($projectid, $path . '/' . $rf, $rev);
|
||||||
if ($readme !== FALSE)
|
if ($readme !== FALSE)
|
||||||
{
|
{
|
||||||
$data['readme_text'] = $readme['content'];
|
$data['readme_text'] = $readme['content'];
|
||||||
$data['readme_file'] = $rf;
|
$data['readme_file'] = $rf;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->load->view ($this->VIEW_FOLDER, $data);
|
$this->load->view ($this->VIEW_FOLDER, $data);
|
||||||
|
@ -87,7 +87,9 @@ function load_ini ($file)
|
|||||||
array ('svn_min_commit_message_length', 'integer', 0),
|
array ('svn_min_commit_message_length', 'integer', 0),
|
||||||
array ('svn_restricted_topdirs', 'string', ''),
|
array ('svn_restricted_topdirs', 'string', ''),
|
||||||
array ('svn_restriction_allowed_subdir_depth_min', 'integer', 0),
|
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)
|
foreach ($xcfgs as $x)
|
||||||
|
Loading…
Reference in New Issue
Block a user