/** * Creates child control * Override parent implementation to create a container which will contain all * child controls. This container will be a TActivePanel, in order to allow user * to update its content on callback. */ public function createChildControls() { if ($this->_container === null) { $this->_container = Prado::CreateComponent('System.Web.UI.ActiveControls.TActivePanel'); $this->_container->setId($this->getId(false) . '_content'); parent::getControls()->add($this->_container); } }
private function processChildren($writer) { if ($this->getNodeType() == MyTreeList::NODE_TYPE_INTERNAL_LINK) { $panel = new TPanel(); $this->title = new InternalHyperLink(); $this->title->setToPage($this->getToPage()); $this->title->setGetVariables($this->getGetVariables()); $this->title->setAnchor($this->getAnchor()); $this->title->Attributes->OnClick = "toggleSub('" . $this->getID() . "')"; $this->title->setID($this->getID()); $panel->getControls()->add($this->title); $this->addContextMenu($this->getClientID()); } elseif ($this->getNodeType() == MyTreeList::NODE_TYPE_INTERNAL_ACTIVE_LINK) { $panel = new TPanel(); $this->title = new InternalHyperLink(); $this->title->setToPage($this->getToPage()); $this->title->setGetVariables($this->getGetVariables()); $this->title->setAnchor($this->getAnchor()); $this->title->Attributes->OnClick = "toggleSub('" . $this->getID() . "')"; $this->title->setID($this->getID()); $panel->getControls()->add($this->title); //$this->addContextMenu($this->getClientID()); } elseif ($this->getNodeType() == MyTreeList::NODE_TYPE_LINK) { $this->title = new THyperLink(); $this->title->setNavigateUrl($this->getToPage()); $this->title->Attributes->OnClick = "toggleSub('" . $this->getID() . "')"; $this->title->setID($this->getID()); } else { $this->title = new TLabel(); } $this->title->setCssClass($this->getTitleClass()); $this->title->setText($this->getTitle()); $panel = new TPanel(); $panel->getControls()->add($this->title); $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() . MyTreeList::SUB_ID_LI . "'>"); $this->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() . MyTreeList::SUB_ID_UL . "'><ul {$cssclass} style='display: {$style}'>\n"); } $order = 0; foreach ($this->subTree as $c) { if (!$c instanceof TWebControl) { continue; } if ($c instanceof MyTreeList) { $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"); } }