Made sure main content id isn't required.

Conflicts:
	h5p.classes.php
namespaces
Frode Petterson 2014-08-22 11:34:38 +02:00
parent 08f8c46544
commit 89bacfdb88
1 changed files with 19 additions and 0 deletions

View File

@ -1278,6 +1278,25 @@ class H5PCore {
}
}
/**
* Save content and clear cache.
*
* @param array $content
* @return int Content ID
*/
public function saveContent($content, $contentMainId = NULL) {
if (isset($content['id'])) {
$this->h5pF->updateContent($content, $contentMainId);
}
else {
$content['id'] = $this->h5pF->insertContent($content, $contentMainId);
}
$this->h5pF->cacheDel('parameters', $content['id']);
return $content['id'];
}
/**
* Load content.
*