added a new configuration item code_folder_readme
This commit is contained in:
		| @ -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"; | ||||
|  | ||||
| @ -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) | ||||
| 				{ | ||||
| 					$readme = $this->subversion->getFile ($projectid, $path . '/' . $rf, $rev); | ||||
| 					if ($readme !== FALSE) | ||||
| 					$rf = trim($rf); | ||||
| 					if (strlen($rf) > 0) | ||||
| 					{ | ||||
| 						$data['readme_text'] = $readme['content']; | ||||
| 						$data['readme_file'] = $rf; | ||||
| 						$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) | ||||
| 				{ | ||||
| 					$readme = $this->subversion->getFile ($projectid, $path . '/' . $rf, $rev); | ||||
| 					if ($readme !== FALSE) | ||||
| 					$rf = trim($rf); | ||||
| 					if (strlen($rf) > 0) | ||||
| 					{ | ||||
| 						$data['readme_text'] = $readme['content']; | ||||
| 						$data['readme_file'] = $rf; | ||||
| 						$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) | ||||
| 				{ | ||||
| 					$readme = $this->subversion->getFile ($projectid, $path . '/' . $rf, $rev); | ||||
| 					if ($readme !== FALSE) | ||||
| 					$rf = trim($rf); | ||||
| 					if (strlen($rf) > 0) | ||||
| 					{ | ||||
| 						$data['readme_text'] = $readme['content']; | ||||
| 						$data['readme_file'] = $rf; | ||||
| 						$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); | ||||
|  | ||||
| @ -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) | ||||
|  | ||||
		Reference in New Issue
	
	Block a user