You are here

function pathauto_patterns_export_all_url_alias in Patterns 7

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

File

patterns_components/components/pathauto.inc, line 37

Code

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

  //$info = pathauto_patterns();

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

  //$loop = TRUE;
  $paths = db_query("SELECT * FROM {url_alias}", array(), array(
    'fetch' => PDO::FETCH_ASSOC,
  ))
    ->fetchAll();
  $result = array();
  foreach ($paths as $path) {
    $path = (array) $path;
    $data = array(
      'tag' => 'path',
    );
    $data = array_merge($data, $path);
    $action = array(
      PATTERNS_CREATE => $data,
    );
    array_push($result, $action);

    //  $action = array(PATTERNS_PATTERNS_CREATE => $data);
    // array_push($result, $action);
    // It is important to user array merge. Pushing is not enough

    //$result = array_merge($result, patterns_export_actions_from_form($form_id, $path, 'url_alias', PATTERNS_MODIFY));
  }
  return $result;
}