From 2db11d272785b5a4844923e12b63a28d5a4eeff8 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Tue, 30 Nov 2010 00:26:50 -0500 Subject: [PATCH] Removed instance-relative code for add_item - this method can be called statically --- main/newscorm/learnpath.class.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/main/newscorm/learnpath.class.php b/main/newscorm/learnpath.class.php index a18d166fce..9c46cc3c7f 100755 --- a/main/newscorm/learnpath.class.php +++ b/main/newscorm/learnpath.class.php @@ -342,7 +342,7 @@ class learnpath { * @param int $parent * @param int $previous * @param string $type - * @param int $id + * @param int Learnpath ID * @param string $title * @param string $description * @return int @@ -364,7 +364,7 @@ class learnpath { $description = $this->escape_string($description); $sql_count = " SELECT COUNT(id) AS num FROM " . $tbl_lp_item . " - WHERE lp_id = " . $this->get_id() . " AND parent_item_id = " . $parent; + WHERE lp_id = " . $id . " AND parent_item_id = " . $parent; $res_count = Database::query($sql_count); $row = Database :: fetch_array($res_count); @@ -375,7 +375,7 @@ class learnpath { $sql = "SELECT id, next_item_id, display_order FROM " . $tbl_lp_item . " WHERE - lp_id = " . $this->get_id() . " AND + lp_id = " . $id . " AND parent_item_id = " . $parent . " AND previous_item_id = 0 OR previous_item_id=" . $parent; $result = Database::query($sql); @@ -394,7 +394,7 @@ class learnpath { display_order FROM " . $tbl_lp_item . " WHERE - lp_id = " . $this->get_id() . " AND + lp_id = " . $id . " AND id = " . $previous; $result = Database::query($sql); @@ -444,7 +444,7 @@ class learnpath { max_time_allowed ) VALUES ( - " . $this->get_id() . ", + " . $id . ", '" . $type . "', '', '" . $title . "', @@ -475,7 +475,7 @@ class learnpath { display_order, max_time_allowed ) VALUES ( - " . $this->get_id() . ", + " . $id . ", '" . $type . "', '', '" . $title . "', @@ -520,7 +520,7 @@ class learnpath { UPDATE " . $tbl_lp_item . " SET display_order = display_order + 1 WHERE - lp_id = " . $this->get_id() . " AND + lp_id = " . $id . " AND id <> " . $new_item_id . " AND parent_item_id = " . $parent . " AND display_order > " . $display_order; @@ -8495,4 +8495,4 @@ if (!function_exists('trim_value')) { function trim_value(& $value) { $value = trim($value); } -} \ No newline at end of file +}