| @@ -50,11 +50,13 @@ | ||
| 50 | 50 | * put your comment there... |
| 51 | 51 | * |
| 52 | 52 | */ |
| 53 | 53 | public function main() { |
| 54 | - // Run the coupling! | |
| 55 | - $this->controllerName = 'blocks-coupling'; | |
| 56 | - $this->route(); | |
| 54 | + // Run the coupling only if installed! | |
| 55 | + if (CJTPlugin::getInstance()->isInstalled()) { | |
| 56 | + $this->controllerName = 'blocks-coupling'; | |
| 57 | + $this->route(false); | |
| 58 | + } | |
| 57 | 59 | // Run all the aother access points! |
| 58 | 60 | CJTPlugin::getInstance()->listen(); |
| 59 | 61 | } |
| 60 | 62 | |
| @@ -62,17 +64,21 @@ | ||
| 62 | 64 | * put your comment there... |
| 63 | 65 | * |
| 64 | 66 | */ |
| 65 | 67 | public static function uninstall() { |
| 66 | - // Get the only instance we've for the main access point! | |
| 67 | - $mainAccessPointObject = self::$instance; | |
| 68 | - // Load default controller! | |
| 69 | - $mainAccessPointObject->controllerName = 'default'; | |
| 70 | - $controller = $mainAccessPointObject->route() | |
| 71 | - // Fire uninstall action! | |
| 72 | - ->setAction('uninstall') | |
| 73 | - ->_doAction(); | |
| 74 | - return $controller; | |
| 68 | + // For the uninstaller to be run eraseData setting must be enabled. | |
| 69 | + cssJSToolbox::import('models:settings:uninstall.php'); | |
| 70 | + $settings = new CJTSettingsUninstallPage(); | |
| 71 | + if ($settings->eraseData) { | |
| 72 | + // Get the only instance we've for the main access point! | |
| 73 | + $mainAccessPointObject = self::$instance; | |
| 74 | + // Load default controller! | |
| 75 | + $mainAccessPointObject->controllerName = 'default'; | |
| 76 | + $controller = $mainAccessPointObject->route(false) | |
| 77 | + // Fire uninstall action! | |
| 78 | + ->setAction('uninstall') | |
| 79 | + ->_doAction(); | |
| 80 | + } | |
| 75 | 81 | } |
| 76 | 82 | |
| 77 | 83 | } // End class. |
| 78 | 84 | |