This is an old revision of the document!


NAV_ROWX

RT NAV_ROW ausgelager nach /frontend_render/* und erweitert um das “title” Atribut mit dem Inhalt aus “Seitentitel:” zu erzeugen.


rt_word_text_title V1.0 05.01.11

Docu: Replacement Tags für die Navigation
Forum: Wiederkehrenden Begriff durch Variable ersetzen

Autor: O.Georgi http://phpwcms.de → Erweitert: K.Heermann (flip-flop) http://planmatrix.de
CMS Version: >= 1.3
Version: V1.0

<div class=“nav-row-vert01”>{NAV_ROWX:CURRENT:1}</div>

Tag: {NAV_ROWX:…} (Parameter wie in Replacement Tags für die Navigation beschrieben)

Dateiname: rt_nav_row_x.php

Verzeichnis: template/inc_script/frontend_render/

Bedingung:/config/phpwcms/conf.inc.php

  • $phpwcms['allow_ext_render'] = 1;


rt_nav_row_x

<?php
 
/**
*********************************************************************************************
* 05.01.11 KH: http://planmatrix.de V1.0
* NAV_ROW small enhanced for alt and title text
* Cat out and enhanced navigation NAV_ROW from "include"inc_front"front.func.inc.php
* line 644 function nav_level_row(.....
*
*********************************************************************************************
*/
// -------------------------------------------------------------------------------------------
// obligate check for phpwcms constants
   if (!defined('PHPWCMS_ROOT')) {die("You Cannot Access This Script Directly, Have a Nice Day."); }
// -------------------------------------------------------------------------------------------
 
// -------------------------------------------------------------
 
// Simple row based navigation
if(strpos($content["all"],'{NAV_ROWX') !== false) {
    $content["all"] = str_replace('{NAV_ROWX}', nav_level_row_x(0), $content["all"]);
    $content["all"] = preg_replace('/\{NAV_ROWX:(\w+|\d+):(0|1)\}/e',"nav_level_row_x('$1',$2);",$content["all"]);
}
 
// -------------------------------------------------------------
 
function nav_level_row_x($show_id, $show_home=1) {
    //returns a simple row based navigation
 
    if(strtoupper($show_id) == 'CURRENT') {
        $act_cat_id = $GLOBALS['content']["cat_id"];
    } else {
        $act_cat_id = intval($show_id);
    }
 
    $nav = '';
 
    if($show_home && $GLOBALS['content']['struct'][$act_cat_id]['acat_hidden'] != 1) {
        if($GLOBALS['content']["cat_id"] == $act_cat_id) {
            $before = $GLOBALS['template_default']["nav_row"]["link_before_active"];
            $after  = $GLOBALS['template_default']["nav_row"]["link_after_active"];
            $direct_before    = $GLOBALS['template_default']["nav_row"]["link_direct_before_active"];
            $direct_after    = $GLOBALS['template_default']["nav_row"]["link_direct_after_active"];
        } else {
            $before = $GLOBALS['template_default']["nav_row"]["link_before"];
            $after  = $GLOBALS['template_default']["nav_row"]["link_after"];
            $direct_before    = $GLOBALS['template_default']["nav_row"]["link_direct_before"];
            $direct_after    = $GLOBALS['template_default']["nav_row"]["link_direct_after"];
        }
        $nav .= $before;
        $nav .= '<a href="index.php?';
        $nav .= ($GLOBALS['content']['struct'][$act_cat_id]['acat_alias']) ? html_specialchars($GLOBALS['content']['struct'][$act_cat_id]['acat_alias']) : 'id='.$act_cat_id; //',0,0,1,0,0';
        // +KH 05.01.11 title
        $nav .= '"'.(empty($GLOBALS['content']['struct'][$act_cat_id]['acat_pagetitle']) ? '' : ' title="'.$GLOBALS['content']['struct'][$act_cat_id]['acat_pagetitle'].'"');
 
        $nav .= (empty($GLOBALS['content']['struct'][$act_cat_id]["acat_class"]) ? '' : ' class="'.$GLOBALS['content']['struct'][$act_cat_id]["acat_class"].'"').'>'.$direct_before;
        $nav .= html_specialchars($GLOBALS['content']['struct'][$act_cat_id]['acat_name']);
        $nav .= $direct_after.'</a>'.$after;
    }
 
    // check against breadcrumb - active site tree
    if($GLOBALS['content']['struct'][$GLOBALS['content']["cat_id"]]['acat_struct'] != 0) {
        $breadcrumb = get_breadcrumb($GLOBALS['content']["cat_id"], $GLOBALS['content']['struct']);
    }
 
    foreach($GLOBALS['content']['struct'] as $key => $value) {
 
        if($key != $act_cat_id && _getStructureLevelDisplayStatus($key, $act_cat_id) ) {
 
            $class = empty($GLOBALS['content']['struct'][$key]["acat_class"]) ? '' : ' class="'.$GLOBALS['content']['struct'][$key]["acat_class"].'"';
 
            if($nav) {
                $nav .= $GLOBALS['template_default']["nav_row"]["between"];
            }
 
            if($GLOBALS['content']["cat_id"] == $key || isset($breadcrumb[$key])) {
                $before = $GLOBALS['template_default']["nav_row"]["link_before_active"];
                $after  = $GLOBALS['template_default']["nav_row"]["link_after_active"];
                $direct_before    = $GLOBALS['template_default']["nav_row"]["link_direct_before_active"];
                $direct_after    = $GLOBALS['template_default']["nav_row"]["link_direct_after_active"];
            } else {
                $before = $GLOBALS['template_default']["nav_row"]["link_before"];
                $after  = $GLOBALS['template_default']["nav_row"]["link_after"];
                $direct_before    = $GLOBALS['template_default']["nav_row"]["link_direct_before"];
                $direct_after    = $GLOBALS['template_default']["nav_row"]["link_direct_after"];
            }
 
            $nav .= $before;
 
            if(!$GLOBALS['content']['struct'][$key]["acat_redirect"]) {
                $nav .= '<a href="index.php?';
                if($GLOBALS['content']['struct'][$key]["acat_alias"]) {
                    $nav .= html_specialchars($GLOBALS['content']['struct'][$key]["acat_alias"]);
                } else {
                    $nav .= 'id='.$key; //',0,0,1,0,0';
                }
                $nav .= '"'.$class.'>';
            } else {
                $redirect = get_redirect_link($GLOBALS['content']['struct'][$key]["acat_redirect"], ' ', '');
                $nav .= '<a href="'.$redirect['link'].'"'.$redirect['target'].$class.'>';
            }
            $nav .= $direct_before;
            $nav .= html_specialchars($GLOBALS['content']['struct'][$key]['acat_name']);;
            $nav .= $direct_after.'</a>'.$after;
        }
    }
    if($nav) {
        $nav  = $GLOBALS['template_default']["nav_row"]["before"].$nav;
        $nav .= $GLOBALS['template_default']["nav_row"]["after"];
    }
 
 
    // -- <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)
 
    // 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>';
 
    $nav = preg_replace($search, $replace, $nav);
 
    // -- <E01> -------------------------------------------------------------------
 
 
    return $nav;
}
 
?>


deutsch/navigationen/nav-rowx.1294226229.txt.gz · Last modified: 2018/06/03 18:07 (external edit)
www.planmatrix.de www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0