2 /************************************************************************/
4 /************************************************************************/
5 /* Copyright (c) 2002-2008 by Greg Gay, Joel Kronenberg, Heidi Hazelton */
8 /* This program is free software. You can redistribute it and/or */
9 /* modify it under the terms of the GNU General Public License */
10 /* as published by the Free Software Foundation. */
11 /************************************************************************/
14 ignore_user_abort(true);
17 if (!defined('AT_INCLUDE_PATH')) { exit; }
19 if (isset($_POST['submit'])) {
20 if (!isset($errors)) {
21 unset($_POST['submit']);
29 print_progress($step);
31 /* try copying the content over from the old dir to the new one */
32 require('../include/lib/filemanager.inc.php'); // for copys()
34 $content_dir = urldecode(trim($_POST['step4']['content_dir']));
35 $_POST['step4']['copy_from'] = urldecode(trim($_POST['step4']['copy_from'])) . DIRECTORY_SEPARATOR;
37 //copy if copy_from is not empty
39 if ($_POST['step4']['copy_from'] && ($_POST['step4']['copy_from'] != DIRECTORY_SEPARATOR)) {
40 if (is_dir($_POST['step4']['copy_from'])) {
41 $files = scandir($_POST['step4']['copy_from']);
43 foreach ($files as $file) {
44 if ($file == '.' || $file == '..') { continue; }
45 if (is_dir($_POST['step4']['copy_from'] . $file)) {
46 copys($_POST['step4']['copy_from'] . $file, $content_dir . $file);
47 if (is_dir($content_dir.$course)) {
48 $progress[] = 'Course content directory <b>'.$file.'</b> copied successfully.';
50 $errors[] = 'Course content directory <b>'.$file.'</b> <strong>NOT</strong> copied.';
54 copy($_POST['step4']['copy_from'] . $file, $content_dir .$file);
60 $progress[] = 'Using existing content directory <strong>'.$content_dir.'</strong>.';
64 if (isset($progress)) {
65 print_feedback($progress);
68 print_errors($errors);
71 if ($_POST['step1']['cache_dir'] != '') {
72 define('CACHE_DIR', urldecode($_POST['step1']['cache_dir']));
73 define('CACHE_ON', 1);
74 require('../include/phpCache/phpCache.inc.php');
75 cache_gc(NULL, 1, true);
79 <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="form">
80 <input type="hidden" name="step" value="<?php echo $step;?>" />
81 <?php print_hidden($step); ?>
83 <br /><br /><p align="center"><input type="submit" class="button" value=" Next »" name="submit" /></p>