Restored old package and tutorial functionality

Removed uuid registration, will need separate endpoint
Use time instead of localized time when setting ct cache update time
Changed variable names to match API docs
pull/38/head
thomasmars 2017-02-24 15:38:49 +01:00
parent fb1ed589e5
commit 0641b3b824
1 changed files with 14 additions and 11 deletions

View File

@ -576,13 +576,6 @@ interface H5PFrameworkInterface {
* containing the new content type cache that should replace the old one. * containing the new content type cache that should replace the old one.
*/ */
public function replaceContentTypeCache($contentTypeCache); public function replaceContentTypeCache($contentTypeCache);
/**
* Get timestamp of time at user
*
* @return int Timestamp of localized time
*/
public function getCurrentUserTime();
} }
/** /**
@ -2453,9 +2446,19 @@ class H5PCore {
return; return;
} }
// Handle new uuid // Handle libraries metadata
if ($uuid === '' && isset($result->uuid)) { if (isset($result->libraries)) {
$this->h5pF->setOption('site_uuid', $result->uuid); foreach ($result->libraries as $library) {
if (isset($library->tutorialUrl) && isset($library->machineName)) {
$this->h5pF->setLibraryTutorialUrl($library->machineNamee, $library->tutorialUrl);
}
}
}
// Handle latest version of H5P
if (!empty($result->packageReleased)) {
$this->h5pF->setOption('update_available', $result->packageReleased->releasedAt);
$this->h5pF->setOption('update_available_path', $result->packageReleased->path);
} }
} }
@ -2793,7 +2796,7 @@ class H5PCore {
// Inform of the changes and update timestamp // Inform of the changes and update timestamp
$interface->setInfoMessage($interface->t('Library cache was successfully updated!')); $interface->setInfoMessage($interface->t('Library cache was successfully updated!'));
$interface->setOption('content_type_cache_updated_at', $interface->getCurrentUserTime()); $interface->setOption('content_type_cache_updated_at', time());
return $data; return $data;
} }
} }