diff --git a/metatag.inc b/metatag.inc index b00588b..2608261 100644 --- a/metatag.inc +++ b/metatag.inc @@ -135,54 +135,61 @@ class DrupalExtendedMetaTag extends DrupalTextMetaTag { '#title' => $this->info['label'], '#tree' => TRUE, '#description' => !empty($this->info['description']) ? $this->info['description'] : '', - '#attributes' => array('class' => array('metatag-item')), + '#attributes' => array('class' => array('metatag-item', 'extended-metatag-item')), '#collapsible' => TRUE, '#collapsed' => TRUE, ); - $form['item']['value'] = isset($this->info['form']) ? $this->info['form'] : array(); + $form['item']['value'] = isset($this->info['form']['value']) ? $this->info['form']['value'] : array(); $form['item']['value'] += array( '#type' => 'textfield', '#title' => t('Value'), - '#default_value' => isset($this->data['value']) ? $this->data['value'] : '', + '#attributes' => array('class' => array('extended-metatag-field')), + '#default_value' => isset($this->data['item']['value']) ? $this->data['item']['value'] : '', '#element_validate' => array('token_element_validate'), '#token_types' => $options['token types'], '#maxlength' => 1024, '#length' => '60', ); - $form['item']['scheme'] = isset($this->info['scheme']) ? $this->info['scheme'] : array(); + $form['item']['scheme'] = isset($this->info['form']['scheme']) ? $this->info['form']['scheme'] : array(); $form['item']['scheme'] += array( '#type' => 'textfield', '#title' => t('Scheme'), - '#default_value' => isset($this->data['scheme']) ? $this->data['scheme'] : '', + '#attributes' => array('class' => array('extended-metatag-field')), + '#default_value' => isset($this->data['item']['scheme']) ? $this->data['item']['scheme'] : '', '#element_validate' => array('token_element_validate'), '#token_types' => $options['token types'], '#maxlength' => 1024, ); - $form['item']['lang'] = isset($this->info['lang']) ? $this->info['lang'] : array(); + $form['item']['lang'] = isset($this->info['form']['lang']) ? $this->info['form']['lang'] : array(); $form['item']['lang'] += array( '#type' => 'textfield', '#title' => t('Language'), + '#attributes' => array('class' => array('extended-metatag-field')), '#description' => t("The lang attribute's value is a language code that identifies a natural language spoken, written, or otherwise used for the communication of information among people."), - '#default_value' => isset($this->data['scheme']) ? $this->data['scheme'] : '', + '#default_value' => isset($this->data['item']['lang']) ? $this->data['item']['lang'] : '', '#element_validate' => array('token_element_validate'), '#token_types' => $options['token types'], '#maxlength' => 1024, ); - $form['item']['dir'] = isset($this->info['dir']) ? $this->info['dir'] : array(); + $form['item']['dir'] = isset($this->info['form']['dir']) ? $this->info['form']['dir'] : array(); $form['item']['dir'] += array( - '#type' => 'textfield', + '#type' => 'select', '#title' => t('Text direction'), + '#attributes' => array('class' => array('extended-metatag-field')), '#description' => t("Specifies the base direction of directionally neutral text. It also specifies the directionality of tables. Can be either ltr or rtl."), - '#default_value' => isset($this->data['scheme']) ? $this->data['scheme'] : '', - '#element_validate' => array('token_element_validate'), - '#token_types' => $options['token types'], + '#default_value' => isset($this->data['item']['dir']) ? $this->data['item']['dir'] : '', + '#options' => array( + FALSE => '- none -', + 'ltr' => t('Left to right'), + 'rtl' => t('Right to left'), + ), '#maxlength' => 1024, ); diff --git a/metatag.vertical-tabs.js b/metatag.vertical-tabs.js index b207b2c..bca6dbd 100644 --- a/metatag.vertical-tabs.js +++ b/metatag.vertical-tabs.js @@ -5,7 +5,7 @@ Drupal.behaviors.metatagFieldsetSummaries = { attach: function (context) { $('fieldset.metatags-form', context).drupalSetSummary(function (context) { var vals = []; - $("input[type='text'], select, textarea", context).each(function() { + $("input[type='text'], select, textarea", context).not(".extended-metatag-field").each(function() { var default_name = $(this).attr('name').replace(/\[value\]/, '[default]'); var default_value = $("input[type='hidden'][name='" + default_name + "']", context); if (default_value.length && default_value.val() == $(this).val()) { diff --git a/metatag_dc/metatag_dc.metatag.inc b/metatag_dc/metatag_dc.metatag.inc index e7c8403..12418a2 100644 --- a/metatag_dc/metatag_dc.metatag.inc +++ b/metatag_dc/metatag_dc.metatag.inc @@ -12,43 +12,43 @@ function metatag_dc_metatag_config_default_alter(array &$configs) { switch ($config->instance) { case 'global': $config->config += array( - 'dcterms.title' => array('value' => '[current-page:title]'), - 'dcterms.type' => array('value' => 'Text'), - 'dcterms.format' => array('value' => 'text/html'), + 'dcterms.title' => array('item' => array('value' => '[current-page:title]')), + 'dcterms.type' => array('item' => array('value' => 'Text')), + 'dcterms.format' => array('item' => array('value' => 'text/html')), ); break; case 'global:frontpage': $config->config += array( - 'dcterms.title' => array('value' => '[site:name]'), - 'dcterms.identifier' => array('value' => '[site:url]'), + 'dcterms.title' => array('item' => array('value' => '[site:name]')), + 'dcterms.identifier' => array('item' => array('value' => '[site:url]')), ); break; case 'node': $config->config += array( - 'dcterms.title' => array('value' => '[node:title]'), - 'dcterms.date' => array('value' => '[node:created:custom:Y-m-d\TH:iP]'), - 'dcterms.identifier' => array('value' => '[current-page:url:absolute]'), - 'dcterms.language' => array('value' => '[node:language]'), - 'dcterms.creator' => array('value' => '[node:author]'), + 'dcterms.title' => array('item' => array('value' => '[node:title]')), + 'dcterms.date' => array('item' => array('value' => '[node:created:custom:Y-m-d\TH:iP]')), + 'dcterms.identifier' => array('item' => array('value' => '[current-page:url:absolute]')), + 'dcterms.language' => array('item' => array('value' => '[node:language]')), + 'dcterms.creator' => array('item' => array('value' => '[node:author]')), ); break; case 'taxonomy_term': $config->config += array( - 'dcterms.title' => array('value' => '[term:name]'), - 'dcterms.identifier' => array('value' => '[current-page:url:absolute]'), - 'dcterms.description' => array('value' => '[term:description]'), + 'dcterms.title' => array('item' => array('value' => '[term:name]')), + 'dcterms.identifier' => array('item' => array('value' => '[current-page:url:absolute]')), + 'dcterms.description' => array('item' => array('value' => '[term:description]')), ); break; case 'user': $config->config += array( - 'dcterms.title' => array('value' => '[user:name]'), - 'dcterms.date' => array('value' => '[user:created:custom:Y-m-d\TH:iP]'), - 'dcterms.identifier' => array('value' => '[current-page:url:absolute]'), - 'dcterms.creator' => array('value' => '[user:name]'), + 'dcterms.title' => array('item' => array('value' => '[user:name]')), + 'dcterms.date' => array('item' => array('value' => '[user:created:custom:Y-m-d\TH:iP]')), + 'dcterms.identifier' => array('item' => array('value' => '[current-page:url:absolute]')), + 'dcterms.creator' => array('item' => array('value' => '[user:name]')), ); break; }