$box['bottom_bar'] += Skin::navigate($home, $prefix, $count, $items_per_page, $zoom_index); } // bottom menu if ($box['bottom_bar']) { $box['text'] .= Skin::build_list($box['bottom_bar'], 'menu_bar'); } // there is some box content if ($box['text']) { $text .= $box['text']; } } } // associates may list special sections as well if (!$zoom_type && Surfer::is_empowered()) { // inactive sections, if any $items = Sections::list_inactive_by_title_for_anchor('section:' . $item['id'], 0, 50, 'compact'); // we have an array to format if (count($items)) { $items =& Skin::build_list($items, 'compact'); } // displayed as another box if ($items) { $context['page_menu'] += array('_other_sections' => Skin::build_sliding_box(i18n::s('Other sections'), $items, NULL, TRUE, TRUE)); } } // trailer information // // add trailer information from the overlay, if any if (is_object($overlay)) { $text .= $overlay->get_text('trailer', $item); }
$menu = array_merge($menu, Skin::navigate($home, $prefix, $count, $items_per_page, $page)); // add a menu at the bottom $text .= Skin::build_list($menu, 'menu_bar'); } // make a box if ($items) { $text .= Skin::build_box('', $items, 'header1', 'sections'); } // associates may list specific sections as well if ($page == 1 && Surfer::is_associate()) { // load the layout to use $layout = Layouts::new_('yahoo', 'section'); $layout->set_variant(20); // show more elements at the site map // query the database and layout that stuff if ($items = Sections::list_inactive_by_title_for_anchor(NULL, 0, 50, $layout)) { // we have an array to format if (is_array($items)) { $items = Skin::build_list($items, '2-columns'); } // displayed as another page section $text .= Skin::build_box(i18n::s('Other sections'), $items, 'header1', 'other_sections'); } } // cache this to speed subsequent queries Cache::put($cache_id, $text, 'sections'); } $context['text'] .= $text; } // the suffix hook for the site map page if (is_callable(array('Hooks', 'include_scripts'))) {
/** * get options recursively * * This function is called internally by Sections::get_options(), above. * * @param string the current anchor to an existing section (e.g., 'section:12') * @param string spaces to prepend before section name -- to reflect depth * @param string the reference of the default section * @param array list of sections made of $id => $attributes * @return the HTML to insert in the page * */ public static function get_options_for_anchor($anchor, $spaces, $default, $to_avoid) { global $context; // add to text $text = ''; // list sections at this level if ($sections = Sections::list_by_title_for_anchor($anchor, 0, 1000, 'raw')) { foreach ($sections as $id => $attributes) { if (Sections::match($id, $to_avoid)) { continue; } // this section $reference = 'section:' . $id; $text .= '<option value="' . $reference . '"'; // the section is locked if (isset($attributes['locked']) && $attributes['locked'] == 'Y' && !Surfer::is_associate()) { $text .= ' style="font-style: italic;" disabled="disabled"'; } // currently selected if ($default && $default == $reference) { $text .= ' selected="selected"'; } $text .= '>' . $spaces . Skin::strip($attributes['title']) . "</option>\n"; // depending sections, if any if ($to_avoid == 'no_subsections') { } elseif ($depending = Sections::get_options_for_anchor($reference, $spaces . ' ', $default, $to_avoid)) { $text .= $depending; } } } // associates can also access inactive sections at this level if ($anchor && Surfer::is_associate()) { if ($sections = Sections::list_inactive_by_title_for_anchor($anchor, 0, 100, 'raw')) { foreach ($sections as $id => $attributes) { if (Sections::match($id, $to_avoid)) { continue; } // this section $reference = 'section:' . $id; $text .= '<option value="' . $reference . '"'; if ($default && $default == $reference) { $text .= ' selected="selected"'; } $text .= '>' . $spaces . Skin::strip($attributes['title']) . "</option>\n"; // depending sections, if any if ($depending = Sections::get_options_for_anchor($reference, $spaces . ' ', $default, $to_avoid)) { $text .= $depending; } } } } // end of job return $text; }