load modal content
355077
public function loadModalContent()
	{
		global $objPage;

		$id = \Input::get('modal');

		if($id == '')
		{
			return;
		}

		$page = \Input::get('page');

		// load layout because we need to initiate bootstrap
		/** @var \PageModel $objPage */
		$objPage = \PageModel::findByPk($page);
		$objPage->loadDetails();

		if($objPage === null)
		{
			$this->log(sprintf('Page ID %s not found', $page), 'Netzmacht\Bootstrap\Ajax::loadModalContent', TL_ERROR);
			exit;
		}

		$objLayout = $this->getPageLayout($objPage);

		// Set the layout template and template group
		$objPage->template = $objLayout->template ?: 'fe_page';
		$objPage->templateGroup = $objLayout->getRelated('pid')->templates;

		// trigger getPageLayout hook so
		if(isset($GLOBALS['TL_HOOKS']['getPageLayout']) && is_array($GLOBALS['TL_HOOKS']['getPageLayout']))
		{
			foreach($GLOBALS['TL_HOOKS']['getPageLayout'] as $hook)
			{
				$this->import($hook[0]);
				$this->{$hook[0]}->{$hook[1]}($objPage, $objLayout, $this);
			}
		}

		$model = \ModuleModel::findOneBy('type="bootstrap_modal" AND tl_module.id', $id);

		if($model === null)
		{
			exit;
		}

		$model->isAjax = true;
		$this->output($this->getFrontendModule($model));
	}
1158078
function pongOnTheFlyCreModalFromMeta(id, modalName, resourceURL) {
  log( "PoNG-OnTheFly", "Create modal view content " + resourceURL );
  if ( !modalName ) {
    modalName = "OnTheFly";
  }

  if ( resourceURL ) {
    log( "PoNG-OnTheFly", "Get JSON for " + id );
    // var jsonCfg = pongOnTheFlyFindSubJSON( layoutOrig, "", sessionInfo[
    // id+"OnTheFly" ].resID );
    var editName = id + modalName + 'DialogConfig';
    var tmplName = id + modalName + 'DialogAssist';
    
    log( "PoNG-OnTheFly", "Add JSON to #" + id + modalName + "Dialog" );
    $( '#' + id + modalName + 'Dialog' ).html(
      '<form>'
      +'<label for="' +editName+ '">View Configuration Editor:</label>'
      +'<textarea id="' +editName+ '" class="OnTheFly-ConfField"/>'
      +'<label for="' +tmplName + '">Config Copy-Paste Template</label>'
      +'<textarea id="' +tmplName+ '" class="OnTheFly-AssistField"/>'
      +'</form>' );
    $( '#' + id + modalName + 'DialogConfig' ).val(
        $.i18n( 'Could not load configuration from' )
          + ' "' + resourceURL + '"' );
    $( '#' + id + modalName + 'DialogAssist' ).val(
        $.i18n( 'No help available.' ) );
  } else {
    log( "PoNG-OnTheFly", "WARNING: Configuration issue!" );
  }
  log( "PoNG-OnTheFly", "Done." );
}
497821
public static function modalBody($content, $htmlOptions = array())
    {
        self::addCssClass('modal-body', $htmlOptions);
        return self::tag('div', $htmlOptions, $content);
    }
825083
public function modal($config = array())
    {
        $config = new KObjectConfigJson($config);
        $config->append(array(
            'debug'    => false,
            'selector' => '[data-k-modal]',
            'data'     => 'k-modal',
            'options_callback' => null,
            'options'  => array('type' => 'image')
        ));

        $html = '';

        if(!static::isLoaded('modal'))
        {
            $html .= $this->jquery();
            $html .= '<ktml:script src="assets://js/'.($config->debug ? 'build/' : 'min/').'jquery.magnific-popup.js" />';

            static::setLoaded('modal');
        }

        if(!static::isLoaded('modal-select2-fix'))
        {
            $html .= "<script>

                // WORKAROUND FOR ISSUE: #873

                kQuery(function($)
                {
                    $.magnificPopup.instance._onFocusIn = function(e)
                    {
                        // Do nothing if target element is select2 input
                        if( $(e.target).hasClass('select2-search__field') ) {
                            return true;
                        }
            
                        // Else call parent method
                        $.magnificPopup.proto._onFocusIn.call(this,e);
                    };
                });
            </script>";

            static::setLoaded('modal-select2-fix');
        }

        $options   = (string)$config->options;
        $signature = md5('modal-'.$config->selector.$config->options_callback.$options);

        if (!static::isLoaded($signature))
        {
            if ($config->options_callback) {
                $options = $config->options_callback.'('.$options.')';
            }

            $html .= "<script>
            kQuery(function($){
                $('$config->selector').each(function(idx, el) {
                    var el = $(el);
                    var data = el.data('$config->data');
                    var options = ".$options.";
                    if (data) {
                        $.extend(true, options, data);
                    }
                    el.magnificPopup(options);
                });
            });
            </script>";

            static::setLoaded($signature);
        }

        return $html;
    }
97134
function(message, callback) {

						if (!F2.isInit()) {
							F2.log('F2.init() must be called before F2.UI.Modals.alert()');
							return;
						}

						if (F2.Rpc.isRemote(_appConfig.instanceId)) {
							F2.Rpc.call(
								_appConfig.instanceId,
								F2.Constants.Sockets.UI_RPC,
								'Modals.alert',
								[].slice.call(arguments)
							);
						} else {
							// display the alert
							jQuery(_renderAlert(message))
								.on('show.bs.modal', function() {
									var modal = this;
									jQuery(modal).find('.btn-primary').on('click', function() {
										jQuery(modal).modal('hide').remove();
										(callback || jQuery.noop)();
									});
								})
								.modal({backdrop:true});
						}
					}
1056684
def imodal(title, body, html_options = {})
      label ||= html_options.delete(:label) \
                  || html_options.delete(:icon) || fa_icon('clone')
      content_tag :span, class: 'modaler' do
        concat link_to(label, '#', data: { target: '#imodal', toggle: 'modal' })
        concat content_tag(:span, title, class: 'modaler__title')
        concat content_tag(:span, body, class: 'modaler__body')
      end
    end
264392
protected function loadMods(): void
    {
        if (!$this->isLoaded) {
            $this->mods = [];
            foreach ($this->decodeContent((string) $this->loadContent(self::HASH_FILE_MODS)) as $modData) {
                if (is_array($modData)) {
                    $mod = new Mod();
                    $mod->readData(new DataContainer($modData));
                    $this->mods[$mod->getName()] = $mod;
                }
            }
            $this->isLoaded = true;
        }
    }
1257087
public function index() {
		$objects = $this->getInstances ( $totalCount );
		$modal = ($this->_getModelViewer ()->isModal ( $objects, $this->model )) ? "modal" : "no";
		$dt = $this->_getModelViewer ()->getModelDataTable ( $objects, $this->model, $totalCount );
		$this->jquery->getOnClick ( "#btAddNew", $this->_getBaseRoute () . "/newModel/" . $modal, "#frm-add-update", [ "hasLoader" => "internal" ] );
		$this->_getEvents ()->onDisplayElements ( $dt, $objects, false );
		$this->crudLoadView ( $this->_getFiles ()->getViewIndex (), [ "classname" => $this->model,"messages" => $this->jquery->semantic ()->matchHtmlComponents ( function ($compo) {
			return $compo instanceof HtmlMessage;
		} ) ] );
	}
66432
public function modal($filename, array $vars = [])
    {
        if (presenter()->theme->hasLayout('modal')) {
            if (presenter()->theme->hasLayout('modal')) {
                presenter()->theme->setLayout('modal');
                echo $this->load($filename, $vars, true);
                exit(EXIT_SUCCESS);
            }
        }

        if ($content = $this->load($filename, $vars, true)) {
            echo $content;
            exit(EXIT_SUCCESS);
        }
    }
259100
public function run()
    {
        if (!isset($this->content)) {
            $this->content = ob_get_clean();
        }
        echo TbHtml::modalBody($this->content);
        echo TbHtml::modalFooter($this->footer);
        echo '</div>' . PHP_EOL;
        echo '</div>' . PHP_EOL;
        echo '</div>' . PHP_EOL;
        $this->renderButton();
        $this->registerClientScript();
    }
471035
public function modalWindow(
        $modal_id,
        $modal_title,
        $modal_body,
        $modal_footer = null,
        $modal_size = null,
        $modal_progress = null
    ) {
        $data = [
            'modal_id'          => $modal_id,
            'modal_size'        => $modal_size,
            'modal_progress'    => $modal_progress,
            'modal_title'       => $modal_title,
            'modal_body'        => $modal_body,
            'modal_footer'      => $modal_footer
        ];
        
        return view('redminportal::partials.modal-window', $data);
    }
221175
public void show(boolean modal) {
    if (modal) {
      dialog.initModality(Modality.APPLICATION_MODAL);
      dialog.showAndWait();
    } else {
      dialog.initModality(Modality.NONE);
      dialog.show();
    }
  }
18868
function (element, options) {
			this.options = options;
			this.$body = $(document.body);
			this.$element = $(element);
			this.$dialog = this.$element.find(".modal-dialog");
			this.$backdrop = null;
			this.isShown = null;
			this.originalBodyPad = null;
			this.scrollbarWidth = 0;
			this.ignoreBackdropClick = false;

			if (this.options.remote) {
				this.$element
					.find(".modal-content")
					.load(this.options.remote, $.proxy(function () {
						this.$element.trigger("loaded.bs.modal");
					}, this));
			}
		}
421095
function() {
			var self = this;
			var modal_wrapper = $( '#' + self.scope.id );
			var animation_type = self.options.animation;

			if (animation_type === 'none' ){
				modal_wrapper.removeClass('modaal-start_none');
				self.options.after_open.call(self, modal_wrapper);
			}

			// Open with fade
			if (animation_type === 'fade') {
				modal_wrapper.removeClass('modaal-start_fade');
			}

			// Open with slide down
			if (animation_type === 'slide-down') {
				modal_wrapper.removeClass('modaal-start_slide_down');
			}

			var focusTarget = modal_wrapper;

			// Switch focusTarget tabindex (switch from other modal if exists)
			$('.modaal-wrapper *[tabindex=0]').removeAttr('tabindex');

			if ( self.options.type == 'image' ) {
				focusTarget = $('#' + self.scope.id).find('.modaal-gallery-item.' + self.private_options.active_class);

			} else if ( modal_wrapper.find('.modaal-iframe-elem').length ) {
				focusTarget = modal_wrapper.find('.modaal-iframe-elem');

			} else if ( modal_wrapper.find('.modaal-video-wrap').length ) {
				focusTarget = modal_wrapper.find('.modaal-video-wrap');

			} else {
				focusTarget = modal_wrapper.find('.modaal-focus');

			}

			// now set the focus
			focusTarget.attr('tabindex', '0').focus();

			// Run after_open
			if (animation_type !== 'none') {
				// CB: after_open
				setTimeout(function() {
					self.options.after_open.call(self, modal_wrapper)
				}, self.options.after_callback_delay);
			}
		}
1156723
function showModal(saveMessages, errorMessage) {
    $(document.body).append($modal);
    $modal.find(".save-messages")[0].innerHTML = saveMessages;
    $modal.find(".error-message")[0].textContent = errorMessage;
    $modal.on("hide.bs.modal.modal", function hidden() {
      $modal.remove();
      window.location.reload();
    });
    $modal.modal();
  }
269227
public function modal(Modal\Modal $modal)
    {

        $html = '';

        // header
        if ($modal->hasCloseButton()) {
            $html .= html('button', ['type' => 'button', 'class' => 'close', 'data-dismiss' => 'modal', 'aria-label' => $modal->getCloseButtonLabel()], '<span aria-hidden="true">&times;</span>');
        }

        if ($modal->hasTitle()) {
            $html .= html('h4', ['class' => Style::MODAL_HEADER_TITLE_CLASS], $modal->getTitle());
            $html = html('div', ['class' => Style::MODAL_HEADER_CLASS], $html);
        }

        // body
        $html .= html('div', ['class' => Style::MODAL_BODY_CLASS], $modal->getBody());

        // footer
        if ($modal->hasActions()) {

            $actions = '';

            if ($modal->hasCloseButton()) {
                $actions .= html('button', ['type' => 'button', 'class' => 'btn btn-default', 'data-dismiss' => 'modal'], $modal->getCloseButtonLabel());
            }

            foreach ($modal->getActions() as $action) {
                /** @var Element\Button $action */
                $actions .= $this->render('action', $action);
            }

            $html .= html('div', ['class' => Style::MODAL_FOOTER_CLASS], $actions);
        }

        // container
        if (!$modal->isRemote()) {
            $html = html('div', ['class' => Style::MODAL_CONTENT_CLASS, ], $html);
            $html = html('div', ['class' => Style::MODAL_DIALOG_CLASS, 'role' => 'document'], $html);
            $html = html('div', ['class' => Style::MODAL_CLASS,'role' => 'dialog'], $html);
        }

        $html .= html('script', ['type' => 'text/javascript'],js('onload'));

        return $html;
    }
1371027
function () {
            // --------------------------------------------------- destructuring

            var cfg = this._cfg;

            var modal = cfg.modal;
            var waiAria = cfg.waiAria;

            // ------------------------------------------------------ processing

            // refreshParams ---------------------------------------------------

            var refreshParams = {
                section : "__dialog_" + this._domId,
                writerCallback : {
                    fn : this._writerCallback,
                    scope : this
                }
            };

            // popupContainer --------------------------------------------------

            var popupContainer = PopupContainerManager.createPopupContainer(cfg.container);
            this._popupContainer = popupContainer;

            // previouslyFocusedElement ----------------------------------------

            if (modal) {
                this._previouslyFocusedElement = Aria.$window.document.activeElement;
            }

            // optionsBeforeMaximize -------------------------------------------
            // store current options to reapply them when unmaximized

            this._optionsBeforeMaximize = this._createOptionsBeforeMaximize(cfg);

            // section ---------------------------------------------------------

            var section = this._context.getRefreshedSection(refreshParams);

            // popup -----------------------------------------------------------

            var popup = new ariaPopupsPopup();

            this._popup = popup;

            popup.$on({
                "onAfterOpen" : this._onAfterPopupOpen,
                "onEscape" : this._onEscape,
                "onAfterClose" : this._onAfterPopupClose,
                scope : this
            });

            if (cfg.closeOnMouseClick) {
                popup.$on({
                    "onMouseClickClose" : this._onMouseClickClose,
                    scope : this
                });
            }

            popup.open({
                section : section,
                keepSection : true,
                absolutePosition : {
                    left : cfg.xpos,
                    top : cfg.ypos
                },
                center : cfg.center,
                maximized : cfg.maximized,
                offset : cfg.maximized ? this._shadows : this._shadowsZero,
                modal : modal,
                maskCssClass : "xDialogMask",
                popupContainer : popupContainer,
                closeOnMouseClick : cfg.closeOnMouseClick,
                closeOnMouseScroll : false,
                parentDialog : this,
                zIndexKeepOpenOrder : false, // allows to re-order dialogs (dynamic z-index)
                role: modal ? "dialog" : null,
                labelId: modal ? this.__getLabelId() : null,
                waiAria: waiAria
            });

            // hiddenElements --------------------------------------------------

            if (modal && waiAria) {
                var container = popupContainer.getContainerElt();
                this._showBack = DomNavigationManager.hidingManager.hideOthers(popup.domElement, function (element) {
                     return element != null && element !== container;
                });
            }

            // -----------------------------------------------------------------

            // must be registered before we check for _cfg.maximized, to fire the event correctly after overflow change
            ariaTemplatesLayout.$on({
                "viewportResized" : this._onViewportResized,
                scope : this
            });

            // -----------------------------------------------------------------

            // in case when bound "maximized" was toggled while Dialog was not visible
            if (cfg.maximized) {
                this._setContainerOverflow("hidden");
                this._setMaximizedHeightAndWidth();
            }

            this._firstEscapeTime = null;
        }