<?php

lt_include(PLOG_CLASS_PATH.'class/view/admin/adminplugintemplatedview.class.php');

// implements the main view of the google adsense plugin
class PluginGoogleAdsenseConfigView extends AdminPluginTemplatedView
{
    function PluginGoogleAdsenseConfigView($blogInfo)
	{
		$this->AdminPluginTemplatedView($blogInfo, 'googleadsense', 'googleadsense');
	}

	function render()
	{
		// load some configuration settings
		$blogSettings = $this->_blogInfo->getSettings();
		$pluginEnabled = $blogSettings->getValue('plugin_googleadsense_enabled');
		$client = $blogSettings->getValue('plugin_googleadsense_client');
		$contentEnabled = $blogSettings->getValue('plugin_googleadsense_content_enabled');
		$contentWidth = $blogSettings->getValue('plugin_googleadsense_content_width');
		$contentHeight = $blogSettings->getValue('plugin_googleadsense_content_height');
		$contentFormat = $blogSettings->getValue('plugin_googleadsense_content_format');
		$contentType = $blogSettings->getValue('plugin_googleadsense_content_type');
		$contentChannel = $blogSettings->getValue('plugin_googleadsense_content_channel');
		$suggestionEnabled = $blogSettings->getValue('plugin_googleadsense_suggestion_enabled');
		$suggestionWidth = $blogSettings->getValue('plugin_googleadsense_suggestion_width');
		$suggestionHeight = $blogSettings->getValue('plugin_googleadsense_suggestion_height');
		$suggestionFormat = $blogSettings->getValue('plugin_googleadsense_suggestion_format');
		$suggestionChoice = $blogSettings->getValue('plugin_googleadsense_suggestion_choice');
		$suggestionChannel = $blogSettings->getValue('plugin_googleadsense_suggestion_channel');
		$searchEnabled = $blogSettings->getValue('plugin_googleadsense_search_enabled');

		// create a view and export the settings to the template
		$this->setValue('pluginEnabled', $pluginEnabled);
		$this->setValue('client', $client);
		$this->setValue('contentEnabled', $contentEnabled);
		$this->setValue('contentWidth', $contentWidth);
		$this->setValue('contentHeight', $contentHeight);
		$this->setValue('contentFormat', $contentFormat);
		$this->setValue('contentType', $contentType);
		$this->setValue('contentChannel', $contentChannel);
		$this->setValue('suggestionEnabled', $suggestionEnabled);
		$this->setValue('suggestionWidth', $suggestionWidth);
		$this->setValue('suggestionHeight', $suggestionHeight);
		$this->setValue('suggestionFormat', $suggestionFormat);
		$this->setValue('suggestionChoice', $suggestionChoice);
		$this->setValue('suggestionChannel', $suggestionChannel);
		$this->setValue('searchEnabled', $searchEnabled);

		parent::render();
	}
}

?>
