@param AbstractPopup $popup

@return \Symfony\Component\Form\Form
974825
protected function createSubscriptionForm(AbstractPopup $popup)
    {
        $form = $this->createForm($this->getSubscriptionFormType(), null, array(
            'method' => 'POST',
            'action' => $this->generateUrl('popup_newsletter_subscribe', array('popup' => $popup->getId())),
        ));
        $form->add('submit', SubmitType::class, array(
            'attr' => array('class' => $popup->getHtmlId() . '--submit'),
        ));

        return $form;
    }
1196911
public function generatePopup()
    {
        $GLOBALS['TL_JAVASCRIPT']['cca.dc-general.vanillaGeneral'] = 'bundles/ccadcgeneral/js/vanillaGeneral.js';

        $environment = $this->getEnvironment();
        $translator  = $environment->getTranslator();
        $template    = new ContaoBackendViewTemplate('widget_treepicker_popup');

        $icon = new GenerateHtmlEvent($this->titleIcon);
        $environment->getEventDispatcher()->dispatch(ContaoEvents::IMAGE_GET_HTML, $icon);

        $template
            ->setTranslator($translator)
            ->set('id', 'tl_listing')
            ->set('name', $this->strName)
            ->set('class', ($this->strClass ? ' ' . $this->strClass : ''))
            ->set('icon', $icon->getHtml())
            ->set('title', $translator->translate($this->title ?: 'MSC.treePicker', '', [$this->sourceName]))
            ->set('fieldType', $this->fieldType)
            ->set('resetSelected', $translator->translate('MSC.resetSelected'))
            ->set('selectAll', $translator->translate('MSC.selectAll'))
            ->set('values', StringUtil::deserialize($this->varValue, true));

        // Create Tree Render with custom root points.
        $tree = '';
        foreach ($this->getRootIds() as $pid) {
            $tree .= $this->generateTreeView($this->loadCollection($pid), 'tree');
        }

        $template->set('tree', $tree);

        // Load the fonts for the drag hint.
        $GLOBALS['TL_CONFIG']['loadGoogleFonts'] = true;

        return $template->parse();
    }
145790
public function setClient(AbstractClient $client)
    {
        $this->client = $client;

        $this->parser->setClient($this->client);

        return $this;
    }
811071
protected function proxy() {
        if (!$this->context) {
            $this->context = new FormContext($this->version, $this->solution['formType']);
        }

        return $this->context;
    }
330495
public function addPopup($popup = null, $icon = 'caret square down')
    {
        if (!$this->app) {
            throw new Exception('Columns\'s popup need to have a layout.');
        }

        $popup = $this->app->add($popup ? $popup : 'Popup')->setHoverable();

        $this->setHeaderPopup($popup, $icon);

        return $popup;
    }
188841
protected function findInContextualBindings($abstract)
    {
        if (isset($this->contextual[end($this->buildStack)][$abstract])) {
            return $this->contextual[end($this->buildStack)][$abstract];
        }
    }
1165656
protected function _getElementHtml(AbstractElement $element) {
        $callbackUrl= $this->getBaseUrl() . 'checkout_com/' . $this->getControllerUrl();

        $element->setData('value', $callbackUrl);
        $element->setReadonly('readonly');

        return $element->getElementHtml();
    }
906747
protected function buildInlineCodeOfEvent(AbstractEvent $event) {
        if ($event->getInline()) {
            $code = $event->getCode() . PHP_EOL;
        } else {
            $code = $this->buildHandlerFunctionCall($event);
        }
        $condition = $this->buildCondition($event);
        if (empty($condition)) {
            $result = $code;
        } else {
            $result = '                    if (' . $condition . ') {' . PHP_EOL
                    . $code
                    . '                    }' . PHP_EOL;
        }
        return $result;
    }
540240
public function findOrCreateFor(AbstractEntity $entity)
    {
        $seo = $this->findFor($entity);

        if (is_null($seo)) {
            $seo = new Seo();
            $seo->setRef($entity);
        }

        return $seo;
    }
258790
public function bindPopup($popup, $options = null)
    {
        $this->popup        = $popup;
        $this->popupOptions = $options;

        if (!empty($options)) {
            return $this->addMethod('binPopup', array($popup, $options));
        }

        return $this->addMethod('bindPopup', array($popup));
    }
133665
public function onLoadPopup()
    {
        $this->bottomToolbar = Input::get('bottomToolbar', $this->bottomToolbar);

        $this->cropAndInsertButton = Input::get('cropAndInsertButton', $this->cropAndInsertButton);

        return $this->makePartial('popup-body');
    }
1066777
protected function configureForm($form, AbstractOptions $options)
    {
        /* @var $options \Applications\Options\ModuleOptions */
        $form->get($this->fileName)->setViewHelper('formImageUpload')
           ->setMaxSize($options->getContactImageMaxSize())
           ->setAllowedTypes($options->getContactImageMimeType())
           ->setForm($form);
    }
141191
public function addPopup($title="", $content="", $variation=NULL, $params=array()) {
		$this->_popup=new InternalPopup($this, $title, $content, $variation, $params);
		return $this;
	}
1254961
public function createStepDescriptor(DOMElement $step = null, AbstractDescriptor $parent = null)
    {
        return new StepDescriptor($step, $parent);
    }
918260
function Popup (opts) {
	if (!(this instanceof Popup)) return new Popup(opts);

	var typeOpts = this.types[opts.type || this.type] || {};

	//hook up type events and options events
	if (typeOpts.onInit) this.on('init', typeOpts.onInit);
	if (typeOpts.onShow) this.on('show', typeOpts.onShow);
	if (typeOpts.onHide) this.on('hide', typeOpts.onHide);
	if (typeOpts.onAfterShow) this.on('afterShow', typeOpts.onAfterShow);
	if (typeOpts.onAfterHide) this.on('afterHide', typeOpts.onAfterHide);
	if (opts.onInit) this.on('init', opts.onInit);
	if (opts.onShow) this.on('show', opts.onShow);
	if (opts.onHide) this.on('hide', opts.onHide);
	if (opts.onAfterShow) this.on('afterShow', opts.onAfterShow);
	if (opts.onAfterHide) this.on('afterHide', opts.onAfterHide);


	//generate unique id
	this.id = uid();

	//FIXME: :'(
	this.update = this.update.bind(this);

	//ensure element
	if (!this.element) this.element = document.createElement('div');
	this.element.classList.add('popoff');
	this.element.classList.add('popoff-popup');
	this.element.classList.add('popoff-hidden');

	//take over type’s options.
	//should be after element creation to init `content` property
	extend(this, typeOpts, opts);

	this.element.classList.add(`popoff-${this.type}`);

	//take over a target first
	if (!this.container) {
		this.container = document.body || document.documentElement;
	}
	this.container.classList.add('popoff-container');

	//create close element
	this.closeElement = document.createElement('div');
	this.closeElement.classList.add('popoff-close');
	if (this.closable) {
		this.closeElement.addEventListener('click', e => {
			this.hide();
		});
		this.element.appendChild(this.closeElement);
	}

	//create tip
	this.tipElement = document.createElement('div');
	this.tipElement.classList.add('popoff-tip');
	this.tipElement.classList.add('popoff-hidden');
	if (this.tip) {
		this.container.appendChild(this.tipElement);
		this.element.classList.add('popoff-popup-tip');
	}

	//apply custom style
	if (this.style) {
		for (var name in this.style) {
			let value = this.style[name];
			if (typeof value === 'number' && !/z/.test(name)) value += 'px';
			this.element.style[name] = value;
		}
	}

	//create overflow for tall content
	this.overflowElement = document.createElement('div');
	this.overflowElement.classList.add('popoff-overflow');

	this.container.appendChild(this.element);

	if (this.escapable) {
		document.addEventListener('keyup', e => {
			if (!this.isVisible) return;
			if (e.which === 27) {
				this.hide();
			}
		});
	}

	//init proper target
	if (typeof this.target === 'string') {
		this.target = document.querySelector(this.target);
	}

	//update on resize
	window.addEventListener('resize', () => {
		this.update();
	});

	this.emit('init');
}
109345
public function loadPlugin(AbstractPlugin $plugin)
    {
        $name = $plugin->getName();
        $this->log->addDebug('--- Loading plugin ' . $name . PHP_EOL);

        $plugin->init();
        $this->plugins[$name] = $plugin;

        return $this;
    }
25302
public function getCurrentMenuList(\Zend_Controller_Request_Abstract $request, $parentLabel = null)
    {
        $controller = $request->getControllerName();
        $action     = $request->getActionName();

        $menuList = $this->getMenuList();

        if ($controller !== 'index') {
            $menuList->addByController($controller, 'index', $parentLabel);
        }

        foreach ($this->getCurrent()->getChildren() as $child) {
            if ($child instanceof \Gems_Menu_SubMenuItem) {
                $chAction = $child->get('action');
                $chContr  = $child->get('controller');
                if (! ($controller == $chContr && $action == $chAction)) {
                    $menuList->addByController($chContr, $chAction);
                }
            }
        }
        return $menuList;
    }