Adding error_logs

skala
Julio Montoya 14 years ago
parent 598e9e9a74
commit 300253ea1a
  1. 16
      main/newscorm/learnpath.class.php
  2. 21
      main/newscorm/learnpathItem.class.php
  3. 4
      main/newscorm/lp_view.php

@ -223,6 +223,7 @@ class learnpath {
if ($this->debug > 2) {
error_log('New LP - learnpath::__construct() ' . __LINE__ . ' - query lp items: ' . $sql, 0);
error_log('-- Start while--', 0);
}
$lp_item_id_list = array();
@ -263,7 +264,13 @@ class learnpath {
break;
case 1:
default:
if ($this->debug > 2) {
error_log('New LP - learnpath::__construct() ' . __LINE__ . ' - calling learnpathItem', 0);
}
$oItem = new learnpathItem($row['id'], $user_id, $course_id, $row);
if ($this->debug > 2) {
error_log('New LP - learnpath::__construct() ' . __LINE__ . ' - end calling learnpathItem', 0);
}
if (is_object($oItem)) {
$my_item_id = $oItem->get_id();
//$oItem->set_lp_view($this->lp_view_id); // Moved down to when we are sure the item_view exists.
@ -302,6 +309,10 @@ class learnpath {
}
}
if ($this->debug > 2) {
error_log('New LP - learnpath::__construct() ' . __LINE__ . ' ----- end while ----', 0);
}
if (!empty($lp_item_id_list)) {
$lp_item_id_list_to_string = implode("','", $lp_item_id_list);
@ -2609,10 +2620,7 @@ class learnpath {
}
$toc = $varname.' = new Array();';
//echo "<pre>".print_r($this->items,true)."</pre>";
foreach ($this->ordered_items as $item_id) {
if ($this->debug > 2) {
error_log('New LP - learnpath::get_items_details_as_js(): getting info for item ' . $item_id, 0);
}
foreach ($this->ordered_items as $item_id) {
$toc.= $varname."['i$item_id'] = '".$this->items[$item_id]->get_type()."';";
}
if ($this->debug > 2) {

@ -76,18 +76,15 @@ class learnpathItem {
// Get items table.
if (!isset($user_id)) { $user_id = api_get_user_id(); }
if (self::debug > 0) { error_log("New LP - In learnpathItem constructor: id: $id user_id: $user_id course_id: $course_id item_content: $item_content", 0); }
if (empty($course_id)) {
$course_id = api_get_course_int_id();
} else {
$course_id = intval($course_id);
}
$items_table = Database::get_course_table(TABLE_LP_ITEM);
$this->course_id = api_get_course_int_id();
$id = intval($id);
if (empty($item_content)) {
$items_table = Database::get_course_table(TABLE_LP_ITEM);
if (empty($course_id)) {
$course_id = api_get_course_int_id();
} else {
$course_id = intval($course_id);
}
$sql = "SELECT * FROM $items_table WHERE c_id = $course_id AND id = $id";
//error_log('New LP - Creating item object from DB: '.$sql, 0);
$res = Database::query($sql);
@ -1141,10 +1138,8 @@ class learnpathItem {
* @return string The item type (can be doc, dir, sco, asset)
*/
public function get_type() {
$res = 'asset';
if (self::debug > 0) { error_log('New LP - In learnpathItem::get_type() on item '.$this->db_id, 0); }
if (!empty($this->type)) {
//error_log('In item::get_type() - returning '.$this->type, 0);
$res = 'asset';
if (!empty($this->type)) {
$res = $this->type;
}
if (self::debug > 2) { error_log('New LP - In learnpathItem::get_type() - Returning '.$res.' for item '.$this->db_id, 0); }

@ -476,3 +476,7 @@ if (Database::num_rows($res_media) > 0) {
<?php
// Restore a global setting.
$_setting['show_navigation_menu'] = $save_setting;
if ($debug) {
error_log(' ------- end lp_view.php ------');
}
Loading…
Cancel
Save