403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /home/bitrix/ext_www/ilovecveti.ru/bitrix/modules/iblock/lib/grid/panel/ui/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/ilovecveti.ru/bitrix/modules/iblock/lib/grid/panel/ui/elementpanelprovider.php
<?php

namespace Bitrix\Iblock\Grid\Panel\UI;

use Bitrix\Iblock\Grid\Access\IblockRightsChecker;
use Bitrix\Iblock\Grid\Entity\ElementSettings;
use Bitrix\Iblock\Grid\Panel\UI\Actions\Item\EditActionsItem;
use Bitrix\Iblock\Grid\Panel\UI\Actions\Item\ElementGroupActionsItem;
use Bitrix\Iblock\Grid\Panel\UI\Actions\Item\RemoveActionsItem;
use Bitrix\Main\Grid\Column\Columns;
use Bitrix\Main\Grid\Panel\Action\ForAllCheckboxAction;
use Bitrix\Main\Grid\Panel\Action\DataProvider;

/**
 * Action panel for ui grid. If need action panel for admin grid see `GroupAction`.
 *
 * @see \Bitrix\Iblock\Grid\Panel\GroupAction
 *
 * @method ElementSettings getSettings()
 */
class ElementPanelProvider extends DataProvider
{
	private Columns $columns;
	private IblockRightsChecker $rights;

	public function __construct(
		ElementSettings $settings,
		Columns $columns,
		IblockRightsChecker $rights
	)
	{
		parent::__construct($settings);

		$this->columns = $columns;
		$this->rights = $rights;
	}

	final protected function getIblockId(): int
	{
		return $this->getSettings()->getIblockId();
	}

	final protected function getListMode(): string
	{
		return $this->getSettings()->getListMode();
	}

	final protected function getIblockRightsChecker(): IblockRightsChecker
	{
		return $this->rights;
	}

	final protected function getColumns(): Columns
	{
		return $this->columns;
	}

	public function prepareActions(): array
	{
		$result = [];

		if ($this->rights->canEditElements())
		{
			$result[] = new EditActionsItem($this->getIblockId(), $this->columns, $this->rights);
		}

		if ($this->rights->canDeleteElements())
		{
			$result[] = new RemoveActionsItem($this->getIblockId(), $this->rights, $this->getListMode());
		}

		$result[] = new ElementGroupActionsItem($this->getIblockId(), $this->rights, $this->getListMode());

		if (!empty($result))
		{
			$result[] = new ForAllCheckboxAction();
		}

		return $result;
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit