<?php defined('SYSPATH') or die('No direct access allowed.');

/**
 * This class provides HOST Plugin Support
 *
 * @package    Host
 * @category   Plugins
 * @author     Deon George
 * @copyright  (c) 2009-2013 Open Source Billing
 * @license    http://dev.osbill.net/license.html
 */
abstract class Host_Plugin implements Serializable {
	protected $hso; // Our Host Serve Object
	protected $_object;

	protected $curlopts = array(
		CURLOPT_CONNECTTIMEOUT => 60,
		CURLOPT_FAILONERROR => TRUE,
		CURLOPT_FOLLOWLOCATION => FALSE,
		CURLOPT_HEADER => FALSE,
		CURLOPT_HTTPPROXYTUNNEL => FALSE,
		CURLOPT_RETURNTRANSFER => TRUE,
		CURLOPT_TIMEOUT => 30,
		CURLOPT_SSL_VERIFYHOST => FALSE,
		CURLOPT_SSL_VERIFYPEER => FALSE,
		CURLOPT_VERBOSE => FALSE,
	);

	// Required abstract classes
	abstract public function __get($key);
	abstract public function admin_update();

	abstract public function manage_button(Model_Service_Plugin_Host $spho,$t);
	abstract public function admin_manage_button(Model_Host_Server $hso,$t);
	abstract protected function render_button($t,$sid,$u,$p);

	public function __construct(Model_Host_Server $hso) {
		$this->hso = $hso;
	}

	public function value($key,$value=NULL) {
		// If value is NULL, we are a getter
		if (is_null($value))
			return isset($this->hso->provision_plugin_data[$key]) ? $this->hso->provision_plugin_data[$key] : NULL;
		else
			$this->hso->provision_plugin_data[$key] = $value;
	}

}
?>
