<?php

    include_once( PLOG_CLASS_PATH."class/plugin/pluginbase.class.php" );
    include_once( PLOG_CLASS_PATH."class/plugin/pluginmanager.class.php" );
    include_once( PLOG_CLASS_PATH."class/dao/articles.class.php" );
    include_once( PLOG_CLASS_PATH."class/data/Date.class.php" );
    
    /**
	* Plugin that offers features to get all articles from specific article cateogries 
	* as announcements and sticky articles.
	*/
    class PluginWeather extends PluginBase
    {
        var $pluginEnabled;
        
        var $area, $width, $height;			


        function PluginWeather()
        {
			$this->PluginBase();
			
            $this->id = "weather";
            $this->author = "Jase Chen";
            $this->desc = "";
  
            $this->locales = Array( "en_UK" , "zh_TW" );
            
            $this->init();
        }

		function init()
		{
			$this->registerAdminAction( "weather", "PluginWeatherConfigAction" );
			$this->registerAdminAction( "updateweather", "PluginWeatherUpdateConfigAction" );
			
			$menu =& Menu::getMenu();
			
            $this->addMenuEntry( "/menu/controlCenter/manageSettings", "Weather", "?op=weather");
		}

		function register()
		{
		    $blogSettings = $this->blogInfo->getSettings();
		    $this->pluginEnabled = $blogSettings->getValue( "plugin_weather_enabled" );

		    $this->area = $blogSettings->getValue( "plugin_weather_area" );
		    $this->width = $blogSettings->getValue( "plugin_weather_width" );
		    $this->height = $blogSettings->getValue( "plugin_weather_height" );

   		}
	    
  	    function isEnabled()
    	{
        	return $this->pluginEnabled;
    	}

        /**
		* Returns the stickyposts articles object of current blog
		*/
        function getPic()
        {
  	      return $this->area;
        }


        function width()
        {
          return $this->width;
        }                

        function height()
        {
          return $this->height;
        }                

    }
?>
