Outputs a jQuery toggle event

@param string $element element
@param boolean $immediatly delayed if false
@return string
553338
public function _toggle($element='this', $immediatly=false) {
		$element=$this->_prep_element($element);
		$str="$({$element}).toggle();";

		if ($immediatly)
			$this->jquery_code_for_compile[]=$str;
			return $str;
	}
151469
public function _exec($js, $immediatly=false) {
		$script=$js."\n";
		if ($immediatly)
			$this->jquery_code_for_compile[]=$script;
			return $script;
	}
1212871
public function toggle($field = null, $id = null) {
		 $fields = ['active'];

		if (!empty($field) && in_array($field, $fields) && !empty($id)) {
			$value = $this->{$this->modelClass}->toggleField($field, $id);

		}

		# http get request + redirect
		if (!$this->request->is('ajax')) {
			$this->Flash->success(__('Saved'));
			return $this->Common->autoRedirect(['action' => 'index']);
		}

		# ajax
		$model = $this->{$this->modelClass}->alias;
		$this->autoRender = false;
		if (isset($value)) {
			$this->set('ajaxToggle', $value);
			$this->set(compact('field', 'model'));

			//FIXME
			$this->render('admin_toggle', 'ajax');
		}
	}
900053
function() {
			var $el = $(this.el);
			$el.render(this.model.toJSON(), {
				toggle: { checked: function(p) {
				      p.element.checked = this.completed;
				    }
				  }
				});

			$el.toggleClass('completed', this.model.get('completed'));

			this.input = this.$('.edit');
			return this;
		}
396416
public function iWaitXUntilISee($wait, $selector) {
		$page = $this->getSession()->getPage();

		$this->spin(function($page) use ($page, $selector){
			$element = $page->find('css', $selector);

			if(empty($element)) {
				return false;
			} else {
				return $element->isVisible();
			}
		});
	}
828239
protected function processingElementsResult($element)
    {
        $arElement = $element;

        if ($this->arParams['RESULT_PROCESSING_MODE'] === 'EXTENDED')
        {
            $arElement = $element->GetFields();
            $arElement['PROPS'] = $element->GetProperties();
        }
        elseif (!empty($this->arParams['SELECT_PROPS']))
        {
            foreach ($this->arParams['SELECT_PROPS'] as $propCode)
            {
                if (trim($propCode))
                {
                    $arProp = explode('.', $propCode);
                    $propCode = array_shift($arProp);
                    $propValue = $element['PROPERTY_'.$propCode.'_VALUE'];
                    $propDescr = $element['PROPERTY_'.$propCode.'_DESCRIPTION'];

                    if ($propValue)
                    {
                        $arElement['PROPS'][$propCode]['VALUE'] = $propValue;
                    }

                    if ($propDescr)
                    {
                        $arElement['PROPS'][$propCode]['DESCRIPTION'] = $propDescr;
                    }

                    if (!empty($arElement['PROPS'][$propCode]))
                    {
                        foreach ($arProp as $field)
                        {
                            $arElement['PROPS'][$propCode]['LINKED'][$field] = $element['PROPERTY_'.$propCode.'_'.$field];
                        }
                    }
                }
            }
        }

        if ($arElement = $this->prepareElementsResult($arElement))
        {
            return $arElement;
        }
        else
        {
            return false;
        }
    }
127166
protected function _getElementHtml(AbstractElement $element)
    {
        $element->addData([
            'wysiwyg' => true,
            'config'  => $this->wysiwygConfig->getConfig($element)
        ]);
        return parent::_getElementHtml($element);
    }
1106989
public function _getElementHtml(\Magento\Framework\Data\Form\Element\AbstractElement $element)
    {
        $url = $this->escapeUrl($this->_urlBuilder->getUrl('dotdigitalgroup_email/run/catalogsync'));

        return $this->getLayout()
            ->createBlock(\Magento\Backend\Block\Widget\Button::class)
            ->setType('button')
            ->setLabel($this->buttonLabel)
            ->setOnClick("window.location.href='" . $url . "'")
            ->toHtml();
    }
39808
function publishHandlerCustom( $element, &$params )
    {
        $ret = null;

        $element->removeAttribute( 'inline' );
        $this->convertCustomAttributes( $element );

        return $ret;
    }
430492
protected void toggleElementVisibility() {

        if (CmsDomUtil.hasClass(HIDE_ELEMENTS_CLASS, getGroupContainerWidget().getElement())) {
            getGroupContainerWidget().removeStyleName(HIDE_ELEMENTS_CLASS);
        } else {
            getGroupContainerWidget().addStyleName(HIDE_ELEMENTS_CLASS);
        }
        getGroupContainerWidget().refreshHighlighting();
    }
765444
private function assertCheckboxState(NodeElement $toggleableElement, $expectedState)
    {
        if ($toggleableElement->isChecked() !== $expectedState) {
            throw new \RuntimeException(sprintf(
                "Toggleable element state is '%s' but expected '%s'.",
                $toggleableElement->isChecked() ? 'true' : 'false',
                $expectedState ? 'true' : 'false'
            ));
        }
    }
497324
public function _doJQuery($element, $jqueryCall, $param="", $jsCallback="", $immediatly=false) {
		$param=$this->_prep_value($param);
		$callback="";
		if ($jsCallback!="")
			$callback=", function(event){\n{$jsCallback}\n}";
			$script="$(".$this->_prep_element($element).").".$jqueryCall."(".$param.$callback.");\n";
			if ($immediatly)
				$this->jquery_code_for_compile[]=$script;
				return $script;
	}
429878
public function renderElement(Element $element) : string
    {
        // @todo - if the element implements neither HasContent or HasChildren, make it self-closing <img />
        // @todo - fix indentation - currently it adds an extra line as the middle indentation
        return $this->indent($this->depth, sprintf('<%s%s>', $element->getElement(), $this->getAttributesForElement($element))) .
            $this->indent($this->depth++, $this->getContentForElement($element)) .
            $this->indent(--$this->depth, sprintf('</%s>', $element->getElement()));
    }
1345806
public function render(ElementInterface $element): string
    {
        if (! $element instanceof ChoiceElementInterface) {
            throw new InvalidClassException(
                sprintf(
                    'The given element "%s" has to implement "%s"',
                    $element->name(),
                    ChoiceElementInterface::class
                )
            );
        }
        $list = $element->choices();
        $attributes = $element->attributes();
        $choices = $list->choices();
        $selected = $list->choicesForValue((array) $element->value());

        $html = [];

        if (count($choices) < 1) {
            return '';
        }

        $isMultiChoice = false;
        if (count($choices) > 1) {
            $attributes['name'] = $element->name().'[]';
            $isMultiChoice = true;
        }

        foreach ($choices as $key => $name) {
            $elementAttr = $attributes;
            $elementAttr['value'] = $key;
            $elementAttr['checked'] = isset($selected[$key]);
            $elementAttr['id'] = $isMultiChoice
                ? $element->id().'_'.$key
                : $element->id();

            $label = sprintf(
                '<label for="%s">%s</label>',
                $this->escapeAttribute($elementAttr['id']),
                $this->escapeHtml($name)
            );

            $html[] = sprintf(
                '<p><input %s /> %s</p>',
                $this->attributesToString($elementAttr),
                $label
            );
        }

        return implode('', $html);
    }
67449
public function trigger($element='this', $event='click', $immediatly=false) {
		return $this->js->_trigger($element, $event, $immediatly);
	}
103390
public function _getElementHtml(
        \Magento\Framework\Data\Form\Element\AbstractElement $element
    ) {
        $element->setData('readonly', 1);
        $element->setData('class', 'ddg-dynamic-content');
        return parent::_getElementHtml($element);
    }
670
public function outputElement() : string
    {
        $selected = explode(',', $this->getValue());
        $disabled = $this->disabled;
        $hidden = $this->hidden;

        $return = '<div class="checkboxgroup">';
        foreach ($this->options as $val=>$txt) {
            if (in_array($val, $hidden)) {
                break;
            }
            $d = (in_array($val, $disabled)) ? ' disabled="disabled"' : '';
            $s = (in_array($val, $selected)) ? ' checked="checked"' : '';
            $return .= '<div><input id="cb-' . $val . '" type="checkbox" name="' . $this->attributes['name'] . '[]" value="' . $val . '" ' . $d . $s . ' /> <label class="cblabel" for="cb-' . $val . '">' . $txt . "</label></div>\n";
        }
        $return .= '</div>';

        return $return;
    }