isEnabled(true)) {
    api_not_allowed(true);
    exit;
}
//Update 1.5 comment after first update
$sqlUpdate = "SELECT COUNT(*) as nb FROM information_schema.COLUMNS WHERE COLUMN_NAME = 'terms_d' and TABLE_NAME LIKE 'plugin_h5p'";
$resultUpdate = Database::query($sqlUpdate);
$rowUpdate = Database::fetch_array($resultUpdate);
$intUpdate = (int) $rowUpdate['nb'];
if ($intUpdate == 0) {
    header('Location: '.api_get_path(WEB_PLUGIN_PATH).'h5p/update.php?version=1-5');
    exit;
}
//Update 1.5
$userId = $user['id'];
$vers = 6;
//wordsmatch
$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
$nodeType = isset($_GET['node_type']) ? Security::remove_XSS($_GET['node_type']) : '';
$action = isset($_GET['action']) ? Security::remove_XSS($_GET['action']) : 'add';
$table = 'plugin_h5p';
$urlId = api_get_current_access_url_id();
$UrlWhere = "";
if ((api_is_platform_admin() || api_is_session_admin()) && api_get_multiple_access_url()) {
    $UrlWhere = " AND url_id = $urlId ";
}
$sql = "SELECT * FROM $table WHERE user_id = $userId $UrlWhere ORDER BY title";
if (isset($_GET['id'])) {
    $sql = "SELECT * FROM $table  WHERE id <> $id AND user_id = $userId $UrlWhere LIMIT 2";
}
$result = Database::query($sql);
$terms = Database::store_result($result, 'ASSOC');
$countData = count($terms);
$term = null;
if ($id > 0) {
    if (!empty($id)) {
        $sql = "SELECT * FROM $table WHERE id = $id AND user_id = $userId ";
        $result = Database::query($sql);
        $term = Database::fetch_array($result, 'ASSOC');
        if (empty($term)) {
            api_not_allowed(true);
        }
    }
}
include __DIR__.'/inc/translate.php';
include __DIR__.'/inc/edit.form.php';
$htmlHeadXtra[] = '';
$htmlHeadXtra[] = '';
$htmlHeadXtra[] = '';
$htmlHeadXtra[] = '';
$htmlHeadXtra[] = '';
$htmlHeadXtra[] = '';
$htmlHeadXtra[] = '';
$htmlHeadXtra[] = '';
$htmlHeadXtra[] = "";
if ($nodeType != '') {
    $htmlHeadXtra[] = "";
}
$htmlHeadXtra[] = "";
include 'inc/action.switch.php';
$tpl = new Template('H5P');
if ($nodeType == '') {
    $tpl->assign('terms', $terms);
}
$tpl->assign('tables', $tableOfnodes);
$tpl->assign('form', $form->returnForm());
$content = $tpl->fetch('h5p/view/list.tpl');
$tpl->assign('content', $content);
$tpl->display_one_col_template();