You are here

function custom_breadcrumbs_simple_breadcrumb_table in Custom Breadcrumbs 6.2

Same name and namespace in other branches
  1. 7.2 custom_breadcrumbs.admin.inc \custom_breadcrumbs_simple_breadcrumb_table()

Provides a simple breadcrumb table for the node edit form.

Parameters

$breadcrumbs: An array of breadcrumbs that apply to the node.

Return value

A themed table of custom breadcrumbs.

3 calls to custom_breadcrumbs_simple_breadcrumb_table()
custom_breadcrumbs_form_alter in ./custom_breadcrumbs.module
Implements hook_form_alter().
custom_breadcrumbs_taxonomy_form_taxonomy_form_term_alter in custom_breadcrumbs_taxonomy/custom_breadcrumbs_taxonomy.module
Implements hook_form_FORM_ID_alter().
custom_breadcrumbs_taxonomy_form_taxonomy_form_vocabulary_alter in custom_breadcrumbs_taxonomy/custom_breadcrumbs_taxonomy.module
Implements hook_form_alter().

File

./custom_breadcrumbs.admin.inc, line 851
Admin page callback file for the custom_breadcrumbs module.

Code

function custom_breadcrumbs_simple_breadcrumb_table($breadcrumbs) {
  $header = array(
    t('Name'),
    t('Type'),
    t('Titles'),
    t('Paths'),
  );
  $multilingual = _custom_breadcrumbs_multilingual();
  if ($multilingual) {
    $header[] = t('Language');
  }
  $header[] = t('Operations');
  $rows = array();
  foreach ($breadcrumbs as $breadcrumb) {
    $row = array();
    $row[] = array(
      'data' => $breadcrumb->name . (!empty($breadcrumb->visibility_php) ? ' ' . t('with PHP snippet') : ''),
    );
    $row[] = array(
      'data' => $breadcrumb->breadcrumb_type,
    );
    $row[] = array(
      'data' => check_plain($breadcrumb->titles),
    );
    $row[] = array(
      'data' => check_plain($breadcrumb->paths),
    );
    if ($multilingual) {
      $row[] = array(
        'data' => module_invoke('locale', 'language_name', $breadcrumb->language),
      );
    }
    $row[] = l(t('edit'), 'admin/build/custom_breadcrumbs/' . $breadcrumb->breadcrumb_type . '/edit/' . $breadcrumb->bid);
    $rows[] = $row;
  }
  if (count($rows) == 0) {
    $rows[] = array(
      array(
        'data' => t('You can define custom breadcrumbs at <a href ="@link">Custom Breadcrumbs Administration Page</a>.', array(
          '@link' => url('admin/build/custom_breadcrumbs'),
        )),
        'colspan' => 5 + (int) $multilingual,
      ),
    );
  }
  return theme('table', $header, $rows);
}