Opens all subpages in a new window without template and navigation (Like the printfunction)
cms.php //---Mod PrintPageSubMenu---------------------- function InPageA($i, $x) { global $sn, $u; return '<a href="'.$sn.'?'.$u[$i].$x.'&print" target="_">'; } function submenu_target() { global $s, $cl, $l, $tx, $cf; $ta = array(); if ($s > -1) { $tl = $l[$s]+1+$cf['menu']['levelcatch']; for($i = $s+1; $i < $cl; $i++) { if ($l[$i] <= $l[$s])break; if ($l[$i] <= $tl)if(!hide($i))$ta[] = $i; if ($l[$i] < $tl)$tl = $l[$i]; } if (count($ta) != 0) return InPageLi($ta, 'submenutarget'); } } function InPageLi($ta, $st) { global $s, $l, $h, $cl, $cf, $u; $tl = count($ta); if ($tl < 1)return; $t = ''; if ($st == 'submenutarget' )$t .= '<ul >'; $b = 0; if ($st > 0) { $b = $st-1; $st = 'menulevel'; } $lf = array(); for($i = 0; $i < $tl; $i++) { $tf = ($s != $ta[$i]); if ($st == 'menulevel' || $st == 'sitemaplevel') { for($k = (isset($ta[$i-1])?$l[$ta[$i-1]]:$b); $k < $l[$ta[$i]]; $k++)$t .= '<ul class="'.$st.($k+1).'">'; } $t .= '<li class="'; if (!$tf)$t .= ''; else if(@$cf['menu']['sdoc'] == "parent" && $s > -1) { if ($l[$ta[$i]] < $l[$s]) { if (substr($u[$s], 0, strlen($u[$ta[$i]])) == $u[$ta[$i]])$t .= ''; } } $t .= 'submenutargetdoc'; for($j = $ta[$i]+1; $j < $cl; $j++)if(!hide($j) && $l[$j]-$l[$ta[$i]] < 2+$cf['menu']['levelcatch']) { if ($l[$j] > $l[$ta[$i]])$t .= ''; break; } $t .= '">'; if ($tf)$t .= InPageA($ta[$i], ''); $t .= $h[$ta[$i]]; if ($tf)$t .= '</a>'; if ($st == 'menulevel' || $st == 'sitemaplevel') { if ((isset($ta[$i+1])?$l[$ta[$i+1]]:$b) > $l[$ta[$i]])$lf[$l[$ta[$i]]] = true; else { $t .= '</li>'; $lf[$l[$ta[$i]]] = false; } for($k = $l[$ta[$i]]; $k > (isset($ta[$i+1])?$l[$ta[$i+1]]:$b); $k--) { $t .= '</ul>'; if (isset($lf[$k-1]))if($lf[$k-1]) { $t .= '</li>'; $lf[$k-1] = false; } }; } else $t .= '</li>'; } if ($st == 'submenu' || $st == 'search')$t .= '</ul>'; return $t; } //------------------------ Add to content: #CMSimple $output=preg_replace('/'.chr(35).'CMSimple.*'.chr(35).'/',submenu_target(),$c[$s]);# CSS Class:"submenutargetdoc"
back to addons
Discussion
No need to write. When will the site navigation CMSimple all CMS use paginator, just CMSimple runs on the submenu. Here it is necessary to change the look.
Replace <li> at the numbers and add <previouspage> «< 1 2 3 »> <nextpage>
function submenu() {
global $s, $cl, $l, $tx, $cf; $ta = array(); if ($s > -1) { $tl = $l[$s]+1+$cf['menu']['levelcatch']; for($i = $s+1; $i < $cl; $i++) { if ($l[$i] <= $l[$s])break; if ($l[$i] <= $tl)if(!hide($i))$ta[] = $i; if ($l[$i] < $tl)$tl = $l[$i]; } if (count($ta) != 0)return '<h5>'.$tx['submenu']['heading'].'</h5>'.li($ta, 'submenu'); }} Function <?php echo previouspage();?><?php echo nextpage();?> is not needed