Example #1
0
 $list = array();
 $highlight = 0;
 $count = 0;
 if (empty($_GET['close'])) {
     foreach (C::t('home_docomment')->fetch_all_by_doid($doid) as $value) {
         $tree->setNode($value['id'], $value['upid'], $value);
         $count++;
         if ($value['authorid'] == $space['uid']) {
             $highlight = $value['id'];
         }
     }
 }
 if ($count) {
     $values = $tree->getChilds();
     foreach ($values as $key => $vid) {
         $one = $tree->getValue($vid);
         $one['layer'] = $tree->getLayer($vid) * 2;
         $one['style'] = "padding-left:{$one['layer']}em;";
         if ($one['layer'] > 0) {
             if ($one['layer'] % 3 == 2) {
                 $one['class'] = ' dtls';
             } else {
                 $one['class'] = ' dtll';
             }
         }
         if ($one['id'] == $highlight && $one['uid'] == $space['uid']) {
             $one['style'] .= 'color:#F60;';
         }
         $list[] = $one;
     }
 }