Remove unused learnpath_functions.inc.php file

remotes/angel/1.11.x
jmontoyaa 8 years ago
parent fbc3241845
commit c190325966
  1. 4
      main/lp/aicc.class.php
  2. 103
      main/lp/learnpath_functions.inc.php
  3. 3
      main/lp/lp_add.php
  4. 2
      main/lp/lp_add_audio.php
  5. 2
      main/lp/lp_add_category.php
  6. 2
      main/lp/lp_add_item.php
  7. 4
      main/lp/lp_admin_view.php
  8. 10
      main/lp/lp_build.php
  9. 5
      main/lp/lp_edit_item.php
  10. 5
      main/lp/lp_edit_item_prereq.php
  11. 4
      main/lp/lp_move_item.php
  12. 6
      main/lp/scorm.class.php
  13. 1
      src/Chamilo/CoreBundle/Composer/ScriptHandler.php

@ -679,10 +679,8 @@ class aicc extends learnpath
}
}
}
//error_log('New LP - in export_zip()', 0);
// Zip everything that is in the corresponding scorm dir.
// Write the zip file somewhere (might be too big to return).
require_once 'learnpath_functions.inc.php';
$course_id = api_get_course_int_id();
$tbl_lp = Database::get_course_table(TABLE_LP_MAIN);
$_course = api_get_course_info(api_get_course_id());
@ -702,7 +700,7 @@ class aicc extends learnpath
// Get a temporary dir for creating the zip file.
//error_log('New LP - cleaning dir '.$zipfoldername, 0);
deldir($zipfoldername); //make sure the temp dir is cleared
removeDir($zipfoldername); //make sure the temp dir is cleared
mkdir($zipfoldername, api_get_permissions_for_new_directories());
//error_log('New LP - made dir '.$zipfoldername, 0);

@ -1,103 +0,0 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This is a function library for the learning path.
*
* Due to the face that the learning path has been built upon the resoucelinker,
* naming conventions have changed at least 2 times. You can see here in order the :
* 1. name used in the first version of the resourcelinker
* 2. name used in the first version of the LP
* 3. name used in the second (current) version of the LP
*
* 1. 2. 3.
* Category = Chapter = Module
* Item (?) = Item = Step
*
* @author Denes Nagy <darkden@evk.bke.hu>, main author
* @author Roan Embrechts, some code cleaning
* @author Yannick Warnier <yannick.warnier@beeznest.com>, multi-level learnpath behaviour + new SCORM tool
* @access public
* @package chamilo.learnpath
* @todo rename functions to coding conventions: not deleteitem but delete_item, etc
* @todo rewrite functions to comply with phpDocumentor
* @todo remove code duplication
*/
/**
* This function deletes an entire directory
* @param string The directory path
* @return boolean True on success, false on failure
*/
function deldir($dir) {
$dh = opendir($dir);
while ($file = readdir($dh)) {
if ($file != '.' && $file != '..') {
$fullpath = $dir.'/'.$file;
if (!is_dir($fullpath)) {
unlink($fullpath);
} else {
deldir($fullpath);
}
}
}
closedir($dh);
if (rmdir($dir)) {
return true;
}
return false;
}
function rcopy($source, $dest) {
//error_log($source." -> ".$dest, 0);
if (!file_exists($source)) {
//error_log($source." does not exist", 0);
return false;
}
if (is_dir($source)) {
//error_log($source." is a dir", 0);
// This is a directory.
// Remove trailing '/'
if (strrpos($source, '/') == sizeof($source) - 1) {
$source = substr($source, 0, size_of($source) - 1);
}
if (strrpos($dest, '/') == sizeof($dest) - 1) {
$dest = substr($dest, 0, size_of($dest) - 1);
}
if (!is_dir($dest)) {
$res = @mkdir($dest, api_get_permissions_for_new_directories());
if ($res !== false) {
return true;
} else {
// Remove latest part of path and try creating that.
if (rcopy(substr($source, 0, strrpos($source, '/')), substr($dest, 0, strrpos($dest, '/')))) {
return @mkdir($dest, api_get_permissions_for_new_directories());
} else {
return false;
}
}
}
return true;
} else {
// This is presumably a file.
//error_log($source." is a file", 0);
if (!@ copy($source, $dest)) {
//error_log("Could not simple-copy $source", 0);
$res = rcopy(dirname($source), dirname($dest));
if ($res === true) {
//error_log("Welcome dir created", 0);
return @ copy($source, $dest);
} else {
return false;
//error_log("Error creating path", 0);
}
} else {
//error_log("Could well simple-copy $source", 0);
return true;
}
}
}

@ -16,9 +16,6 @@
$this_section = SECTION_COURSES;
api_protect_course_script();
/* Libraries */
require 'learnpath_functions.inc.php';
/* Header and action code */
$currentstyle = api_get_setting('stylesheets');
$htmlHeadXtra[] = '<script>

@ -11,8 +11,6 @@ $this_section = SECTION_COURSES;
api_protect_course_script();
require_once 'learnpath_functions.inc.php';
$is_allowed_to_edit = api_is_allowed_to_edit(null, true);
$isStudentView = isset($_REQUEST['isStudentView']) ? (int)$_REQUEST['isStudentView'] : null;

@ -9,8 +9,6 @@
$this_section = SECTION_COURSES;
api_protect_course_script();
require 'learnpath_functions.inc.php';
$is_allowed_to_edit = api_is_allowed_to_edit(null, true);
if (!$is_allowed_to_edit) {

@ -19,8 +19,6 @@ $this_section = SECTION_COURSES;
api_protect_course_script();
require_once 'learnpath_functions.inc.php';
/** @var learnpath $learnPath */
$learnPath = Session::read('oLP');

@ -15,10 +15,6 @@ $this_section = SECTION_COURSES;
api_protect_course_script();
/* Libraries */
include 'learnpath_functions.inc.php';
$is_allowed_to_edit = api_is_allowed_to_edit(null, true);
$tbl_lp = Database::get_course_table(TABLE_LP_MAIN);

@ -16,8 +16,6 @@ $this_section = SECTION_COURSES;
api_protect_course_script();
include 'learnpath_functions.inc.php';
/* Constants and variables */
$is_allowed_to_edit = api_is_allowed_to_edit(null, true);
@ -39,13 +37,13 @@ if ((!$is_allowed_to_edit) || ($isStudentView)) {
/* The learnpath has been just created, go get the last id. */
$is_new = false;
$course_id = api_get_course_int_id();
if ($learnpath_id == 0) {
$is_new = true;
$sql = "SELECT id FROM " . $tbl_lp . " WHERE c_id = $course_id ORDER BY id DESC LIMIT 0, 1";
$sql = "SELECT id FROM $tbl_lp
WHERE c_id = $course_id
ORDER BY id DESC LIMIT 0, 1";
$result = Database::query($sql);
$row = Database::fetch_array($result);
$learnpath_id = $row['id'];
@ -82,7 +80,7 @@ Display::display_header('', 'Path');
$suredel = trim(get_lang('AreYouSureToDeleteJS'));
?>
<script type='text/javascript'>
<script>
/* <![CDATA[ */
function stripslashes(str) {
str=str.replace(/\\'/g,'\'');

@ -16,12 +16,7 @@ $this_section = SECTION_COURSES;
api_protect_course_script();
/* Libraries */
include 'learnpath_functions.inc.php';
/* Header and action code */
$htmlHeadXtra[] = '
<script>'.$_SESSION['oLP']->get_js_dropdown_array().
"

@ -13,12 +13,7 @@ $this_section = SECTION_COURSES;
api_protect_course_script();
/* Libraries */
include 'learnpath_functions.inc.php';
/* Constants and variables */
$is_allowed_to_edit = api_is_allowed_to_edit(null, true);
$tbl_lp = Database::get_course_table(TABLE_LP_MAIN);

@ -15,10 +15,8 @@ $this_section = SECTION_COURSES;
api_protect_course_script();
include 'learnpath_functions.inc.php';
/* Header and action code */
$htmlHeadXtra[] = '<script type="text/javascript">'.
$htmlHeadXtra[] = '<script>'.
$_SESSION['oLP']->get_js_dropdown_array() .
"
function load_cbo(id) {

@ -858,11 +858,9 @@ class scorm extends learnpath
}
}
}
//error_log('New LP - in export_zip()',0);
//zip everything that is in the corresponding scorm dir
//write the zip file somewhere (might be too big to return)
require_once 'learnpath_functions.inc.php';
$courseId = api_get_course_int_id();
$_course = api_get_course_info();
@ -881,8 +879,8 @@ class scorm extends learnpath
// Get a temporary dir for creating the zip file.
//error_log('New LP - cleaning dir '.$zipfoldername, 0);
deldir($zipfoldername); // Make sure the temp dir is cleared.
$res = mkdir($zipfoldername, api_get_permissions_for_new_directories());
my_delete($zipfoldername); // Make sure the temp dir is cleared.
mkdir($zipfoldername, api_get_permissions_for_new_directories());
//error_log('New LP - made dir '.$zipfoldername, 0);
// Create zipfile of given directory.

@ -152,6 +152,7 @@ class ScriptHandler
__DIR__.'/../../../../main/inc/lib/formvalidator/Element/tbl_change.js.php',
__DIR__.'/../../../../main/lp/resourcelinker.php',
__DIR__.'/../../../../main/lp/resourcelinker.inc.php',
__DIR__.'/../../../../main/lp/learnpath_functions.inc.php',
__DIR__.'/../../../../main/tracking/toolaccess_details.php',
__DIR__.'/../../../../main/tracking/course_access_details.php',
__DIR__.'/../../../../src/Chamilo/CoreBundle/Entity/GroupRelGroup.php',

Loading…
Cancel
Save