Exemple #1
0
 /** Print component heading, etc. Then call getHtmlList() to print list */
 function printTree(&$joomap, &$root)
 {
     global $database, $Itemid;
     $config =& $joomap->config;
     $menu = new mosMenu($database);
     $menu->load($Itemid);
     // Load params for the Joomap menu-item
     $title = $menu->name;
     $exlink[0] = $config->exlinks;
     // image to mark popup links
     $exlink[1] = $config->ext_image;
     if ($config->columns > 1) {
         // calculate column widths
         $total = count($root);
         $columns = $total < $config->columns ? $total : $config->columns;
         $width = 100 / $columns - 1;
     }
     echo '<div class="' . $config->classname . '">';
     echo '<h2 class="componentheading">' . $title . '</h2>';
     echo '<div class="contentpaneopen"' . ($config->columns > 1 ? ' style="float:left;width:100%;"' : '') . '>';
     if ($config->show_menutitle || $config->columns > 1) {
         // each menu gets a separate list
         foreach ($root as $menu) {
             if ($config->columns > 1) {
                 // use columns
                 echo '<div style="float:left;width:' . $width . '%;">';
             }
             if ($config->show_menutitle) {
                 // show menu titles
                 echo '<h2 class="menutitle">' . $menu->name . '</h2>';
             }
             echo JoomapHtml::getHtmlList($menu->tree, $exlink);
             if ($config->columns > 1) {
                 echo "</div>\n";
             }
         }
         if ($config->columns > 1) {
             echo '<div style="clear:left"></div>';
         }
     } else {
         // don't show menu titles, all items in one big tree
         $tmp = array();
         foreach ($root as $menu) {
             // concatenate all menu-trees
             foreach ($menu->tree as $node) {
                 $tmp[] = $node;
             }
         }
         echo JoomapHtml::getHtmlList($tmp, $exlink);
     }
     //BEGIN: Advertisement
     if ($config->includelink) {
         $keywords = array('Webdesign', 'Software Anpassung', 'Software Entwicklung', 'Programmierung');
         $location = array('Iserlohn', 'Hagen', 'Dortmund', 'Ruhrgebiet', 'NRW');
         $advert = $keywords[mt_rand() % count($keywords)] . ' ' . $location[mt_rand() % count($location)];
         echo "<a href=\"http://www.ko-ca.com\" style=\"font-size:1px;display:none;\">{$advert}</a>";
     }
     //END: Advertisement
     echo "</div>";
     echo "</div>\n";
 }