You are here

function glossary_admin_links in Glossary 7

Same name and namespace in other branches
  1. 5.2 glossary.module \glossary_admin_links()
  2. 5 glossary.module \glossary_admin_links()
  3. 6 glossary.module \glossary_admin_links()

Create Admin links for the overview.

1 call to glossary_admin_links()
glossary_overview in ./glossary.module
Produce the Glossary overview.

File

./glossary.module, line 1031
Glossary terms will be automatically marked with links to their descriptions.

Code

function glossary_admin_links($vocabulary, $destination) {
  $output = '<div class="glossary-admin-links">';
  $links = array();
  if (user_access('administer taxonomy')) {
    $links['glossary_add_term'] = array(
      'title' => t('Add term'),
      'href' => 'admin/structure/taxonomy/' . $vocabulary->machine_name . '/add/term',
    );
    $links['glossary_edit'] = array(
      'title' => t('Edit @name', array(
        '@name' => $vocabulary->name,
      )),
      // Is this secure?.
      'href' => "admin/structure/taxonomy/{$vocabulary->machine_name}/edit",
      'query' => $destination,
    );
  }
  if (user_access('administer filters')) {
    $links['glossary_admin'] = array(
      'title' => t('Glossary settings'),
      'href' => 'admin/config/content/glossary',
      'query' => $destination,
    );
  }
  if (!empty($links)) {
    $output .= theme('links', array(
      'links' => $links,
      'attributes' => array(
        'class' => array(
          'links',
          'inline',
        ),
      ),
    ));
  }
  return $output . '</div>';
}