You are here

public static function ActivityActionHandler::defaultOptions in Activity 7

Generates the default options from the provided option definition.

Parameters

array $definition: Option definition from the handler.

Return value

array Default options.

1 call to ActivityActionHandler::defaultOptions()
activity_create_form_submit in ./activity.admin.inc
Form submit callback to create the new ActivityActionHandler.

File

./activity_action_handlers.inc, line 60

Class

ActivityActionHandler

Code

public static function defaultOptions(array $definition) {
  $accumlator = array();
  foreach (element_children($definition) as $child) {
    if (isset($definition[$child]['#default_value'])) {
      $accumlator[$child] = $definition[$child]['#default_value'];
    }
    else {
      $grand_children = element_children($definition[$child]);
      if (!empty($grand_children)) {
        $accumlator[$child] = self::defaultOptions($definition[$child]);
      }
    }
  }
  return $accumlator;
}