<?php

namespace IPS\{app}\extensions\core\UIReview;

use IPS\Content\Comment as BaseComment;
use IPS\Content\Item as BaseItem;
use IPS\Helpers\Form\FormAbstract;
use IPS\Helpers\Menu\MenuItem;
use IPS\Output\UI\Review as UIReview;
use function defined;

/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
	header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
	exit;
}

/**
 * @brief	Content UI extension: {class}
 */
class {class} extends UIReview
{

	/**
	 * @brief	Class to extend
	 */
	 public static ?string $class = '{review}';

	/**
	 * Can be used to add additional css classes to the comment
	 *
	 * @param BaseComment $comment
	 * @return string
	 */
	public function css( BaseComment $comment ): string
	{
		return '';
	}

	/**
	 * Can be used to add additional data attributes to the comment
	 *
	 * @param BaseComment $comment
	 * @return string
	 */
	public function dataAttributes( BaseComment $comment ): string
	{
		return '';
	}

	/**
	 * Can be used to attach additional content to the author panel
	 *
	 * @param BaseComment $comment
	 * @return string
	 */
	public function authorPanel( BaseComment $comment ): string
	{
		return '';
	}

	/**
	 * returns additional menu items for the comment menu
	 *
	 * @param BaseComment $comment
	 * @return array<string,MenuItem>
	 */
	public function menuItems( BaseComment $comment ): array
	{
		return [];
	}

	/**
	 * Add elements to the comment form
	 *
	 * @param BaseComment|null $comment
	 * @param BaseItem $item
	 * @return array<string,FormAbstract>
	 */
	public function formElements( ?BaseComment $comment, BaseItem $item ): array
	{
		return [];
	}

	/**
	 * Triggered after the comment form is saved
	 *
	 * @param BaseComment $comment
	 * @param array $values
	 * @return void
	 */
	public function formPostSave( BaseComment $comment, array $values ): void
	{

	}
}