HEX
Server: nginx/1.26.1
System: Linux 850a3e23ecee 5.15.0-122-generic #132-Ubuntu SMP Thu Aug 29 13:45:52 UTC 2024 x86_64
User: (1000)
PHP: 8.2.27
Disabled: NONE
Upload Files
File: /var/www/html/wp-content/plugins/fixed-toc/frontend/html/class-element-container-outer.php
<?php

/**
 * Container outer element
 *
 * @since 3.0.0
 * @see Fixedtoc_Element
 */
class Fixedtoc_Element_Container_outer extends Fixedtoc_Element {

	/**
	 * Data of TOC.
	 *
	 * @since 3.0.0
	 * @access protected
	 * @var array
	 */
	protected $data;

	/**
	 * Constructor.
	 *
	 * @since 3.0.0
	 * @access public
	 *
	 * @param array $data Data of TOC
	 */
	public function __construct( $data ) {
		$this->data = $data;
		parent::__construct();
	}

	/**
	 * Set the tag name.
	 *
	 * @since 3.0.0
	 * @see Fixedtoc_Element
	 *
	 * @return void
	 */
	protected function set_tagname() {
		$this->tagname = 'div';
	}

	/**
	 * Set the attributes array.
	 *
	 * @since 3.0.0
	 * @see Fixedtoc_Element
	 *
	 * @return void
	 */
	protected function set_attrs() {
		$this->attrs = array(
			'id'    => 'ftwp-container-outer',
			'class' => $this->get_cls()
		);
	}

	/**
	 * Get the class property value.
	 *
	 * @since 3.0.0
	 * @access private
	 *
	 * @return string
	 */
	private function get_cls() {
		return 'ftwp-in-post ftwp-float-' . fixedtoc_get_val( 'contents_float_in_post' );
	}

	/**
	 * Set the Content inner tags.
	 *
	 * @since 3.0.0
	 * @see Fixedtoc_Element
	 *
	 * @return void
	 */
	protected function set_content() {
		require_once 'class-element-container.php';
		$obj_container = new Fixedtoc_Dom( new Fixedtoc_Element_Container( $this->data ) );
		$this->content = $obj_container->get_html();
	}

}