You are here

function _crumbs_admin_debug_matrix in Crumbs, the Breadcrumbs suite 7.2

Helper function for crumbs_admin_debug_page().

Parameters

string $path_to_test: Test path to build a Crumbs breadcrumb.

Return value

string The debug matrix as rendered html.

1 call to _crumbs_admin_debug_matrix()
crumbs_debug_page in admin/crumbs.debug.inc
Page callback for 'admin/structure/crumbs/debug'.

File

admin/crumbs.debug.inc, line 103

Code

function _crumbs_admin_debug_matrix($path_to_test) {

  // Create a local version of the service container.
  $services = new crumbs_DIC_ServiceContainer();
  $page_info = $services->page;
  $page_info->path = $path_to_test;

  // Change the settings so that all breadcrumb items are visible.
  $page_info->minTrailItems = 1;
  $page_info->showFrontPage = TRUE;
  $page_info->showCurrentPage = TRUE;
  $unfilteredPluginBag = new crumbs_PluginSystem_PluginBag($services->pluginInfo->plugins, $services->pluginInfo->routelessPluginMethodsUnsorted, $services->pluginInfo->routePluginMethodsUnsorted);
  $unfilteredPluginEngine = new crumbs_PluginSystem_PluginEngine($unfilteredPluginBag, $services->router, $services->pluginInfo->weightMap);
  $table = new crumbs_Admin_DebugTable();
  $table
    ->setTrail($page_info->trail, $page_info->rawBreadcrumbItems);
  $table
    ->addPluginResults($unfilteredPluginEngine, $services->pluginInfo->weightMap);
  $html = $table
    ->render();
  return '<div style="overflow-x: auto;">' . $html . '</div>';
}