@param Toggle $toggle

@return string
490217
private function serializeStrategy(Toggle $toggle)
    {
        switch ($toggle->getStrategy()) {
            case Toggle::STRATEGY_AFFIRMATIVE:
                return 'affirmative';
            case Toggle::STRATEGY_MAJORITY:
                return 'majority';
            case Toggle::STRATEGY_UNANIMOUS:
                return 'unanimous';
        }
    }
893716
function _toggleBoundaryToggle () {
        var somethingEntered = false;

        $('input[type="number"]').each(function () {
            if (parseInt(this.value, 10) !== 0) {
                somethingEntered = true;
            }
        });

        if (somethingEntered) {
            $showBoundsCheck.parent().slideDown();
        }
        else {
            $showBoundsCheck.parent().slideUp();
        }
    }
992430
protected function renderToggleButton($type="nav")
    {
        $bar = Html::tag('span', '', ['class' => 'icon-bar']);
        $screenReader = "<span class=\"sr-only\">{$this->screenReaderToggleText}</span>";
        if($type=="nav"){
            return Html::button("{$screenReader}\n{$bar}\n{$bar}\n{$bar}", [
                'class' => 'navbar-toggle',
                'data-toggle' => 'collapse',
                'data-target' => "#{$this->containerOptions['id']}",
            ]);
        }
        else{
            return Html::button("{$screenReader}\n{$bar}\n{$bar}\n{$bar}",[
                'class' => 'navbar-sidebar',
                'data-toggle' => 'offcanvas',
                'role' => "button",
                //'style' => "display:block;"
            ]);
        }
    }
1262734
public function toString($indent = null)
    {
        $helperManager = $this->getView()->getHelperPluginManager();
        if ($helperManager->has('dojo')) {
            $dojo = $helperManager->get('dojo');
            $dojo->initialize();
        }
        return parent::toString($indent);
    }
126296
public function processForm(array $data, array $toggles = [])
    {
        $this->initInternals();

        return $this->blueprintSchema->processForm($data, $toggles);
    }
714651
public function closeTag($tag)
    {
        if (!in_array($tag, $this->voidTags)) {
            return replace_variables($this->closeTagPattern, compact('tag'));
        }

        return '';
    }
515569
public function toFullyQualifiedString() : string
   {

      if ( empty( $this->_subDomainName ) )
      {

         if ( null === $this->_sld )
         {
            return '';
         }

         return $this->_sld->toFullyQualifiedString();

      }

      if ( null === $this->_sld )
      {
         return $this->_subDomainName;
      }

      return $this->_subDomainName . '.' . $this->_sld->toFullyQualifiedString();

   }
4245
public function make_toggle($key) {
        $attrs = array('href' => '#');

        // Do proper lang strings for title attributes exist for the given key?
        $strmanager = \get_string_manager();
        $titleall = get_string('all');
        $titlenone = get_string('none');
        if ($strmanager->string_exists(strtolower($key) . 'all', 'gradereport_singleview')) {
            $titleall = get_string(strtolower($key) . 'all', 'gradereport_singleview');
        }
        if ($strmanager->string_exists(strtolower($key) . 'none', 'gradereport_singleview')) {
            $titlenone = get_string(strtolower($key) . 'none', 'gradereport_singleview');
        }

        $all = html_writer::tag('a', get_string('all'), $attrs + array(
            'class' => 'include all ' . $key,
            'title' => $titleall
        ));

        $none = html_writer::tag('a', get_string('none'), $attrs + array(
            'class' => 'include none ' . $key,
            'title' => $titlenone
        ));

        return html_writer::tag('span', "$all / $none", array(
            'class' => 'inclusion_links'
        ));
    }
645257
protected function toggleElementClass(DOMElement $domReference, $class, $toggle)
    {
        // Get all existing classes.
        $classes = array_filter(explode(' ', trim($domReference->getAttribute('class'))));

        // Add or remove the broken class from the link, depending on the link status.
        if ($toggle) {
            $classes = array_unique(array_merge($classes, [$class]));
        } else {
            $classes = array_diff($classes, [$class]);
        }

        if (!empty($classes)) {
            $domReference->setAttribute('class', implode(' ', $classes));
        } else {
            $domReference->removeAttribute('class');
        }
    }
1258674
public function toggle($check_or_uncheck = null)
	{
		if ( !isset($check_or_uncheck) ) {
			$check_or_uncheck = !$this->isChecked();
		}

		return $check_or_uncheck ? $this->check() : $this->uncheck();
	}
30179
function() {
            var self            = this,
                delineator      = self.config.controls.toggleLogic === 'or' ? ', ' : '',
                toggleSelector  = '';

            self.callActions('beforeGetToggleSelector', arguments);

            self.toggleArray = h.clean(self.toggleArray);

            toggleSelector = self.toggleArray.join(delineator);

            if (toggleSelector === '') {
                toggleSelector = self.config.controls.toggleDefault;
            }

            return self.callFilters('selectorGetToggleSelector', toggleSelector, arguments);
        }
999714
private function displayBindings()
    {
        $bindings = array();
        foreach ($this->bindings as $binding) {
            if (is_object($binding)) {
                $bindings[] = get_class($binding);
            } else {
                $bindings[] = (string) $binding;
            }
        }

        return implode(',', $bindings);
    }
548944
function toggle($field, $field_extend = []) {
        $toggler = new Toggler();
        $toggler->setState($this->model->{$field})
                ->setLabel($this->model->getEntityLabel($field))
                ->setAttribute('data-action', 'toggle')
                ->setAttribute('data-field', $field)
                ->setAttribute('data-field-extend', http_build_query($field_extend));

        return $toggler;
    }
1058954
private function getOtherRecom($each_other)
    {
        $text = $each_other->find('.spaceit_pad', 0)->plaintext;
        $useless_area = $each_other->find('.js-toggle-recommendation-button', 0) ? $each_other->find('.js-toggle-recommendation-button', 0)->plaintext : null;
        $text = str_replace($useless_area, '', $text);
        $text = str_replace('&lt;', '<', $text);
        $text = preg_replace('/\s{2,}/', "\n", $text);

        return $text;
    }
1121518
def toggle_save
      return if !verify_logged_in

      resp = Caboose::StdClass.new
      if SavedProperty.where(:user_id => logged_in_user.id, :mls => params[:mls]).exists?
        SavedProperty.where(:user_id => logged_in_user.id, :mls => params[:mls]).destroy_all
        resp.saved = false
      else
        p = SavedProperty.new
        p.user_id = logged_in_user.id
        p.mls = params[:mls]
        p.save
        resp.saved = true
      end

      render :json => resp
    end
292939
public function toggleDisplayEvent($initialState, $invert = false)
    {
        $action = strtolower($initialState) === 'hide' ? 'show' : 'hide';
        if ($invert) {
            $action = $action === 'hide' ? 'show' : 'hide';
        }
        return sprintf('userform.field.%s', $action);
    }
911502
public function getItagInfo($itag)
	{
		$itag = '' . $itag;
		$itags = $this->getItags();

		if (property_exists($itags, $itag))
			return $itags->$itag;

		return null;
	}