Cleaning code

skala
Julio Montoya 15 years ago
parent 0af4e27d52
commit a10add4b11
  1. 35
      main/coursecopy/backup.php
  2. 11
      main/coursecopy/copy_course.php
  3. 7
      main/coursecopy/copy_course_session.php
  4. 48
      main/coursecopy/create_backup.php
  5. 47
      main/coursecopy/import_backup.php
  6. 44
      main/coursecopy/recycle_course.php

@ -1,35 +1,10 @@
<?php
// $Id: backup.php 12219 2007-05-01 18:46:59Z yannoo $
/*
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004 Dokeos S.A.
Copyright (c) 2003 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
Copyright (c) Bart Mollet (bart.mollet@hogent.be)
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
See the GNU General Public License for more details.
Contact address: Dokeos, 44 rue des palais, B-1030 Brussels, Belgium
Mail: info@dokeos.com
==============================================================================
*/
/* For licensing terms, see /license.txt */
/**
* ==============================================================================
* Create a backup.
*
* @author Bart Mollet <bart.mollet@hogent.be>
* @package dokeos.backup
* ==============================================================================
* @package chamilo.backup
*/
// name of the language file that needs to be included
@ -56,11 +31,7 @@ Display::display_header($nameTools);
// Display the tool title
api_display_tool_title($nameTools);
/*
==============================================================================
MAIN CODE
==============================================================================
*/
/* MAIN CODE */
?>
<ul>

@ -1,5 +1,4 @@
<?php // $Id: copy_course.php 22204 2009-07-17 20:31:35Z iflorespaz $
/* For licensing terms, see /dokeos_license.txt */
// name of the language file that needs to be included
@ -9,7 +8,7 @@ $language_file = array('exercice', 'coursebackup', 'admin');
require_once '../inc/global.inc.php';
// including additional libraries
include_once api_get_path(LIBRARY_PATH) . 'fileManage.lib.php';
require_once api_get_path(LIBRARY_PATH) . 'fileManage.lib.php';
require_once 'classes/CourseBuilder.class.php';
require_once 'classes/CourseRestorer.class.php';
require_once 'classes/CourseSelectForm.class.php';
@ -37,9 +36,7 @@ $this_section=SECTION_COURSES;
Display::display_header(get_lang('CopyCourse'));
//api_display_tool_title($nameTools);
/*
==============================================================================
MAIN CODE
==============================================================================
*/
// If a CourseSelectForm is posted or we should copy all resources, then copy them
if ((isset ($_POST['action']) && $_POST['action'] == 'course_select_form') || (isset ($_POST['copy_option']) && $_POST['copy_option'] == 'full_copy')) {
@ -117,10 +114,6 @@ if ((isset ($_POST['action']) && $_POST['action'] == 'course_select_form') || (i
}
}
/*
==============================================================================
FOOTER
==============================================================================
*/
/* FOOTER */
Display::display_footer();
?>

@ -1,13 +1,10 @@
<?php
/* For licensing terms, see /dokeos_license.txt */
/* For licensing terms, see /license.txt */
/**
* ==============================================================================
* Copy resources from one course in a session to another one.
*
* @author Christian Fasanando <christian.fasanando@dokeos.com>
* @package dokeos.backup
* ==============================================================================
* @package chamilo.backup
*/
/* INIT SECTION */

@ -1,42 +1,18 @@
<?php
// $Id: create_backup.php 20084 2009-04-24 20:10:43Z aportugal $
/*
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004 Dokeos SPRL
Copyright (c) 2003 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
Copyright (c) Bart Mollet (bart.mollet@hogent.be)
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
See the GNU General Public License for more details.
Contact address: Dokeos, rue du Corbeau, 108, B-1030 Brussels, Belgium
Mail: info@dokeos.com
==============================================================================
*/
/* For licensing terms, see /license.txt */
/**
* ==============================================================================
* Create a backup.
*
* @author Bart Mollet <bart.mollet@hogent.be>
* @package dokeos.backup
* ==============================================================================
* @package chamilo.backup
*/
// name of the language file that needs to be included
$language_file = array ('exercice', 'admin', 'coursebackup');
// including the global file
include ('../inc/global.inc.php');
require_once ('../inc/global.inc.php');
// Check access rights (only teachers are allowed here)
if (!api_is_allowed_to_edit())
@ -62,11 +38,11 @@ $nameTools = get_lang('CreateBackup');
Display::display_header($nameTools);
// include additional libraries
include_once(api_get_path(LIBRARY_PATH) . 'fileManage.lib.php');
require_once ('classes/CourseBuilder.class.php');
require_once ('classes/CourseArchiver.class.php');
require_once ('classes/CourseRestorer.class.php');
require_once ('classes/CourseSelectForm.class.php');
require_once api_get_path(LIBRARY_PATH) . 'fileManage.lib.php';
require_once 'classes/CourseBuilder.class.php';
require_once 'classes/CourseArchiver.class.php';
require_once 'classes/CourseRestorer.class.php';
require_once 'classes/CourseSelectForm.class.php';
// Display the tool title
api_display_tool_title($nameTools);
@ -121,7 +97,7 @@ else
{
echo get_lang('SelectOptionForBackup');
include_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
$form = new FormValidator('create_backup_form','POST');
$renderer = $form->defaultRenderer();
$renderer->setElementTemplate('<div>{element}</div> ');
@ -138,10 +114,6 @@ else
$form->display();
}
}
/*
==============================================================================
FOOTER
==============================================================================
*/
/* FOOTER */
Display::display_footer();
?>

@ -1,40 +1,13 @@
<?php // $Id: import_backup.php 20448 2009-05-10 10:17:22Z ivantcholakov $
/*
==============================================================================
Dokeos - elearning and course management software
/* For licensing terms, see /license.txt */
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)
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
See the GNU General Public License for more details.
Contact address: Dokeos, rue du Corbeau, 108, B-1030 Brussels, Belgium
Mail: info@dokeos.com
==============================================================================
*/
/**
* ==============================================================================
* Import a backup.
*
* @author Bart Mollet <bart.mollet@hogent.be>
* @package dokeos.backup
* ==============================================================================
* @package chamilo.backup
*/
/*
==============================================================================
INIT SECTION
==============================================================================
*/
/* INIT SECTION */
// name of the language file that needs to be included
$language_file = array('exercice', 'coursebackup', 'admin');
@ -75,11 +48,7 @@ require_once('classes/CourseSelectForm.class.php');
api_display_tool_title($nameTools);
/*
==============================================================================
MAIN CODE
==============================================================================
*/
/* MAIN CODE */
if((isset($_POST['action']) && $_POST['action'] == 'course_select_form' ) || (isset($_POST['import_option']) && $_POST['import_option'] == 'full_backup' )) {
$error=false;
@ -207,10 +176,6 @@ if((isset($_POST['action']) && $_POST['action'] == 'course_select_form' ) || (is
$form->display();
}
/*
==============================================================================
FOOTER
==============================================================================
*/
/* FOOTER */
Display::display_footer();
?>
?>

@ -1,41 +1,17 @@
<?php // $Id: recycle_course.php 19948 2009-04-21 17:27:59Z juliomontoya $
/*
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004 Dokeos S.A.
Copyright (c) 2003 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
Copyright (c) Bart Mollet (bart.mollet@hogent.be)
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
See the GNU General Public License for more details.
Contact address: Dokeos, 44 rue des palais, B-1030 Brussels, Belgium
Mail: info@dokeos.com
==============================================================================
*/
/* For licensing terms, see /license.txt */
/**
* ==============================================================================
* Delete resources from a course.
*
* @author Bart Mollet <bart.mollet@hogent.be>
* @package dokeos.backup
* ==============================================================================
* @package chamilo.backup
*/
// name of the language file that needs to be included
$language_file = array ('exercice', 'admin', 'course_info', 'coursebackup');
// including the global file
include ('../inc/global.inc.php');
require_once '../inc/global.inc.php';
// Check access rights (only teachers are allowed here)
if( ! api_is_allowed_to_edit()) {
@ -52,19 +28,15 @@ $nameTools = get_lang('RecycleCourse');
Display::display_header($nameTools);
// include additional libraries
require_once('classes/CourseBuilder.class.php');
require_once('classes/CourseArchiver.class.php');
require_once('classes/CourseRecycler.class.php');
require_once('classes/CourseSelectForm.class.php');
require_once 'classes/CourseBuilder.class.php';
require_once 'classes/CourseArchiver.class.php';
require_once 'classes/CourseRecycler.class.php';
require_once 'classes/CourseSelectForm.class.php';
// Display the tool title
api_display_tool_title($nameTools);
/*
==============================================================================
MAIN CODE
==============================================================================
*/
/* MAIN CODE */
if( (isset($_POST['action']) && $_POST['action'] == 'course_select_form' ) || (isset($_POST['recycle_option']) && $_POST['recycle_option'] == 'full_backup' ) ) {
if(isset($_POST['action']) && $_POST['action'] == 'course_select_form' ) {
$course = CourseSelectForm::get_posted_course();

Loading…
Cancel
Save