<?php

abstract class Tac_StopCountrySpam_Option_CountrySelector
{
	public static function renderOption(XenForo_View $view, $fieldPrefix, array $preparedOption, $canEdit)
	{
		$value = $preparedOption['option_value'];

		$editLink = $view->createTemplateObject('option_list_option_editlink', array(
			'preparedOption' => $preparedOption,
			'canEditOptionDefinition' => $canEdit
		));

		$spamModel = XenForo_Model::create('Tac_StopCountrySpam_Model_Spam');
		$countryOptions = $spamModel->getCountryOptionsArray($spamModel->getAllCountries(), $preparedOption, $fieldPrefix);
				
		return $view->createTemplateObject('option_list_option_multi_StopCountrySpam', array(
			'fieldPrefix' => $fieldPrefix,
			'listedFieldName' => $fieldPrefix . '_listed[]',
			'preparedOption' => $preparedOption,
			'formatParams' => $countryOptions,
			'editLink' => $editLink,
			'value' => isset($preparedOption['option_value']) ? $preparedOption['option_value'] : '',
			'adminClass' => "admincheckbox",
		));
		
	}
	

	
}