{{indexmenu_n>10}}
====== NAV_HORIZ_DD:Type,ID,Depth,li-id ======
==== TAG ====
**{NAV_HORIZ_DD: Type, ID, depth, li-ID}**
##@string $parameter = "menu type, start_id, max_level_depth, id for every li"##
-> Menu starts from level 0 (Home) and is limited to two levels deep, home is well spent, jedes
NAVI HORIZONTAL DROP-DOWN
* Oliver Georgi
* http://www.phpwcms.de/forum/viewtopic.php?p=89743#89743
* 08.11.07 KH (flip-flop) Enhanced: Start[ID] {NAV_HORIZ_DD:ID}
* 28.04.08 KH (flip-flop) Enhanced: Level depth {NAV_HORIZ_DD:ID,Depth}
* http://www.phpwcms.de/forum/viewtopic.php?p=94688#94688
* 05.03.10 KH (flip-flop) Enhanced: Menu type, H&P, id for every li
* @string $parameter = "menu type, start_id, max_level_depth, id for ervery li"
* - Menu type: H=Home on|off, P=Parent on|off
* - id for ervery li: class name
* 16.12.10 KH (flip-flop) Enhanced: Every first is marked with the
* class "sub_first"
*
* TAG: {NAV_HORIZ_DD1:Menu type, Start-ID, Level depth, li id_name}
* E.g.: {NAV_HORIZ_DD1:H, 2, 3, id}
* Location: Put it into the file e.g.:
* /template/inc_script/frontend_render/rt_nav_horiz_drop_down_v11.php
* Switch in conf.inc.php: $phpwcms['allow_ext_render'] = 1;
* **************************************************************************
*/
// ----------------------------------------------------------------
// obligate check for phpwcms constants
if (!defined('PHPWCMS_ROOT')) {
die("You Cannot Access This Script Directly, Have a Nice Day."); }
// ----------------------------------------------------------------
if( ! ( strpos($content["all"],'{NAV_HORIZ_DD1')==false ) ) {
$content["all"] = str_replace('{NAV_HORIZ_DD1}','{NAV_HORIZ_DD1:,0,100}',$content["all"]); // For a simple call
$content["all"] = preg_replace('/\{NAV_HORIZ_DD1:(.*?)\}/e', 'buildNavi_horiz1("$1");', $content["all"]);
}
//function buildNavi_horiz($start=0, $counter=0, $depth=0) {
function buildNavi_horiz1($parameter='', $counter=0, $param='string') {
// ====== CUSTOM VAR ==========================================
$menu_class = ' hmenu'; // Menu class name // Menue Klassenname
$first_lev = ' first-level';
$act_path = ' act_path';
$active = ' active'; // The active link // Der aktive Link
// ====== CUSTOM VAR ENDE ======================================
// only for the first call from extern
// Nur fuer den ersten externen Aufruf
if($param == 'string') {
$parameter = explode(',', $parameter);
// first entry a digit or sign? Only for compatibility to the older nav version
// Erster Eintrag eine Zahl? Nur fuer Kompatibilität mit aeltere Navi Version
if (isset($parameter[0]) AND (preg_match('/^[0-9]+$/i',$parameter[0])) ) {
array_unshift ( $parameter, '' ); // Fill up array for $menu_type
}
$menu_type = empty($parameter[0]) ? '' : strtoupper(trim($parameter[0]));
$start_id = empty($parameter[1]) ? 0 : intval($parameter[1]);
$max_depth = empty($parameter[2]) ? 0 : intval($parameter[2]-1);
$level_id_name = empty($parameter[3]) ? '' : trim($parameter[3]);
$parent = false; // do not show parent link
$home = false; // do not show home link
switch($menu_type) {
// show parent level too - only in first line [Parent]
case 'P': $parent = true;
break;
// Home in the first line [Home] [Cat01] [Cat02] [Cat03]
case 'HP': $parent = true;
case 'H': $home = true;
if($start_id == '0' AND $parent) $home = false;
break;
}
} else { // for the inner call (recursive run)
$menu_type = $parameter[0];
$start_id = $parameter[1];
$max_depth = $parameter[2]-1;
$level_id_name = $parameter[3];
$parent = false; // do not show parent link
$home = false; // do not show home link
}
// ----- System var ----------------
$t = array();
$x = 0;
// ---------------------------------
$struct = getStructureChildData($start_id); // Catch structure
if($counter == 0) {
$last = count($start_id) - 1;
// ======== Only if you want the home link // Nur wenn Home gewuenscht
if ($home) { // Home in the first line [Home] [Cat01] [Cat02] [Cat03]
$l = ' ';
$l .= get_level_ahref($start_id, ' class="home"') . ''. html_specialchars($GLOBALS['content']['struct']['0']['acat_name']);
$l .= ' ';
$t[] = $l;
}
// ======== Only if you want the parent link // Nur wenn der Eltern-Link gewuenscht
if ($parent) { // Parent only in first line [Parent]
$struct = array(); // clear array // Array leeren
$struct[$start_id] = $GLOBALS['content']['struct'][$start_id];
}
// ========
} else {
$last = 0;
}
$first_li = ' sub_first'; // Init first flag
foreach($struct as $value) {
// ============
// dumpVar($value['acat_id']);
// Is it a active path ? ========
// Ist dies der aktive Pfad ? ========
if( isset($GLOBALS['LEVEL_KEY'][ $value['acat_id'] ]) ) {
$p1 = $act_path;
} else {
$s = ''; // Reset $struct
$p1 = '';
}
// Only if there is a sub level ========
// Nur wenn SubLevel vorhanden ist ========
if($GLOBALS['content']['cat_id'] == $value['acat_id']) {
$a1 = $act_path; // Only for a direct call // Nur bei direktem Aufruf (FirstLevel active)
$a3 = ''; // active
}
else { // If first level isn´t active // Wenn FirstLevel nicht aktiv
$a1 = $p1;
$a3 = '';
}
// ==========================
// -- -------------------------------------------------------------------
// Preset level depth added
// Ebenetiefenvorgabe hinzugefuegt
// $s = buildNavi_horiz($value['acat_id'], $counter+1);
$parameter[1] = $value['acat_id']; // start_id
// if (($counter) < $depth) {$s = buildNavi_horiz($value['acat_id'], $counter+1, $depth, 'param_is_array');
if (($counter) < $max_depth) {$s = buildNavi_horiz1($parameter, $counter+1, 'param_is_array');
}
else {$s = '';}
// -- -------------------------------------------------------------------
// Set the active link class
// Aktive Link Classe setzen
($GLOBALS['content']['cat_id'] == $value['acat_id']) ? $a3 = $active: $a3 = '';
if($s) {
$g = '';
$g .= $s;
$g .= LF . str_repeat(' ', $counter);
$class = $counter ? (' class="fly_ul '.$a1.$a3.$first_li.'"') : (' class="drop_ul '.$a1.$first_lev.$a3.$first_li.'"'); // Second level with active category
$close_li = str_repeat(' ', $counter+1);
} else {
$g = '';
$class = ' class="sub_no'.$a1.$a3.$first_li.'"'; // act_path auch im letzten activ link
// $class = ' class="sub_no'.$a3.'"';
// -- -------------------------------------------------------------------
// Only the first level if there is no sub level
// Ausschlieszlich das erste Level wenn kein Sublevel vorhanden ist
if ($counter == 0) {
$class = ' class="sub_no'.$a1.$first_lev.$first_li.'"'; // Set it, it is active or not // Es ist aktiv oder nicht
// -- -------------------------------------------------------------------
}
$close_li = '';
}
// first li in block =======
// Erstes li im letzten Block =======
if( $last && $last == $x ) {
$enclose = ' class="horiz_enclose"';
} elseif( $x || ($counter == 0 && $x == 0) ) {
$enclose = '';
} else {
$enclose = ' class="horiz_enclose"';
}
// IDs for every li ======= If you need the ID class, please uncomment/comment
// IDs fuer jedes li ======= Wenn sie die ID Klassen benoetigen, bitte dekommentieren/kommentieren
// $l = str_repeat(' ', $counter+1) . '';
if ($level_id_name)
$l = str_repeat(' ', $counter+1) . ' ';
else
$l = str_repeat(' ', $counter+1) . ' ';
$l .= get_level_ahref($value['acat_id'], $enclose) . html_specialchars($value['acat_name']);
$l .= $g;
$l .= $close_li . ' ';
$t[] = $l;
$x++;
$first_li = ''; // Reset first_li
} // END foreach
if($counter) {
$A = LF . str_repeat(' ', $counter) . '';
$B = LF . str_repeat(' ', $counter) . '';
} else {
$A = '';
$B = '';
}
$t = implode(LF, $t);
if($t) {
$t = $A . LF . str_repeat(' ', $counter) . ' '. $B ;
}
/*
// -- -------------------------------------------------------------------
// EDIT: 07/11/25 KH. (flip-flop) including simple Tags in category headline from the file
// /include/inc_front/front.func.inc.php and the function html_parser($string)
// you can copy&paste what you want.
// ========== copy&paste ===========
// typical html formattings
$search[18] = '/\[i\](.*?)\[\/i\]/is'; $replace[18] = '$1';
$search[19] = '/\[u\](.*?)\[\/u\]/is'; $replace[19] = '$1';
$search[20] = '/\[s\](.*?)\[\/s\]/is'; $replace[20] = '$1';
$search[21] = '/\[b\](.*?)\[\/b\]/is'; $replace[21] = '$1';
// ========== end copy&paste ========
$t = preg_replace($search, $replace, $t);
// -- -------------------------------------------------------------------
*/
return $t;
}
?>
\\
==== CSS for V1.2: ====
/* ================================================================
This copyright notice must be untouched at all times.
The original version of this stylesheet and the associated (x)htmlis
available at http://www.cssplay.co.uk/menus/simple_vertical.html
Copyright (c) 2005-2007 Stu Nicholls. All rights reserved.
This stylesheet and the associated (x)html may be modified in any
way to fit your requirements.
08.11.07 KH (flip-flop) Enhanced: Start[ID] {NAV_HORIZ_DD:ID}
http://www.phpwcms.de/forum/viewtopic.php?p=94688#94688
(http://www.phpwcms.de/forum/viewtopic.php?p=89743#89743)
V1.1 05.03.2010 KH: For active path
=================================================================== */
/* Add a margin - for this demo only - and a relative position with a high z-index to make it appear over any element below */
/* margin hinzugefuegt - ausschließlich fuer diese demo - und ein "relative position" mit einem hohen z-index Wert um sicherzustellen dass das Menue ueber jedem nachfolgenden Element aufklappt. */
#menu_container {
/* margin: 0 0 100px 0; /* 100px only for testing - default = 0 */
position: relative;
width: 990px;
height: 21px; /* ORG 20px */
z-index: 1000;
}
/* Get rid of the margin, padding and bullets in the unordered lists */
/* margin und padding auf 0, Aufzählungszeichen der unsortierten Liste unterdruecken */
.hmenu, .hmenu ul {
padding: 0;
margin: 0;
list-style-type: none;
}
/* Set up the link size, color and borders */
/* Einstellen der Groeszen, Farben und Rahmen fuer die Links */
.hmenu a, .hmenu a:visited {
display: block;
width: 150px;
font-size: 11px;
color: #fff;
height: 21px; /* ORG 25px */
line-height: 20px; /* ORG 24px */
text-decoration: none;
text-indent: 5px;
border: 1px solid #fff;
border-width: 1px 0 1px 1px;
}
/* Set up the sub level borders */
/* Einstellen der Rahmen fuer die Unterebenen */
.hmenu li ul li a, .hmenu li ul li a:visited {
border-width: 0 1px 1px 1px;
}
.hmenu li a.horiz_enclose, .hmenu li a.horiz_enclose:visited {
border-width: 1px;
}
/* Set up the list items */
/* Einstellen der Listeneinzelheiten */
.hmenu li {
float: left;
list-style-type: none;
background: #7484ad;
}
/* For Non-IE browsers and IE7 */
/* Fuer alle nicht IE + IE7 */
.hmenu li:hover {
position: relative;
}
/* Make the hovered list color persist */
/* Festlegen der Farbe fuer hover li */
.hmenu li:hover > a {
background: #D1D5DF; /* ORG #dfd7ca; */
color: #BF4300; /* ORG #c00; */
}
.hmenu li.act_path:hover > a {
background:#8FB0FF url(../../img/symbols/klapp_auf.gif) no-repeat 135px center;
color: #fff;
/* background:#cccccc url(../../img/article/navi/drop.gif) no-repeat right center;
*/
}
.hmenu li li.act_path:hover > a {
background:#8FB0FF url(../../img/symbols/klapp_zu.gif) no-repeat 135px center;
color: #fff;
}
.hmenu li li.act_path:hover > a {
background:#8FB0FF url(../../img/symbols/klapp_zu.gif) no-repeat 135px center;
color: #fff;
}
.hmenu li li.sub_no.act_path:hover > a {
background:red no-repeat 135px center;
color: #fff;
}
/* Set up the sublevel lists with a position absolute for flyouts and overrun padding. The transparent gif (leer.gif) is for IE to work */
/* Einstellen der Unterebenenlisten mit einer absoluten Positionierung fuer die FlyOuts und dem "Ueberfahren-Abstand"
Das transparente gif (leer.gif) ist fuer den IE gedacht */
.hmenu li ul {
display: none;
}
/* For Non-IE and IE7 make the sublevels visible on list hover. This is all it needs */
/* Fuer alle nicht-IE + IE7 wird die Unterebenenliste sichtbar bei einem Ueberfahren (hover) */
.hmenu li:hover > ul {
display: block;
position: absolute;
top: -7px; /* ORG -11px */
left: 115px;
padding: 7px 30px 30px 30px; /* ORG padding: 10px */
background:transparent url(../../img/article/leer.gif);
width: 150px;
}
/* Position the first sub level beneath the top level links */
/* Positioniere die erste Unterebene nach dem Topebenenlink */
.hmenu > li:hover > ul {
left: -30px;
top: 16px;
}
/* get rid of the table */
/* Tabelle neu einstellen */
.hmenu table {
position: absolute;
border-collapse: collapse;
top: 0;
left: 0;
z-index: 1000;
font-size: 1em;
}
/* For IE5.5 and IE6 give the hovered links a position relative and a change of background and foreground color. This is needed to trigger IE to show the sub levels */
/* Fuer den IE5 und IE6 gebe dem hover-Link eine relative Position und wechsele die Hinter- und Vordergrundfarbe. Das ist notwendig damit der IE angestoszen wird die Unterebenen auszugeben */
* html .hmenu li a:hover {
position: relative;
background: #D1D5DF; /* ORG #dfd7ca; */
color: #c00;
}
.hmenu li.drop_ul {
background: #7484ad url(../../img/symbols/klapp_auf.gif) no-repeat 135px center;
/* background: #7484ad url(../../img/article/navi/drop.gif) no-repeat right center;
*/
}
/* active path ======================== */
/* KH: Active Path output first level */
/* KH: Ausgabe des aktiven Pfads erste Ebene */
.hmenu li.act_path {
background:#4161AF url(../../img/symbols/klapp_auf.gif) no-repeat 135px center;
/* background:#cccccc url(../../img/article/navi/drop.gif) no-repeat right center;
*/
}
/* KH: Active Path output */
/* KH: Ausgabe des aktiven Pfads */
.hmenu li li.act_path,
.hmenu li li li.act_path,
.hmenu li li li li.act_path,
.hmenu li li li li li.act_path {
background:#4161AF url(../../img/symbols/klapp_zu.gif) no-repeat 137px center;
/* background:#cccccc url(../../img/article/navi/drop.gif) no-repeat right center;
*/
}
/* Set up the pointers for the sub level indication */
/* Einstellen der Symbole/Pfeile für die Unterebenenanzeige */
.hmenu li.fly_ul {
background: #7484ad url(../../img/symbols/klapp_zu.gif) no-repeat 137px center;
/* background: #7484ad url(../../img/article/navi/fly.gif) no-repeat right center;
*/
}
/* active link ======================== */
/* For accessibility of the top level menu when tabbing */
/* Fuer die Aktivierung der ersten Ebene, wenn im Menue geblättert wird */
.hmenu li a:active, .hmenu li a:focus {
background: #6189DF;
color: #BF4300; /* ORG #c00; */
}
/* active link in first level */
/* Aktiver Link in der ersten Ebene */
.hmenu li.active {
background-color: #6F99FF;
color: #BF4300; /* ORG #c00; */
}
/* active link behind first level */
/* Aktiver Link nach der ersten Ebene */
.hmenu li li.active,
.hmenu li li li.active,
.hmenu li li li li.active,
.hmenu li li li li li.active {
background: #6890EF;
color: #BF4300; /* ORG #c00; */
}
/* This lot is for IE5.5 and IE6 ONLY and is necessary to make the sublevels appear */
/* change the drop down levels from display:none; to visibility:hidden; */
/* Dies ist fuer den IE5.5 und IE6 notwendig um die Unterebenen anzuzeigen */
/* Wechselt die Unterebenen von display:none; nach visibility:hidden; */
* html .hmenu li ul {
visibility: hidden;
display: block;
position: absolute;
top: -11px;
left: 115px;
padding: 10px 30px 30px 30px;
background: transparent url(../../img/article/leer.gif);
}
/* keep the third level+ hidden when you hover on first level link */
.hmenu li a:hover ul ul {
visibility: hidden;
}
/* keep the fourth level+ hidden when you hover on second level link */
.hmenu li a:hover ul a:hover ul ul {
visibility: hidden;
}
/* keep the fifth level hidden when you hover on third level link */
.hmenu li a:hover ul a:hover ul a:hover ul ul {
visibility: hidden;
}
/* keep the sixth level hidden when you hover on fourth level link */
.hmenu li a:hover ul a:hover ul a:hover ul a:hover ul ul {
visibility: hidden;
}
/* make the second level visible when hover on first level link and position it */
.hmenu li a:hover ul {
visibility: visible;
left: -30px; /* (IE5 ONLY) */
top: 10px; /* ORG 14px (IE5 ONLY) */
lef\t: -31px; /* (IE6 ONLY) */
to\p: 11px; /* ORG 15px (IE6 ONLY) */
}
/* make the third level visible when you hover over second level link and position it and all further levels */
.hmenu li a:hover ul a:hover ul {
visibility: visible;
top: -11px; /* ORG -11px (IE6 ONLY) */
left: 115px;
}
/* make the fourth level visible when you hover over third level link */
.hmenu li a:hover ul a:hover ul a:hover ul {
visibility: visible;
}
/* make the fifth level visible when you hover over fourth level link */
.hmenu li a:hover ul a:hover ul a:hover ul a:hover ul {
visibility: visible;
}
/* make the sixth level visible when you hover over fifth level link */
.hmenu li a:hover ul a:hover ul a:hover ul a:hover ul a:hover ul {
visibility: visible;
}
/* If you can see the pattern in the above IE5.5 and IE6 style then you can add as many sub levels as you like */
\\
\\
==== PHP V1.2b ====
Update 22.12.2010 KH:
* Wrap link text: Eg. ''%% ... %%''.
* Parameter: %%"WrapIn|WrapOut"%%
\\
NAVI HORIZONTAL DROP-DOWN
* Oliver Georgi
* http://www.phpwcms.de/forum/viewtopic.php?p=89743#89743
* 08.11.07 KH (flip-flop) Enhanced: Start[ID] {NAV_HORIZ_DD:ID}
* 28.04.08 KH (flip-flop) Enhanced: Level depth {NAV_HORIZ_DD:ID,Depth}
* http://www.phpwcms.de/forum/viewtopic.php?p=94688#94688
* 05.03.10 KH (flip-flop) Enhanced: Menu type, H&P, id for every li
* @string $parameter = "menu type, start_id, max_level_depth, id for ervery li"
* - Menu type: H=Home on|off, P=Parent on|off
* - id for ervery li: class name
* 16.12.10 KH (flip-flop) Enhanced: Every first is marked with the
* class "sub_first"
* 16.12.10 KH (flip-flop) Enhanced: Class in TAG (ul class="Name">)
* - TAG: {NAV_HORIZ_DD1:Menu type, Start-ID, Level depth, li id_name,class_name}
* - E.g.: {NAV_HORIZ_DD1:H, 2, 3, id}
*
* 22.12.10 KH (flip-flop) Enhanced: Wrap-link-text in TAG (..>LinkText">)
* - TAG: {NAV_HORIZ_DD1:Menu type, Start-ID, Level depth, li id_name,class_name,|}
* - E.g.: {NAV_HORIZ_DD1:H, 2, 3, cat, my_class,|}
*
* Location: Put it into the file e.g.:
* /template/inc_script/frontend_render/rt_nav_horiz_drop_down_v11.php
* Switch in conf.inc.php: $phpwcms['allow_ext_render'] = 1;
* **************************************************************************
*/
// ----------------------------------------------------------------
// obligate check for phpwcms constants
if (!defined('PHPWCMS_ROOT')) {
die("You Cannot Access This Script Directly, Have a Nice Day."); }
// ----------------------------------------------------------------
if( ! ( strpos($content["all"],'{NAV_HORIZ_DD1')==false ) ) {
$content["all"] = str_replace('{NAV_HORIZ_DD1}','{NAV_HORIZ_DD1:,0,100}',$content["all"]); // For a simple call
$content["all"] = preg_replace('/\{NAV_HORIZ_DD1:(.*?)\}/e', 'buildNavi_horiz1("$1");', $content["all"]);
}
//function buildNavi_horiz($start=0, $counter=0, $depth=0) {
function buildNavi_horiz1($parameter='', $counter=0, $param='string') {
// ====== CUSTOM VAR ==========================================
$menu_class = ' hmenu'; // Menu class name // Menue Klassenname
$first_lev = ' first-level';
$act_path = ' act_path';
$active = ' active'; // The active link // Der aktive Link
// ====== CUSTOM VAR ENDE ======================================
// only for the first call from extern
// Nur fuer den ersten externen Aufruf
if($param == 'string') {
$parameter = explode(',', $parameter);
// first entry a digit or sign? Only for compatibility to the older nav version
// Erster Eintrag eine Zahl? Nur fuer Kompatibilität mit aeltere Navi Version
if (isset($parameter[0]) AND (preg_match('/^[0-9]+$/i',$parameter[0])) ) {
array_unshift ( $parameter, '' ); // Fill up array for $menu_type
}
$menu_type = empty($parameter[0]) ? '' : strtoupper(trim($parameter[0]));
$start_id = empty($parameter[1]) ? 0 : intval($parameter[1]);
$max_depth = empty($parameter[2]) ? 0 : intval($parameter[2]-1);
$level_id_name = empty($parameter[3]) ? '' : trim($parameter[3]);
$menu_class = empty($parameter[4]) ? $menu_class : ' '.trim($parameter[4]);
$wrap_link_text = empty($parameter[5]) ? array(0 => '', 1 => '') : explode('|', trim($parameter[5]), 2);
if(empty($wrap_link_text[1])) {
$wrap_link_text[1] = '';
}
$parent = false; // do not show parent link
$home = false; // do not show home link
switch($menu_type) {
// show parent level too - only in first line [Parent]
case 'P': $parent = true;
break;
// Home in the first line [Home] [Cat01] [Cat02] [Cat03]
case 'HP': $parent = true;
case 'H': $home = true;
if($start_id == '0' AND $parent) $home = false;
break;
}
$parameter = array( 0 => $menu_type, 1 => $start_id, 2 => $max_depth,
3 => $level_id_name, 4 => $menu_class, 5 => $wrap_link_text
);
} else { // for the inner call (recursive run)
$menu_type = $parameter[0];
$start_id = $parameter[1];
$max_depth = $parameter[2]-1;
$level_id_name = $parameter[3];
$menu_class = $parameter[4];
$wrap_link_text = $parameter[5];
$parent = false; // do not show parent link
$home = false; // do not show home link
}
// ----- System var ----------------
$t = array();
$x = 0;
// ---------------------------------
$struct = getStructureChildData($start_id); // Catch structure
if($counter == 0) {
$last = count($start_id) - 1;
// ======== Only if you want the home link // Nur wenn Home gewuenscht
if ($home) { // Home in the first line [Home] [Cat01] [Cat02] [Cat03]
$l = ' ';
$l .= get_level_ahref($start_id, ' class="home"') . ''. html_specialchars($GLOBALS['content']['struct']['0']['acat_name']);
$l .= ' ';
$t[] = $l;
}
// ======== Only if you want the parent link // Nur wenn der Eltern-Link gewuenscht
if ($parent) { // Parent only in first line [Parent]
$struct = array(); // clear array // Array leeren
$struct[$start_id] = $GLOBALS['content']['struct'][$start_id];
}
// ========
} else {
$last = 0;
}
$first_li = ' sub_first'; // Init first flag
foreach($struct as $value) {
// ============
// dumpVar($value['acat_id']);
// Is it a active path ? ========
// Ist dies der aktive Pfad ? ========
if( isset($GLOBALS['LEVEL_KEY'][ $value['acat_id'] ]) ) {
$p1 = $act_path;
} else {
$s = ''; // Reset $struct
$p1 = '';
}
// Only if there is a sub level ========
// Nur wenn SubLevel vorhanden ist ========
if($GLOBALS['content']['cat_id'] == $value['acat_id']) {
$a1 = $act_path; // Only for a direct call // Nur bei direktem Aufruf (FirstLevel active)
$a3 = ''; // active
}
else { // If first level isn´t active // Wenn FirstLevel nicht aktiv
$a1 = $p1;
$a3 = '';
}
// ==========================
// -- -------------------------------------------------------------------
// Preset level depth added
// Ebenetiefenvorgabe hinzugefuegt
// $s = buildNavi_horiz($value['acat_id'], $counter+1);
$parameter[1] = $value['acat_id']; // start_id
// if (($counter) < $depth) {$s = buildNavi_horiz($value['acat_id'], $counter+1, $depth, 'param_is_array');
if (($counter) < $max_depth) {$s = buildNavi_horiz1($parameter, $counter+1, 'param_is_array');
}
else {$s = '';}
// -- -------------------------------------------------------------------
// Set the active link class
// Aktive Link Classe setzen
($GLOBALS['content']['cat_id'] == $value['acat_id']) ? $a3 = $active: $a3 = '';
if($s) {
$g = '';
$g .= $s;
$g .= LF . str_repeat(' ', $counter);
$class = $counter ? (' class="fly_ul '.$a1.$a3.$first_li.'"') : (' class="drop_ul '.$a1.$first_lev.$a3.$first_li.'"'); // Second level with active category
$close_li = str_repeat(' ', $counter+1);
} else {
$g = '';
$class = ' class="sub_no'.$a1.$a3.$first_li.'"'; // act_path auch im letzten activ link
// $class = ' class="sub_no'.$a3.'"';
// -- -------------------------------------------------------------------
// Only the first level if there is no sub level
// Ausschlieszlich das erste Level wenn kein Sublevel vorhanden ist
if ($counter == 0) {
$class = ' class="sub_no'.$a1.$first_lev.$first_li.'"'; // Set it, it is active or not // Es ist aktiv oder nicht
// -- -------------------------------------------------------------------
}
$close_li = '';
}
// first li in block =======
// Erstes li im letzten Block =======
if( $last && $last == $x ) {
$enclose = ' class="horiz_enclose"';
} elseif( $x || ($counter == 0 && $x == 0) ) {
$enclose = '';
} else {
$enclose = ' class="horiz_enclose"';
}
// IDs for every li ======= If you need the ID class, please uncomment/comment
// IDs fuer jedes li ======= Wenn sie die ID Klassen benoetigen, bitte dekommentieren/kommentieren
// $l = str_repeat(' ', $counter+1) . '';
if ($level_id_name)
$l = str_repeat(' ', $counter+1) . ' ';
else
$l = str_repeat(' ', $counter+1) . ' ';
$l .= get_level_ahref($value['acat_id'], $enclose) . $wrap_link_text[0]. html_specialchars($value['acat_name']).$wrap_link_text[1];
$l .= $g;
$l .= $close_li . ' ';
$t[] = $l;
$x++;
$first_li = ''; // Reset first_li
} // END foreach
if($counter) {
$A = LF . str_repeat(' ', $counter) . '';
$B = LF . str_repeat(' ', $counter) . '';
} else {
$A = '';
$B = '';
}
$t = implode(LF, $t);
if($t) {
$t = $A . LF . str_repeat(' ', $counter) . ' '. $B ;
}
/*
// -- -------------------------------------------------------------------
// EDIT: 07/11/25 KH. (flip-flop) including simple Tags in category headline from the file
// /include/inc_front/front.func.inc.php and the function html_parser($string)
// you can copy&paste what you want.
// ========== copy&paste ===========
*/
// typical html formattings
$search[18] = '/\[i\](.*?)\[\/i\]/is'; $replace[18] = '$1';
$search[19] = '/\[u\](.*?)\[\/u\]/is'; $replace[19] = '$1';
$search[20] = '/\[s\](.*?)\[\/s\]/is'; $replace[20] = '$1';
$search[21] = '/\[b\](.*?)\[\/b\]/is'; $replace[21] = '$1';
$search[22] = '/\[br\]/is'; $replace[22] = '
';
// ========== end copy&paste ========
$t = preg_replace($search, $replace, $t);
/*
// -- -------------------------------------------------------------------
*/
return $t;
}
?>
\\
==== PHP V1.2c ====
Update 18.11.2011 KH:
* The title tag for each link can be displayed e.g. ''%%%%''.
* Parameters in the Script in CUSTOM VAR: %%"$title = true/false"%%
\\
NAVI HORIZONTAL DROP-DOWN
* Oliver Georgi
* http://www.phpwcms.de/forum/viewtopic.php?p=89743#89743
* 08.11.07 KH (flip-flop) Enhanced: Start[ID] {NAV_HORIZ_DD:ID}
* 28.04.08 KH (flip-flop) Enhanced: Level depth {NAV_HORIZ_DD:ID,Depth}
* http://www.phpwcms.de/forum/viewtopic.php?p=94688#94688
* 05.03.10 KH (flip-flop) Enhanced: Menu type, H&P, id for every li
* @string $parameter = "menu type, start_id, max_level_depth, id for ervery li"
* - Menu type: H=Home on|off, P=Parent on|off
* - id for ervery li: class name
* 16.12.10 KH (flip-flop) Enhanced: Every first is marked with the
* class "sub_first"
* 16.12.10 KH (flip-flop) Enhanced: Class in TAG (ul class="Name">)
* - TAG: {NAV_HORIZ_DD1:Menu type, Start-ID, Level depth, li id_name,class_name}
* - E.g.: {NAV_HORIZ_DD1:H, 2, 3, id}
*
* 22.12.10 KH (flip-flop) Enhanced: Wrap-link-text in TAG (..>LinkText">)
* - TAG: {NAV_HORIZ_DD1:Menu type, Start-ID, Level depth, li id_name,class_name,|}
* - E.g.: {NAV_HORIZ_DD1:H, 2, 3, cat, my_class,|}
*
* 18.11.11 KH (flip-flop) Enhanced: title output in link yes/no
*
* Location: Put it into the file e.g.:
* /template/inc_script/frontend_render/rt_nav_horiz_drop_down_v11.php
* Switch in conf.inc.php: $phpwcms['allow_ext_render'] = 1;
* **************************************************************************
*/
// ----------------------------------------------------------------
// obligate check for phpwcms constants
if (!defined('PHPWCMS_ROOT')) {
die("You Cannot Access This Script Directly, Have a Nice Day."); }
// ----------------------------------------------------------------
if( ! ( strpos($content["all"],'{NAV_HORIZ_DD1')==false ) ) {
$content["all"] = str_replace('{NAV_HORIZ_DD1}','{NAV_HORIZ_DD1:,0,100}',$content["all"]); // For a simple call
$content["all"] = preg_replace('/\{NAV_HORIZ_DD1:(.*?)\}/e', 'buildNavi_horiz1("$1");', $content["all"]);
}
//function buildNavi_horiz($start=0, $counter=0, $depth=0) {
function buildNavi_horiz1($parameter='', $counter=0, $param='string') {
// ====== CUSTOM VAR ==========================================
$menu_class = ' hmenu'; // Menu class name // Menue Klassenname
$first_lev = ' first';
$act_path = ' act_path';
$active = ' active'; // The active link // Der aktive Link
$title = false; // Title ausgeben ja/nein
// ====== CUSTOM VAR ENDE ======================================
// only for the first call from extern
// Nur fuer den ersten externen Aufruf
if($param == 'string') {
$parameter = explode(',', $parameter);
// first entry a digit or sign? Only for compatibility to the older nav version
// Erster Eintrag eine Zahl? Nur fuer Kompatibilität mit aeltere Navi Version
if (isset($parameter[0]) AND (preg_match('/^[0-9]+$/i',$parameter[0])) ) {
array_unshift ( $parameter, '' ); // Fill up array for $menu_type
}
$menu_type = empty($parameter[0]) ? '' : strtoupper(trim($parameter[0]));
$start_id = empty($parameter[1]) ? 0 : intval($parameter[1]);
$max_depth = empty($parameter[2]) ? 0 : intval($parameter[2]-1);
$level_id_name = empty($parameter[3]) ? '' : trim($parameter[3]);
$menu_class = empty($parameter[4]) ? $menu_class : ' '.trim($parameter[4]);
$wrap_link_text = empty($parameter[5]) ? array(0 => '', 1 => '') : explode('|', trim($parameter[5]), 2);
if(empty($wrap_link_text[1])) {
$wrap_link_text[1] = '';
}
$parent = false; // do not show parent link
$home = false; // do not show home link
switch($menu_type) {
// show parent level too - only in first line [Parent]
case 'P': $parent = true;
break;
// Home in the first line [Home] [Cat01] [Cat02] [Cat03]
case 'HP': $parent = true;
case 'H': $home = true;
if($start_id == '0' AND $parent) $home = false;
break;
}
$parameter = array( 0 => $menu_type, 1 => $start_id, 2 => $max_depth,
3 => $level_id_name, 4 => $menu_class, 5 => $wrap_link_text
);
} else { // for the inner call (recursive run)
$menu_type = $parameter[0];
$start_id = $parameter[1];
$max_depth = $parameter[2]-1;
$level_id_name = $parameter[3];
$menu_class = $parameter[4];
$wrap_link_text = $parameter[5];
$parent = false; // do not show parent link
$home = false; // do not show home link
}
// ----- System var ----------------
$t = array();
$x = 0;
// ---------------------------------
$struct = getStructureChildData($start_id); // Catch structure
if($counter == 0) {
$last = count($start_id) - 1;
// ======== Only if you want the home link // Nur wenn Home gewuenscht
if ($home) { // Home in the first line [Home] [Cat01] [Cat02] [Cat03]
$l = ' ';
if (!$title)
$l .= get_level_ahref($start_id, ' class="home"') . ''. html_specialchars($GLOBALS['content']['struct']['0']['acat_name']);
else
$l .= get_level_ahref($start_id, ' class="home" title="'.html_specialchars($GLOBALS['content']['struct']['0']['acat_name']).'"') . ''. html_specialchars($GLOBALS['content']['struct']['0']['acat_name']);
$l .= '