File "base_admin.class.php"
Full path: /home/kosmetik/public_html/wp-content/plugins/unlimited-elements-for-elementor/inc_php/framework/base_admin.class.php
File
size: 4.15 B
MIME-type: text/x-php
Charset: utf-8
Download Open Edit Advanced Editor Back
<?php
defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
class UniteBaseAdminClassUC
{
protected static $master_view;
protected static $view;
private static $arrSettings = array();
private static $tempVars = array();
public function __construct()
{
$this->initView();
}
protected static function getSettingsFilePath($settingsFile)
{
$filepath = self::$path_plugin . "settings/{$settingsFile}.php";
return $filepath;
}
private function initView()
{
$defaultView = GlobalsUC::$view_default;
$viewInput = UniteFunctionsUC::getGetVar("view", "", UniteFunctionsUC::SANITIZE_KEY);
$page = UniteFunctionsUC::getGetVar("page", "", UniteFunctionsUC::SANITIZE_KEY);
if (!empty($viewInput)) {
self::$view = $viewInput;
return false;
}
$deviderPos = strpos($page, "_");
if ($deviderPos !== false) {
self::$view = substr($page, $deviderPos + 1);
return false;
}
$deviderPos = strpos($page, "-");
if ($deviderPos !== false) {
self::$view = substr($page, $deviderPos + 1);
return false;
}
self::$view = $defaultView;
}
protected static function setMasterView($masterView)
{
self::$master_view = $masterView;
}
private static function getPluginViewFilePath($viewFilepath, $view)
{
if (empty($view)) {
return $viewFilepath;
}
$arrViewPaths = GlobalsUC::$arrAdminViewPaths;
if (empty($arrViewPaths)) {
return $viewFilepath;
}
foreach ($arrViewPaths as $path) {
$filepath = $path . $view . ".php";
if (file_exists($filepath) == true) {
return $filepath;
}
}
return $viewFilepath;
}
protected static function requireView($view)
{
try {
if (!empty(self::$master_view) && !isset(self::$tempVars["is_masterView"])) {
$masterViewFilepath = GlobalsUC::$pathViews . self::$master_view . ".php";
UniteFunctionsUC::validateFilepath($masterViewFilepath, "Master View");
self::$tempVars["is_masterView"] = true;
require $masterViewFilepath;
} else {
$viewFilepath = GlobalsUC::$pathViews . $view . ".php";
$pathViewProvider = GlobalsUC::$pathProviderViews . $view . ".php";
if (file_exists($viewFilepath) == false && file_exists($pathViewProvider) == true) {
$viewFilepath = $pathViewProvider;
}
if (file_exists($viewFilepath) == false) {
$viewFilepath = self::getPluginViewFilePath($viewFilepath, $view);
}
$viewFilepath = UniteProviderFunctionsUC::applyFilters(UniteCreatorFilters::FILTER_ADMIN_VIEW_FILEPATH, $viewFilepath, $view);
UniteFunctionsUC::validateFilepath($viewFilepath, "View");
require $viewFilepath;
}
} catch (Exception $e) {
$view = esc_html($view);
$message = $e->getMessage();
$message = esc_html($message);
echo "<div id='uc_view_error_message'> <br><br>View ({$view}) Error: <b>" . $message . "</b>";
if (GlobalsUC::SHOW_TRACE == true) {
dmp($e->getTraceAsString());
}
echo "</div>";
?>
<script>
jQuery(document).ready(function(){
var htmlError = jQuery("#uc_view_error_message").html();
jQuery("#viewWrapper").html(htmlError);
});
</script>
<?php
}
}
protected static function requireSettings($settingsFile)
{
try {
require self::$path_plugin . "settings/{$settingsFile}.php";
} catch (Exception $e) {
echo "<br><br>Settings ({$settingsFile}) Error: <b>" . $e->getMessage() . "</b>";
dmp($e->getTraceAsString());
}
}
public static function getView()
{
return self::$view;
}
public static function setView($view)
{
self::$view = $view;
}
}