You are here

function system_patterns_params in Patterns 7

Same name and namespace in other branches
  1. 7.2 patterns_components/components/system.inc \system_patterns_params()

File

patterns_components/components/system.inc, line 391

Code

function system_patterns_params($action, $form_id, &$data = NULL, &$a) {
  $result = NULL;
  if ($form_id == 'set_active_theme') {
    $result = array(
      $data['theme_default'],
      isset($data['default']) ? TRUE : FALSE,
      isset($data['admin']) ? TRUE : FALSE,
    );
  }
  elseif ($form_id == 'call_php_func_form') {
    $result = array(
      $data['function'],
      $data['type'],
      $data['module'],
      $data['name'],
      $data['filepath'],
      $data['arguments'],
    );
  }
  else {

    // Running a user-provided form through tag 'form'.
    if (isset($data['args'])) {
      $params = $data['args'];
      unset($data['args']);
      $result = params;
    }
  }
  return patterns_results(PATTERNS_SUCCESS, t('Execution successful'), $result);
}