You are here

private function crumbs_Admin_DebugTable::addCandidateCells in Crumbs, the Breadcrumbs suite 7.2

Parameters

string[][][] $candidates_all: Format: $['parent'|'title'][][$candidateKey] = $candidate

crumbs_Container_WeightMap $weightMap:

1 call to crumbs_Admin_DebugTable::addCandidateCells()
crumbs_Admin_DebugTable::addPluginResults in lib/Admin/DebugTable.php

File

lib/Admin/DebugTable.php, line 212

Class

crumbs_Admin_DebugTable

Code

private function addCandidateCells(array $candidates_all, $weightMap) {
  foreach ($candidates_all as $type => $candidates_type) {
    foreach ($candidates_type as $i => $candidates) {
      $path = $this->paths[$i];
      $item = $this->trail[$path];
      $bestCandidateKey = $weightMap
        ->findBestCandidateKey($candidates);
      foreach ($candidates as $candidateKey => $candidate) {
        $this
          ->addCandidateCell($candidate, $type, $i, $candidateKey, $bestCandidateKey);
      }
      if ($type === 'parent') {
        $defaultCandidate = isset($paths[$i + 1]) ? $paths[$i + 1] : NULL;
      }
      else {
        $defaultCandidate = isset($item['title']) ? $item['title'] : NULL;
      }
      $this
        ->addCandidateCell($defaultCandidate, $type, $i, NULL, $bestCandidateKey);
    }
  }
}