Minor - cleaning code

skala
Julio Montoya 15 years ago
parent 1867133f85
commit b5661c8a64
  1. 6
      main/newscorm/lp_controller.php
  2. 6
      main/newscorm/lp_list.php
  3. 8
      main/upload/form.document.php
  4. 10
      main/upload/form.scorm.php
  5. 33
      main/upload/index.php
  6. 9
      main/upload/upload.document.php
  7. 9
      main/upload/upload.php
  8. 7
      main/upload/upload.scorm.php
  9. 12
      main/upload/upload_ppt.php
  10. 3
      main/upload/upload_word.php

@ -1,8 +1,10 @@
<?php //$id: $
<?php
/* For licensing terms, see /license.txt */
/**
* Controller script. Prepares the common background variables to give to the scripts corresponding to
* the requested action
* @package dokeos.learnpath
* @package chamilo.learnpath
* @author Yannick Warnier <ywarnier@beeznest.org>
*/
/**

@ -1,14 +1,12 @@
<?php //$id:$
/* For licensing terms, see /dokeos_license.txt */
/* For licensing terms, see /license.txt */
/**
==============================================================================
* This file was origially the copy of document.php, but many modifications happened since then ;
* the direct file view is not any more needed, if the user uploads a scorm zip file, a directory
* will be automatically created for it, and the files will be uncompressed there for example ;
*
* @package dokeos.learnpath
* @package chamilo.learnpath
* @author Yannick Warnier <ywarnier@beeznest.org>
==============================================================================
*/
/**
* Script

@ -1,4 +1,6 @@
<?php //$id: $
<?php
/* For licensing terms, see /license.txt */
/**
* Display part of the document sub-process for upload. This script MUST BE included by upload/index.php
* as it prepares most of the variables needed here.
@ -9,7 +11,7 @@
* Just display the form needed to upload a SCORM and give its settings
*/
$noPHP_SELF = false;
$nameTools = get_lang("FileUpload");
$nameTools = get_lang('FileUpload');
$interbreadcrumb[]= array ("url"=>"../newscorm/lp_controller.php?action=list", "name"=> get_lang(TOOL_DOCUMENT));
Display::display_header($nameTools,"Doc");
//show the title
@ -40,9 +42,7 @@ api_display_tool_title($nameTools.$add_group_to_title);
<br/>
<?php
/*
==============================================================================
FOOTER
==============================================================================
*/
Display::display_footer();
?>

@ -1,4 +1,5 @@
<?php //$id: $
<?php
/* For licensing terms, see /license.txt */
/**
* Display part of the SCORM sub-process for upload. This script MUST BE included by upload/index.php
* as it prepares most of the variables needed here.
@ -38,15 +39,14 @@ Display::display_header($nameTools,"Path");
//api_display_tool_title(get_lang("Learnpath")." - ".$nameTools.$add_group_to_title);
//TODO: Include right language file
require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
include('../newscorm/content_makers.inc.php');
require_once(api_get_path(LIBRARY_PATH) . 'specific_fields_manager.lib.php');
require_once api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php';
require_once '../newscorm/content_makers.inc.php';
require_once api_get_path(LIBRARY_PATH) . 'specific_fields_manager.lib.php';
echo '<div class="actions">';
echo '<a href="../newscorm/lp_controller.php?cidReq='.$_course['sysCode'].'">'.Display::return_icon('scorm.gif',get_lang('ReturnToLearningPaths')).' '.get_lang('ReturnToLearningPaths').'</a>';
echo '</div>';
$form = new FormValidator('','POST','upload.php','','id="upload_form" enctype="multipart/form-data" style="background-image: url(\'../img/scorm.jpg\'); background-repeat: no-repeat; background-position: 620px;"');
$form->addElement('header', '', $nameTools);
$form->addElement('hidden', 'curdirpath', $path);

@ -1,26 +1,6 @@
<?php // $Id$
/*
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004-2006 Dokeos S.A.
Copyright (c) 2003 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
Copyright (c) various contributors
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.
<?php
/* For licensing terms, see /license.txt */
See the GNU General Public License for more details.
Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
==============================================================================
*/
/**
* Main script for the documents tool
*
@ -32,7 +12,7 @@
* part is only processing code (init, process, display preparation) and the second
* part is only display (HTML)
*
* @package dokeos.upload
* @package chamilo.upload
*/
/**
@ -47,7 +27,7 @@ $language_file[] = "learnpath";
// global settings initialisation
// also provides access to main api (inc/lib/main_api.lib.php)
include("../inc/global.inc.php");
require_once '../inc/global.inc.php';
$htmlHeadXtra[] =
"<script type=\"text/javascript\">
@ -75,11 +55,8 @@ if(!$is_allowed_to_edit){
}
/*
-----------------------------------------------------------
Libraries
-----------------------------------------------------------
*/
//many useful functions in main_api.lib.php, by default included
@ -88,10 +65,8 @@ require_once(api_get_path(LIBRARY_PATH) . 'fileUpload.lib.php');
require_once(api_get_path(LIBRARY_PATH) . 'document.lib.php');
/*
-----------------------------------------------------------
Variables
- some need defining before inclusion of libraries
-----------------------------------------------------------
*/
$courseDir = $_course['path']."/document";
$sys_course_path = api_get_path(SYS_COURSE_PATH);

@ -1,8 +1,9 @@
<?php //$id: $
<?php
/* For licensing terms, see /license.txt */
/**
* Process part of the document sub-process for upload. This script MUST BE included by upload/index.php
* as it prepares most of the variables needed here.
* @package dokeos.upload
* @package chamilo.upload
* @author Yannick Warnier <ywarnier@beeznest.org>
*/
/**
@ -10,9 +11,7 @@
*/
/*
-----------------------------------------------------------
Libraries
-----------------------------------------------------------
*/
//many useful functions in main_api.lib.php, by default included
@ -225,9 +224,7 @@ if(api_get_setting('use_document_title')=='true')
<?php
/*
==============================================================================
FOOTER
==============================================================================
*/
Display::display_footer();
?>

@ -1,4 +1,5 @@
<?php // $Id$
<?php
/* For licensing terms, see /license.txt */
/**
* Action controller for the upload process. The display scripts (web forms) redirect
* the process here to do what needs to be done with each file.
@ -13,7 +14,7 @@ $language_file = 'document';
//the document file is loaded because most of the upload vocab relates to the document tool
// global settings initialisation
// also provides access to main api (inc/lib/main_api.lib.php)
include("../inc/global.inc.php");
require_once '../inc/global.inc.php';
// return to index if no tool is set
if(empty($_SESSION['my_tool'])){header('location:index.php');}
@ -31,14 +32,14 @@ if(!$is_allowed_to_edit){
*/
switch($_SESSION['my_tool']){
case TOOL_LEARNPATH:
require('upload.scorm.php');
require 'upload.scorm.php';
break;
//the following cases need to be distinguished later on
case TOOL_DROPBOX:
case TOOL_STUDENTPUBLICATION:
case TOOL_DOCUMENT:
default:
require('upload.document.php');
require 'upload.document.php';
break;
}
?>

@ -1,4 +1,6 @@
<?php //$id: $
<?php
/* For licensing terms, see /license.txt */
/**
* Process part of the SCORM sub-process for upload. This script MUST BE included by upload/index.php
* as it prepares most of the variables needed here.
@ -10,7 +12,7 @@
*/
$language_file = "scorm";
$cwdir = getcwd();
require('../newscorm/lp_upload.php');
require_once '../newscorm/lp_upload.php';
//reinit current working directory as many functions in upload change it
chdir($cwdir);
$error = api_failure::get_last_failure();
@ -43,5 +45,6 @@ if ($error=='not_a_learning_path') {
$msg = urlencode(get_lang('UplUploadSucceeded'));
$dialogtype = 'confirmation';
}
var_dump($msg);exit;
header('location: ../newscorm/lp_controller.php?action=list&dialog_box='.$msg.'&dialogtype='.$dialogtype);
?>

@ -1,8 +1,9 @@
<?php // $Id$
<?php
/* For licensing terms, see /license.txt */
/**
* Action controller for the upload process. The display scripts (web forms) redirect
* the process here to do what needs to be done with each file.
* @package dokeos.upload
* @package chamilo.upload
* @author Yannick Warnier <ywarnier@beeznest.org>
*/
/**
@ -15,7 +16,7 @@ $language_file[] = "learnpath";
$language_file[] = "scormdocument";
// global settings initialisation
// also provides access to main api (inc/lib/main_api.lib.php)
include("../inc/global.inc.php");
require_once '../inc/global.inc.php';
require_once(api_get_path(LIBRARY_PATH) . 'fileUpload.lib.php');
require_once(api_get_path(LIBRARY_PATH) . 'document.lib.php');
require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
@ -210,10 +211,7 @@ $form->setDefaults($defaults);
$form -> display();
/*
==============================================================================
FOOTER
==============================================================================
*/
Display::display_footer();
?>
?>

@ -1,4 +1,5 @@
<?php // $Id$
<?php
/* For licensing terms, see /license.txt */
/**
* Action controller for the upload process. The display scripts (web forms) redirect
* the process here to do what needs to be done with each file.

Loading…
Cancel
Save