%PDF- %PDF- 403WebShell
403Webshell
Server IP : 37.220.80.31  /  Your IP : 18.226.172.130
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux 3051455-guretool.twc1.net 5.15.0-107-generic #117-Ubuntu SMP Fri Apr 26 12:26:49 UTC 2024 x86_64
User : www-root ( 1010)
PHP Version : 7.4.33
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/dev.artlot24.ru/bitrix/modules/ui/install/components/bitrix/ui.sidepanel.wrappermenu/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/www-root/data/www/dev.artlot24.ru/bitrix/modules/ui/install/components/bitrix/ui.sidepanel.wrappermenu//class.php
<?
if (!defined('B_PROLOG_INCLUDED') || B_PROLOG_INCLUDED!==true)die();

/**
 * Class UISidepanelMenuComponent
 */
class UISidepanelMenuComponent extends \CBitrixComponent
{
	/**
	 * Check page has been opened in slider
	 *
	 * @return bool
	 */
	protected function isPageSliderContext()
	{
		return $this->request->get('IFRAME') === 'Y';
	}

	/**
	 * Prepare menu item for view
	 *
	 * @param array $item
	 *
	 * @return array
	 */
	protected function prepareItem(array $item)
	{
		$convertedItem = array();
		$convertedItem['~NAME'] = $item['NAME'];
		$convertedItem['NAME'] = isset($item['NAME_HTML']) ? $item['NAME_HTML'] : htmlspecialcharsbx($convertedItem['~NAME']);
		$convertedItem['ACTIVE'] = (bool)$item['ACTIVE'];
		$convertedItem['NOTICE'] = (bool)$item['NOTICE'];

		if (!empty($item['ATTRIBUTES']) && is_array($item['ATTRIBUTES']))
		{
			$convertedItem['~ATTRIBUTES'] = $item['ATTRIBUTES'];
			$convertedItem['ATTRIBUTES'] = $this->prepareAttributes($convertedItem['~ATTRIBUTES']);
		}

		if (empty($item['CHILDREN']))
		{
			$convertedItem['OPERATIVE'] = true;
		}
		else
		{
			$convertedItem['OPERATIVE'] = isset($item['OPERATIVE']) ? (bool)$item['OPERATIVE'] : false;
			$convertedItem['~CHILDREN'] = $item['CHILDREN'];
			foreach ($item['CHILDREN'] as &$children)
			{
				$convertedItem['CHILDREN'][] = $this->prepareItem($children);
			}
		}
		$convertedItem['ATTRIBUTES']['bx-operative'] = ($convertedItem['OPERATIVE'] ? 'Y' : 'N');

		return $convertedItem;
	}

	/**
	 * Prepare attribute array items for output
	 *
	 * @param array $attributes
	 *
	 * @return array
	 */
	protected function prepareAttributes(array $attributes)
	{
		$result = array();

		foreach ($attributes as $key => $attributeValue)
		{
			$newKey = mb_strtolower($key);
			$newKey = str_replace('_', '-', $newKey);

			if (is_array($attributeValue))
			{
				$newAttribute = $this->prepareAttributes($attributeValue);
			}
			else
			{
				$newAttribute = $attributeValue;
			}

			$result[$newKey] = $newAttribute;
		}

		return $result;
	}

	/**
	 * @return array
	 */
	protected function prepareResult()
	{
		if(isset($this->arParams['TITLE_HTML']))
		{
			$this->arResult['TITLE'] = (string)$this->arParams['~TITLE_HTML'];
		}
		elseif (isset($this->arParams['TITLE']))
		{
			$this->arResult['TITLE'] = (string)$this->arParams['TITLE'];
		}
		else
		{
			$this->arResult['TITLE'] = '';
		}

		$this->arResult['ITEMS'] = array();
		$this->arResult['ID'] = !empty($this->arParams['ID']) ? $this->arParams['ID'] : '';
		foreach ($this->arParams['ITEMS'] as $item)
		{
			$this->arResult['ITEMS'][] = $this->prepareItem($item);
		}

		$this->arResult['VIEW_TARGET'] = $this->arParams['VIEW_TARGET'] ?? 'left-panel';

		return $this->arResult;
	}

	/**
	 * Execute component.
	 *
	 * @return mixed|void
	 */
	public function executeComponent()
	{
		$this->arParams['FRAME'] = (
			isset($this->arParams['FRAME']) ? (bool)$this->arParams['FRAME'] : $this->isPageSliderContext()
		);

		$this->arParams['ITEMS'] = (
			isset($this->arParams['ITEMS']) && is_array($this->arParams['ITEMS']) ? $this->arParams['ITEMS'] : []
		);

		$this->prepareResult();
		$this->includeComponentTemplate();
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit