You are here

public static function UltimateCronPlugin::defaultSettingsForm in Ultimate Cron 7.2

Default settings form.

1 method overrides UltimateCronPlugin::defaultSettingsForm()
UltimateCronPluginMultiple::defaultSettingsForm in ./ultimate_cron.plugin.inc
Default settings form.

File

./ultimate_cron.plugin.inc, line 457
Plugin framework for Ultimate Cron.

Class

UltimateCronPlugin
This is the base class for all Ultimate Cron plugins.

Code

public static function defaultSettingsForm(&$form, &$form_state, $plugin_info) {
  $plugin_type = $plugin_info['type'];
  $static = $plugin_info['defaults']['static'];
  $key = 'ultimate_cron_plugin_' . $plugin_type . '_default';
  $options = array();
  foreach (_ultimate_cron_plugin_load_all($plugin_type) as $name => $plugin) {
    if ($plugin
      ->isValid()) {
      $options[$name] = $plugin->title;
    }
  }
  $form[$key] = array(
    '#type' => 'select',
    '#options' => $options,
    '#default_value' => variable_get($key, $static['default plugin']),
    '#title' => t('Default @plugin_type', array(
      '@plugin_type' => $static['title singular'],
    )),
  );
  $form = system_settings_form($form);
}