You are here

function pathauto_patterns_export_all_pathauto_setting in Patterns 7.2

1 string reference to 'pathauto_patterns_export_all_pathauto_setting'
pathauto_patterns in patterns_components/components/pathauto.inc

File

patterns_components/components/pathauto.inc, line 44

Code

function pathauto_patterns_export_all_pathauto_setting($args = NULL, &$result = NULL) {

  //$info = pathauto_patterns();

  //$form_id = current($info['url_alias'][PATTERNS_MODIFY]);
  module_load_include('inc', 'pathauto');
  $result = array();
  $data = array(
    'tag' => 'pathauto_setting',
  );
  $data['pathauto_verbose'] = variable_get('pathauto_verbose', FALSE);
  $data['pathauto_separator'] = variable_get('pathauto_separator', '-');
  $data['pathauto_case'] = variable_get('pathauto_case', PATHAUTO_CASE_LOWER);
  $data['pathauto_max_length'] = variable_get('pathauto_max_length', 100);
  $data['pathauto_max_component_length'] = variable_get('pathauto_max_component_length', 100);
  $data['pathauto_update_action'] = variable_get('pathauto_update_action', PATHAUTO_UPDATE_ACTION_DELETE);
  $data['pathauto_transliterate'] = variable_get('pathauto_transliterate', FALSE) && module_exists('transliteration');
  $data['pathauto_reduce_ascii'] = variable_get('pathauto_reduce_ascii', FALSE);
  $data['pathauto_ignore_words'] = variable_get('pathauto_ignore_words', PATHAUTO_IGNORE_WORDS);
  $punctuation = pathauto_punctuation_chars();
  foreach ($punctuation as $name => $details) {
    $details['default'] = PATHAUTO_PUNCTUATION_REMOVE;
    if ($details['value'] == variable_get('pathauto_separator', '-')) {
      $details['default'] = PATHAUTO_PUNCTUATION_REPLACE;
    }
    $data['pathauto_punctuation_' . $name] = variable_get('pathauto_punctuation_' . $name, $details['default']);
  }
  $action = array(
    PATTERNS_MODIFY => $data,
  );
  array_push($result, $action);
  return $result;
}