<?php

class Waindigo_InstallUpgrade_Option_CopyrightRemoval
{

    public static function renderVisibilityRadio(XenForo_View $view, $fieldPrefix, array $preparedOption, $canEdit)
    {
        $preparedOption['formatParams'] = array(
            'visible' => new XenForo_Phrase('waindigo_always_show_copyright_notice_installupgrade'),
            'js' => new XenForo_Phrase('waindigo_hide_copyright_notice_with_javascript_installupgrade'),
            'css' => new XenForo_Phrase('waindigo_hide_copyright_notice_with_css_installupgrade')
        );

        if ($preparedOption['option_value'] != 'none') {
            return XenForo_ViewAdmin_Helper_Option::renderOptionTemplateInternal('option_list_option_radio', $view,
                $fieldPrefix, $preparedOption, $canEdit);
        }
    }

    public static function renderPositionRadio(XenForo_View $view, $fieldPrefix, array $preparedOption, $canEdit)
    {
        $preparedOption['formatParams'] = array(
            'below-xenforo-copyright' => new XenForo_Phrase('waindigo_below_xenforo_copyright_installupgrade'),
            'below-bottom-breadcrumbs' => new XenForo_Phrase('waindigo_below_bottom_breadcrumbs_installupgrade')
        );

        $xenOptions = XenForo_Application::get('options');

        if ($xenOptions->waindigo_installUpgrade_copyrightVisibility != 'none') {
            return XenForo_ViewAdmin_Helper_Option::renderOptionTemplateInternal('option_list_option_radio', $view,
                $fieldPrefix, $preparedOption, $canEdit);
        }
    }

    public static function renderCheckbox(XenForo_View $view, $fieldPrefix, array $preparedOption, $canEdit)
    {
        $xenOptions = XenForo_Application::get('options');

        if ($xenOptions->waindigo_installUpgrade_copyrightVisibility != 'none') {
            return XenForo_ViewAdmin_Helper_Option::renderOptionTemplateInternal('option_list_option_onoff', $view,
                $fieldPrefix, $preparedOption, $canEdit);
        }
    }
}