Make copyright fields translatable

https://github.com/h5p/h5p-image/issues/2
pull/6/head
Frode Petterson 2015-11-23 14:35:51 +01:00
parent 813103a28b
commit 5aec15061c
1 changed files with 20 additions and 20 deletions

View File

@ -2870,7 +2870,7 @@ class H5PContentValidator {
} }
if (isset($file->copyright)) { if (isset($file->copyright)) {
$this->validateGroup($file->copyright, H5PContentValidator::getCopyrightSemantics()); $this->validateGroup($file->copyright, $this->getCopyrightSemantics());
} }
} }
@ -3373,40 +3373,40 @@ class H5PContentValidator {
return $uri; return $uri;
} }
public static function getCopyrightSemantics() { public function getCopyrightSemantics() {
static $semantics; static $semantics;
if ($semantics === NULL) { if ($semantics === NULL) {
$semantics = (object) array( $semantics = (object) array(
'name' => 'copyright', 'name' => 'copyright',
'type' => 'group', 'type' => 'group',
'label' => 'Copyright information', 'label' => $this->h5pF->t('Copyright information'),
'fields' => array( 'fields' => array(
(object) array( (object) array(
'name' => 'title', 'name' => 'title',
'type' => 'text', 'type' => 'text',
'label' => 'Title', 'label' => $this->h5pF->t('Title'),
'placeholder' => 'La Gioconda', 'placeholder' => 'La Gioconda',
'optional' => TRUE 'optional' => TRUE
), ),
(object) array( (object) array(
'name' => 'author', 'name' => 'author',
'type' => 'text', 'type' => 'text',
'label' => 'Author', 'label' => $this->h5pF->t('Author'),
'placeholder' => 'Leonardo da Vinci', 'placeholder' => 'Leonardo da Vinci',
'optional' => TRUE 'optional' => TRUE
), ),
(object) array( (object) array(
'name' => 'year', 'name' => 'year',
'type' => 'text', 'type' => 'text',
'label' => 'Year(s)', 'label' => $this->h5pF->t('Year(s)'),
'placeholder' => '1503 - 1517', 'placeholder' => '1503 - 1517',
'optional' => TRUE 'optional' => TRUE
), ),
(object) array( (object) array(
'name' => 'source', 'name' => 'source',
'type' => 'text', 'type' => 'text',
'label' => 'Source', 'label' => $this->h5pF->t('Source'),
'placeholder' => 'http://en.wikipedia.org/wiki/Mona_Lisa', 'placeholder' => 'http://en.wikipedia.org/wiki/Mona_Lisa',
'optional' => true, 'optional' => true,
'regexp' => (object) array( 'regexp' => (object) array(
@ -3417,56 +3417,56 @@ class H5PContentValidator {
(object) array( (object) array(
'name' => 'license', 'name' => 'license',
'type' => 'select', 'type' => 'select',
'label' => 'License', 'label' => $this->h5pF->t('License'),
'default' => 'U', 'default' => 'U',
'options' => array( 'options' => array(
(object) array( (object) array(
'value' => 'U', 'value' => 'U',
'label' => 'Undisclosed' 'label' => $this->h5pF->t('Undisclosed')
), ),
(object) array( (object) array(
'value' => 'CC BY', 'value' => 'CC BY',
'label' => 'Attribution' 'label' => $this->h5pF->t('Attribution')
), ),
(object) array( (object) array(
'value' => 'CC BY-SA', 'value' => 'CC BY-SA',
'label' => 'Attribution-ShareAlike' 'label' => $this->h5pF->t('Attribution-ShareAlike')
), ),
(object) array( (object) array(
'value' => 'CC BY-ND', 'value' => 'CC BY-ND',
'label' => 'Attribution-NoDerivs' 'label' => $this->h5pF->t('Attribution-NoDerivs')
), ),
(object) array( (object) array(
'value' => 'CC BY-NC', 'value' => 'CC BY-NC',
'label' => 'Attribution-NonCommercial' 'label' => $this->h5pF->t('Attribution-NonCommercial')
), ),
(object) array( (object) array(
'value' => 'CC BY-NC-SA', 'value' => 'CC BY-NC-SA',
'label' => 'Attribution-NonCommercial-ShareAlike' 'label' => $this->h5pF->t('Attribution-NonCommercial-ShareAlike')
), ),
(object) array( (object) array(
'value' => 'CC BY-NC-ND', 'value' => 'CC BY-NC-ND',
'label' => 'Attribution-NonCommercial-NoDerivs' 'label' => $this->h5pF->t('Attribution-NonCommercial-NoDerivs')
), ),
(object) array( (object) array(
'value' => 'GNU GPL', 'value' => 'GNU GPL',
'label' => 'General Public License' 'label' => $this->h5pF->t('General Public License')
), ),
(object) array( (object) array(
'value' => 'PD', 'value' => 'PD',
'label' => 'Public Domain' 'label' => $this->h5pF->t('Public Domain')
), ),
(object) array( (object) array(
'value' => 'ODC PDDL', 'value' => 'ODC PDDL',
'label' => 'Public Domain Dedication and Licence' 'label' => $this->h5pF->t('Public Domain Dedication and Licence')
), ),
(object) array( (object) array(
'value' => 'CC PDM', 'value' => 'CC PDM',
'label' => 'Public Domain Mark' 'label' => $this->h5pF->t('Public Domain Mark')
), ),
(object) array( (object) array(
'value' => 'C', 'value' => 'C',
'label' => 'Copyright' 'label' => $this->h5pF->t('Copyright')
) )
) )
) )