Remove use of message or error property.

1.10.x
Julio Montoya 10 years ago
parent 7db58b4961
commit 623892c989
  1. 51
      main/newscorm/learnpath.class.php
  2. 1
      main/newscorm/lp_controller.php
  3. 1
      main/newscorm/lp_save.php
  4. 2835
      tests/main/newscorm/learnpath.class.test.php

@ -834,18 +834,6 @@ class learnpath
}
}
/**
* Appends a message to the message attribute
* @param string $string Message to append.
*/
public function append_message($string)
{
if ($this->debug > 0) {
error_log('New LP - In learnpath::append_message()', 0);
}
$this->message .= $string;
}
/**
* Auto completes the parents of an item in case it's been completed or passed
* @param integer $item Optional ID of the item from which to look for parents
@ -969,17 +957,6 @@ class learnpath
// TODO: Add save operations for the learnpath itself.
}
/**
* Clears the message attribute
*/
public function clear_message()
{
if ($this->debug > 0) {
error_log('New LP - In learnpath::clear_message()', 0);
}
$this->message = '';
}
/**
* Closes the current resource
*
@ -990,7 +967,6 @@ class learnpath
*/
public function close()
{
$course_id = api_get_course_int_id();
if ($this->debug > 0) {
error_log('New LP - In learnpath::close()', 0);
}
@ -3260,18 +3236,6 @@ class learnpath
}
}
/**
* Gets the user-friendly message stored in $this->message
* @return string Message
*/
public function get_message()
{
if ($this->debug > 0) {
error_log('New LP - In learnpath::get_message()', 0);
}
return $this->message;
}
/**
* Gets the learnpath name/title
* @return string Learnpath name/title
@ -4292,7 +4256,6 @@ class learnpath
$res = $this->items[$this->current]->save(false, $this->prerequisites_match($this->current));
$this->autocomplete_parents($this->current);
$status = $this->items[$this->current]->get_status();
$this->append_message('new_item_status: ' . $status);
$this->update_queue[$this->current] = $status;
return $res;
}
@ -5145,7 +5108,8 @@ class learnpath
error_log('New LP - In learnpath::update_reinit()', 0);
}
$lp_table = Database :: get_course_table(TABLE_LP_MAIN);
$sql = "SELECT * FROM $lp_table WHERE c_id = ".$course_id." AND id = " . $this->get_id();
$sql = "SELECT * FROM $lp_table
WHERE c_id = ".$course_id." AND id = " . $this->get_id();
$res = Database::query($sql);
if (Database :: num_rows($res) > 0) {
$row = Database :: fetch_array($res);
@ -5438,9 +5402,6 @@ class learnpath
*/
public function overview()
{
$is_allowed_to_edit = api_is_allowed_to_edit(null,true);
$_course = api_get_course_info();
if ($this->debug > 0) {
error_log('New LP - In learnpath::overview()', 0);
}
@ -5886,7 +5847,8 @@ class learnpath
{
$course_id = api_get_course_int_id();
global $charset;
$dir = isset ($_GET['dir']) ? $_GET['dir'] : $_POST['dir']; // Please, do not modify this dirname formatting.
$dir = isset ($_GET['dir']) ? $_GET['dir'] : $_POST['dir'];
// Please, do not modify this dirname formatting.
if (strstr($dir, '..'))
$dir = '/';
if ($dir[0] == '.')
@ -8141,7 +8103,8 @@ class learnpath
$return .= 'child_value[0][' . $i++ . '] = "' . $row_zero['id'] . '";' . "\n";
}
$return .= "\n";
$sql = "SELECT * FROM " . $tbl_lp_item . " WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id;
$sql = "SELECT * FROM " . $tbl_lp_item . "
WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id;
$res = Database::query($sql);
while ($row = Database :: fetch_array($res)) {
$sql_parent = "SELECT * FROM " . $tbl_lp_item . "
@ -8173,8 +8136,6 @@ class learnpath
public function display_move_item($item_id)
{
$course_id = api_get_course_int_id();
$_course = api_get_course_info();
global $charset;
$return = '';
if (is_numeric($item_id)) {

@ -345,7 +345,6 @@ $is_allowed_to_edit = api_is_allowed_to_edit(false, true, false, false);
if (isset($_SESSION['oLP'])) {
$_SESSION['oLP']->update_queue = array(); // Reinitialises array used by javascript to update items in the TOC.
$_SESSION['oLP']->message = ''; // Should use ->clear_message() method but doesn't work.
}
if (isset($_GET['isStudentView']) && $_GET['isStudentView'] == 'true') {

@ -14,7 +14,6 @@
/**
* Switching within the field to update
*/
$msg = $_SESSION['oLP']->get_message();
error_log('New LP - Loaded lp_save : '.$_SERVER['REQUEST_URI'].' from '.$_SERVER['HTTP_REFERER'], 0);
?>

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save