add_help_tab(array( 'id' => 'dup-pro-help-tab-recovery', 'title' => DUP_PRO_U::__('Recovery'), 'content' => DupProSnapLibIOU::getInclude(DUPLICATOR_PRO_PLUGIN_PATH.'/views/tools/recovery/recovery-help-main.php') )); $currentScreen->add_help_tab(array( 'id' => 'dup-pro-help-tab-recovery-faq', 'title' => DUP_PRO_U::__('FAQ'), 'content' => DupProSnapLibIOU::getInclude(DUPLICATOR_PRO_PLUGIN_PATH.'/views/tools/recovery/recovery-help-faq.php') )); $currentScreen->add_help_tab(array( 'id' => 'dup-pro-help-tab-recovery-cases', 'title' => DUP_PRO_U::__('Example Usage'), 'content' => DupProSnapLibIOU::getInclude(DUPLICATOR_PRO_PLUGIN_PATH.'/views/tools/recovery/recovery-help-example-usage.php') )); $currentScreen->set_help_sidebar(self::getHelpSidebar()); } protected static function getHelpSidebar() { ob_start(); ?>
'duplicator-pro-tools', 'tab' => 'recovery' )); return $url.'?'.$queryStr; } public static function actionResetRecoveryPoint() { try { if (file_exists(DUPLICATOR_PRO_PATH_RECOVER)) { DupProSnapLibIOU::rrmdir(DUPLICATOR_PRO_PATH_RECOVER); } DUP_PRO_Package_Recover::setRecoveablePackage(false); } catch (Exception $e) { self::$isError = true; self::$errorMessage = $e->getMessage(); return false; } catch (Error $e) { self::$isError = true; self::$errorMessage = $e->getMessage(); return false; } return true; } public static function actionSetRecoveryPoint() { try { $recPackageId = DupProSnapLibUtil::filterInputRequest('recovery_package', FILTER_VALIDATE_INT); if ($recPackageId === DUP_PRO_Package_Recover::getRecoverPackageId()) { return true; } if (file_exists(DUPLICATOR_PRO_PATH_RECOVER)) { DupProSnapLibIOU::rrmdir(DUPLICATOR_PRO_PATH_RECOVER); } $errorMessage = ''; if (!DUP_PRO_Package_Recover::setRecoveablePackage($recPackageId, $errorMessage)) { throw new Exception("The old Recovery Point was removed but this package can't be set as the Recovery Point! ".$errorMessage); } } catch (Exception $e) { self::$isError = true; self::$errorMessage = $e->getMessage(); return false; } catch (Error $e) { self::$isError = true; self::$errorMessage = $e->getMessage(); return false; } return true; } public static function renderRecoveryWidged($options = array(), $echo = true) { ob_start(); $options = array_merge( array( 'selector' => false, 'subtitle' => '', 'copyLink' => false, 'copyButton' => true, 'launch' => true, 'download' => false, 'info' => true ), (array) $options); $recoverPackage = DUP_PRO_Package_Recover::getRecoverPackage(); $recoverPackageId = DUP_PRO_Package_Recover::getRecoverPackageId(); $recoveablePackages = DUP_PRO_Package_Recover::getRecoverablesPackages(); $selector = $options['selector']; $subtitle = $options['subtitle']; $displayCopyLink = $options['copyLink']; $displayCopyButton = $options['copyButton']; $displayLaunch = $options['launch']; $displayDownload = $options['download']; $displayInfo = $options['info']; $importFailMessage = ''; if (!$recoverPackage instanceof DUP_PRO_Package_Recover) { $viewMode = self::VIEW_WIDGET_NO_PACKAGE_SET; } elseif (!$recoverPackage->isImportable($importFailMessage)) { $viewMode = self::VIEW_WIDGET_NOT_VALID; } else { $viewMode = self::VIEW_WIDGET_VALID; } require(DUPLICATOR_PRO_PLUGIN_PATH.'/views/tools/recovery/widget/recovery-widget.php'); if ($echo) { ob_end_flush(); return ''; } else { return ob_get_clean(); } } /** * parse view for import-installer */ protected static function doView() { $recoverPackage = DUP_PRO_Package_Recover::getRecoverPackage(); $recoverPackageId = DUP_PRO_Package_Recover::getRecoverPackageId(); $recoveablePackages = DUP_PRO_Package_Recover::getRecoverablesPackages(); require(DUPLICATOR_PRO_PLUGIN_PATH.'/views/tools/recovery/recovery.php'); } }