You are here

function lexicon_page in Lexicon 6

1 string reference to 'lexicon_page'
lexicon_menu in ./lexicon.module
Implementation of hook_menu().

File

./lexicon.module, line 751
Lexicon is used to create lists of terms and definitions to use on a website and optionally mark them in the content with an indicator.

Code

function lexicon_page($letter = NULL) {
  $found_vid = NULL;
  $curr_path = $_GET['q'];
  if ($letter != NULL) {
    $letter = drupal_substr($letter, 7, 1);
  }
  $vids = variable_get('lexicon_vids', array());
  foreach ($vids as $vid) {
    $tmp_path = variable_get('lexicon_path_' . $vid, 'lexicon/' . $vid);
    if (strpos($curr_path, $tmp_path) !== FALSE) {
      $found_vid = $vid;
    }
  }
  if ($found_vid == NULL) {
    return _lexicon_list();
  }
  else {
    $voc = taxonomy_vocabulary_load($found_vid);

    //Set the active menu to be "primary-links" to make the breadcrumb work.

    //By default the active menu would be "navigation", causing only "Home" > node.title to be shown.
    menu_set_active_menu_name("primary-links");
    return lexicon_overview($voc, $letter);
  }
}