function rules_scheduler_action_schedule_info_alter

Info alteration callback for the schedule action.

Related topics

File

rules_scheduler/rules_scheduler.rules.inc, line 107

Code

function rules_scheduler_action_schedule_info_alter(&$element_info, RulesPlugin $element) {
    if (isset($element->settings['component'])) {
        // If run during a cache rebuild the cache might not be instantiated yet,
        // so fail back to loading the component from database.
        if (($component = rules_get_cache('comp_' . $element->settings['component'])) || ($component = rules_config_load($element->settings['component']))) {
            // Add in the needed parameters.
            foreach ($component->parameterInfo() as $name => $info) {
                $element_info['parameter']['param_' . $name] = $info;
            }
        }
    }
}