From d963a23a159d1d18a6d0c5992951744b33a79273 Mon Sep 17 00:00:00 2001 From: thomasmars Date: Tue, 26 Jun 2018 10:51:48 +0200 Subject: [PATCH] HFP-2074 Add optgroup to Creative Commons licenses in metadata dialog. --- h5p.classes.php | 78 ++++++++++++++++++++++++++----------------------- 1 file changed, 42 insertions(+), 36 deletions(-) diff --git a/h5p.classes.php b/h5p.classes.php index 303e2b5..b413920 100644 --- a/h5p.classes.php +++ b/h5p.classes.php @@ -4169,42 +4169,48 @@ class H5PContentValidator { 'label' => $this->h5pF->t('Undisclosed') ), (object) array( - 'value' => 'CC BY', - 'label' => $this->h5pF->t('CC Attribution'), - 'versions' => $cc_versions - ), - (object) array( - 'value' => 'CC BY-SA', - 'label' => $this->h5pF->t('CC Attribution-ShareAlike'), - 'versions' => $cc_versions - ), - (object) array( - 'value' => 'CC BY-ND', - 'label' => $this->h5pF->t('CC Attribution-NoDerivs'), - 'versions' => $cc_versions - ), - (object) array( - 'value' => 'CC BY-NC', - 'label' => $this->h5pF->t('CC Attribution-NonCommercial'), - 'versions' => $cc_versions - ), - (object) array( - 'value' => 'CC BY-NC-SA', - 'label' => $this->h5pF->t('CC Attribution-NonCommercial-ShareAlike'), - 'versions' => $cc_versions - ), - (object) array( - 'value' => 'CC BY-NC-ND', - 'label' => $this->h5pF->t('CC Attribution-NonCommercial-NoDerivs'), - 'versions' => $cc_versions - ), - (object) array( - 'value' => 'CC0 1.0', - 'label' => $this->h5pF->t('CC Public Domain Dedication') - ), - (object) array( - 'value' => 'CC PDM', - 'label' => $this->h5pF->t('Public Domain Mark') + 'type' => 'optgroup', + 'label' => $this->h5pF->t('Creative Commons'), + 'options' => [ + (object) array( + 'value' => 'CC BY', + 'label' => $this->h5pF->t('CC Attribution'), + 'versions' => $cc_versions + ), + (object) array( + 'value' => 'CC BY-SA', + 'label' => $this->h5pF->t('CC Attribution-ShareAlike'), + 'versions' => $cc_versions + ), + (object) array( + 'value' => 'CC BY-ND', + 'label' => $this->h5pF->t('CC Attribution-NoDerivs'), + 'versions' => $cc_versions + ), + (object) array( + 'value' => 'CC BY-NC', + 'label' => $this->h5pF->t('CC Attribution-NonCommercial'), + 'versions' => $cc_versions + ), + (object) array( + 'value' => 'CC BY-NC-SA', + 'label' => $this->h5pF->t('CC Attribution-NonCommercial-ShareAlike'), + 'versions' => $cc_versions + ), + (object) array( + 'value' => 'CC BY-NC-ND', + 'label' => $this->h5pF->t('CC Attribution-NonCommercial-NoDerivs'), + 'versions' => $cc_versions + ), + (object) array( + 'value' => 'CC0 1.0', + 'label' => $this->h5pF->t('CC Public Domain Dedication') + ), + (object) array( + 'value' => 'CC PDM', + 'label' => $this->h5pF->t('Public Domain Mark') + ), + ] ), (object) array( 'value' => 'GNU GPL',