You are here

function pathauto_patterns_export_all_pathauto_patterns in Patterns 7.2

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

File

patterns_components/components/pathauto.inc, line 111

Code

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

  //$info = pathauto_patterns();

  //$form_id = current($info['url_alias'][PATTERNS_MODIFY]);

  //$loop = TRUE;
  $result = array();
  $data = array(
    'tag' => 'pathauto_patterns',
  );
  $all_settings = module_invoke_all('pathauto', 'settings');
  foreach ($all_settings as $settings) {
    $module = $settings->module;
    $patterndescr = $settings->patterndescr;
    $patterndefault = $settings->patterndefault;
    $groupheader = $settings->groupheader;
    $variable = 'pathauto_' . $module . '_pattern';
    $data[$variable] = variable_get($variable, $patterndefault);

    // If the module supports a set of specialized patterns, set
    // them up here
    if (isset($settings->patternitems)) {
      foreach ($settings->patternitems as $itemname => $itemlabel) {
        $variable = 'pathauto_' . $module . '_' . $itemname . '_pattern';
        $data[$variable] = variable_get($variable, '');
      }
    }
  }
  $action = array(
    PATTERNS_MODIFY => $data,
  );
  array_push($result, $action);
  return $result;
}