Zwar hab ich keine Heldentat vollbracht, aber dachte mir die Anfänger können es gebrauchen (ich erinnere mich an meine Anfänge).
Das Modul Navigationspfad (Navipath) habe ich dahingehend geändert, dass Mehrsprachig ist und die letzte Ausgabe mit CSS formatiert wird. Wenn das Modul angelegt wird ist stets die Übersetzung zu machen. Ein Beispiel für die CSS formatierung liegt ebenfalls nachstehend bei.
Modul Output
Code: Alles auswählen
<?php
/***********************************************
* CONTENIDO MODUL - OUTPUT
*
* Modulname : Navigationpath
* Author(s) : Andreas Lindner
* Copyright : Contenido - four for business, Andreas Lindner
* Created : 05-08-2005
* Modified : 02-08-2008, Supporter
* Supports multilanguage, getting path
* from root and formating last output with css
************************************************/
#Settings
$separator = '>';
$max_length = 64;
#Get path to root
$dummy = conCreateLocationString($idcat, ' '.$separator.' ', $retval, true, "navipath", 0);
$multidesc = mi18n("Sie sind hier:");
if ($retval=='') {
$retval=' ';
} else {
$pattern = "'>.*?<'";
preg_match_all($pattern, $retval, $matches);
$matches = $matches[0];
#Get effective text length
$length = 0;
foreach ($matches as $value) {
$length += strlen($value) - 2;
}
#Get shorten factor
if ($length > $max_length * 4) {
$shorten = 5;
}
elseif ($length > $max_length * 3) {
$shorten = 4;
}
elseif ($length > $max_length * 2) {
$shorten = 3;
}
elseif ($length > $max_length) {
$shorten = 2;
} else {
$shorten = 1;
}
#Shorten items
if ($length > $max_length) {
foreach ($matches as $value) {
if (strpos($value, $separator) === FALSE) {
$text = substr($value, 1, strlen($value) - 2);
$len = strlen($text);
if (strpos($text, ' ') === FALSE) {
$text_new = $text;
} else {
$text_new = capiStrTrimAfterWord($text, intval($len / $shorten));
}
if (strlen($text) != strlen($text_new)) {
$text_new .= '...';
}
$text_new = '>'.$text_new.'<';
$retval = str_replace('>'.$text.'<', $text_new, $retval);
}
}
}
$retval = str_replace('"/index.html"', '"Home/index.html"', $retval);
$setcss = explode('<a ', $retval);
$setcss[count($setcss)-1] = 'class="last" '.$setcss[count($setcss)-1];
$retval = implode('<a ', $setcss);
}
echo "<p class=\"path\">$multidesc $retval </p>";
?>
Code: Alles auswählen
#Get path to root
$dummy = conCreateLocationString($idcat, ' '.$separator.' ', $retval, true, "navipath", 0);
Code: Alles auswählen
#Get path to root
$dummy = conCreateLocationString($idcat, ' '.$separator.' ', $retval, true, "navipath", 1);
Hier der Style
Code: Alles auswählen
.path { font-size:0.8em; line-height:32px; margin:16px 0 0 0; }
.path .last { font-weight:bold; }