You are here

public function CslMappingForm::buildForm in Bibliography & Citation 2.0.x

Same name and namespace in other branches
  1. 8 modules/bibcite_entity/src/Form/CslMappingForm.php \Drupal\bibcite_entity\Form\CslMappingForm::buildForm()

Form constructor.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Return value

array The form structure.

Overrides MappingForm::buildForm

File

modules/bibcite_entity/src/Form/CslMappingForm.php, line 16

Class

CslMappingForm
Mapping form for CSL pseudo format.

Namespace

Drupal\bibcite_entity\Form

Code

public function buildForm(array $form, FormStateInterface $form_state, $bibcite_format = NULL) {
  $definition = [
    'id' => 'csl',
    'label' => $this
      ->t('CSL'),
    'types' => [
      'bill',
      'book',
      'chapter',
      'broadcast',
      'paper-conference',
      'motion_picture',
      'article-journal',
      'legal_case',
      'article-magazine',
      'manuscript',
      'map',
      'article-newspaper',
      'patent',
      'personal_communication',
      'report',
      'legislation',
      'thesis',
      'webpage',
      'article',
      'dataset',
      'entry',
      'entry-dictionary',
      'entry-encyclopedia',
      'figure',
      'graphic',
      'interview',
      'musical_score',
      'pamphlet',
      'post',
      'post-weblog',
      'review',
      'review-book',
      'song',
      'speech',
      'treaty',
    ],
    'fields' => [
      'title',
      'type',
      'keyword',
      'author',
      'abstract',
      'issued',
      'collection-title',
      'container-title',
      'volume',
      'edition',
      'version',
      'chapter-number',
      'section',
      'issue',
      'number-of-volumes',
      'number',
      'page',
      'container',
      'event-date',
      'original-date',
      'publisher',
      'event-place',
      'publisher-place',
      'ISSN',
      'ISBN',
      'call-number',
      'citation-label',
      'URL',
      'DOI',
      'note',
      'original-title',
      'accessed',
      'annote',
      'archive',
      'archive_location',
      'archive-place',
      'author',
      'authority',
      'citation-number',
      'collection-editor',
      'collection-number',
      'composer',
      'container-author',
      'container-title',
      'container-title-short',
      'dimensions',
      'director',
      'editor',
      'editorial-director',
      'first-reference-note-number',
      'genre',
      'illustrator',
      'interviewer',
      'jurisdiction',
      'locator',
      'medium',
      'number-of-pages',
      'original-author',
      'original-publisher',
      'original-publisher-place',
      'page-first',
      'PMCID',
      'PMID',
      'recipient',
      'references',
      'reviewed-author',
      'reviewed-title',
      'scale',
      'source',
      'status',
      'submitted',
      'title-short',
      'translator',
      'year-suffix',
    ],
    'provider' => 'bibcite_entity',
  ];
  $bibcite_format = new BibciteFormat([], 'csl', $definition);
  return parent::buildForm($form, $form_state, $bibcite_format);
}