<?php    

defined('C5_EXECUTE') or die(_("Access Denied."));

class BlockWhosonlinePackage extends Package {

	protected $pkgHandle = 'block_whosonline';
	protected $appVersionRequired = '5.3.3';
	protected $pkgVersion = '2.2';
	
	public function getPackageDescription() {
		return t("Who's Online block by <a href='www.theoryblister.com'>TheoryBlister</a>.<br/>Future releases will have options for registered users.");
	}
	
	public function getPackageName() {
		return t("Who's Online");
	}

    public function on_start() {
        Events::extend('on_page_view',
    'TheoryblisterWhosOnlineBlockController',
    'eventOnPageView',
    'packages/'. $this->pkgHandle. '/blocks/theoryblister_whos_online/controller.php');

    }
    
	public function install() {
		$pkg = parent::install();
		
		// install block		
		BlockType::installBlockTypeFromPackage('theoryblister_whos_online', $pkg);
        //move file into config if site_events file is not present else append event stanza
	}

    public function upgrade() {
        parent::upgrade();
        //$pkg=Package::getByHandle($this->pkgHandle);
       // BlockType::installBlockTypeFromPackage('theoryblister_whos_online', $pkg);
    }




}