예제 #1
0
 /**
  * Run attachment displays for the view.
  */
 public function attachDisplays()
 {
     if (!empty($this->is_attachment)) {
         return;
     }
     if (!$this->display_handler->acceptAttachments()) {
         return;
     }
     $this->is_attachment = TRUE;
     // Find out which other displays attach to the current one.
     foreach ($this->display_handler->getAttachedDisplays() as $id) {
         $display_handler = $this->displayHandlers->get($id);
         // Only attach enabled attachments.
         if ($display_handler->isEnabled()) {
             $cloned_view = Views::executableFactory()->get($this->storage);
             $display_handler->attachTo($cloned_view, $this->current_display, $this->element);
         }
     }
     $this->is_attachment = FALSE;
 }
예제 #2
0
 /**
  * Run attachment displays for the view.
  */
 public function attachDisplays()
 {
     if (!empty($this->is_attachment)) {
         return;
     }
     if (!$this->display_handler->acceptAttachments()) {
         return;
     }
     $this->is_attachment = TRUE;
     // Find out which other displays attach to the current one.
     foreach ($this->display_handler->getAttachedDisplays() as $id) {
         // Create a clone for the attachments to manipulate. 'static' refers to the current class name.
         $cloned_view = new static($this->storage, $this->user);
         $cloned_view->setRequest($this->getRequest());
         $this->displayHandlers->get($id)->attachTo($cloned_view, $this->current_display);
     }
     $this->is_attachment = FALSE;
 }