} if ($package_base_path) { $package_base_path = implode('/', $package_base_path); } elseif (empty($package_base_path)) { $package_base_path = ''; } if ($xml_base_path) { $package_base_path = $xml_base_path . $package_base_path; mkdir(TR_TEMP_DIR . $course_id . '/' . $xml_base_path); $package_base_name = $xml_base_path . $package_base_name; } /* get the top level content ordering offset */ //$sql = "SELECT MAX(ordering) AS ordering FROM ".TABLE_PREFIX."content WHERE course_id=$_SESSION[course_id] AND content_parent_id=$cid"; //$result = mysql_query($sql, $db); //$row = mysql_fetch_assoc($result); $order_offset = $contentDAO->getMaxOrdering($course_id, 0); /* it's nice to have a real number to deal with */ $lti_offset = array(); //since we don't need lti tools, the ordering needs to be subtracted //reorder the items stack $items = rehash($items); foreach ($items as $item_id => $content_info) { //formatting field, default 1 $content_formatting = 1; //CONTENT_TYPE_CONTENT //if this is any of the LTI tools, skip it. (ie. Discussion Tools, Weblinks, etc) //take this condition out once the LTI tool kit is implemented. if ($content_info['type'] == 'imsdt_xmlv1p0') { $lti_offset[$content_info['parent_content_id']]++; continue; }