{{indexmenu_n>300}} ====== WRAP_NAV_LIST_UL ====== **{WRAP_NAV_LIST_UL:...:level, class}** Das Gleiche wie [[deutsch/navigationen/nav_list_ul|{NAV_LIST_UL: ...]] jedoch mit einem **umschließenden div container** und **eingebautem Level-Lift**. \\ Bei einer leeren oder nicht sichbaren Navigation wird keine Ausgabe generiert (and no div wrapper :!:). Z.B.: {WRAP_NAV_LIST_UL:F, 4,10, act_path, active : 0, my_class} -> output beginning at start ID 4 wrapped with my_class {WRAP_NAV_LIST_UL:F, ,10, act_path, active : 2, my_class} -> output beginning at level 2 wrapped with my_class {WRAP_NAV_LIST_UL:F, 4,10, act_path, active : 0 } -> output beginning at start ID 4 (no level lift) {WRAP_NAV_LIST_UL:F, 4,10, act_path, active } -> the same as above (no level lift) {WRAP_NAV_LIST_UL:F, ,10, act_path, active : 2 } -> output beginning at level 2 (no wrapper class set) **Docu:** -- \\ **Forum:** [[http://forum.phpwcms.org/viewtopic.php?p=111157#p111157]] **Autor:** K.Heermann (flip-flop) http://planmatrix.de \\ **CMS-Version:** >= V1.3.0 \\ **Version:** V1.0 //2008/11/08// \\ **Dateiname:** rt_wrap_nav_list_ul.php **Verzeichnis:** /template/inc_script/frontend_render/ **Bedingung:** -> [[http://www.phpwcms-docu.de/confincphp_de.phtml|/config/phpwcms/conf.inc.php]] \\ * ##$phpwcms['allow_ext_render'] = 1;## \\ output beginning at start ID 4 wrapped with my_class {WRAP_NAV_LIST_UL:F, ,10, act_path, active : 2, my_class} -> output beginning at level 2 wrapped with my_class {WRAP_NAV_LIST_UL:F, 4,10, act_path, active : 0 } -> output beginning at start ID 4 (no level lift) {WRAP_NAV_LIST_UL:F, 4,10, act_path, active } -> the same as above (no level lift) {WRAP_NAV_LIST_UL:F, ,10, act_path, active : 2 } -> output beginning at level 2 (no wrapper class) Direct call NAV_LIST_UL -> function buildCascadingMenu No default class: wrap_nlu_navi1 ?????? File name: /template/inc_script/frontend_render/rt_wrap_nav_list_ul.php Forum: http://forum.phpwcms.org/viewtopic.php?p=111157#p111157 Basic navigation: (c) Oliver Georgi, written for phpwcms Enhanced by (c) 08.11.08 Knut Heermann (flip-flop) http://planmatrix.de ===================================================================== */ // ------------------------------------------------------------------ // obligate check for phpwcms constants if (!defined('PHPWCMS_ROOT')) { die("You Cannot Access This Script Directly, Have a Nice Day."); } // ------------------------------------------------------------------ if( strpos($content['all'], '{WRAP_NAV_LIST_UL:') !== FALSE ) { function func_wrap_nav_list_ul($my_param) { // $my_class = 'wrap_nlu_navi1'; // default fallback class $my_class = ''; // no default fallback class $div_before = '
nav_list_ul parameter array if (!empty($my_arr[1])) // ===== custom parameter are filled up? { $my_arr[1] = explode(",",$my_arr[1]); // cut out level and class // $my_arr[1][0] => level // $my_arr[1][1] => class // ===== level-lift parameter given? if (!empty($my_arr[1][0]) and ($my_arr[1][0] > 0 ) ) // level { $my_level_lift = true; // Yes level-lift ist active // ===== level lift: is this the right level? if ( isset($GLOBALS['LEVEL_ID'][$my_arr[1][0]]) ) { // fill up the level $my_level_id = $GLOBALS['LEVEL_ID'][$my_arr[1][0]]; // inject level lift ID into parameter string (No 2)) $my_arr[0][1] = $my_level_id; } else unset ($my_level_id); // It is not the right level } // ===== custom class name given? if (!empty($my_arr[1][1])) // custom class name { $my_class = $my_arr[1][1]; // custom class name = yes -> set it up } // kh else {$my_class = 'wrap_nlu_navi1'; } // custom class name = no -> default name } // =====END custom parameter are filled up? // kh else {$my_class = 'wrap_nlu_navi1'; } // set to default ???? // ===== set the parameter string for NAV_LIST_UL $my_nlu_set = implode (",",$my_arr[0]); // ======= set the wrapper code if (empty($my_class)) // is there any class name set?? { $div_before = ''; // No class name set $div_behind = ''; } else $div_before .= '="'.$my_class.'">'; // Set your class // ======= catching the navigation $string = ''; // Direct call NAV_LIST_UL -> same as NAV_LIST_UL $string = trim(buildCascadingMenu($my_nlu_set)); // ======= Output: Set the wrapper around and have a look to the level id if ($string ) // is there any navi? { $my_replace = $div_before.LF.' '.$string.LF.$div_behind; if ( $my_level_lift and !isset($my_level_id) ) // level-lift is set but we are not in the right level { $my_replace = ''; } } else { $my_replace = ''; } // no navi found // ---------------------------------------------------------------- // Parsing simple Tags in link name like [i] [u] [s] [b] [br] ..... // If you need it, please uncomment the next line // $my_replace = local_html_parser($my_replace); // ---------------------------------------------------------------- return $my_replace; } function local_html_parser($t) { // --------------------------------------------------------------------------- // Parse the $t and replace all possible values like you see in // function html_parser (front.func.inc.php) // $t = html_parser($t); // EDIT: 07/11/25 KH. (flip-flop) including simple Tags 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'; // added simple [br] ->
$search[25] = '/\[br\]/i'; $replace[25] = '
'; // ========== end copy&paste ======== $t = preg_replace($search, $replace, $t); return $t; // --------------------------------------------------------------------------- } // And do it ================================================================== $content["all"] = preg_replace('/{WRAP_NAV_LIST_UL:(.*?)}/e', 'func_wrap_nav_list_ul("$1")', $content["all"]); // ============================================================================ } ?>