This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| HTML | |
| <input type="file" id="file"> | |
| JS | |
| var file=document.getElementById("file"), | |
| xhr=new XMLHttpRequest(), | |
| form=new FormData(); | |
| file.onchange=function() | |
| { | |
| var upload_file=file.files[0]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Перегруппируем компоненты меню для удобного вывода | |
| */ | |
| <? | |
| $aItems = array(); | |
| $aParentItem = false; | |
| foreach( $arResult as $aItem ) { | |
| if( $aItem["DEPTH_LEVEL"] == 1 ) { | |
| if( $aParentItem && ( $aParentItem["PERMISSION"] !== "D" ) ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //HTML | |
| <snippet> | |
| <content><![CDATA[ | |
| <!-- begin $1 --> | |
| <div class="$1"> | |
| $2 | |
| </div> | |
| <!-- end $1 --> | |
| ]]></content> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if($arResult['ITEMS']) { //Проверяем наличие элементов | |
| $arSectionId = Array(); //Создаем пустой массив, куда получим ID используемых разделов | |
| foreach($arResult['ITEMS'] as $arItem) { //Перебираем все элементы | |
| if(!in_array($arItem['IBLOCK_SECTION_ID'], $arSectionId)) { //Если Id раздела не содержится в новом массиве $arSectionId, | |
| $arSectionId[] = $arItem['IBLOCK_SECTION_ID']; //то добавляем id в массив | |
| } | |
| } | |
| //На выходе имеем массив $arSectionId, в котором будут имена |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(document).ready(function(){ | |
| var f_select = function(){ | |
| var $select = $('.f-select'); | |
| var selectId = 'f-select_' + Math.floor( Math.random( ) * (100001) ); | |
| $select.addClass(selectId); | |
| $select.css('display', 'none'); | |
| $select.after('<div class="f-custom-select" id="' + selectId + '"><div class="f-custom-select__title"><span></span></div></div><div class="f-custom-select__hidden" data-select-class="' + selectId + '"></div>'); | |
| var $f_select = $('#' + selectId); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- Изменение вывода компонента --> | |
| <?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die(); | |
| if ($arResult['SECTIONS']) //Проверяем существует ли эллемент массива | |
| { | |
| ?><div class="spotlight-grouping"><? //В верстку внедряем вывод из массива | |
| foreach ($arResult['SECTIONS'] as $arSection) //Обходим все элементы | |
| { | |
| $pictureSrc = SITE_TEMPLATE_PATH . "/images/no-photobig.gif"; //если изображения для вывода нет, то заменяем его на стандартное и ложим в переменную |