Make the HTML element that toggles all the checkboxes on or off.

@param string $key A unique key for this control - inserted in the classes.
@return string
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'
        ));
    }
72227
public function get($key)
    {
        if ($key instanceof UniqueId) {
            $key = $key->id();
        }

        return $this->elements->get($key);
    }
891896
public function releaseKey($key)
    {
        $this->executor->execute(DriverCommand::SEND_KEYS_TO_ACTIVE_ELEMENT, [
            'value' => [(string) $key],
        ]);

        return $this;
    }
281046
private function getSectionFromKey($key)
    {
        $section = null;

        $parts = explode('.', $key);
        if (count($parts) > 1) {
            $section = $parts[0];
        }

        if (array_key_exists($section, $this->sectionMap)) {
            $section = $this->sectionMap[$section];
        }

        if (null === $section) {
            $section ='PHP';
        }

        return $section;
    }
549533
public function field($key)
    {
        return View::make('decoy::layouts.blank')
            ->nest('content', 'decoy::elements.field', [
                'element' => app('decoy.elements')
                    ->localize(Decoy::locale())
                    ->hydrate(true)
                    ->get($key),
            ]);
    }
381640
public function isFullPageElementType ($key)
    {
        return array_key_exists($key, $this->elementTypes)
            ? $this->elementTypes[$key]["isFullPage"]
            : null;
    }
502546
function get_html( $type, $key ) {
		$options       = Product::PLUGIN_TYPE === $type ? $this->options_plugin : $this->options_theme;
		$button_cancel = Product::PLUGIN_TYPE === $type ? $this->button_cancel : 'Skip';
		$button_submit = Product::PLUGIN_TYPE === $type ? $this->button_submit : 'Submit';
		$options       = $this->randomize_options( apply_filters( $this->product->get_key() . '_feedback_deactivate_options', $options ) );
		$button_submit = apply_filters( $this->product->get_key() . '_feedback_deactivate_button_submit', $button_submit );
		$button_cancel = apply_filters( $this->product->get_key() . '_feedback_deactivate_button_cancel', $button_cancel );

		$options += $this->other;

		$list = '';
		foreach ( $options as $title => $attributes ) {
			$id    = $attributes['id'];
			$list .= '<li ti-option-id="' . $id . '"><input type="radio" name="ti-deactivate-option" id="' . $key . $id . '"><label for="' . $key . $id . '">' . str_replace( '{theme}', $this->product->get_name(), $title ) . '</label>';
			if ( array_key_exists( 'type', $attributes ) ) {
				$list       .= '<div>';
				$placeholder = array_key_exists( 'placeholder', $attributes ) ? $attributes['placeholder'] : '';
				switch ( $attributes['type'] ) {
					case 'text':
						$list .= '<textarea style="width: 100%" rows="1" name="comments" placeholder="' . $placeholder . '"></textarea>';
						break;
					case 'textarea':
						$list .= '<textarea style="width: 100%" rows="2" name="comments" placeholder="' . $placeholder . '"></textarea>';
						break;
				}
				$list .= '</div>';
			}
			$list .= '</li>';
		}

		$disclosure_new_labels = apply_filters( $this->product->get_slug() . '_themeisle_sdk_disclosure_content_labels', [], $this->product );
		$disclosure_labels     = array_merge(
			[
				'title' => 'Below is a detailed view of all data that ThemeIsle will receive if you fill in this survey. No domain name, email address or IP addresses are transmited after you submit the survey.',
				'items' => [
					sprintf( '%s %s version %s %s %s %s', '<strong>', ucwords( $this->product->get_type() ), '</strong>', '<code>', $this->product->get_version(), '</code>' ),
					sprintf( '%s Uninstall reason %s %s Selected reson from the above survey %s ', '<strong>', '</strong>', '<i>', '</i>' ),
				],
			],
			$disclosure_new_labels
		);

		$info_disclosure_link    = '<a href="#" id="' . $this->product->get_key() . '-info-disclosure">' . apply_filters( $this->product->get_slug() . '_themeisle_sdk_info_collect_cta', 'What info do we collect?' ) . '</a>';
		$info_disclosure_content = '<div id="' . $this->product->get_key() . '-info-disclosure-content"><p>' . wp_kses_post( $disclosure_labels['title'] ) . '</p><ul>';
		foreach ( $disclosure_labels['items'] as $disclosure_item ) {
			$info_disclosure_content .= sprintf( '<li>%s</li>', wp_kses_post( $disclosure_item ) );
		}
		$info_disclosure_content .= '</ul></div>';

		return
			'<div id="' . $this->product->get_key() . '"><ul class="ti-list">' . $list . '</ul>'
			. $info_disclosure_content
			. '<div class="actions">'
			. get_submit_button(
				$button_submit,
				'secondary',
				$this->product->get_key() . 'ti-deactivate-yes',
				false,
				array(
					'data-after-text' => $button_submit,
					'disabled'        => true,
				)
			)
			. wp_kses_post( $info_disclosure_link )
			. get_submit_button( $button_cancel, 'primary', $this->product->get_key() . 'ti-deactivate-no', false )
			. '</div></div>';
	}
1163316
public function getStyle($key)
    {
        $styles = Helpers::cssStringToArray($this->getAttribute('style'));
        return (isset($styles[$key]) ? $styles[$key] : null);
    }
597673
public function get($key)
    {
        if ($this->has($key) === false) {
            throw new \RuntimeException(sprintf('Element with key: "%s" not found.', $key));
        }

        return $this->elements[$key];
    }
409829
protected function trimSuffix($key)
    {
        $suffix = $this->config->getCategoryUrlSuffix();
        //user can enter .html or html suffix
        if ($suffix != '' && $suffix[0] != '.') {
            $suffix = '.' . $suffix;
        }

        $key = str_replace($suffix, '', $key);

        $suffix = $this->config->getPostUrlSuffix();
        //user can enter .html or html suffix
        if ($suffix != '' && $suffix[0] != '.') {
            $suffix = '.' . $suffix;
        }

        $key = str_replace($suffix, '', $key);

        return $key;
    }
171206
public function clean(string $key = null): ConfigInterface
    {
        if (null !== $key) {
            unset($this->_config[$key]);
        } else {
            $this->_config = [];
        }

        return $this;
    }
1167438
public function get($key) {
        return isset($this->_elements[$key]) ? $this->_elements[$key] : null;
    }
733995
public function getToolbarButton($key)
	{
		if (!isset($this->toolbar_buttons[$key])) {
			throw new DataGridException("There is no toolbar button at key [$key] defined.");
		}

		return $this->toolbar_buttons[$key];
	}
280564
public function attribute(string $key)
    {
        if ($key !== 'value') {
            return parent::attribute($key);
        }

        return array_map(
            function (ElementInterface $element) {
                return $element->value();
            },
            $this->elements()
        );
    }
1267474
protected function mapper(string $key)
    {
        $character = $this->getOption('character');
        $config = config('mentions.pools.' . $this->getOption('pool'));

        $mention = str_replace($character, '', trim($key));

        $mentionned = $config['model']::whereRaw("LOWER({$config['column']}) = ?", [Str::lower($mention)])->first();

        if ($mentionned == false) {
            return null;
        }

        if ($this->getOption('mention') == true && $mentionned->getKey() !== Auth::id()) {
            $this->model->mention($mentionned, $this->getOption('notify'));
        }

        return '/' . preg_quote($key) . '(?!\w)/';
    }
698821
protected function &getAttributeValue(string $key)
    {
        if (isset($this->attributes[$key])) {

            return $this->attributes[ $key ];
        }

        $null = null;

        return $null;
    }
1108991
protected function createForeignKey($key) {
		$res = "\n\t\$table->addForeignKeyConstraint('".$key->getForeignTableName()."', ".$this->outputPHP($key->getLocalColumns(), 2).", ".$this->outputPHP($key->getForeignColumns(), 2).
			", ".$this->outputPHP($key->getOptions(), 2).", '".$key->getName()."');";

		return $res;
	}