Minor - Format code.

1.10.x
Julio Montoya 10 years ago
parent ff029b5ec6
commit a4d8c89d75
  1. 1
      composer.json
  2. 1
      main/document/edit_document.php
  3. 33
      main/work/work.lib.php

@ -82,7 +82,6 @@
},
"scripts": {
"post-update-cmd": [
"Chamilo\\CoreBundle\\Component\\Theme\\DumpTheme::dumpCssFiles"
],
"post-install-cmd": [

@ -537,7 +537,6 @@ Display::display_footer();
function change_name($base_work_dir, $source_file, $rename_to, $dir, $doc) {
$file_name_for_change = $base_work_dir.$dir.$source_file;
//api_display_debug_info("call my_rename: params $file_name_for_change, $rename_to");
$rename_to = disable_dangerous_file($rename_to); // Avoid renaming to .htaccess file
$rename_to = my_rename($file_name_for_change, stripslashes($rename_to)); // fileManage API

@ -1248,11 +1248,8 @@ function updateDirName($work_data, $newPath)
{
$course_id = $work_data['c_id'];
$sessionId = intval($work_data['session_id']);
$courseInfo = api_get_course_info_by_id($course_id);
$work_id = intval($work_data['id']);
$oldPath = $work_data['url'];
$path = $work_data['url'];
$originalNewPath = Database::escape_string($newPath);
$newPath = Database::escape_string($newPath);
$newPath = api_replace_dangerous_char($newPath);
@ -1263,37 +1260,7 @@ function updateDirName($work_data, $newPath)
}
if (!empty($newPath)) {
//$base_work_dir = api_get_path(SYS_COURSE_PATH).$courseInfo['path'].'/work';
//error_log('rename'.$base_work_dir.$oldPath.' - '.$newPath);
//my_rename($base_work_dir.$oldPath, $newPath);
$table = Database::get_course_table(TABLE_STUDENT_PUBLICATION);
/*
// Update all the files in the other directories according with the next query
$sql = "SELECT id, url FROM $table
WHERE
c_id = $course_id AND
parent_id = $work_id AND
session_id = $sessionId AND
url <> ''
";
$result = Database::query($sql);
$oldPathWithWork = 'work'.$path;
while ($work = Database :: fetch_array($result)) {
$url = str_replace($oldPathWithWork, 'work/'.$newPath, $work['url']);
$sql = 'UPDATE ' . $table . '
SET url = "' . $url . '"
WHERE
c_id = ' . $course_id . ' AND
id = ' . $work['id'] . ' AND
session_id = ' . $sessionId . '
';
Database::query($sql);
}*/
//url= '/".$newPath."',
$sql = "UPDATE $table SET
title = '".$originalNewPath."'
WHERE

Loading…
Cancel
Save