public function classBranchPopup(NodeInterface $node, $js = 'nojs') {
    if ($js == 'ajax') {
      $response = new AjaxResponse();
      $form['#attached']['library'][] = 'core/drupal.dialog.ajax';
      $response->setAttachments($form['#attached']);
      $content = $this->buildPopupContent($node);
      if ($content instanceof CommandInterface) {
        $response->addCommand($content);
      }
      else {
        $modal = new OpenModalDialogCommand(t('Select location'), $content, $this->popupOptions());
        $response->addCommand($modal);
      }
      return $response;
    }
    else {
      return $this->redirect('user.page');
    }
  }
public function classBranchPopup(NodeInterface $node, $js = 'nojs') {
    if ($js == 'ajax') {
      $response = new AjaxResponse();
      $form['#attached']['library'][] = 'core/drupal.dialog.ajax';
      $response->setAttachments($form['#attached']);
      $content = $this->buildPopupContent($node);
      if ($content instanceof CommandInterface) {
        $response->addCommand($content);
      }
      else {
        $modal = new OpenModalDialogCommand(t('Select location'), $content, $this->popupOptions());
        $response->addCommand($modal);
      }
      return $response;
    }
    else {
      return $this->redirect('user.page');
    }
  }
public function classBranchPopup ( NodeInterface $ node , $ js = 'nojs' ) { if ( $ js == 'ajax' ) { $ response = new AjaxResponse ( ) ; $ form [ '#attached' ] [ 'library' ] [ ] = 'core/drupal.dialog.ajax' ; $ response -> setAttachments ( $ form [ '#attached' ] ) ; $ content = $ this -> buildPopupContent ( $ node ) ; if ( $ content instanceof CommandInterface ) { $ response -> addCommand ( $ content ) ; } else { $ modal = new OpenModalDialogCommand ( t ( 'Select location' ) , $ content , $ this -> popupOptions ( ) ) ; $ response -> addCommand ( $ modal ) ; } return $ response ; } else { return $ this -> redirect ( 'user.page' ) ; } }
ClassBranch Popup.

@param NodeInterface $node
A node object.
@param string $js
Nojs|ajax.

@return AjaxResponse
Response.
ClassBranch Popup .