function theme_biblio_admin_author_types_form in Bibliography Module 7.2
Same name and namespace in other branches
- 6.2 includes/biblio.admin.inc \theme_biblio_admin_author_types_form()
- 6 biblio.admin.inc \theme_biblio_admin_author_types_form()
- 7 includes/biblio.admin.inc \theme_biblio_admin_author_types_form()
File
- includes/
biblio.admin.inc, line 1767
Code
function theme_biblio_admin_author_types_form($variables) {
$form = $variables['form'];
// We need this complex query to realize author_types which are not in use (cid is NULL)
$query = db_select('biblio_contributor_type_data', 'ctd');
$query
->fields('ctd', array(
'auth_type',
'title',
'hint',
))
->leftJoin('biblio_contributor', 'bc', 'ctd.auth_type = bc.auth_type');
$db_result = $query
->groupBy('ctd.auth_type')
->groupBy('ctd.title')
->groupBy('ctd.hint')
->orderBy('ctd.auth_type')
->execute();
foreach ($db_result as $row) {
$ops = l(t('edit'), 'admin/config/content/biblio/author/type/' . $row->auth_type . '/edit');
if (!isset($row->cid) && $row->auth_type >= 10) {
// allow delete only if type not in use
$ops .= ' ';
$ops .= l(t('delete'), 'admin/config/content/biblio/author/type/' . $row->auth_type . '/delete/');
}
$rows[] = array(
$row->auth_type,
check_plain($row->title),
check_plain($row->hint),
$ops,
);
}
$header = array(
t('Type Id'),
t('Contributor Type'),
t('Description'),
array(
'data' => t('Operations'),
'colspan' => '2',
),
);
$output = '<p>[ ' . l(t('Add New Type'), 'admin/config/content/biblio/author/type/new') . ' ]';
$output .= theme('table', array(
'header' => $header,
'rows' => $rows,
));
$output .= '<p>[ ' . l(t('Add New Type'), 'admin/config/content/biblio/author/type/new') . ' ]';
// $output .= ' [ ' . l(t('Reset all types to defaults'), 'admin/config/content/biblio/authors/reset') . ' ]';
return $output;
}