From f29ad51b798e611fc14848dbbcf1c9d79d69d571 Mon Sep 17 00:00:00 2001 From: corinna Date: Sat, 14 Sep 2024 22:24:04 +0200 Subject: [PATCH 1/2] delete button disabled only when library has an Instance or Instance dependency --- js/h5p-library-list.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/js/h5p-library-list.js b/js/h5p-library-list.js index 344b7367..736e5577 100644 --- a/js/h5p-library-list.js +++ b/js/h5p-library-list.js @@ -81,9 +81,7 @@ var H5PLibraryList = H5PLibraryList || {}; if (libraries.notCached !== undefined || hasContent || (library.numContentDependencies !== '' && - library.numContentDependencies !== 0) || - (library.numLibraryDependencies !== '' && - library.numLibraryDependencies !== 0)) { + library.numContentDependencies !== 0)) { // Disabled delete if content. $deleteButton.attr('disabled', true); } From 2240b3dc907d9f000bbef1b4f9489538ba0f3240 Mon Sep 17 00:00:00 2001 From: corinna Date: Tue, 17 Sep 2024 18:42:37 +0200 Subject: [PATCH 2/2] Adding function call to interface --- h5p.classes.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/h5p.classes.php b/h5p.classes.php index 1a239882..1a11552d 100644 --- a/h5p.classes.php +++ b/h5p.classes.php @@ -350,6 +350,14 @@ public function saveLibraryUsage($contentId, $librariesInUse); */ public function getLibraryUsage($libraryId, $skipContent = FALSE); + /** + * Get the names of dependencies to other libraries + * + * @param int $id + * @return array The array contains the names of the dependet libraries + */ + public function getLibraryUsageNames($id); + /** * Loads a library *