|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2000-07-04 15:58 UTC] stas at cvs dot php dot net
[2000-08-01 23:01 UTC] waldschrott@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 11 07:00:02 2026 UTC |
<?php class Menu { function printfield($Active, $Level, $Value, $Link) { [...] } function printchilds($Parents, $Active=0, $Level=0, $Parent=0) { $name=$this->that_class; $q = new $name; $q->query('select ID,Expand,Value,Link from ' . $this->table . ' where GID=' . $Parent . ' and En=1 order by Sort'); while($q->next_record()) { $ID=$q->f(0); $Expand=intval($q->f(1)); $Value=htmlentities($q->f(2)); $Link=$q->f(3); $this->printfield($Active==$ID, $Level, $Value, $Link); if (!$Expand) { if ($ID==$Active) $Expand=true; else for ($i=0;isset($Parents[$i]);++$i) $Expand=$Expand || ($Parents[$i]==$ID); } if ($Expand) $this->printchilds($Parents, $Active, $Level+1, $ID); # Recoursive call } } } ?> $Parent variable assumes other variables values instead $ID value