Location: PHPKode > scripts > SecureLab > securelab/securelab-addons.php
<?php

 class SecureLabAddonsManager {
		
	public function __construct() {
		
		return true;
		
	}
	
	public function RunAddon( $AddonName ) {

		try {

			if( file_exists( "system/addons/" . $AddonName . "/addon.public.php" ) ) {

				include_once( "system/addons/" . $AddonName . "/addon.public.php" );

				if( class_exists( $AddonName . "Addon" ) ) {

					if( ! is_callable( $AddonName . "Addon::__construct" ) and is_callable( $AddonName . "Addon::_Requirements" ) ) {

						$Requirements = call_user_func($AddonName . "Addon::_Requirements");

						foreach( $Requirements as $RequirementName => $RequirementValue ) {

							if( $RequirementValue == true ) {

								switch($RequirementName) {

									case "AddonsAPI":

										#include_once("securelab-addonsapi.php");

										@ define( "ADDON_CURRENT_DIR", "system/addons/" . $AddonName );
										
										break;

									case "ConfigurationFileAccess":

										@ define( "SECURELAB_CONFIGURATION_DIR", "system/configuration/SLConfiguration.Main.Secured.php" );

										break;
										
								}
							
							}
						
						}
						
						@ call_user_func( $AddonName . "Addon::_Run" );
						
					}  else  {
			
						throw new Exception("Addon does not builded correctly");
						
						return false;
					
					}
				
				}  else  {
			
				throw new Exception("Addon does not builded correctly");
				
				return false;
			
			}
			
			}  else  {
			
				throw new Exception("Addon does not exists");
				
				return false;
			
			}
			
		}  catch ( Exception $ErrorMessage )  {
		
			global $_SecureLabMainClass;
					
			@ $_SecureLabMainClass->DumpAPI->CreateDumpEvent( array(
	
				"ErrorReporterFile" => __FILE__,
					
				"ErrorReporterMessage" => $ErrorMessage->getMessage(),
				
				"ErrorOccuredObject" => __METHOD__,
				
				"ErrorIncomingEvent" => $AddonName,
				
				"ErrorFileLine" => __LINE__
				
			) );
		
		}
		
	}
	
	public function AddonExists( $AddonName ) {
	
		return @ file_exists( "system/addons/" . $AddonName . "/addon.public.php" );
	
	}
	
 }
	  
	 ?>
Return current item: SecureLab