<?php  
defined('C5_EXECUTE') or die("Access Denied.");

/*
Editor Comment by John Liddiard (aka JohntheFish)
www.c5magic.co.uk
This software is licensed under the terms described in the concrete5.org marketplace.
Please find the add-on there for the latest license copy.
*/

class JlEditorCommentPackage extends Package {

	protected $pkgHandle = 'jl_editor_comment';
	protected $appVersionRequired = '5.6';
	protected $pkgVersion = '1.0';


	public function getPackageName() {
		return t('Editor Comment');
	}

	public function getPackageDescription() {
		return t('Enter a comment that shows only in edit mode. For use by site developers who want to leave notes/comments for those editing a page in the future.');
	}

	public function install() {
		$pkg = parent::install();
		// install block
		BlockType::installBlockTypeFromPackage('jl_editor_comment', $pkg);
	}

 	public function upgrade() {		
 		// make sure block is installed
 		if(!is_object(BlockType::getByHandle('jl_editor_comment'))){
			BlockType::installBlockTypeFromPackage('jl_editor_comment', $this);
 		}
 		parent::upgrade();
	}


	/*
	Clean up on uninstall
	*/
	public function uninstall() {
		parent::uninstall();
		$db = Loader::db();
		$db->Execute('DROP TABLE IF EXISTS btJlEditorComment');
	}


}