コード例 #1
0
ファイル: PFTreeList.php プロジェクト: quantrocket/planlogiq
 private function processChildren($writer)
 {
     if ($this->getNodeType() == PFTreeList::NODE_TYPE_INTERNAL_LINK) {
         $title = new InternalHyperLink();
         $title->setToPage($this->getToPage());
         $title->setGetVariables($this->getGetVariables());
         $title->setAnchor($this->getAnchor());
         $title->Attributes->OnClick = "toggleSub('" . $this->getID() . "')";
     } elseif ($this->getNodeType() == PFTreeList::NODE_TYPE_INTERNAL_ACTIVE_LINK) {
         $title = new InternalHyperLink();
         $title->setToPage($this->getToPage());
         $title->setGetVariables($this->getGetVariables());
         $title->setAnchor($this->getAnchor());
         $title->Attributes->OnClick = "toggleSub('" . $this->getID() . "')";
     } elseif ($this->getNodeType() == PFTreeList::NODE_TYPE_LINK) {
         $title = new THyperLink();
         $title->setNavigateUrl($this->getToPage());
         $title->Attributes->OnClick = "toggleSub('" . $this->getID() . "')";
     } else {
         $title = new TLabel();
     }
     $title->setCssClass($this->getTitleClass());
     $title->setText($this->getTitle());
     $i = 0;
     foreach ($this->subTree as $c) {
         if (!$c instanceof TWebControl) {
             continue;
         }
         $i++;
         break;
     }
     if ($i == 0) {
         $class = "leaf";
         $fct = "";
     } else {
         $class = $this->getDeploy() ? "node" : "nodeDeployed";
         $fct = $this->getCanDeploy() ? "onClick='toggleSub(\"" . $this->getID() . "\")'" : "";
     }
     $writer->write("<li class='{$class}' {$fct} id='" . $this->getID() . PFTreeList::SUB_ID_LI . "'>");
     $title->render($writer);
     $writer->write("</li>");
     $cssclass = $this->getCssClass() ? " class='" . $this->getCssClass() . "'" : "";
     $style = $this->getDeploy() ? "block" : "none";
     if ($i > 0) {
         $writer->write("<li style='list-style: none outside; padding-left:0px; margin-left:0px; min-height: 0px;' id='" . $this->getID() . PFTreeList::SUB_ID_UL . "'><ul {$cssclass} style='display: {$style}'>\n");
     }
     $order = 0;
     foreach ($this->subTree as $c) {
         if (!$c instanceof TWebControl) {
             continue;
         }
         if ($c instanceof PFTreeList) {
             $c->Parent = $this;
             $c->setOrder($order++);
             $c->setCssClass($this->getCssClass());
             $c->render($writer);
         } else {
             $cssclass = $this->getCssClass() ? " class='" . $this->getCssClass() . "'" : "";
             $writer->write("<ul {$cssclass}><li class='leaf'>");
             $c->getPage()->addParsedObject($c);
             $c->render($writer);
             $writer->write("</li></ul>\n");
         }
     }
     if ($i > 0) {
         $writer->write("</ul></li>\n");
     }
 }