You are here

function _lexicon_admin_links in Lexicon 7

Lexicon admin links function. Returns an array of admin links if the user has the appropriate permissions.

1 call to _lexicon_admin_links()
_lexicon_overview in includes/lexicon.pages.inc
Lexicon overview function that creates all the data end renders the output through the various theme templates.

File

includes/lexicon.pages.inc, line 297
Page callbacks for the Lexicon module

Code

function _lexicon_admin_links($vocabulary, $destination) {
  $links = array();
  if (user_access('administer taxonomy')) {
    $links['lexicon_add_term'] = array(
      'title' => t('Add term'),
      'href' => 'admin/structure/taxonomy/' . $vocabulary->machine_name . '/add/term',
    );
    $links['lexicon_edit'] = array(
      'title' => t('Edit @name', array(
        '@name' => drupal_strtolower(check_plain($vocabulary->name)),
      )),
      'href' => 'admin/structure/taxonomy/' . $vocabulary->machine_name . '/edit',
      'query' => $destination,
    );
  }
  if (user_access('administer filters')) {
    $links['lexicon_admin'] = array(
      'title' => t('Lexicon settings'),
      'href' => 'admin/config/system/lexicon',
      'query' => $destination,
    );
  }
  return $links;
}