Exemplo n.º 1
0
 /**
  * Ensure that the ID attribute is rendered and registers the javascript code
  * for initializing the active control.
  */
 protected function addAttributesToRender($writer)
 {
     parent::addAttributesToRender($writer);
     $writer->addAttribute('id', $this->getClientID());
     $this->renderLinkButtonHref($writer);
     $this->getActiveControl()->registerCallbackClientScript($this->getClientClassName(), $this->getPostBackOptions());
 }
Exemplo n.º 2
0
 /**
  * Instantiates the template.
  * It creates a {@link TLinkButton}.
  * @param TControl parent to hold the content within the template
  */
 public function instantiateIn($parent)
 {
     $button = new TLinkButton();
     $button->setID(TWizard::ID_SIDEBAR_BUTTON);
     $parent->getControls()->add($button);
 }
Exemplo n.º 3
0
 /**
  * Ensures that the anchor is rendered correctly when its Enabled property
  * changes in a callback
  * @param bool enabled
  */
 public function setEnabled($value)
 {
     parent::setEnabled($value);
     if ($this->getActiveControl()->canUpdateClientSide()) {
         if ($this->getEnabled(true)) {
             $nop = "javascript:;//" . $this->getClientID();
             $this->getPage()->getCallbackClient()->setAttribute($this, 'href', $nop);
             $this->getActiveControl()->registerCallbackClientScript($this->getClientClassName(), $this->getPostBackOptions());
         } else {
             $this->getPage()->getCallbackClient()->setAttribute($this, 'href', false);
         }
     }
 }