You are here

public function Settings::commandFromSettings in Forena Reports 8

Same name and namespace in other branches
  1. 7.4 AjaxCommand/Settings.php \Drupal\forena\FrxPlugin\AjaxCommand\Settings::commandFromSettings()

Settings are passed into this factory from either the skin or the report element. If there are complex structures when used in the arguments they will be passed in the 'text' setting. These should be decoded by any plugin intending to use the interior element of an AJAX command.

Parameters

array $settings:

Return value

mixed The ajax command object expected by drupal.

Overrides AjaxCommandInterface::commandFromSettings

File

src/FrxPlugin/AjaxCommand/Settings.php, line 22

Class

Settings
Class Settings

Namespace

Drupal\forena\FrxPlugin\AjaxCommand

Code

public function commandFromSettings(array $settings) {
  if (!isset($settings['merge'])) {
    $settings['merge'] = TRUE;
  }
  $merge = $this
    ->getSetting($settings, 'merge');
  $json_settings = $this
    ->getJSONText($settings, 'settings');
  return new SettingsCommand($json_settings);
}