Code: Alles auswählen
Titel:
Strukturnavigation
LASTMODIFY: 15.April 2003
Beschreibung:
Listet von einem bestimmten Startpunkt aus alle darunter befindlichen und
aktivierten Strukturpunkte auf.
Sven cms@elbecomputer.net
Ist aus dem Code von sven777b entstanden
Hinweis:
Wenn man mehrmals den Code ändert so muss man die wieder reinschreiben
da beim abspeichern diese in Leerzeichen umgewandelt werden.
Resultat ist das man dann keine farbigen Balken mehr am Rand sieht :(( .
Zeile 131, 135, 139
#######################################################################################
INPUT:
require_once ($ContenidoPath ."inc/fnc_mip_forms.inc.php");
$mip_form['0']['cat'] = 'txt';
$mip_form['0']['type'] = '';
$mip_form['0']['desc'] = 'StartPoint';
$mip_form['0']['cms_var'] = 'CMS_VAR[1]';
$mip_form['0']['cms_val'] = 'CMS_VALUE[1]';
$mip_form['0']['cms_val_default'] = '3';
$mip_form['0']['tab'] = '0';
$mip_form['1']['desc'] = "Schriftart";
$mip_form['1']['cat'] = 'app_css';
$mip_form['1']['output_cat'] = 'option';
$mip_form['1']['cms_var'] = "CMS_VAR[2]";
$mip_form['1']['cms_val'] = "CMS_VALUE[2]";
$mip_form['1']['file'] = "";
$mip_form['1']['flag'] = "id_only";
$mip_form['2']['cat'] = 'txt';
$mip_form['2']['type'] = '';
$mip_form['2']['desc'] = NavColOut;
$mip_form['2']['cms_var'] = 'CMS_VAR[3]';
$mip_form['2']['cms_val'] = 'CMS_VALUE[3]';
$mip_form['2']['cms_val_default'] = '#FFFFFF';
$mip_form['2']['tab'] = '0';
$mip_form['3']['cat'] = 'txt';
$mip_form['3']['type'] = '';
$mip_form['3']['desc'] = 'NavColOver';
$mip_form['3']['cms_var'] = 'CMS_VAR[4]';
$mip_form['3']['cms_val'] = 'CMS_VALUE[4]';
$mip_form['3']['cms_val_default'] = '#999999';
$mip_form['3']['tab'] = '0';
$mip_form['4']['cat'] = 'txt';
$mip_form['4']['type'] = '';
$mip_form['4']['desc'] = 'NavColBack';
$mip_form['4']['cms_var'] = 'CMS_VAR[5]';
$mip_form['4']['cms_val'] = 'CMS_VALUE[5]';
$mip_form['4']['cms_val_default'] = '#FFFFFF';
$mip_form['4']['tab'] = '0';
$mip_form['5']['cat'] = 'txt';
$mip_form['5']['type'] = '';
$mip_form['5']['desc'] = 'NavColOn';
$mip_form['5']['cms_var'] = 'CMS_VAR[6]';
$mip_form['5']['cms_val'] = 'CMS_VALUE[6]';
$mip_form['5']['cms_val_default'] = '#FF0000';
$mip_form['5']['tab'] = '0';
$mip_form['6']['cat'] = 'txt';
$mip_form['6']['type'] = '';
$mip_form['6']['desc'] = 'NavColOff';
$mip_form['6']['cms_var'] = 'CMS_VAR[7]';
$mip_form['6']['cms_val'] = 'CMS_VALUE[7]';
$mip_form['6']['cms_val_default'] = '#000000';
$mip_form['6']['tab'] = '0';
mip_formsp($mip_form['0']);
mip_formsp($mip_form['1']);
mip_formsp($mip_form['2']);
mip_formsp($mip_form['3']);
mip_formsp($mip_form['4']);
mip_formsp($mip_form['5']);
mip_formsp($mip_form['6']);
unset($mip_form);
#######################################################################################
OUTPUT:
// offenen Pfad finden //
$nav_path = array();
$nav_tree = array();
$tmp_idcat = $idcat;
while($tmp_idcat > 0){
array_push($nav_path, $tmp_idcat);
$tmp_idcat = $con_tree[$tmp_idcat][parent];
};
$nav_path = array_reverse($nav_path);
if($nav_path[0] != CMS_VALUE[1]){$nav_path = array(CMS_VALUE[1]);};
// Baum sortieren //
for($i = 0;$i < sizeof($nav_path);$i++){
$tmp_found=0;
for($nr = 0; $nr <= $con_tree_max; $nr++){
if($con_tree[$nr][parent] == $nav_path[$i] && $con_tree[$nr][preid] == '0'){$tmp_found=1;break;}
}
unset($tmp_level);$tmp_level = array();
do{
array_push($tmp_level , $nr);
$nr = $con_tree[$nr][postid];
} while($nr != '0' && $tmp_found==1);
if($i == 0){$nav_tree = $tmp_level;}
else {
$x = array_search("$nav_path[$i]", $nav_tree);
array_splice($nav_tree, $x+1, 0, $tmp_level);
};
};
// Baum ausgeben //
echo "<table width=60% cellspacing=\"5\" cellpadding=\"0\" border=\"0\">\n";
foreach($nav_tree as $nr){
if(($con_tree[$nr][public] == '1' or $auth->auth["uid"] != "") and $con_tree[$nr][visible] == '1'){
echo "<tr height=\"15\">\n";
echo "<td onMouseOver=\"this.style['background']='CMS_VALUE[4]';\" ";
echo "onMouseOut=\"this.style['background']='CMS_VALUE[3]';\" bgcolor=\"CMS_VALUE[3]\" nowrap>\n";
unset($mod_space);
$mod_space = array();
$mod_space = array_pad($mod_space,($con_tree[$nr][level] - 1)," ");
echo "<span style='background-color:CMS_VALUE[5]'>".implode("",$mod_space)."</span>";
if($nr == $idcat)
{
echo "<span style='background-color:CMS_VALUE[6]'> </span>";
}
else
{
echo "<span style='background-color:CMS_VALUE[7]'> </span>";
};
echo "<a href=\"".$con_tree[$nr][link]."\" id=\"CMS_VALUE[2]\" onmouseover=\"on('".$con_tree[$nr][titel]."');return true;\" onmouseout=\"off(); return true;\"> ".$con_tree[$nr][titel]."</a></td></tr>";
};
};
echo "</table>";
unset($nav_tree);
unset($nav_path);
cu
Sven