<?php

    lt_include( PLOG_CLASS_PATH."class/plugin/pluginbase.class.php" );

    class PluginExtraFields extends PluginBase
    {
        var $_value;
        
        function PluginExtraFields( $source = "" )
        {
            $this->PluginBase( $source );
            
            $this->id      = "extrafields";
            $this->author  = "Jon Daley";
            $this->desc    = 'This plugin is an example of how to have an additional per-blog setting.';
            $this->version = "20080111";

            $this->locales = Array( "en_UK" );

			if( $source == "admin" )
				$this->initAdmin();
        }

		function initAdmin()
		{
            $this->registerAdminAction( "extrafields", "PluginExtraFieldsConfigAction" );
			$this->registerAdminAction( "updateExtraFieldsConfig", "PluginExtraFieldsUpdateConfigAction" );
			
			$menu =& Menu::getMenu();
            $this->addMenuEntry( "/menu/controlCenter/manageSettings", "ExtraFields", "?op=extrafields", "");
		}
 
		function register()
		{
		    $blogSettings = $this->blogInfo->getSettings();
			$this->_value = $blogSettings->getValue( "plugin_extrafields_value" );
		}

        function getField() {
            return $this->_value;
        }

		function getPluginConfigurationKeys()
		{
			lt_include( PLOG_CLASS_PATH."class/data/validator/stringvalidator.class.php" );
			
			return( Array(
				Array( "name" => "plugin_extrafields_value", "validator" => new StringValidator(), "type" => "string", "allowEmpty" => true )
			));
		}
    }
        
?>
