You are here

function _freelinking_nodetitle_failure in Freelinking 6.3

Same name and namespace in other branches
  1. 7.3 plugins/freelinking_nodetitle.inc \_freelinking_nodetitle_failure()

Determining the proper failure response per plugin configuration

1 call to _freelinking_nodetitle_failure()
freelinking_nodetitle_callback in plugins/freelinking_nodetitle.inc
Replacement callback for nodetitle plugin

File

plugins/freelinking_nodetitle.inc, line 147

Code

function _freelinking_nodetitle_failure($target) {
  $failover = variable_get('freelinking_nodetitle_failover', _freelinking_nodetitle_default_failover());
  switch ($failover) {
    case 'create':
      return array(
        'failover' => 'createnode',
        'target' => $target,
      );
    case 'showtext':
      return array(
        'failover' => 'showtext',
        'target' => $target,
      );
    case 'search':
      return array(
        'failover' => 'search',
        'target' => $target,
      );
    case 'error':
      return array(
        'failover' => 'error',
        'message' => t('%title not found', array(
          '%title' => $target['dest'],
        )),
      );
  }

  // do nothing
  return FALSE;
}