You are here

function _biblio_author_edit_links in Bibliography Module 7

Same name and namespace in other branches
  1. 6.2 includes/biblio.pages.inc \_biblio_author_edit_links()
  2. 6 biblio.pages.inc \_biblio_author_edit_links()
  3. 7.2 includes/biblio.pages.inc \_biblio_author_edit_links()

Return an HTML link to an author edit page.

If current_path() is within the admin section of biblio, the link will be to the admin version of the edit page.

Parameters

object $author: The author object.

Return value

string The HTML link.

3 calls to _biblio_author_edit_links()
BiblioContributorWebTestCase::testFormatting in tests/BiblioContributorWebTestCase.test
Test formatting functions.
_biblio_filter_info_line in includes/biblio.pages.inc
_biblio_format_author in includes/biblio.pages.inc
Helper function to format the authors and add edit links if required.

File

includes/biblio.pages.inc, line 1400
Copyright (C) 2006-2011 Ron Jerome.

Code

function _biblio_author_edit_links($author) {

  // Cache $path.
  static $path = NULL;
  if (empty($path)) {

    // When the page is an admin page, use the admin author edit page. Usually:
    // admin/config/content/biblio/author
    // admin/config/content/biblio/author/list.
    $search_path = 'admin/config/content/biblio/';
    if (substr(current_path(), 0, 28) === $search_path) {
      $path = 'admin/config/content/biblio/author/';
    }
    else {
      $path = variable_get('biblio_base', 'biblio') . '/authors/';
    }
  }
  return l(' [' . t('edit') . ']', $path . $author->cid . "/edit");
}