HEX
Server: Apache
System: Linux webm004.cluster121.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
User: grainesdfo (155059)
PHP: 5.4.45
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/grainesdfo/www/wp-content/plugins/easing-slider/src/Plugin/Admin/Ajax/Router.php
<?php

namespace EasingSlider\Plugin\Admin\Ajax;

use EasingSlider\Foundation\Admin\Ajax\Router as BaseRouter;
use EasingSlider\Plugin\Admin\Ajax\AddonActivator;
use EasingSlider\Plugin\Admin\Ajax\AddonDeactivator;
use EasingSlider\Plugin\Admin\Ajax\AddonInstaller;

/**
 * Exit if accessed directly
 */
if ( ! defined('ABSPATH')) {
	exit;
}

class Router extends BaseRouter
{
	/**
	 * Define hooks
	 *
	 * @return void
	 */
	protected function defineHooks()
	{
		$this->setAction('easingslider_activate_addon', array($this, 'activateAddon'));
		$this->setAction('easingslider_deactivate_addon', array($this, 'deactivateAddon'));
		$this->setAction('easingslider_install_addon', array($this, 'installAddon'));
	}

	/**
	 * Activates an addon
	 *
	 * @return void
	 */
	public function activateAddon()
	{
		$activator = new AddonActivator();

		$response = $activator->activate();

		if (false === $response) {
			$this->response(true);
		} else {
			$this->response($response);
		}
	}

	/**
	 * Deactivates an addon
	 *
	 * @return void
	 */
	public function deactivateAddon()
	{
		$deactivator = new AddonDeactivator();

		$response = $deactivator->deactivate();

		if (false === $response) {
			$this->response(true);
		} else {
			$this->response($response);
		}
	}

	/**
	 * Installs an addon
	 *
	 * @return void
	 */
	public function installAddon()
	{
		$installer = new AddonInstaller();

		$response = $installer->install();

		if (false === $response) {
			$this->response(true);
		} else {
			$this->response($response);
		}
	}
}