[svn r15429] Minor - code headers and XHTML cleaning

skala
Yannick Warnier 17 years ago
parent f31a1bc29d
commit 2a6f6b4f24
  1. 18
      main/coursecopy/classes/CourseArchiver.class.php
  2. 14
      main/coursecopy/classes/CourseSelectForm.class.php
  3. 18
      main/coursecopy/import_backup.php

@ -1,10 +1,10 @@
<?php
// $Id: CourseArchiver.class.php 15428 2008-05-26 20:30:11Z yannoo $
// $Id: CourseArchiver.class.php 15429 2008-05-26 20:34:37Z yannoo $
/*
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004 Dokeos S.A.
Copyright (c) 2004-2008 Dokeos SPRL
Copyright (c) 2003 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
Copyright (c) Bart Mollet (bart.mollet@hogent.be)
@ -19,7 +19,7 @@
See the GNU General Public License for more details.
Contact address: Dokeos, 44 rue des palais, B-1030 Brussels, Belgium
Contact address: Dokeos, rue du Corbeau, 108, B-1030 Brussels, Belgium
Mail: info@dokeos.com
==============================================================================
*/
@ -189,24 +189,24 @@ class CourseArchiver
$tmp_dir_name = 'CourseArchiver_'.uniqid('');
$unzip_dir = api_get_path(SYS_ARCHIVE_PATH).''.$tmp_dir_name;
mkdirr($unzip_dir,0755);
copy(api_get_path(SYS_ARCHIVE_PATH).''.$filename,$unzip_dir.'/backup.zip');
@copy(api_get_path(SYS_ARCHIVE_PATH).''.$filename,$unzip_dir.'/backup.zip');
// unzip the archive
$zip = new PclZip($unzip_dir.'/backup.zip');
chdir($unzip_dir);
@chdir($unzip_dir);
$zip->extract();
// remove the archive-file
if($delete)
{
unlink(api_get_path(SYS_ARCHIVE_PATH).''.$filename);
@unlink(api_get_path(SYS_ARCHIVE_PATH).''.$filename);
}
// read the course
if(!is_file('course_info.dat'))
{
return new Course();
}
$fp = fopen('course_info.dat', "r");
$contents = fread($fp, filesize('course_info.dat'));
fclose($fp);
$fp = @fopen('course_info.dat', "r");
$contents = @fread($fp, filesize('course_info.dat'));
@fclose($fp);
$course = unserialize(base64_decode($contents));
if( get_class($course) != 'Course')
{

@ -1,10 +1,10 @@
<?php
// $Id: CourseSelectForm.class.php 14323 2008-02-20 02:25:29Z yannoo $
// $Id: CourseSelectForm.class.php 15429 2008-05-26 20:34:37Z yannoo $
/*
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004 Dokeos S.A.
Copyright (c) 2004-2008 Dokeos SPRL
Copyright (c) 2003 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
Copyright (c) Bart Mollet (bart.mollet@hogent.be)
@ -19,7 +19,7 @@
See the GNU General Public License for more details.
Contact address: Dokeos, 44 rue des palais, B-1030 Brussels, Belgium
Contact address: Dokeos, rue du Corbeau, 108, B-1030 Brussels, Belgium
Mail: info@dokeos.com
==============================================================================
*/
@ -118,18 +118,18 @@ class CourseSelectForm
break;
default :
echo ' <img id="img_'.$type.'" src="../img/1.gif" onclick="javascript:exp('."'$type'".');" >';
echo ' <b onclick="javascript:exp('."'$type'".');" >'.$resource_titles[$type].'</b><br/>';
echo ' <b onclick="javascript:exp('."'$type'".');" >'.$resource_titles[$type].'</b><br />';
echo '<div id="div_'.$type.'">';
echo '<blockquote>';
echo "[<a href=\"#\" onclick=\"javascript:setCheckbox('$type',true);\" >".get_lang('All')."</a> - <a href=\"#\" onclick=\"javascript:setCheckbox('$type',false);\" >".get_lang('None')."</a>]";
echo '<br/>';
echo '<br />';
foreach ($resources as $id => $resource)
{
echo '<input type="checkbox" name="resource['.$type.']['.$id.']" id="resource['.$type.']['.$id.']"/>';
echo ' <label for="resource['.$type.']['.$id.']">';
$resource->show();
echo '</label>';
echo '<br/>';
echo '<br />';
echo "\n";
}
echo '</blockquote>';
@ -146,7 +146,7 @@ class CourseSelectForm
echo '<input type="hidden" name="'.$key.'" value="'.$value.'"/>';
}
}
echo '<br/><input type="submit" value="'.get_lang('Ok').'" onclick="checkLearnPath(\''.addslashes(get_lang('DocumentsWillBeAddedToo')).'\')"/>';
echo '<br /><input type="submit" value="'.get_lang('Ok').'" onclick="checkLearnPath(\''.addslashes(get_lang('DocumentsWillBeAddedToo')).'\')"/>';
CourseSelectForm :: display_hidden_quiz_questions($course);
CourseSelectForm :: display_hidden_scorm_directories($course);

@ -1,9 +1,9 @@
<?php // $Id: import_backup.php 15428 2008-05-26 20:30:11Z yannoo $
<?php // $Id: import_backup.php 15429 2008-05-26 20:34:37Z yannoo $
/*
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004 Dokeos S.A.
Copyright (c) 2004-2008 Dokeos SPRL
Copyright (c) 2003 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
Copyright (c) Bart Mollet (bart.mollet@hogent.be)
@ -18,7 +18,7 @@
See the GNU General Public License for more details.
Contact address: Dokeos, 44 rue des palais, B-1030 Brussels, Belgium
Contact address: Dokeos, rue du Corbeau, 108, B-1030 Brussels, Belgium
Mail: info@dokeos.com
==============================================================================
*/
@ -173,7 +173,7 @@ else
$backups = CourseArchiver::get_available_backups($is_platformAdmin?null:$user['user_id']);
$backups_available = (count($backups)>0);
echo get_lang('SelectBackupFile').'<br/><br/>';
echo get_lang('SelectBackupFile').'<br /><br />';
include (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
$form = new FormValidator('import_backup_form','POST','import_backup.php', '','multipart/form-data');
@ -185,7 +185,7 @@ else
$form->addElement('radio', 'backup_type', '', get_lang('LocalFile'), 'local', 'id="bt_local" class="checkbox" onclick="javascript:document.import_backup_form.backup_server.disabled=true;document.import_backup_form.backup.disabled=false;"');
$form->addElement('file', 'backup', '', 'style="margin-left: 50px;"');
$form->addElement('html', '<br/>');
$form->addElement('html', '<br />');
if( $backups_available ){
$form->addElement('radio', 'backup_type', '', get_lang('ServerFile'), 'server', 'id="bt_server" class="checkbox" onclick="javascript:document.import_backup_form.backup_server.disabled=false;document.import_backup_form.backup.disabled=true;"');
@ -202,20 +202,20 @@ else
$form->addElement('radio', '', '', '<i>'.get_lang('NoBackupsAvailable').'</i>', '', 'disabled="true"');
}
$form->addElement('html', '<br/><br/>');
$form->addElement('html', '<br /><br />');
$form->addElement('radio', 'import_option', '', get_lang('ImportFullBackup'), 'full_backup', 'id="import_option_1" class="checkbox"');
$form->addElement('radio', 'import_option', '', get_lang('LetMeSelectItems'), 'select_items', 'id="import_option_2" class="checkbox"');
$form->addElement('html', '<br/><br/>');
$form->addElement('html', '<br /><br />');
$form->addElement('html', get_lang('SameFilename'));
$form->addElement('html', '<br/><br/>');
$form->addElement('html', '<br /><br />');
$form->addElement('radio', 'same_file_name_option', '', get_lang('SameFilenameSkip'), FILE_SKIP, 'id="same_file_name_option_1" class="checkbox"');
$form->addElement('radio', 'same_file_name_option', '', get_lang('SameFilenameRename'), FILE_RENAME, 'id="same_file_name_option_2" class="checkbox"');
$form->addElement('radio', 'same_file_name_option', '', get_lang('SameFilenameOverwrite'), FILE_OVERWRITE, 'id="same_file_name_option_3" class="checkbox"');
$form->addElement('html', '<br/>');
$form->addElement('html', '<br />');
$form->addElement('submit', null, get_lang('ImportBackup'));
$values['backup_type'] = 'local';

Loading…
Cancel
Save