<?php
namespace Engine\Logger\Context;

class Xml extends \Engine\Logger\Context\StringRaw
{

	protected function renderOperations_groups($classes)
	{
		$classes = ["string", "limit-width", "type-string", "type-xml", "type-html", ];
		$outputOperations = parent::renderOperations_groups($classes);

		$outputOperations.= "<span class='group'>";
		$outputOperations.= "<button data-group='reformat' data-type='raw' class='active'>raw</button>";
		$outputOperations.= "<button data-group='reformat' data-type='xml'>as xml</button>";
		$outputOperations.= "</span>";

	}

	protected function renderOperations_download_determineData(array $classes, $logRow=null, $key=null)
	{
		$fileName = "file";
		$fileExtension = "xml";
		if ($logRow && $key) {
			$fileName = sprintf("%s-%s", $logRow['logSession'], $key);
		}

		$value = $this->value;

		return [$fileName, $fileExtension, $value];
	}

}
