function editContent($content_id, $title, $text, $keywords,$related, $formatting,
$release_date, $head, $use_customized_head, $test_message,
- $allow_test_export) {
+ $allow_test_export, $content_type) {
if (!authenticate(AT_PRIV_CONTENT, AT_PRIV_RETURN)) {
return FALSE;
}
SET title='$title', head='$head', use_customized_head=$use_customized_head,
text='$text', keywords='$keywords', formatting=$formatting,
revision=revision+1, last_modified=NOW(), release_date='$release_date',
- test_message='$test_message', allow_test_export=$allow_test_export
+ test_message='$test_message', allow_test_export=$allow_test_export,
+ content_type=$content_type
WHERE content_id=$content_id AND course_id=$_SESSION[course_id]";
$result = mysql_query($sql, $this->db);
/****************************************************************/
// $Id$
-function get_html_resources($text) {
- $resources = array();
+/**
+ * @param
+ * @param int course id, which should be in $_SESSION, but during export to AContent,
+ * SESSION is not available, thus we will have to use parameters
+ */
+function get_html_resources($text, $course_id=0) {
+ $resources = array();
+ if ($course_id == 0){
+ $course_id = $_SESSION['course_id'];
+ }
$handler = new XML_HTMLSax_Handler();
}
// make sure this resource exists in this course's content directory:
- $resource_server_path = realpath(AT_CONTENT_DIR . $_SESSION['course_id']. '/' . $resource);
+ $resource_server_path = realpath(AT_CONTENT_DIR . $course_id. '/' . $resource);
if (file_exists($resource_server_path) && is_file($resource_server_path)) {
$resources[$resource] = $resource_server_path;
}
}
-
return $resources;
}
'',
$content_row['use_customized_head'],
'',
- $content_row['allow_test_export']);
+ $content_row['allow_test_export'],
+ CONTENT_TYPE_FOLDER);
}
else
{ // add new content
$err = $contentManager->editContent($_POST['cid'], $_POST['title'], $_POST['body_text'],
$_POST['keywords'], $_POST['related'], $_POST['formatting'],
$release_date, $_POST['head'], $_POST['use_customized_head'],
- $_POST['test_message'], $_POST['allow_test_export']);
+ $_POST['test_message'], $_POST['allow_test_export'], $content_type_pref);
$cid = $_POST['cid'];
} else {
/* insert new */
$local_dependencies = array();
$text_blob = implode(' ', $row);
- $local_dependencies = get_html_resources($text_blob);
+ $local_dependencies = get_html_resources($text_blob, $course_id);
$dependencies = array_merge($dependencies, $local_dependencies);
$xml = $xml . "\n\n" . $local_xml;