# css-javascript-toolbox/6.0.9/access.points/main.accesspoint.php

CSS &amp; JavaScript Toolbox, version 6.0.9. 82 lines.

- Page: https://pluginprobe.com/plugins/css-javascript-toolbox/6.0.9/code/access.points/main.accesspoint.php
- Raw: https://pluginprobe.com/plugins/css-javascript-toolbox/6.0.9/raw/access.points/main.accesspoint.php
- Modified: 2013-03-23T22:50:16+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/css-javascript-toolbox/6.0.9/code/access.points/main.accesspoint.php#L10-L20`.

```php
<?php
/**
* 
*/

// Disallow direct access.
defined('ABSPATH') or die("Access denied");

/**
* 
*/
class CJTMainAccessPoint extends CJTAccessPoint {
	
	/**
	* put your comment there...
	*  
	* @var mixed
	*/
	protected static $instance;
	
	/**
	* put your comment there...
	* 
	*/
	public function __construct() {
		// Initialize Access Point base!
		parent::__construct();
		// Set access point name!
		$this->name = 'main';
		// Needed for calling from nuinstall static method!
		self::$instance = $this;
	}

	/**
	* put your comment there...
	* 
	*/
	protected function doListen() {
		// Register uninstall hook!
		if (CJTPlugin::getInstance()->isInstalled()) {
			// Wordpress need STATIC method!
			register_uninstall_hook(CJTOOLBOX_PLUGIN_FILE, array(__CLASS__, 'uninstall'));	
		}
		// If not in uninstall state then plugins_loaded hook
		// used to run the plugin!
		add_action('plugins_loaded', array(&$this, 'main'));
	}
	
	/**
	* put your comment there...
	* 
	*/
	public function main() {
		// Run the coupling only if installed!
		if (CJTPlugin::getInstance()->isInstalled()) {
			$this->controllerName = 'blocks-coupling';
			$this->route(false);
		}
		// Run all the aother access points!
		CJTPlugin::getInstance()->listen();
	}
	
	/**
	* put your comment there...
	* 
	*/
	public static function uninstall() {
		// Get the only instance we've for the main access point!
		$mainAccessPointObject = self::$instance;
		// Load default controller!
		$mainAccessPointObject->controllerName = 'default';
		$controller = $mainAccessPointObject->route(false)
		// Fire uninstall action!
		->setAction('uninstall')
		->_doAction();
		return $controller;
	}
	
} // End class.

// Hookable!
CJTMainAccessPoint::define('CJTMainAccessPoint', array('hookType' => CJTWordpressEvents::HOOK_FILTER));
```
