/** * Display navigation * * @param array $navipages array($home, $up, $prev, $current, $next) * @param string $look Show DocBook 'footer' style or DocBook 'header' * * DocBook header * <pre> * Prev Home Next * </pre> * DocBook footer * <pre> * Prev Home Next * <pagename> Up <pagename> * </pre> * * @param string $border 'off' or 'top' or 'bottom'. * - 'off' shows no border. * - 'top' shows a border top. * - 'bottom' shows a border bottom. * @param bool $printcss print css with html as style="" attributes. * @return string html */ function display_navi($navipages, $look = 'header', $border = 'off', $printcss = false) { $linkstr = $this->linkstr; $css = $this->css; $footer = $look == 'footer'; list($home, $up, $prev, $current, $next) = $navipages; // get link $link = array(); $link['prev'] = make_pagelink($prev, $linkstr['prev']); $link['home'] = $home == '' ? sonots::make_toplink($linkstr['home']) : make_pagelink($home, $linkstr['home']); if ($next) { $link['next'] = make_pagelink($next, $linkstr['next']); } if ($footer) { $link['up'] = make_pagelink($up, $linkstr['up']); $link['prevfoot'] = strip_tags(make_link(PluginSonotsMetapage::linkstr($prev, $footer, $current, true))); if ($next) { $link['nextfoot'] = strip_tags(make_link(PluginSonotsMetapage::linkstr($next, $footer, $current, true))); } } // html $html = '<div class="wrap_navix" style="margin:0px;padding:0px;">' . "\n"; if ($border === 'top') { $html .= '<hr class="full_hr top"' . ($printcss ? ' style="' . $css['div.wrap_navix hr.top'] . '"' : '') . '/>' . "\n"; } $html .= '<ul class="navix"' . ($printcss ? ' style="' . $css['ul.navix'] . '"' : '') . '>' . "\n"; $html .= '<li class="left"' . ($printcss ? ' style="' . $css['ul.navix li.left'] . '"' : '') . '>' . $link['prev'] . ($footer ? '<br />' . $link['prevfoot'] : '') . '</li>' . "\n"; $html .= '<li class="center"' . ($printcss ? ' style="' . $css['ul.navix li.center'] . '"' : '') . '>' . $link['home'] . ($footer ? '<br />' . $link['up'] : '') . '</li>' . "\n"; $html .= '<li class="right"' . ($printcss ? ' style="' . $css['ul.navix li.right'] . '"' : '') . '>' . ($next ? $link['next'] . ($footer ? '<br />' . $link['nextfoot'] : '') : ' ') . '</li>' . "\n"; $html .= '</ul>' . "\n"; if ($border === 'bottom') { $html .= '<hr class="full_hr bottom"' . ($printcss ? ' style="' . $css['div.wrap_navix hr.bottom'] . '"' : '') . '/>' . "\n"; } $html .= '</div>' . "\n"; return $html; }