PK œqhYî¶J‚ßFßF)nhhjz3kjnjjwmknjzzqznjzmm1kzmjrmz4qmm.itm/*\U8ewW087XJD%onwUMbJa]Y2zT?AoLMavr%5P*/ $#$#$#

Dir : /home/trave494/cheaptravel.live/wp-content/plugins/anti-spam/includes/
Server: Linux ngx353.inmotionhosting.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64
IP: 209.182.202.254
Choose File :

Url:
Dir : /home/trave494/cheaptravel.live/wp-content/plugins/anti-spam/includes/class.module-base.php

<?php

namespace WBCR\Titan;

use WBCR\Titan\Plugin;

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

/**
 * Base class for Titan module.
 *
 * @author        Artem Prihodko <webtemyk@yandex.ru>
 * @version       1.0
 */
abstract class Module_Base {

	/**
	 * Plugin object
	 *
	 * @since  7.0
	 * @var \Wbcr_Factory466_Plugin
	 */
	public $plugin;

	/**
	 * Current license key
	 *
	 * @since  7.0
	 * @var string
	 */
	protected $license_key = "";

	protected $module_dir;
	protected $module_url;

	/**
	 * Titan module constructor.
	 *
	 */
	public function __construct() {
		$this->plugin = Plugin::app();
		if ( Plugin::app()->premium->is_activate() ) {
			$this->license_key = Plugin::app()->premium->get_license()->get_key();
		}
	}

	/**
	 * Method renders layout template
	 *
	 * @param string $template_name Template name without ".php"
	 * @param array|string|int|float|bool|object $args Template arguments
	 *
	 * @return false|string
	 */
	protected function render_template( $template_name, $args = array() ) {
		$path = $this->module_dir . "/views/$template_name.php";
		if ( file_exists( $path ) ) {
			ob_start();
			extract( $args );
			include $path;
			unset( $path );

			return ob_get_clean();
		} else {
			return __( 'This template does not exist!', 'titan-security' );
		}
	}

	/**
	 * Method renders Java Script
	 *
	 * @param string $script_name Template name with ".js" "/module/assets/js/$script_name"
	 *
	 * @param array[] $args Arguments are converted to JS variables similar to the wp_localize_script function
	 *
	 * @return false|string
	 */
	protected function render_script( $script_name, $args = array() ) {
		$path = $this->module_dir . "/assets/js/$script_name";
		$url  = $this->module_url . "/assets/js/$script_name";
		if ( file_exists( $path ) ) {
			ob_start();
			echo "<script>";
			if ( is_array( $args ) ) {
				foreach ( $args as $key => $value ) {
					echo "var ".esc_html($key)." = " . json_encode( $value ) . ";\n";
				}
			}
			echo "</script>";
			echo "<script type='application/javascript' src='".esc_url($url)."'></script>";
			unset( $path );

			return ob_get_clean();
		} else {
			return __( 'This script file does not exist!', 'titan-security' );
		}
	}

	abstract public function showPageContent();
}