Exemplo n.º 1
0
 public function onPreRender($param)
 {
     parent::onPreRender($param);
     $paths = explode('.', $this->getClassPath());
     if (count($paths) > 1) {
         $classFile = 'class-' . array_pop($paths) . '.html';
         $this->setNavigateUrl(self::BASE_URL . '/' . $classFile);
         if ($this->getText() === '') {
             $this->setText('API Manual');
         }
     }
 }
Exemplo n.º 2
0
 /**
  * Sets the target window or frame to display the Web page content linked to when the THyperLink component is clicked.
  * @param string the target window, valid values include '_blank', '_parent', '_self', '_top' and empty string.
  */
 public function setTarget($value)
 {
     parent::setTarget($value);
     if ($this->getActiveControl()->canUpdateClientSide()) {
         $this->getPage()->getCallbackClient()->setAttribute($this, 'target', $value);
     }
 }
Exemplo n.º 3
0
 public function render($writer)
 {
     if ($this->getVisible()) {
         $writer->writeLine("<table><tr><td>");
         $hplnk = new THyperLink();
         if ($this->getNavigateUrl() !== '') {
             $hplnk->setNavigateUrl($this->getURl());
         } else {
             $hplnk->setNavigateUrl($this->getFirstSubLnk());
         }
         $hplnk->setText($this->getText());
         if ($this->isInPage()) {
             $hplnk->setCssClass($this->getActCss());
         } else {
             $hplnk->setCssClass($this->getIActCss());
         }
         $hplnk->render($writer);
         if (!$this->getColapse() || $this->isInPage()) {
             $writer->writeLine("<table>");
             foreach ($this->getControls() as $item) {
                 if ($item instanceof AxListMenuItem || $item instanceof AxListMenuColl) {
                     $item->render($writer);
                 }
             }
             $writer->writeLine("</table>");
             $writer->writeLine("</td></tr></table>");
         }
     }
 }
Exemplo n.º 4
0
 /**
  * Initializes the specified cell to its initial values.
  * This method overrides the parent implementation.
  * It creates a hyperlink within the cell.
  * @param TTableCell the cell to be initialized.
  * @param integer the index to the Columns property that the cell resides in.
  * @param string the type of cell (Header,Footer,Item,AlternatingItem,EditItem,SelectedItem)
  */
 public function initializeCell($cell, $columnIndex, $itemType)
 {
     if ($itemType === TListItemType::Item || $itemType === TListItemType::AlternatingItem || $itemType === TListItemType::SelectedItem || $itemType === TListItemType::EditItem) {
         $link = new THyperLink();
         if (($url = $this->getImageUrl()) !== '') {
             $link->setImageUrl($url);
             if (($width = $this->getImageWidth()) !== '') {
                 $link->setImageWidth($width);
             }
             if (($height = $this->getImageHeight()) !== '') {
                 $link->setImageHeight($height);
             }
         }
         $link->setText($this->getText());
         $link->setNavigateUrl($this->getNavigateUrl());
         $link->setTarget($this->getTarget());
         if ($this->getDataTextField() !== '' || $this->getDataNavigateUrlField() !== '') {
             $link->attachEventHandler('OnDataBinding', array($this, 'dataBindColumn'));
         }
         $cell->getControls()->add($link);
         $cell->registerObject('HyperLink', $link);
     } else {
         parent::initializeCell($cell, $columnIndex, $itemType);
     }
 }
Exemplo n.º 5
0
 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");
     }
 }