You are here

function _auto_nodetitle_patternprocessor in Automatic Nodetitles 6

Same name and namespace in other branches
  1. 8 auto_nodetitle.module \_auto_nodetitle_patternprocessor()
  2. 5 auto_nodetitle.module \_auto_nodetitle_patternprocessor()
  3. 7 auto_nodetitle.module \_auto_nodetitle_patternprocessor()

Helper function to generate the title according to the PHP code. Right now its only a wrapper, but if this is to be expanded, here is the place to be.

Return value

a title string

1 call to _auto_nodetitle_patternprocessor()
auto_nodetitle_set_title in ./auto_nodetitle.module
Sets the automatically generated nodetitle for the node

File

./auto_nodetitle.module, line 133
Allows hiding of the node title field and automatic title creation

Code

function _auto_nodetitle_patternprocessor($output, $node) {
  if (module_exists('token')) {
    $output = token_replace($output, 'node', $node, '[', ']', array(), TRUE);
  }
  if (variable_get('ant_php_' . $node->type, 0)) {
    $output = auto_nodetitle_eval($output, $node);
  }
  if (variable_get('ant_php_' . $node->type, 0) || module_exists('token')) {
    $output = preg_replace('/[\\t\\n\\r\\0\\x0B]/', '', strip_tags($output));
  }
  return $output;
}