Minor - remove unused code

pull/3357/head
Julio Montoya 5 years ago
parent 76155eab0a
commit 0ba1308c36
  1. 18
      main/lp/learnpathItem.class.php
  2. 42
      main/work/work.lib.php

@ -39,7 +39,6 @@ class learnpathItem
public $lesson_location = '';
public $level = 0;
public $core_exit = '';
//var $location; // Only set this for SCORM?
public $lp_id;
public $max_score;
public $mastery_score;
@ -98,15 +97,6 @@ class learnpathItem
$item_content = null
) {
$items_table = Database::get_course_table(TABLE_LP_ITEM);
// Get items table.
if (!isset($user_id)) {
$user_id = api_get_user_id();
}
if (self::DEBUG > 0) {
error_log("learnpathItem constructor: id: $id user_id: $user_id course_id: $course_id");
error_log("item_content: ".print_r($item_content, 1));
}
$id = (int) $id;
if (empty($item_content)) {
if (empty($course_id)) {
@ -289,9 +279,6 @@ class learnpathItem
*/
public function delete()
{
if (self::DEBUG > 0) {
error_log('learnpath_item::delete() for item '.$this->db_id, 0);
}
$lp_item_view = Database::get_course_table(TABLE_LP_ITEM_VIEW);
$lp_item = Database::get_course_table(TABLE_LP_ITEM);
$course_id = api_get_course_int_id();
@ -311,7 +298,7 @@ class learnpathItem
WHERE iid = ".$this->db_id;
Database::query($sql);
if (api_get_setting('search_enabled') == 'true') {
if (api_get_setting('search_enabled') === 'true') {
if (!is_null($this->search_did)) {
$di = new ChamiloIndexer();
$di->remove_document($this->search_did);
@ -463,9 +450,6 @@ class learnpathItem
public function get_file_path($path_to_scorm_dir = '')
{
$course_id = api_get_course_int_id();
if (self::DEBUG > 0) {
error_log('learnpathItem::get_file_path()', 0);
}
$path = $this->get_path();
$type = $this->get_type();

@ -641,48 +641,6 @@ function showTeacherWorkGrid()
return $html;
}
/**
* Builds the form thats enables the user to
* select a directory to browse/upload in
* This function has been copied from the document/document.inc.php library.
*
* @param array $folders
* @param string $curdirpath
* @param string $group_dir
*
* @return string html form
*/
// TODO: This function is a candidate for removal, it is not used anywhere.
function build_work_directory_selector($folders, $curdirpath, $group_dir = '')
{
$form = '<form name="selector" action="'.api_get_self().'?'.api_get_cidreq().'" method="POST">';
$form .= get_lang('CurrentDirectory').'
<select name="curdirpath" onchange="javascript: document.selector.submit();">';
//group documents cannot be uploaded in the root
if ($group_dir == '') {
$form .= '<option value="/">/ ('.get_lang('Root').')</option>';
if (is_array($folders)) {
foreach ($folders as $folder) {
$selected = ($curdirpath == $folder) ? ' selected="selected"' : '';
$form .= '<option'.$selected.' value="'.$folder.'">'.$folder.'</option>'."\n";
}
}
} else {
foreach ($folders as $folder) {
$selected = ($curdirpath == $folder) ? ' selected="selected"' : '';
$display_folder = substr($folder, strlen($group_dir));
$display_folder = ($display_folder == '') ? '/ ('.get_lang('Root').')' : $display_folder;
$form .= '<option'.$selected.' value="'.$folder.'">'.$display_folder.'</option>'."\n";
}
}
$form .= '</select>';
$form .= '<noscript><input type="submit" name="change_path" value="'.get_lang('Ok').'" /></noscript>';
$form .= '</form>';
return $form;
}
/**
* Builds the form that enables the user to
* move a document from one directory to another

Loading…
Cancel
Save