You are here

function og_vocab_pathauto_taxonomy in OG Vocabulary 5

File

./og_vocab.module, line 333
Give each group its own system controlled vocabularies

Code

function og_vocab_pathauto_taxonomy($op, $category = NULL) {
  switch ($op) {
    case 'placeholders':
      $placeholders = array();
      $placeholders[t('[ogname]')] = t('The name of the organic group this category belongs to.');
      return $placeholders;
    case 'values':
      $results = array();
      $results[t('[ogname]')] = '';
      $where = ' ov.vid = %d';
      $sql = "SELECT n.title FROM {node} n INNER JOIN {og_vocab} ov ON ov.nid = n.nid WHERE {$where}";
      $result = db_query($sql, $category->vid);
      while ($row = db_fetch_object($result)) {
        $name = $row->title;
        $results[t('[ogname]')] = pathauto_cleanstring($name);
      }
      return $results;
    default:
      break;
  }
}