You are here

function quotes_preprocess_node in Quotes 7

Same name and namespace in other branches
  1. 6 quotes.module \quotes_preprocess_node()

Implements hook_preprocess_node().

File

./quotes.module, line 1039
The quotes module allows users to maintain a list of quotes that can be displayed in any number of administrator-defined quote blocks.

Code

function quotes_preprocess_node($variables) {
  $node = $variables['node'];

  // We only do this for our content and only on the links page.
  if ($variables['type'] == 'quotes') {

    // Are we processing the view in a block?
    if (isset($node->in_block) && $node->in_block) {
      unset($variables['submitted']);

      // Do we want the citation?
      if ($node->show_citation == 0 && isset($node->quotes_citation)) {
        $node->quotes_citation == NULL;
      }

      // Do we want titles?
      switch ($node->show_titles) {
        case 1:

          // Link to node.
          $variables['node_url'] = '/node/' . $variables['nid'];
          break;
        case 2:

          // Plain text.
          unset($variables['node_url']);
          $variables['title'] = check_plain($node->title);
          break;
      }
    }
  }
}