You are here

function pathauto_get_placeholders in Pathauto 5.2

Same name and namespace in other branches
  1. 6.2 pathauto.inc \pathauto_get_placeholders()
  2. 6 pathauto.inc \pathauto_get_placeholders()

Generalized function to get tokens across all Pathauto types.

Parameters

$object: A user, node, or category object.

Return value

Tokens for that object formatted in the way that Pathauto expects to see them.

8 calls to pathauto_get_placeholders()
blog_pathauto_bulkupdate in ./pathauto_user.inc
Bulk generate aliases for all blogs without aliases.
node_pathauto_bulkupdate in ./pathauto_node.inc
Generate aliases for all nodes without aliases.
pathauto_nodeapi in ./pathauto.module
Implementation of hook_nodeapi().
pathauto_node_operations_update in ./pathauto.module
Callback function for updating node aliases.
pathauto_user in ./pathauto.module
Implementation of hook_user() for users, trackers, and blogs.

... See full list

File

./pathauto.inc, line 421
Miscellaneous functions for Pathauto.

Code

function pathauto_get_placeholders($type, $object) {
  if (function_exists('token_get_values')) {
    $full = token_get_values($type, $object, TRUE);
    $tokens = token_prepare_tokens($full->tokens);
    $values = pathauto_clean_token_values($full);
    return array(
      'tokens' => $tokens,
      'values' => $values,
    );
  }

  // TODO at some point try removing this and see if install profiles have problems again.
  watchdog('Pathauto', t('It appears that you have installed Pathauto, which depends on token, but token is either not installed or not installed properly.'));
  return array(
    'tokens' => array(),
    'values' => array(),
  );
}