Example #1
0
 } elseif (Module::getModuleByName('places_assistant')) {
     // Places Assistant is a custom/add-on module that was once part of the core code.
     \PlacesAssistantModule::display_map($level, $parent);
 }
 // -- echo the array
 foreach ($child_places as $n => $child_place) {
     if ($n == 0) {
         echo '<table id="place_hierarchy" class="list_table"><tr><td class="list_label" ';
         if ($numfound > 20) {
             echo 'colspan="3"';
         } elseif ($numfound > 4) {
             echo 'colspan="2"';
         }
         echo '><i class="icon-place"></i> ';
         if ($place_id) {
             echo I18N::translate('Places in %s', $place->getPlaceName());
         } else {
             echo I18N::translate('Place hierarchy');
         }
         echo '</td></tr><tr><td class="list_value"><ul>';
     }
     echo '<li><a href="', $child_place->getURL(), '" class="list_item">', $child_place->getPlaceName(), '</a></li>';
     if ($gm_module && $gm_module->getSetting('GM_PLACE_HIERARCHY')) {
         list($tmp) = explode(', ', $child_place->getGedcomName(), 2);
         $place_names[$n] = $tmp;
     }
     $n++;
     if ($numfound > 20) {
         if ($n == (int) ($numfound / 3)) {
             echo '</ul></td><td class="list_value"><ul>';
         }
Example #2
0
     // Places Assistant is a custom/add-on module that was once part of the core code.
     \PlacesAssistantModule::display_map($level, $parent);
 }
 if ($numfound > 0) {
     if ($numfound > 20) {
         $divisor = 3;
     } elseif ($numfound > 4) {
         $divisor = 2;
     } else {
         $divisor = 1;
     }
     $columns = array_chunk($child_places, ceil($numfound / $divisor));
     $html = '<table id="place_hierarchy" class="list_table"><thead><tr><th class="list_label" colspan="' . $divisor . '">';
     $html .= '<i class="icon-place"></i> ';
     if ($place_id) {
         $html .= I18N::translate('Places in %s', $place->getPlaceName());
     } else {
         $html .= I18N::translate('Place hierarchy');
     }
     $html .= '</th></tr></thead>';
     $html .= '<tbody><tr>';
     foreach ($columns as $column) {
         $html .= '<td class="list_value"><ul>';
         foreach ($column as $item) {
             $html .= '<li><a href="' . $item->getURL() . '" class="list_item">' . $item->getPlaceName() . '</a></li>';
             if ($gm_module && $gm_module->getSetting('GM_PLACE_HIERARCHY')) {
                 list($tmp) = explode(', ', $item->getGedcomName(), 2);
                 $place_names[] = $tmp;
             }
         }
         $html .= '</ul></td>';