class DrupalListMetaTag in Metatag 7
Multiple value meta tag controller.
Hierarchy
- class \DrupalDefaultMetaTag implements DrupalMetaTagInterface
- class \DrupalListMetaTag
Expanded class hierarchy of DrupalListMetaTag
7 string references to 'DrupalListMetaTag'
- metatag_context_i18n_object_info in metatag_context/
metatag_context.i18n.inc - Implements hook_i18n_object_info().
- metatag_devel_node_insert in metatag_devel/
metatag_devel.module - Implements hook_node_insert().
- metatag_i18n_object_info in ./
metatag.i18n.inc - Implements hook_i18n_object_info().
- metatag_metatag_info in ./
metatag.metatag.inc - Implements hook_metatag_info().
- metatag_panels_i18n_object_info in metatag_panels/
metatag_panels.i18n.inc - Implements hook_i18n_object_info().
File
- ./
metatag.inc, line 703 - Metatag primary classes.
View source
class DrupalListMetaTag extends DrupalDefaultMetaTag {
/**
* {@inheritdoc}
*/
public function __construct(array $info, array $data = NULL) {
// Ensure that the $data['value] argument is an array.
if (empty($data['value'])) {
$data['value'] = array();
}
$data['value'] = (array) $data['value'];
parent::__construct($info, $data);
}
/**
* {@inheritdoc}
*/
public function getForm(array $options = array()) {
$form['value'] = isset($this->info['form']) ? $this->info['form'] : array();
$form['value'] += array(
'#type' => 'checkboxes',
'#title' => $this->info['label'],
'#description' => !empty($this->info['description']) ? $this->info['description'] : '',
'#default_value' => isset($this->data['value']) ? $this->data['value'] : array(),
);
return $form;
}
/**
* {@inheritdoc}
*/
public function getValue(array $options = array()) {
$values = array_keys(array_filter($this->data['value']));
sort($values);
$value = implode(', ', $values);
$value = $this
->tidyValue($value);
// Translate the final output string prior to output. Use the
// 'output' i18n_string object type, and pass along the meta tag's
// options as the context so it can be handled appropriately.
$value = metatag_translate_metatag($value, $this->info['name'], $options, NULL, TRUE);
return $value;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DrupalDefaultMetaTag:: |
protected | property | The values submitted for this tag. | |
DrupalDefaultMetaTag:: |
protected | property | All of the basic information about this tag. | |
DrupalDefaultMetaTag:: |
protected | property | This item's weight; used for sorting the output. | |
DrupalDefaultMetaTag:: |
protected | function | Make sure a given URL is absolute. | |
DrupalDefaultMetaTag:: |
public | function |
Get the HTML tag for this meta tag. Overrides DrupalMetaTagInterface:: |
4 |
DrupalDefaultMetaTag:: |
public | function |
Calculate the weight of this meta tag. Overrides DrupalMetaTagInterface:: |
|
DrupalDefaultMetaTag:: |
protected | function | Identify the maximum length of which strings will be allowed. | |
DrupalDefaultMetaTag:: |
public static | function |
Copied from text.module with the following changes:. Overrides DrupalMetaTagInterface:: |
|
DrupalDefaultMetaTag:: |
protected | function | Remove unwanted formatting from a meta tag. | |
DrupalDefaultMetaTag:: |
protected | function | Shorten a string to a certain length using ::textSummary(). | |
DrupalListMetaTag:: |
public | function |
Build the form for this meta tag. Overrides DrupalDefaultMetaTag:: |
|
DrupalListMetaTag:: |
public | function |
Get the string value of this meta tag. Overrides DrupalDefaultMetaTag:: |
|
DrupalListMetaTag:: |
public | function |
Constructor. Overrides DrupalDefaultMetaTag:: |