Improving course creation message see #7020

1.9.x
Julio Montoya 12 years ago
parent e4713ff32f
commit 68e449f2e0
  1. 27
      main/install/install.lib.php
  2. 3
      main/lang/english/trad4all.inc.php

@ -1270,12 +1270,30 @@ function display_requirements($installType, $badUpdatePath, $updatePath = '', $u
@rmdir($course_dir); @rmdir($course_dir);
$_SESSION['permissions_for_new_directories'] = $_setting['permissions_for_new_directories'] = $dir_perm_verified; $_SESSION['permissions_for_new_directories'] = $_setting['permissions_for_new_directories'] = $dir_perm_verified;
$_SESSION['permissions_for_new_files'] = $_setting['permissions_for_new_files'] = $fil_perm_verified; $_SESSION['permissions_for_new_files'] = $_setting['permissions_for_new_files'] = $fil_perm_verified;
$dir_perm = Display::label('0'.decoct($dir_perm_verified), 'info'); $dir_perm = Display::label('0'.decoct($dir_perm_verified), 'info');
$file_perm = Display::label('0'.decoct($fil_perm_verified), 'info'); $file_perm = Display::label('0'.decoct($fil_perm_verified), 'info');
$course_test_was_created = ($course_test_was_created == true && $file_course_test_was_created == true) ? Display::label(get_lang('Yes'), 'success') : Display::label(get_lang('No'), 'important'); $courseTestLabel = Display::label(get_lang('No'), 'important');
if ($course_test_was_created && $file_course_test_was_created) {
$courseTestLabel = Display::label(get_lang('Yes'), 'success');
}
if ($course_test_was_created && !$file_course_test_was_created) {
$courseTestLabel = Display::label(
sprintf(
get_lang('InstallWarningCouldNotInterpretPHP'),
api_get_path(WEB_COURSE_PATH).$course_attempt_name.'/test.php'
),
'warning'
);
}
if (!$course_test_was_created && !$file_course_test_was_created) {
$courseTestLabel = Display::label(get_lang('No'), 'important');
}
echo '<table class="table"> echo '<table class="table">
<tr> <tr>
@ -1300,7 +1318,7 @@ function display_requirements($installType, $badUpdatePath, $updatePath = '', $u
</tr> </tr>
<tr> <tr>
<td class="requirements-item">'.get_lang('CourseTestWasCreated').'</td> <td class="requirements-item">'.get_lang('CourseTestWasCreated').'</td>
<td class="requirements-value">'.$course_test_was_created.' </td> <td class="requirements-value">'.$courseTestLabel.' </td>
</tr> </tr>
<tr> <tr>
<td class="requirements-item">'.get_lang('PermissionsForNewDirs').'</td> <td class="requirements-item">'.get_lang('PermissionsForNewDirs').'</td>
@ -1401,11 +1419,10 @@ function display_requirements($installType, $badUpdatePath, $updatePath = '', $u
@chmod($checked_writable, $perm); @chmod($checked_writable, $perm);
} }
if ($course_test_was_created == false || $file_course_test_was_created == false) { if ($course_test_was_created == false) {
$error = true; $error = true;
} }
$checked_writable = api_get_path(SYS_PATH).'home/'; $checked_writable = api_get_path(SYS_PATH).'home/';
if (!is_writable($checked_writable)) { if (!is_writable($checked_writable)) {
$notwritable[] = realpath($checked_writable); $notwritable[] = realpath($checked_writable);

@ -2,6 +2,9 @@
/* /*
for more information: see languages.txt in the lang folder. for more information: see languages.txt in the lang folder.
*/ */
$InstallWarningCouldNotInterpretPHP = "Warning: the installer detected an error while trying to reach the test file at %s. It looks like the PHP script could not be interpreted. This could be a warning sign for future problems when creating courses. Please check the installation guide for more information about permissions. If you are installing a site with a URL that doesn't resolve yet, you can probably ignore this message.";
$BeforeX = "Before %s";
$AfterX = "After %s";
$ExportSettingsAsXLS = "Export settings as XLS"; $ExportSettingsAsXLS = "Export settings as XLS";
$DeleteAllItems = "Delete all items"; $DeleteAllItems = "Delete all items";
$DeleteThisItem = "Delete this item"; $DeleteThisItem = "Delete this item";

Loading…
Cancel
Save