Unterlagen 5. semester

Aus Biostudies
Zur Navigation springen Zur Suche springen

<?php


class CSSTree {

  var $tree;
  var $ul;
  
 function drawTree($tree, $depth=0) { 

$result = "\n".str_repeat(' ', $depth*2)."

    \n"; list($last, $li) = array(count($tree)-1, 0); foreach (array_keys($tree) as $node) { $branch =& $tree[$node]; $class = ($li++ == $last) ? ' class="lc"' : NULL; if (is_array($branch['node'])) { $result .= str_repeat(' ', $depth*2+2).'<li'.$class.'>'. '<a href="'.$branch['href'].'" title="'.$branch['title'].'">'.$branch['title']. ' '.$branch['date'].'</a>'. $this->drawTree($branch['node'], $depth+1). str_repeat(' ', $depth*2+2)."\n"; } else { $result .= str_repeat(' ', $depth*2+2).'<li'.$class.'>'. '<a href="'.$branch['href'].'" title="'.$branch['title'].'">'. $branch['title'].' '.$branch['date'].'</a>'. "\n"; } } return $result.str_repeat(' ', $depth*2)."

\n";

 }
    
 function showTree($id = NULL) {
   $this->ul = $this->drawTree($this->tree);

if ($id != NULL) $this->ul = substr_replace($this->ul, '

    ', 0, 5); print($this->ul); } } $ct = new CSSTree; $ct->tree = array(array('title'=>'Foo', 'date'=>'06.09.2005', 'href'=>'#', 'node' => array(array('title'=>'Foo', 'date'=>'06.09.2005', 'href'=>'#'), array('title'=>'Foo', 'date'=>'06.09.2005', 'href'=>'#'), array('title'=>'Foo', 'date'=>'06.09.2005', 'href'=>'#'))), array('title'=>'Foo', 'date'=>'06.09.2005', 'href'=>'#', 'node' => array(array('title'=>'Foo', 'date'=>'06.09.2005', 'href'=>'#'), array('title'=>'Foo', 'date'=>'06.09.2005', 'href'=>'#'), array('title'=>'Foo', 'date'=>'06.09.2005', 'href'=>'#', 'node' => array(array('title'=>'Foo', 'date'=>'06.09.2005', 'href'=>'#'), array('title'=>'Foo', 'date'=>'06.09.2005', 'href'=>'#'), array('title'=>'Foo', 'date'=>'06.09.2005', 'href'=>'#'))))), array('title'=>'Foo', 'date'=>'06.09.2005', 'href'=>'#')); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> CSS-Baumstruktur
    showTree('filelist')?>
    Meeresbiologie Tierphysiologie Zellbiologie Entwicklungsbiologie der Tiere (jetzt bräuchten wir nur noch ne Altklausur für die Entwicklungsbio der Pflanzen. Wer was hat - unbedingt her damit!) Recht und Ethik (mille grazie Ruperto) Sofern Ihr irgendwelche Altklausuren habt (für dieses Semester vorzugsweise noch Zellbiologie, Entwicklungsbiologie der Pflanzen, Entwicklungsbiologie der Tiere oder Recht und Ethik), wäre ich Euch dankbar, wenn Ihr mir diese zukommen lassen könntet ... Danke Daniel