NAVIGATION
This shows you the differences between two versions of the page.
deutsch:navigationen:dropdown_flyout:nav_horiz_dd:erweitert [2010/12/10 23:29] Knut Heermann (flip-flop) |
deutsch:navigationen:dropdown_flyout:nav_horiz_dd:erweitert [2018/06/03 18:09] (current) |
||
---|---|---|---|
Line 8: | Line 8: | ||
**{NAV_HORIZ_DD: Typ, ID, Ebenentiefe, li-ID}** | **{NAV_HORIZ_DD: Typ, ID, Ebenentiefe, li-ID}** | ||
- | ##@string $parameter = "menu type, start_id, max_level_depth, id for ervery li"## | + | ##@string $parameter = "menu type, start_id, max_level_depth, id for every li"## |
<file> | <file> | ||
- Menu type: H=Home on|off, P=Parent on|off | - Menu type: H=Home on|off, P=Parent on|off | ||
Line 21: | Line 21: | ||
- Der **aktive Link** kann nun mit der Klasse **.act_path** über alle Ebenen verfolgt werden \\ | - Der **aktive Link** kann nun mit der Klasse **.act_path** über alle Ebenen verfolgt werden \\ | ||
- Der **aktive Link** wird mit der Klasse **.active** gekennzeichnet \\ | - Der **aktive Link** wird mit der Klasse **.active** gekennzeichnet \\ | ||
- | - Der Memü-Typ **H** gibt "Home" mit der Klasse **.home** in der ersten Ebene aus \\ | + | - Der Menü-Typ **H** gibt "Home" mit der Klasse **.home** in der ersten Ebene aus \\ |
- | - Der Meny-Typ **P** zeigt auch das **Elternelement** von start_id. \\ | + | - Der Menü-Typ **P** zeigt auch das **Elternelement** von start_id. \\ |
- Die Kombination **HP** bei **ID=0** gibt P den Vorrang. \\ | - Die Kombination **HP** bei **ID=0** gibt P den Vorrang. \\ | ||
- | - Update 20.11.2010 KH: Jedem UL wird ein Level mitgegeben. | + | - Update 20.11.2010 KH: Jedem UL wird ein Level mitgegeben. \\ |
+ | - Update 18.11.2011 KH: Der title TAG zu jedem Link kann optional ausgegeben werden | ||
+ | |||
Line 42: | Line 45: | ||
* **ID** = Start-ID aus dem Kategoriebaum | * **ID** = Start-ID aus dem Kategoriebaum | ||
* **Ebenetiefe** = Anzahl Ebenen/Level tief | * **Ebenetiefe** = Anzahl Ebenen/Level tief | ||
- | * **li-ID** = Teil-Name der Klassse die jedem <li mitgegeben wrid. An die Klasse wird die Kategorie-ID angehängt (li_ID_X). | + | * **li-ID** = Teil-Name der Klasse die jedem <li mitgegeben wird. An die Klasse wird die Kategorie-ID angehängt (li_ID_X). |
\\ | \\ | ||
Line 333: | Line 336: | ||
\\ | \\ | ||
- | ==== PHP V1.2 ==== | + | ==== PHP V1.2a ==== |
Update 20.11.2010 KH: | Update 20.11.2010 KH: | ||
* Jedem UL wird ein Level mitgegeben. | * Jedem UL wird ein Level mitgegeben. | ||
* Aufruf mit {NAV_HORIZ_DD1:.......} | * Aufruf mit {NAV_HORIZ_DD1:.......} | ||
+ | |||
+ | Update 16.12.2010 KH: | ||
+ | * Alle ersten <li> bekommen zusätzlich die Klasse "sub_first" zugewiesen. | ||
+ | |||
+ | \\ | ||
<file> | <file> | ||
<ul class="level-2"> | <ul class="level-2"> | ||
- | <li class="sub_no" id="cat_33"><a href="ind ....... | + | <li class="sub_no sub_first" id="cat_33"><a href="ind ....... |
+ | <li class="fly_ul" id="cat_34"><a href="ind ....... | ||
+ | <ul class="level-3"> | ||
+ | <li class="sub_no sub_first" id="cat_41"><a href="ind ....... | ||
+ | <li class="sub_no" id="cat_43"><a href="ind ....... | ||
+ | ........ | ||
</file> | </file> | ||
Line 360: | Line 373: | ||
/** | /** | ||
* ************************************************************************** | * ************************************************************************** | ||
- | * V1.2 20.11.2010 K.heermann http://planmatrix.de | + | * V1.2a 16.12.2010 K.heermann http://planmatrix.de |
- | * | + | * |
* 25.07.07 horizontal drop-down with ID output -> NAVI HORIZONTAL DROP-DOWN | * 25.07.07 horizontal drop-down with ID output -> NAVI HORIZONTAL DROP-DOWN | ||
* Oliver Georgi | * Oliver Georgi | ||
Line 372: | Line 385: | ||
* - Menu type: H=Home on|off, P=Parent on|off | * - Menu type: H=Home on|off, P=Parent on|off | ||
* - id for ervery li: class name | * - id for ervery li: class name | ||
+ | * 16.12.10 KH (flip-flop) Enhanced: Every first <li> is marked with the | ||
+ | * class "sub_first" | ||
* | * | ||
* TAG: {NAV_HORIZ_DD1:Menu type, Start-ID, Level depth, li id_name} | * TAG: {NAV_HORIZ_DD1:Menu type, Start-ID, Level depth, li id_name} | ||
Line 379: | Line 394: | ||
* Switch in conf.inc.php: $phpwcms['allow_ext_render'] = 1; | * Switch in conf.inc.php: $phpwcms['allow_ext_render'] = 1; | ||
* ************************************************************************** | * ************************************************************************** | ||
- | */ | + | */ |
// ---------------------------------------------------------------- | // ---------------------------------------------------------------- | ||
// obligate check for phpwcms constants | // obligate check for phpwcms constants | ||
Line 387: | Line 402: | ||
if( ! ( strpos($content["all"],'{NAV_HORIZ_DD1')==false ) ) { | 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"] = 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"]); | + | $content["all"] = preg_replace('/\{NAV_HORIZ_DD1:(.*?)\}/e', 'buildNavi_horiz1("$1");', $content["all"]); |
} | } | ||
- | + | ||
- | + | ||
+ | |||
//function buildNavi_horiz($start=0, $counter=0, $depth=0) { | //function buildNavi_horiz($start=0, $counter=0, $depth=0) { | ||
function buildNavi_horiz1($parameter='', $counter=0, $param='string') { | function buildNavi_horiz1($parameter='', $counter=0, $param='string') { | ||
- | + | ||
- | + | ||
- | // ====== CUSTOM VAR ========================================== | + | // ====== CUSTOM VAR ========================================== |
- | + | ||
- | $menu_class = ' hmenu'; // Menu class name // Menue Klassenname | + | $menu_class = ' hmenu'; // Menu class name // Menue Klassenname |
- | + | ||
- | $first_lev = ' first-level'; | + | $first_lev = ' first-level'; |
- | $act_path = ' act_path'; | + | $act_path = ' act_path'; |
- | $active = ' active'; // The active link // Der aktive Link | + | $active = ' active'; // The active link // Der aktive Link |
// ====== CUSTOM VAR ENDE ====================================== | // ====== CUSTOM VAR ENDE ====================================== | ||
- | + | ||
- | + | ||
- | // only for the first call from extern | + | // only for the first call from extern |
- | // Nur fuer den ersten externen Aufruf | + | // Nur fuer den ersten externen Aufruf |
- | if($param == 'string') { | + | if($param == 'string') { |
- | + | ||
- | $parameter = explode(',', $parameter); | + | $parameter = explode(',', $parameter); |
- | + | ||
- | // first entry a digit or sign? Only for compatibility to the older nav version | + | // 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 | + | // Erster Eintrag eine Zahl? Nur fuer Kompatibilität mit aeltere Navi Version |
- | if (isset($parameter[0]) AND (preg_match('/^[0-9]+$/i',$parameter[0])) ) { | + | if (isset($parameter[0]) AND (preg_match('/^[0-9]+$/i',$parameter[0])) ) { |
- | + | ||
- | array_unshift ( $parameter, '' ); // Fill up array for $menu_type | + | array_unshift ( $parameter, '' ); // Fill up array for $menu_type |
- | } | + | } |
- | $menu_type = empty($parameter[0]) ? '' : strtoupper(trim($parameter[0])); | + | $menu_type = empty($parameter[0]) ? '' : strtoupper(trim($parameter[0])); |
- | $start_id = empty($parameter[1]) ? 0 : intval($parameter[1]); | + | $start_id = empty($parameter[1]) ? 0 : intval($parameter[1]); |
- | $max_depth = empty($parameter[2]) ? 0 : intval($parameter[2]-1); | + | $max_depth = empty($parameter[2]) ? 0 : intval($parameter[2]-1); |
- | $level_id_name = empty($parameter[3]) ? '' : trim($parameter[3]); | + | $level_id_name = empty($parameter[3]) ? '' : trim($parameter[3]); |
- | $parent = false; // do not show parent link | + | $parent = false; // do not show parent link |
- | $home = false; // do not show home link | + | $home = false; // do not show home link |
- | + | ||
- | + | ||
- | switch($menu_type) { | + | switch($menu_type) { |
- | // show parent level too - only in first line [Parent] | + | // show parent level too - only in first line [Parent] |
- | case 'P': $parent = true; | + | case 'P': $parent = true; |
- | break; | + | break; |
- | + | ||
- | // Home in the first line [Home] [Cat01] [Cat02] [Cat03] | + | // Home in the first line [Home] [Cat01] [Cat02] [Cat03] |
- | case 'HP': $parent = true; | + | case 'HP': $parent = true; |
- | case 'H': $home = true; | + | case 'H': $home = true; |
- | if($start_id == '0' AND $parent) $home = false; | + | if($start_id == '0' AND $parent) $home = false; |
- | break; | + | break; |
- | } | + | } |
- | + | ||
- | } else { // for the inner call (recursive run) | + | } else { // for the inner call (recursive run) |
- | + | ||
- | $menu_type = $parameter[0]; | + | $menu_type = $parameter[0]; |
- | $start_id = $parameter[1]; | + | $start_id = $parameter[1]; |
- | $max_depth = $parameter[2]-1; | + | $max_depth = $parameter[2]-1; |
- | $level_id_name = $parameter[3]; | + | $level_id_name = $parameter[3]; |
- | $parent = false; // do not show parent link | + | $parent = false; // do not show parent link |
- | $home = false; // do not show home link | + | $home = false; // do not show home link |
- | + | ||
- | } | + | } |
- | + | ||
- | + | ||
- | // ----- System var ---------------- | + | // ----- System var ---------------- |
- | $t = array(); | + | $t = array(); |
- | $x = 0; | + | $x = 0; |
- | // --------------------------------- | + | // --------------------------------- |
$struct = getStructureChildData($start_id); // Catch structure | $struct = getStructureChildData($start_id); // Catch structure | ||
- | + | ||
+ | |||
if($counter == 0) { | if($counter == 0) { | ||
$last = count($start_id) - 1; | $last = count($start_id) - 1; | ||
- | + | ||
// ======== Only if you want the home link // Nur wenn Home gewuenscht | // ======== Only if you want the home link // Nur wenn Home gewuenscht | ||
if ($home) { // Home in the first line [Home] [Cat01] [Cat02] [Cat03] | if ($home) { // Home in the first line [Home] [Cat01] [Cat02] [Cat03] | ||
- | + | ||
$l = ' <li '. | $l = ' <li '. | ||
- | (($level_id_name) ? 'id="'.$level_id_name.'_0" ' : ''). | + | (($level_id_name) ? 'id="'.$level_id_name.'_0" ' : ''). |
- | 'class="drop home'.$first_lev.$a4. | + | 'class="drop home'.$first_lev.$a4. |
- | (($GLOBALS['content']['cat_id'] == 0)?$active:''). | + | (($GLOBALS['content']['cat_id'] == 0)?$active:''). |
- | '">'; | + | '">'; |
$l .= get_level_ahref($start_id, ' class="home"') . '<span>'. html_specialchars($GLOBALS['content']['struct']['0']['acat_name']); | $l .= get_level_ahref($start_id, ' class="home"') . '<span>'. html_specialchars($GLOBALS['content']['struct']['0']['acat_name']); | ||
$l .= '</span></a></li>'; | $l .= '</span></a></li>'; | ||
$t[] = $l; | $t[] = $l; | ||
} | } | ||
+ | |||
// ======== Only if you want the parent link // Nur wenn der Eltern-Link gewuenscht | // ======== Only if you want the parent link // Nur wenn der Eltern-Link gewuenscht | ||
if ($parent) { // Parent only in first line [Parent] | if ($parent) { // Parent only in first line [Parent] | ||
- | + | ||
$struct = array(); // clear array // Array leeren | $struct = array(); // clear array // Array leeren | ||
$struct[$start_id] = $GLOBALS['content']['struct'][$start_id]; | $struct[$start_id] = $GLOBALS['content']['struct'][$start_id]; | ||
} | } | ||
// ======== | // ======== | ||
- | + | ||
} else { | } else { | ||
$last = 0; | $last = 0; | ||
} | } | ||
+ | |||
+ | $first_li = ' sub_first'; // Init first <li> flag | ||
foreach($struct as $value) { | foreach($struct as $value) { | ||
- | + | ||
- | + | ||
- | // ============ | + | // ============ |
// dumpVar($value['acat_id']); | // dumpVar($value['acat_id']); | ||
Line 506: | Line 523: | ||
// Only if there is a sub level ======== | // Only if there is a sub level ======== | ||
// Nur wenn SubLevel vorhanden ist ======== | // Nur wenn SubLevel vorhanden ist ======== | ||
+ | |||
if($GLOBALS['content']['cat_id'] == $value['acat_id']) { | if($GLOBALS['content']['cat_id'] == $value['acat_id']) { | ||
- | + | ||
$a1 = $act_path; // Only for a direct call // Nur bei direktem Aufruf (FirstLevel active) | $a1 = $act_path; // Only for a direct call // Nur bei direktem Aufruf (FirstLevel active) | ||
$a3 = ''; // active | $a3 = ''; // active | ||
- | + | ||
- | } | + | } |
else { // If first level isn´t active // Wenn FirstLevel nicht aktiv | else { // If first level isn´t active // Wenn FirstLevel nicht aktiv | ||
$a1 = $p1; | $a1 = $p1; | ||
$a3 = ''; | $a3 = ''; | ||
} | } | ||
- | + | ||
// ========================== | // ========================== | ||
Line 524: | Line 541: | ||
// Ebenetiefenvorgabe hinzugefuegt | // Ebenetiefenvorgabe hinzugefuegt | ||
// $s = buildNavi_horiz($value['acat_id'], $counter+1); | // $s = buildNavi_horiz($value['acat_id'], $counter+1); | ||
- | + | ||
$parameter[1] = $value['acat_id']; // start_id | $parameter[1] = $value['acat_id']; // start_id | ||
- | + | ||
// if (($counter) < $depth) {$s = buildNavi_horiz($value['acat_id'], $counter+1, $depth, 'param_is_array'); | // 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'); | if (($counter) < $max_depth) {$s = buildNavi_horiz1($parameter, $counter+1, 'param_is_array'); | ||
Line 532: | Line 549: | ||
else {$s = '';} | else {$s = '';} | ||
// -- <D01> ------------------------------------------------------------------- | // -- <D01> ------------------------------------------------------------------- | ||
- | + | ||
- | // Set the active link class | + | // Set the active link class |
// Aktive Link Classe setzen | // Aktive Link Classe setzen | ||
($GLOBALS['content']['cat_id'] == $value['acat_id']) ? $a3 = $active: $a3 = ''; | ($GLOBALS['content']['cat_id'] == $value['acat_id']) ? $a3 = $active: $a3 = ''; | ||
- | + | ||
if($s) { | if($s) { | ||
$g = '<!--[if gte IE 7]><!--></a><!--<![endif]-->'; | $g = '<!--[if gte IE 7]><!--></a><!--<![endif]-->'; | ||
Line 542: | Line 559: | ||
$g .= LF . str_repeat(' ', $counter); | $g .= LF . str_repeat(' ', $counter); | ||
- | $class = $counter ? (' class="fly_ul '.$a1.$a3.'"') : (' class="drop_ul '.$a1.$first_lev.$a3.'"'); // Second level with active category | + | $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); | $close_li = str_repeat(' ', $counter+1); | ||
Line 548: | Line 565: | ||
} else { | } else { | ||
$g = '</a>'; | $g = '</a>'; | ||
- | $class = ' class="sub_no'.$a1.$a3.'"'; // act_path auch im letzten activ link | + | $class = ' class="sub_no'.$a1.$a3.$first_li.'"'; // act_path auch im letzten activ link |
- | // $class = ' class="sub_no'.$a3.'"'; | + | // $class = ' class="sub_no'.$a3.'"'; |
// -- <P01> ------------------------------------------------------------------- | // -- <P01> ------------------------------------------------------------------- | ||
// Only the first level if there is no sub level | // Only the first level if there is no sub level | ||
// Ausschlieszlich das erste Level wenn kein Sublevel vorhanden ist | // Ausschlieszlich das erste Level wenn kein Sublevel vorhanden ist | ||
if ($counter == 0) { | if ($counter == 0) { | ||
- | $class = ' class="sub_no'.$a1.$first_lev.'"'; // Set it, it is active or not // Es ist aktiv oder nicht | + | $class = ' class="sub_no'.$a1.$first_lev.$first_li.'"'; // Set it, it is active or not // Es ist aktiv oder nicht |
// -- <P01> ------------------------------------------------------------------- | // -- <P01> ------------------------------------------------------------------- | ||
} | } | ||
Line 573: | Line 590: | ||
// IDs fuer jedes li ======= Wenn sie die ID Klassen benoetigen, bitte dekommentieren/kommentieren | // IDs fuer jedes li ======= Wenn sie die ID Klassen benoetigen, bitte dekommentieren/kommentieren | ||
// $l = str_repeat(' ', $counter+1) . '<li'. $class . ' id="cat-id_' . $value['acat_id'] . '">'; | // $l = str_repeat(' ', $counter+1) . '<li'. $class . ' id="cat-id_' . $value['acat_id'] . '">'; | ||
- | if ($level_id_name) | + | if ($level_id_name) |
$l = str_repeat(' ', $counter+1) . '<li'. $class . ' id="'.$level_id_name.'_'. $value['acat_id'] . '">'; | $l = str_repeat(' ', $counter+1) . '<li'. $class . ' id="'.$level_id_name.'_'. $value['acat_id'] . '">'; | ||
- | else | + | else |
$l = str_repeat(' ', $counter+1) . '<li'. $class . '>'; | $l = str_repeat(' ', $counter+1) . '<li'. $class . '>'; | ||
+ | |||
$l .= get_level_ahref($value['acat_id'], $enclose) . html_specialchars($value['acat_name']); | $l .= get_level_ahref($value['acat_id'], $enclose) . html_specialchars($value['acat_name']); | ||
Line 588: | Line 605: | ||
$x++; | $x++; | ||
- | } | + | |
+ | $first_li = ''; // Reset first_li | ||
+ | |||
+ | } // END foreach | ||
if($counter) { | if($counter) { | ||
Line 889: | Line 909: | ||
</code> | </code> | ||
+ | \\ | ||
+ | |||
+ | |||
+ | \\ | ||
+ | ==== PHP V1.2b ==== | ||
+ | Update 22.12.2010 KH: | ||
+ | * Der Linktext kann in z.B. ''%%<span> ... </span>%%'' eingefasst werden //(wrap link text)//. | ||
+ | * Parameter: %%"WrapIn|WrapOut"%% | ||
+ | |||
+ | \\ | ||
+ | |||
+ | |||
+ | <file> | ||
+ | <ul class="level-2 "> | ||
+ | <li class="sub_no sub_first" id="cat_14"><a href="index.php?category04_01" class="horiz_enclose"><span>Category04_01</span></a></li> | ||
+ | <li class="sub_no" id="cat_15"><a href="index.php?category04_02"><span>Category04_02<br>auch Text</span></a></li> | ||
+ | <li class="sub_no" id="cat_20"><a href="index.php?category04_03"><span>Category04_03</span></a></li> | ||
+ | ........ | ||
+ | </file> | ||
+ | |||
+ | |||
+ | |||
+ | **Typischer Aufruf:** | ||
+ | <file><div class="hmenu">{NAV_HORIZ_DD1:,0,4,cat,my_class,<span>|</span> }</div></file> | ||
+ | |||
+ | |||
+ | Dateiname: **rt_nav_horiz_drop_down_v12.php** | ||
+ | |||
+ | Ort: **/template/inc_script/frontend_render/ ** | ||
+ | |||
+ | |||
+ | <code php|h rt_nav_horiz_drop_down_v12.php |h> | ||
+ | <?php | ||
+ | /** | ||
+ | * ************************************************************************** | ||
+ | * V1.2b 22.12.2010 K.heermann http://planmatrix.de | ||
+ | * | ||
+ | * 25.07.07 horizontal drop-down with ID output -> 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 <li> 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 (..><wrapIn>LinkText</WrapOut>">) | ||
+ | * - TAG: {NAV_HORIZ_DD1:Menu type, Start-ID, Level depth, li id_name,class_name,<em>|</em>} | ||
+ | * - E.g.: {NAV_HORIZ_DD1:H, 2, 3, cat, my_class,<span>|</span>} | ||
+ | * | ||
+ | * 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 = ' <li '. | ||
+ | (($level_id_name) ? 'id="'.$level_id_name.'_0" ' : ''). | ||
+ | 'class="drop home'.$first_lev.$a4. | ||
+ | (($GLOBALS['content']['cat_id'] == 0)?$active:''). | ||
+ | '">'; | ||
+ | $l .= get_level_ahref($start_id, ' class="home"') . '<span>'. html_specialchars($GLOBALS['content']['struct']['0']['acat_name']); | ||
+ | $l .= '</span></a></li>'; | ||
+ | $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 <li> 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 = ''; | ||
+ | } | ||
+ | |||
+ | // ========================== | ||
+ | |||
+ | // -- <D01> ------------------------------------------------------------------- | ||
+ | // 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 = '';} | ||
+ | // -- <D01> ------------------------------------------------------------------- | ||
+ | |||
+ | // Set the active link class | ||
+ | // Aktive Link Classe setzen | ||
+ | ($GLOBALS['content']['cat_id'] == $value['acat_id']) ? $a3 = $active: $a3 = ''; | ||
+ | |||
+ | if($s) { | ||
+ | $g = '<!--[if gte IE 7]><!--></a><!--<![endif]-->'; | ||
+ | $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 = '</a>'; | ||
+ | $class = ' class="sub_no'.$a1.$a3.$first_li.'"'; // act_path auch im letzten activ link | ||
+ | // $class = ' class="sub_no'.$a3.'"'; | ||
+ | // -- <P01> ------------------------------------------------------------------- | ||
+ | // 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 | ||
+ | // -- <P01> ------------------------------------------------------------------- | ||
+ | } | ||
+ | $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) . '<li'. $class . ' id="cat-id_' . $value['acat_id'] . '">'; | ||
+ | if ($level_id_name) | ||
+ | $l = str_repeat(' ', $counter+1) . '<li'. $class . ' id="'.$level_id_name.'_'. $value['acat_id'] . '">'; | ||
+ | else | ||
+ | $l = str_repeat(' ', $counter+1) . '<li'. $class . '>'; | ||
+ | |||
+ | |||
+ | $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 . '</li>'; | ||
+ | |||
+ | $t[] = $l; | ||
+ | |||
+ | $x++; | ||
+ | |||
+ | $first_li = ''; // Reset first_li | ||
+ | |||
+ | } // END foreach | ||
+ | |||
+ | if($counter) { | ||
+ | $A = LF . str_repeat(' ', $counter) . '<!--[if lte IE 6]><table><tr><td><![endif]-->'; | ||
+ | $B = LF . str_repeat(' ', $counter) . '<!--[if lte IE 6]></td></tr></table></a><![endif]-->'; | ||
+ | } else { | ||
+ | $A = ''; | ||
+ | $B = ''; | ||
+ | } | ||
+ | |||
+ | |||
+ | $t = implode(LF, $t); | ||
+ | if($t) { | ||
+ | $t = $A . LF . str_repeat(' ', $counter) . '<ul class="level-'.($counter+1).' '.(($counter)?'':$menu_class).'">' . LF . $t . LF . str_repeat(' ', $counter) . '</ul>'. $B ; | ||
+ | } | ||
+ | |||
+ | /* | ||
+ | // -- <E01> ------------------------------------------------------------------- | ||
+ | // 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] = '<i>$1</i>'; | ||
+ | $search[19] = '/\[u\](.*?)\[\/u\]/is'; $replace[19] = '<u>$1</u>'; | ||
+ | $search[20] = '/\[s\](.*?)\[\/s\]/is'; $replace[20] = '<strike>$1</strike>'; | ||
+ | $search[21] = '/\[b\](.*?)\[\/b\]/is'; $replace[21] = '<strong>$1</strong>'; | ||
+ | $search[22] = '/\[br\]/is'; $replace[22] = '<br>'; | ||
+ | |||
+ | // ========== end copy&paste ======== | ||
+ | |||
+ | |||
+ | |||
+ | $t = preg_replace($search, $replace, $t); | ||
+ | /* | ||
+ | // -- <E01> ------------------------------------------------------------------- | ||
+ | */ | ||
+ | |||
+ | return $t; | ||
+ | } | ||
+ | ?> | ||
+ | </code> | ||
+ | |||
+ | \\ | ||
+ | ==== PHP V1.2c ==== | ||
+ | Update 18.11.2011 KH: | ||
+ | * Der title TAG zu jedem Link kann ausgegeben werden z.B. ''%%<a href="Link..." ...title="Kategoriename">%%''. | ||
+ | * Parameter im Script in CUSTOM VAR: %%"$title = true/false"%% | ||
+ | |||
+ | \\ | ||
+ | |||
+ | |||
+ | <file> | ||
+ | <ul class="level-2 "> | ||
+ | <li class="sub_no sub_first" id="cat_14"><a href="index.php?category04_01" class="horiz_enclose title="Category04_01"><span>Category04_01</span></a></li> | ||
+ | <li class="sub_no" id="cat_15"><a href="index.php?category04_02" title="Category04_02 auch Text"><span>Category04_02<br> auch Text</span></a></li> | ||
+ | <li class="sub_no" id="cat_20"><a href="index.php?category04_03" title="Category04_03><span>Category04_03</span></a></li> | ||
+ | ........ | ||
+ | </file> | ||
+ | |||
+ | |||
+ | |||
+ | **Typischer Aufruf:** | ||
+ | <file><div class="hmenu">{NAV_HORIZ_DD1:,0,4,cat,my_class,<span>|</span> }</div></file> | ||
+ | |||
+ | |||
+ | Dateiname: **rt_nav_horiz_drop_down_v12.php** | ||
+ | |||
+ | Ort: **/template/inc_script/frontend_render/ ** | ||
+ | |||
+ | |||
+ | <code php|h rt_nav_horiz_drop_down_v12.php |h> | ||
+ | <?php | ||
+ | /** | ||
+ | * ************************************************************************** | ||
+ | * V1.2c 18.11.2011 K.heermann http://planmatrix.de | ||
+ | * | ||
+ | * 25.07.07 horizontal drop-down with ID output -> 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 <li> 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 (..><wrapIn>LinkText</WrapOut>">) | ||
+ | * - TAG: {NAV_HORIZ_DD1:Menu type, Start-ID, Level depth, li id_name,class_name,<em>|</em>} | ||
+ | * - E.g.: {NAV_HORIZ_DD1:H, 2, 3, cat, my_class,<span>|</span>} | ||
+ | * | ||
+ | * 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 = ' <li '. | ||
+ | (($level_id_name) ? 'id="'.$level_id_name.'_0" ' : ''). | ||
+ | 'class="drop home'.$first_lev.$a4. | ||
+ | (($GLOBALS['content']['cat_id'] == 0)?$active:''). | ||
+ | '">'; | ||
+ | if (!$title) | ||
+ | $l .= get_level_ahref($start_id, ' class="home"') . '<span>'. 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']).'"') . '<span>'. html_specialchars($GLOBALS['content']['struct']['0']['acat_name']); | ||
+ | |||
+ | $l .= '</span></a></li>'; | ||
+ | $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 <li> 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 = ''; | ||
+ | } | ||
+ | |||
+ | // ========================== | ||
+ | |||
+ | // -- <D01> ------------------------------------------------------------------- | ||
+ | // 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 = '';} | ||
+ | // -- <D01> ------------------------------------------------------------------- | ||
+ | |||
+ | // Set the active link class | ||
+ | // Aktive Link Classe setzen | ||
+ | ($GLOBALS['content']['cat_id'] == $value['acat_id']) ? $a3 = $active: $a3 = ''; | ||
+ | |||
+ | if($s) { | ||
+ | $g = '<!--[if gte IE 7]><!--></a><!--<![endif]-->'; | ||
+ | $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 = '</a>'; | ||
+ | $class = ' class="sub_no'.$a1.$a3.$first_li.'"'; // act_path auch im letzten activ link | ||
+ | // $class = ' class="sub_no'.$a3.'"'; | ||
+ | // -- <P01> ------------------------------------------------------------------- | ||
+ | // 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 | ||
+ | // -- <P01> ------------------------------------------------------------------- | ||
+ | } | ||
+ | $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) . '<li'. $class . ' id="cat-id_' . $value['acat_id'] . '">'; | ||
+ | if ($level_id_name) | ||
+ | $l = str_repeat(' ', $counter+1) . '<li'. $class . ' id="'.$level_id_name.'_'. $value['acat_id'] . '">'; | ||
+ | else | ||
+ | $l = str_repeat(' ', $counter+1) . '<li'. $class . '>'; | ||
+ | |||
+ | if (!$title) | ||
+ | $l .= get_level_ahref($value['acat_id'], $enclose) . $wrap_link_text[0]. html_specialchars($value['acat_name']).$wrap_link_text[1]; | ||
+ | else | ||
+ | $l .= get_level_ahref($value['acat_id'], $enclose.' title="'.html_specialchars($value['acat_name']).'"') . $wrap_link_text[0]. html_specialchars($value['acat_name']).$wrap_link_text[1]; | ||
+ | |||
+ | $l .= $g; | ||
+ | |||
+ | |||
+ | $l .= $close_li . '</li>'; | ||
+ | |||
+ | $t[] = $l; | ||
+ | |||
+ | $x++; | ||
+ | |||
+ | $first_li = ''; // Reset first_li | ||
+ | |||
+ | } // END foreach | ||
+ | |||
+ | if($counter) { | ||
+ | $A = LF . str_repeat(' ', $counter) . '<!--[if lte IE 6]><table><tr><td><![endif]-->'; | ||
+ | $B = LF . str_repeat(' ', $counter) . '<!--[if lte IE 6]></td></tr></table></a><![endif]-->'; | ||
+ | } else { | ||
+ | $A = ''; | ||
+ | $B = ''; | ||
+ | } | ||
+ | |||
+ | |||
+ | $t = implode(LF, $t); | ||
+ | if($t) { | ||
+ | $t = $A . LF . str_repeat(' ', $counter) . '<ul class="level-'.($counter+1).' '.(($counter)?'':$menu_class).'">' . LF . $t . LF . str_repeat(' ', $counter) . '</ul>'. $B ; | ||
+ | } | ||
+ | |||
+ | /* | ||
+ | // -- <E01> ------------------------------------------------------------------- | ||
+ | // 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 =========== | ||
+ | */ | ||
+ | |||
+ | if ($title) { // Only if title is set | ||
+ | |||
+ | $search[18] = '/title="(.*?)\[i\](.*?)\[\/i\](.*?)"/is'; $replace[18] = 'title="$1$2$3"'; | ||
+ | $search[19] = '/title="(.*?)\[u\](.*?)\[\/u\](.*?)"/is'; $replace[19] = 'title="$1$2$3"'; | ||
+ | $search[20] = '/title="(.*?)\[s\](.*?)\[\/s\](.*?)"/is'; $replace[20] = 'title="$1$2$3"'; | ||
+ | $search[21] = '/title="(.*?)\[b\](.*?)\[\/b\](.*?)"/is'; $replace[21] = 'title="$1$2$3"'; | ||
+ | $search[22] = '/title="(.*?)\[br\](.*?)"/is'; $replace[22] = 'title="$1$2"'; | ||
+ | |||
+ | $t = preg_replace($search, $replace, $t); | ||
+ | } | ||
+ | |||
+ | |||
+ | // typical html formattings | ||
+ | $search[18] = '/\[i\](.*?)\[\/i\]/is'; $replace[18] = '<i>$1</i>'; | ||
+ | $search[19] = '/\[u\](.*?)\[\/u\]/is'; $replace[19] = '<u>$1</u>'; | ||
+ | $search[20] = '/\[s\](.*?)\[\/s\]/is'; $replace[20] = '<strike>$1</strike>'; | ||
+ | $search[21] = '/\[b\](.*?)\[\/b\]/is'; $replace[21] = '<strong>$1</strong>'; | ||
+ | $search[22] = '/\[br\]/is'; $replace[22] = '<br>'; | ||
+ | |||
+ | // ========== end copy&paste ======== | ||
+ | |||
+ | |||
+ | $t = preg_replace($search, $replace, $t); | ||
+ | /* | ||
+ | // -- <E01> ------------------------------------------------------------------- | ||
+ | */ | ||
+ | |||
+ | return $t; | ||
+ | } | ||
+ | ?> | ||
+ | </code> | ||
+ | |||
+ | \\ |