You are here

public function FlexiformElement::getCtoolsSubstitutionsList in Flexiform 7

Build a list of possible ctools substitutions.

Parameters

array $keywords: Optionally provide additional keywords to show.

Return value

array A render array of substitutions.

7 calls to FlexiformElement::getCtoolsSubstitutionsList()
FlexiformElementCustomHtml::configureForm in includes/element/custom_html.element.inc
Builds the configuration form for the form element.
FlexiformElementEntityProperty::configureForm in includes/element/property.element.inc
Build the configure form for the element.
FlexiformElementField::configureForm in includes/element/field.element.inc
Overrides FlexiformElement::configureForm().
FlexiformElementNodeAuthor::configureForm in includes/element/node_author.element.inc
Build the configure form for the element.
FlexiformElementNodeTitle::configureForm in includes/element/node_title.element.inc
Build the configure form for the element.

... See full list

File

includes/flexiform.element.inc, line 425
Controller class for flexiform elements.

Class

FlexiformElement
Base class for all FlexiformElements

Code

public function getCtoolsSubstitutionsList($keywords = array()) {
  $content = array(
    '#theme' => 'table',
    '#header' => array(
      t('Keyword'),
      t('Value'),
    ),
    '#rows' => array(),
  );
  foreach ($this
    ->getCtoolsContexts() as $context) {
    foreach (ctools_context_get_converters('%' . check_plain($context->keyword) . ':', $context) as $keyword => $title) {
      $content['#rows'][] = array(
        check_plain($keyword),
        t('@identifier: @title', array(
          '@title' => $title,
          '@identifier' => $context->identifier,
        )),
      );
    }
  }
  if (count($content['#rows'])) {
    return $content;
  }
  else {
    return array();
  }
}