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,12 +4284,7 @@ class H5PContentValidator {
) )
); );
$semantics = (object) array( $semantics = array(
(object) array(
'name' => 'copyright',
'type' => 'group',
'label' => $this->h5pF->t('Copyright information'),
'fields' => array(
(object) array( (object) array(
'name' => 'title', 'name' => 'title',
'type' => 'text', 'type' => 'text',
@ -4372,7 +4367,7 @@ class H5PContentValidator {
'name' => 'licenseVersion', 'name' => 'licenseVersion',
'type' => 'select', 'type' => 'select',
'label' => $this->h5pF->t('License Version'), 'label' => $this->h5pF->t('License Version'),
'options' => array(), 'options' => $cc_versions,
'optional' => TRUE 'optional' => TRUE
), ),
(object) array( (object) array(
@ -4399,18 +4394,19 @@ class H5PContentValidator {
'label' => $this->h5pF->t('Source'), 'label' => $this->h5pF->t('Source'),
'placeholder' => 'https://', 'placeholder' => 'https://',
'optional' => TRUE 'optional' => TRUE
)
)
), ),
(object) array( (object) array(
'name' => 'authorWidget', 'name' => 'authors',
'type' => 'list',
'field' => (object) array (
'name' => 'author',
'type' => 'group', 'type' => 'group',
'fields'=> array( 'fields'=> array(
(object) array( (object) array(
'label' => $this->h5pF->t("Author's name"), 'label' => $this->h5pF->t("Author's name"),
'name' => "name", 'name' => 'name',
'optional' => TRUE, 'optional' => TRUE,
'type' => "text" 'type' => 'text'
), ),
(object) array( (object) array(
'name' => 'role', 'name' => 'role',
@ -4437,25 +4433,23 @@ 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' => 'list',
'field' => (object) array(
'name' => 'change',
'type' => 'group', 'type' => 'group',
'expanded' => FALSE,
'label' => $this->h5pF->t('Change Log'), 'label' => $this->h5pF->t('Change Log'),
'fields' => array(
(object) array (
'name' => 'changeLogForm',
'type' => 'group',
'label' => $this->h5pF->t('Question'),
'expanded' => TRUE,
'fields' => array( 'fields' => array(
(object) array( (object) array(
'name' => 'date', 'name' => 'date',
@ -4471,30 +4465,23 @@ class H5PContentValidator {
), ),
(object) array( (object) array(
'name' => 'log', 'name' => 'log',
'type' => 'textarea', 'type' => 'text',
'widget' => 'textarea',
'label' => $this->h5pF->t('Description of change'), 'label' => $this->h5pF->t('Description of change'),
'placeholder' => $this->h5pF->t('Photo cropped, text changed, etc.'), 'placeholder' => $this->h5pF->t('Photo cropped, text changed, etc.'),
'optional' => TRUE 'optional' => TRUE
) )
) )
) )
)
), ),
(object) array(
'name' => 'authorComments',
'label' => $this->h5pF->t('Additional Information'),
'type' => 'group',
'expanded' => FALSE,
'fields' => array(
(object) array ( (object) array (
'name' => 'authorComments', 'name' => 'authorComments',
'type' => 'textarea', 'type' => 'text',
'widget' => 'textarea',
'label' => $this->h5pF->t('Author comments'), '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)'), '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 'optional' => TRUE
) )
)
)
); );
return $semantics; return $semantics;