Minor - Remove unused code.

pull/2487/head
jmontoyaa 8 years ago
parent 43e9bbb4ce
commit c510ec7672
  1. 54
      main/inc/lib/fileDisplay.lib.php
  2. 13
      main/work/edit.php

@ -206,57 +206,3 @@ function chooseFolderIcon($folderPath)
return 'folder_document.png';
}
/**
* Transform a UNIX time stamp in human readable format date.
*
* @author - Hugues Peeters <peeters@ipm.ucl.ac.be>
* @param int $date - UNIX time stamp
* @return string A human readable representation of the UNIX date
*/
function format_date($date)
{
return date('d.m.Y', $date);
}
/**
* Transform the file path to a URL.
*
* @param string $file_path (string) - Relative local path of the file on the hard disk
* @return string Relative url
*/
function format_url($file_path)
{
$path_component = explode('/', $file_path);
$path_component = array_map('rawurlencode', $path_component);
return implode('/', $path_component);
}
/**
* Get the total size of a directory.
*
* @param string $dir_name (string) - Path of the dir on the hard disk
* @return int Total size in bytes
*/
function folder_size($dir_name)
{
$size = 0;
if ($dir_handle = opendir($dir_name)) {
while (($entry = readdir($dir_handle)) !== false) {
if ($entry == '.' || $entry == '..') {
continue;
}
if (is_dir($dir_name.'/'.$entry)) {
$size += folder_size($dir_name.'/'.$entry);
} else {
$size += filesize($dir_name.'/'.$entry);
}
}
closedir($dir_handle);
}
return $size;
}

@ -129,20 +129,7 @@ $form = new FormValidator(
array('enctype' => "multipart/form-data")
);
$form->addElement('header', $form_title);
$show_progress_bar = false;
/*
if ($submitGroupWorkUrl) {
// For user coming from group space to publish his work
$realUrl = str_replace($_configuration['root_sys'], api_get_path(WEB_PATH), str_replace("\\", '/', realpath($submitGroupWorkUrl)));
$form->addElement('hidden', 'newWorkUrl', $submitGroupWorkUrl);
$text_document = $form->addElement('text', 'document', get_lang('Document'));
$defaults['document'] = '<a href="' . format_url($submitGroupWorkUrl) . '">' . $realUrl . '</a>';
$text_document->freeze();
} elseif ($item_id && ($is_allowed_to_edit or $is_author)) {
$workUrl = $currentCourseRepositoryWeb . $workUrl;
}*/
$form->addElement('hidden', 'id', $work_id);
$form->addElement('hidden', 'item_id', $item_id);
$form->addText('title', get_lang('Title'), true, array('id' => 'file_upload'));

Loading…
Cancel
Save