You are here

function quotes_get_citations in Quotes 7

Same name and namespace in other branches
  1. 5 quotes.module \quotes_get_citations()
  2. 6 quotes.module \quotes_get_citations()

Produce an array of all citations.

$return An associative array of citations in the quotes table.

File

./quotes.module, line 2365
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_get_citations() {
  $list = array(
    ' ' => t('unspecified'),
  );
  $sql = db_select('quotes', 'q');
  $q_cite = $sql
    ->addField('q', 'citation');
  $sql
    ->orderBy('citation')
    ->distinct();
  $result = $sql
    ->execute()
    ->fetchAll();
  foreach ($result as $key => $row) {
    $list[$row->citation] = $row->citation;
  }
  return $list;
}