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-list-item.php
<?php

/**
 * List item element
 *
 * @since 3.0.0
 * @see Fixedtoc_Element
 */
class Fixedtoc_Element_List_Item extends Fixedtoc_Element {

	/**
	 * The datum of the current item.
	 *
	 * @since 3.0.0
	 * @access protected
	 * @var array
	 */
	protected $datum;

	/**
	 * Constructor.
	 *
	 * @since 3.0.0
	 * @access public
	 *
	 * @param array $datum
	 *            The datum of the current item.
	 */
	public function __construct( $datum ) {
		$this->datum = $datum;
		parent::__construct();
	}

	/**
	 * A datum
	 *
	 * @since 3.0.0
	 * @access protected
	 * @var array
	 */
	protected $attrs = array();

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

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

	/**
	 * Set the Content inner tags.
	 *
	 * @since 3.0.0
	 * @see Fixedtoc_Element
	 *
	 * @return void
	 */
	protected function set_content() {
		require_once 'class-element-list-anchor.php';
		if ( isset( $this->datum['page'] ) ) {
			require_once 'class-element-list-anchor-multipage.php';
			$obj_anchor = new Fixedtoc_Dom( new Fixedtoc_Element_List_Anchor_Multipage( $this->datum ) );
		} else {
			$obj_anchor = new Fixedtoc_Dom( new Fixedtoc_Element_List_Anchor( $this->datum ) );
		}

		$this->content = $obj_anchor->get_html();
	}

}