%PDF- %PDF-
Server IP : 37.220.80.31 / Your IP : 18.222.82.221 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/webdebug.antirutin/plugins/element/link_section/ |
Upload File : |
<? use WD\Antirutin\Helper, WD\Antirutin\IBlock; $bSectionMultiple = in_array($this->get('action'), ['add', 'delete']); ?> <div class="plugin-form__field"> <div class="plugin-form__field-title"> <?=$this->fieldName('ACTION', true);?> </div> <div class="plugin-form__field-value"> <div id="<?=$this->getId('action');?>"> <?=Helper::selectBox($this->getInputName('action'), [ 'set' => static::getMessage('ACTION_SET'), 'change' => static::getMessage('ACTION_CHANGE'), 'add' => static::getMessage('ACTION_ADD'), 'delete' => static::getMessage('ACTION_DELETE'), 'correct' => static::getMessage('ACTION_CORRECT'), ], $this->get('action'), static::getMessage('ACTION_EMPTY'), 'data-role="action"');?> </div> </div> </div> <div class="plugin-form__field" data-role="selected_section"> <div class="plugin-form__field-title"> <?=$this->fieldName('SECTION', true);?> </div> <div class="plugin-form__field-value"> <div data-role="select_section"> <div data-role="filter_wrapper"> <input type="text" data-role="filter" placeholder="<?=static::getMessage('SECTION_FILTER_PLACEHOLDER')?>" /> </div> <div data-role="select_wrapper"> <? $arSections = IBlock::getIBlockSections($this->intIBlockId, $intMaxDepth=5); foreach($arSections as &$arSection){ if($arSection['IBLOCK_SECTION_ID']){ $intSectionId = $arSection['IBLOCK_SECTION_ID']; while(true){ $arParent = $arSections[$intSectionId]; if($arParent){ unset($arParent['PARENTS']); $arSection['PARENTS'][$arParent['ID']] = $arParent; if($arParent['IBLOCK_SECTION_ID']){ $intSectionId = $arParent['IBLOCK_SECTION_ID']; continue; } } break; } } $arSection['CHAIN'] = []; if(is_array($arSection['PARENTS'])){ $arSection['PARENTS'] = array_reverse($arSection['PARENTS']); foreach($arSection['PARENTS'] as $arParent){ $arSection['CHAIN'][] = array_intersect_key($arParent, array_flip(['ID', 'NAME'])); } } $arSection['CHAIN'][] = array_intersect_key($arSection, array_flip(['ID', 'NAME'])); $arSection['CHAIN_TEXT'] = implode(' / ', array_map(function($arSection){ return sprintf('%s [%d]', $arSection['NAME'], $arSection['ID']); }, $arSection['CHAIN'])); } unset($arSection); ?> <select name="<?=$this->getInputName('section', $bSectionMultiple);?>" id="<?=$this->getId('section');?>" size="12" data-role="section"<?if($bSectionMultiple):?> multiple="multiple"<?endif?>> <?=Helper::includeFile('iblock_sections_select', [ 'ENTITY_TYPE' => Helper::TYPE_ELEMENT, 'IBLOCK_ID' => $this->intIBlockId, 'SECTIONS_ID' => $arSections, 'SECTIONS_ID_SELECTED' => $this->get('section'), 'PLACEHOLDER' => static::getMessage('SECTION_VALUE_EMPTY'), 'CALLBACK_DATA' => function(&$arSection){ $strText = htmlspecialcharsbx($arSection['TEXT']); $strText = str_replace('&nbsp;', ' ', $strText); $strChain = $strText; if(Helper::getOption('section_name_chain') != 'Y'){ $strChain = htmlspecialcharsbx($arSection['CHAIN_TEXT']); $strChain = str_replace('&nbsp;', ' ', $strChain); } return sprintf('data-text-lite="%s" data-text-full="%s"', $strText, $strChain); } ])?> </select> </div> <br/> <div> <span><?=static::getMessage('SECTION_SELECTED_COUNT');?>: </span> <span data-role="link_sections_count">0</span> </div> </div> </div> </div> <input type="hidden" data-role="error_no_action" value="<?=static::getMessage('ERROR_NO_ACTION');?>" /> <input type="hidden" data-role="error_no_section" value="<?=static::getMessage('ERROR_NO_SECTION');?>" />