You are here

function pathauto_patterns_params in Patterns 7

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

File

patterns_components/components/pathauto.inc, line 183

Code

function pathauto_patterns_params($action, $form_id, &$data = NULL, &$a) {
  if ($form_id == "path_admin_form" && $action == PATTERNS_MODIFY) {
    $pid = $data['pid'];
    $path = db_query("SELECT * FROM {url_alias} WHERE pid = :pid", array(
      'pid' => $data['pid'],
    ))
      ->fetchField();
    $result = array(
      $path,
    );
  }
  elseif ($form_id == "path_admin_form") {
    $result = array(
      array(
        'source' => '',
        'alias' => '',
        'language' => 'und',
        'pid' => NULL,
      ),
    );
  }
  elseif ($form_id == "path_admin_delete_confirm") {
    $result = array(
      $data['path'],
    );
  }
  return patterns_results(PATTERNS_SUCCESS, t('Execution successful'), $result);
}