예제 #1
0
 /**
  * Compile the module.
  *
  * @return void
  */
 protected function compile()
 {
     if ($this->cssID[0] == '') {
         $cssID = $this->cssID;
         $cssID[0] = 'modal-' . $this->id;
         $this->cssID = $cssID;
     }
     $modal = new Component();
     $modal->setId($this->cssID[0])->setSize($this->bootstrap_modalSize)->setAttribute('role', 'dialog')->setAttribute('aria-hidden', 'true')->setAttribute('taxindex', '-1');
     if ($this->cssID[1]) {
         $modal->addClass($this->cssID[1]);
     }
     // check if ajax is used
     if ($this->bootstrap_modalAjax) {
         $this->Template->hideFrame = $this->isAjax;
         $this->Template->hideContent = !$this->Template->hideFrame;
     }
     if ($this->Template->hideContent) {
         $modal->render($this->Template);
         return;
     }
     if ($this->headline) {
         $headline = Element::create($this->hl)->addClass('modal-title')->addChild($this->headline);
         $modal->setTitle($headline);
     }
     $modal->setContent($this->getContent())->setFooter($this->getButtons())->setCloseButton(Bootstrap::getConfigVar('modal.dismiss'), true)->render($this->Template);
 }
예제 #2
0
파일: Modal.php 프로젝트: Olli/components
 /**
  * compile
  */
 protected function compile()
 {
     if ($this->cssID[0] == '') {
         $cssID = $this->cssID;
         $cssID[0] = 'modal-' . $this->id;
         $this->cssID = $cssID;
     }
     $modal = new Component();
     $modal->setId($this->cssID[0])->setSize($this->bootstrap_modalSize);
     if ($this->cssID[1]) {
         $modal->addClass($this->cssID[1]);
     }
     // check if ajax is used
     if ($this->bootstrap_modalAjax) {
         $this->Template->hideFrame = $this->isAjax;
         $this->Template->hideContent = !$this->Template->hideFrame;
     }
     if ($this->Template->hideContent) {
         $url = \Controller::generateFrontendUrl($GLOBALS['objPage']->row()) . '?bootstrap_modal=' . $this->id;
         //$url = sprintf(Bootstrap::getConfigVar('modal.remoteUrl'), $GLOBALS['objPage']->id, $this->id);
         $modal->setAttribute('data-remote', $url)->render($this->Template);
         return;
     }
     if ($this->headline) {
         $headline = Element::create($this->hl)->addClass('modal-title')->addChild($this->headline);
         $modal->setTitle($headline);
     }
     $modal->setContent($this->getContent())->setFooter($this->getButtons())->setCloseButton(Bootstrap::getConfigVar('modal.dismiss'), true)->render($this->Template);
 }