SILENT KILLERPanel

Current Path: > home > codekrsu > > ameliagraphics.com > wp-content > plugins > filebird > includes > Model >


Operation   : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Software     : Apache
Server IP    : 162.0.232.56 | Your IP: 216.73.216.111
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: /home/codekrsu//ameliagraphics.com/wp-content/plugins/filebird/includes/Model/

NameTypeSizeLast ModifiedActions
Folder.php File 18350 bytes August 04 2025 15:38:16.
SettingModel.php File 2641 bytes August 04 2025 15:38:16.
ThemeModel.php File 329 bytes May 27 2024 10:21:44.
UserSettingModel.php File 5432 bytes August 23 2024 17:15:40.

Reading File: /home/codekrsu//ameliagraphics.com/wp-content/plugins/filebird/includes/Model//SettingModel.php

<?php
namespace FileBird\Model;

use FileBird\Utils\Singleton;
use FileBird\Admin\Settings;

defined( 'ABSPATH' ) || exit;

class SettingModel {
  	use Singleton;
	private $settings = array();
	private $config   = array();

	public function __construct() {
		$this->initialize();
		$this->settings = $this->loadSettings();

		add_filter( 'fbv_data', array( $this, 'addUserSettingsData' ), 10, 1 );
	}

	public function initialize() {
		$this->config = array(
			'USER_MODE'           => array(
				'get' => 'getUserMode',
				'set' => 'setUserMode',
			),
			'SVG_SUPPORT'         => array(
				'get' => 'getSvgSupport',
				'set' => 'setSvgSupport',
			),
			'IS_SEARCH_USING_API' => array(
				'get' => 'getFolderSearchMethod',
				'set' => 'setFolderSearchMethod',
			),
			'enable_cache_optimization' => array(
				'get' => 'getEnableCacheOptimization',
				'set' => 'setEnableCacheOptimization',
			),
		);
	}

	public function addUserSettingsData( $data ) {
		$data['user_settings'] = array_merge( $data['user_settings'], $this->settings );

		return $data;
	}

	public function loadSettings() {
		foreach ( $this->config as $key => $value ) {
			$this->settings[ $key ] = $this->{$value['get']}();
		}

		return $this->settings;
	}

	public function get( $key ) {
		if ( in_array( $key, array_keys( $this->config ) ) ) {
			return $this->settings[ $key ];
		}
	}

	public function setSettings( $params ) {
		foreach ( $params as $key => $value ) {
			if ( isset( $this->config[ $key ] ) ) {
				$this->{$this->config[ $key ]['set']}( $value );
			}
		}
	}

	public function getUserMode() {
		return get_option( 'njt_fbv_folder_per_user', '0' ) === '1';
	}

	public function setUserMode( $value ) {
		update_option( 'njt_fbv_folder_per_user', $value );
	}

	public function getSvgSupport() {
		return get_option( 'njt_fbv_allow_svg_upload', '0' ) === '1';
	}

	public function setSvgSupport( $value ) {
		update_option( 'njt_fbv_allow_svg_upload', $value );
	}

	public function getFolderSearchMethod() {
		return get_option( 'njt_fbv_is_search_using_api', '0' ) === '1';
	}

	public function setFolderSearchMethod( $value ) {
		update_option( 'njt_fbv_is_search_using_api', $value );
	}

	public function getEnableCacheOptimization() {
		$settings = (array) get_option( 'fbv_settings', array() );
		return isset( $settings['enable_cache_optimization'] ) ? (string) $settings['enable_cache_optimization'] : "0";
	}

	public function setEnableCacheOptimization( $value ) {
		$settings = (array) get_option( 'fbv_settings', array() );
		$settings['enable_cache_optimization'] = $value;
		update_option( 'fbv_settings', $settings );
	}
}

SILENT KILLER Tool