JI-857 Make metadata semantics describe the actual data structure

HFP-2095-Fix-table-styling
Paal Joergensen 2018-09-17 08:45:18 +02:00
parent 8067277e63
commit 74f9a84034
1 changed files with 153 additions and 166 deletions

View File

@ -4284,155 +4284,152 @@ class H5PContentValidator {
) )
); );
$semantics = (object) array( $semantics = array(
(object) array( (object) array(
'name' => 'copyright', 'name' => 'title',
'type' => 'group', 'type' => 'text',
'label' => $this->h5pF->t('Copyright information'), 'label' => $this->h5pF->t('Title'),
'fields' => array( 'placeholder' => 'La Gioconda'
),
(object) array(
'name' => 'license',
'type' => 'select',
'label' => $this->h5pF->t('License'),
'default' => 'U',
'options' => array(
(object) array( (object) array(
'name' => 'title', 'value' => 'U',
'type' => 'text', 'label' => $this->h5pF->t('Undisclosed')
'label' => $this->h5pF->t('Title'),
'placeholder' => 'La Gioconda'
), ),
(object) array( (object) array(
'name' => 'license', 'type' => 'optgroup',
'type' => 'select', 'label' => $this->h5pF->t('Creative Commons'),
'label' => $this->h5pF->t('License'), 'options' => [
'default' => 'U',
'options' => array(
(object) array( (object) array(
'value' => 'U', 'value' => 'CC BY',
'label' => $this->h5pF->t('Undisclosed') 'label' => $this->h5pF->t('Attribution (CC BY)'),
'versions' => $cc_versions
), ),
(object) array( (object) array(
'type' => 'optgroup', 'value' => 'CC BY-SA',
'label' => $this->h5pF->t('Creative Commons'), 'label' => $this->h5pF->t('Attribution-ShareAlike (CC BY-SA)'),
'options' => [ 'versions' => $cc_versions
(object) array(
'value' => 'CC BY',
'label' => $this->h5pF->t('Attribution (CC BY)'),
'versions' => $cc_versions
),
(object) array(
'value' => 'CC BY-SA',
'label' => $this->h5pF->t('Attribution-ShareAlike (CC BY-SA)'),
'versions' => $cc_versions
),
(object) array(
'value' => 'CC BY-ND',
'label' => $this->h5pF->t('Attribution-NoDerivs (CC BY-ND)'),
'versions' => $cc_versions
),
(object) array(
'value' => 'CC BY-NC',
'label' => $this->h5pF->t('Attribution-NonCommercial (CC BY-NC)'),
'versions' => $cc_versions
),
(object) array(
'value' => 'CC BY-NC-SA',
'label' => $this->h5pF->t('Attribution-NonCommercial-ShareAlike (CC BY-NC-SA)'),
'versions' => $cc_versions
),
(object) array(
'value' => 'CC BY-NC-ND',
'label' => $this->h5pF->t('Attribution-NonCommercial-NoDerivs (CC BY-NC-ND)'),
'versions' => $cc_versions
),
(object) array(
'value' => 'CC0 1.0',
'label' => $this->h5pF->t('Public Domain Dedication (CC0)')
),
(object) array(
'value' => 'CC PDM',
'label' => $this->h5pF->t('Public Domain Mark (PDM)')
),
]
), ),
(object) array( (object) array(
'value' => 'GNU GPL', 'value' => 'CC BY-ND',
'label' => $this->h5pF->t('General Public License v3') 'label' => $this->h5pF->t('Attribution-NoDerivs (CC BY-ND)'),
'versions' => $cc_versions
), ),
(object) array( (object) array(
'value' => 'PD', 'value' => 'CC BY-NC',
'label' => $this->h5pF->t('Public Domain') 'label' => $this->h5pF->t('Attribution-NonCommercial (CC BY-NC)'),
'versions' => $cc_versions
), ),
(object) array( (object) array(
'value' => 'ODC PDDL', 'value' => 'CC BY-NC-SA',
'label' => $this->h5pF->t('Public Domain Dedication and Licence') 'label' => $this->h5pF->t('Attribution-NonCommercial-ShareAlike (CC BY-NC-SA)'),
'versions' => $cc_versions
), ),
(object) array( (object) array(
'value' => 'C', 'value' => 'CC BY-NC-ND',
'label' => $this->h5pF->t('Copyright') 'label' => $this->h5pF->t('Attribution-NonCommercial-NoDerivs (CC BY-NC-ND)'),
) 'versions' => $cc_versions
) ),
(object) array(
'value' => 'CC0 1.0',
'label' => $this->h5pF->t('Public Domain Dedication (CC0)')
),
(object) array(
'value' => 'CC PDM',
'label' => $this->h5pF->t('Public Domain Mark (PDM)')
),
]
), ),
(object) array( (object) array(
'name' => 'licenseVersion', 'value' => 'GNU GPL',
'type' => 'select', 'label' => $this->h5pF->t('General Public License v3')
'label' => $this->h5pF->t('License Version'),
'options' => array(),
'optional' => TRUE
), ),
(object) array( (object) array(
'name' => 'yearFrom', 'value' => 'PD',
'type' => 'number', 'label' => $this->h5pF->t('Public Domain')
'label' => $this->h5pF->t('Years (from)'),
'placeholder' => '1991',
'min' => '-9999',
'max' => '9999',
'optional' => TRUE
), ),
(object) array( (object) array(
'name' => 'yearTo', 'value' => 'ODC PDDL',
'type' => 'number', 'label' => $this->h5pF->t('Public Domain Dedication and Licence')
'label' => $this->h5pF->t('Years (to)'),
'placeholder' => '1992',
'min' => '-9999',
'max' => '9999',
'optional' => TRUE
), ),
(object) array( (object) array(
'name' => 'source', 'value' => 'C',
'type' => 'text', 'label' => $this->h5pF->t('Copyright')
'label' => $this->h5pF->t('Source'),
'placeholder' => 'https://',
'optional' => TRUE
) )
) )
), ),
(object) array( (object) array(
'name' => 'authorWidget', 'name' => 'licenseVersion',
'type' => 'group', 'type' => 'select',
'fields'=> array( 'label' => $this->h5pF->t('License Version'),
(object) array( 'options' => $cc_versions,
'label' => $this->h5pF->t("Author's name"), 'optional' => TRUE
'name' => "name", ),
'optional' => TRUE, (object) array(
'type' => "text" 'name' => 'yearFrom',
), 'type' => 'number',
(object) array( 'label' => $this->h5pF->t('Years (from)'),
'name' => 'role', 'placeholder' => '1991',
'type' => 'select', 'min' => '-9999',
'label' => $this->h5pF->t("Author's role"), 'max' => '9999',
'default' => 'Author', 'optional' => TRUE
'options' => array( ),
(object) array( (object) array(
'value' => 'Author', 'name' => 'yearTo',
'label' => $this->h5pF->t('Author') 'type' => 'number',
), 'label' => $this->h5pF->t('Years (to)'),
(object) array( 'placeholder' => '1992',
'value' => 'Editor', 'min' => '-9999',
'label' => $this->h5pF->t('Editor') 'max' => '9999',
), 'optional' => TRUE
(object) array( ),
'value' => 'Licensee', (object) array(
'label' => $this->h5pF->t('Licensee') 'name' => 'source',
), 'type' => 'text',
(object) array( 'label' => $this->h5pF->t('Source'),
'value' => 'Originator', 'placeholder' => 'https://',
'label' => $this->h5pF->t('Originator') 'optional' => TRUE
),
(object) array(
'name' => 'authors',
'type' => 'list',
'field' => (object) array (
'name' => 'author',
'type' => 'group',
'fields'=> array(
(object) array(
'label' => $this->h5pF->t("Author's name"),
'name' => 'name',
'optional' => TRUE,
'type' => 'text'
),
(object) array(
'name' => 'role',
'type' => 'select',
'label' => $this->h5pF->t("Author's role"),
'default' => 'Author',
'options' => array(
(object) array(
'value' => 'Author',
'label' => $this->h5pF->t('Author')
),
(object) array(
'value' => 'Editor',
'label' => $this->h5pF->t('Editor')
),
(object) array(
'value' => 'Licensee',
'label' => $this->h5pF->t('Licensee')
),
(object) array(
'value' => 'Originator',
'label' => $this->h5pF->t('Originator')
)
) )
) )
) )
@ -4440,60 +4437,50 @@ class H5PContentValidator {
), ),
(object) array( (object) array(
'name' => 'licenseExtras', 'name' => 'licenseExtras',
'type' => 'textarea', 'type' => 'text',
'widget' => 'textarea',
'label' => $this->h5pF->t('License Extras'), 'label' => $this->h5pF->t('License Extras'),
'optional' => TRUE, 'optional' => TRUE,
'description' => $this->h5pF->t('Any additional information about the license') 'description' => $this->h5pF->t('Any additional information about the license')
), ),
(object) array( (object) array(
'name' => 'changeLog', 'name' => 'changes',
'type' => 'group', 'type' => 'list',
'expanded' => FALSE, 'field' => (object) array(
'label' => $this->h5pF->t('Change Log'), 'name' => 'change',
'fields' => array( 'type' => 'group',
(object) array ( 'label' => $this->h5pF->t('Change Log'),
'name' => 'changeLogForm', 'fields' => array(
'type' => 'group', (object) array(
'label' => $this->h5pF->t('Question'), 'name' => 'date',
'expanded' => TRUE, 'type' => 'text',
'fields' => array( 'label' => $this->h5pF->t('Date'),
(object) array( 'optional' => TRUE
'name' => 'date', ),
'type' => 'text', (object) array(
'label' => $this->h5pF->t('Date'), 'name' => 'author',
'optional' => TRUE 'type' => 'text',
), 'label' => $this->h5pF->t('Changed by'),
(object) array( 'optional' => TRUE
'name' => 'author', ),
'type' => 'text', (object) array(
'label' => $this->h5pF->t('Changed by'), 'name' => 'log',
'optional' => TRUE 'type' => 'text',
), 'widget' => 'textarea',
(object) array( 'label' => $this->h5pF->t('Description of change'),
'name' => 'log', 'placeholder' => $this->h5pF->t('Photo cropped, text changed, etc.'),
'type' => 'textarea', 'optional' => TRUE
'label' => $this->h5pF->t('Description of change'),
'placeholder' => $this->h5pF->t('Photo cropped, text changed, etc.'),
'optional' => TRUE
)
) )
) )
) )
), ),
(object) array( (object) array (
'name' => 'authorComments', 'name' => 'authorComments',
'label' => $this->h5pF->t('Additional Information'), 'type' => 'text',
'type' => 'group', 'widget' => 'textarea',
'expanded' => FALSE, 'label' => $this->h5pF->t('Author comments'),
'fields' => array( 'description' => $this->h5pF->t('Comments for the editor of the content (This text will not be published as a part of copyright info)'),
(object) array ( 'optional' => TRUE
'name' => 'authorComments',
'type' => 'textarea',
'label' => $this->h5pF->t('Author comments'),
'description' => $this->h5pF->t('Comments for the editor of the content (This text will not be published as a part of copyright info)'),
'optional' => TRUE
)
)
) )
); );