This file contains 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
$io = CBXVirtualIo::GetInstance(); - класс для работы с файлами публичной части, которые создаются пользователями или лежат в папках, создаваемых пользователями. | |
CTempFile - класс CTempFile для работы с временными файлами. | |
CTempFile ::GetFileName() возвращает имя, которое можно использовать для создания временного файла. | |
CTempFile::GetDirectoryName() возвращает временную папку. | |
CTempFile::GetAbsoluteRoot() - получить абсолютный путь до временной папки |
This file contains 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
!/bin/sh | |
#SITEDIR=/domains/cremap.pro/images | |
SITEDIR=/domains/brcrm.brightrich.ru/upload/iblock | |
SITEUSER=www-data | |
BOPTI=`du -L -s ${SITEDIR} | awk '{print $1}'` | |
find -L ${SITEDIR} -type f -iname '*.jpg' \ | |
-exec jpegoptim -q --strip-all {} \; \ | |
-exec chown ${SITEUSER}:www-data {} \; \ |
This file contains 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
/** | |
* JavaScript Get URL Parameter | |
* | |
* @param String prop The specific URL parameter you want to retreive the value for | |
* @return String|Object If prop is provided a string value is returned, otherwise an object of all properties is returned | |
*/ | |
function getUrlParams( prop ) { | |
var params = {}; | |
if(window.location.search.length) { | |
var search = decodeURIComponent( window.location.href.slice( window.location.href.indexOf( '?' ) + 1 ) ); |
This file contains 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
function createNavTabSlider() { | |
var $sliderNav = $(".ui-tab-nav-slider"); | |
$sliderNav.each(function(index, el) { | |
var $slider = $(el); | |
if($slider.hasClass('initialized')) { | |
return; | |
} | |
var actWidth = $slider.find('.ui-tab-nav-slider-item.active').parent("li").width(); | |
var actPosition = $slider.find('.ui-tab-nav-slider-item.active').position(); | |
if(actPosition == undefined) { |
This file contains 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
function createNavScrollSpy() { | |
var $slider = $(".ui-scrollspy"); | |
function initScrollSpy() { | |
var headerHeight = $('#header').outerHeight() + 70; | |
var scrollTop = $(document).scrollTop() + headerHeight; | |
if($slider.hasClass('initialized')) { | |
return; | |
} | |
$slider.find('li').each(function(){ | |
var hash = $(this).find('a').attr("href"); |
This file contains 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
$arResult['html'] = \Bitrix\Main\UI\FileInput::createInstance([ | |
"name" => 'NEW_FILE', //[#IND#] - множественное поле ! индекс важен, так как в php шаблоне эта метка будет заменяться | |
"description" => false, | |
"upload" => true, | |
"allowUpload" => "I", | |
"medialib" => false, | |
"fileDialog" => true, | |
"cloud" => false, | |
"delete" => true, | |
"edit" => true, |
This file contains 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
<?php | |
CJSCore::Init(['ui']); | |
$items = [ | |
['NAME' => 'Первый вариант', 'VALUE' => '1'], | |
['NAME' => 'Второй вариант', 'VALUE' => '2'], | |
]; | |
?> | |
<div style="padding: 100px" id="filter"> | |
<div data-name="SELECT_SINGLE" class="main-ui-filter-wield-with-label main-ui-filter-date-group main-ui-control-field-group"> |
This file contains 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
echo CIBlockFormatProperties::DateFormat("j F Y", | |
MakeTimeStamp($arElement["DATE_CREATE"], CSite::GetDateFormat()) | |
); |
This file contains 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
onclick="BX.calendar({node: this, field: this, bTime: false});" |
This file contains 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
<? | |
$_SERVER["DOCUMENT_ROOT"] = "/domains/city.rent"; | |
$DOCUMENT_ROOT = $_SERVER["DOCUMENT_ROOT"]; | |
define("NO_KEEP_STATISTIC", true); | |
define("NOT_CHECK_PERMISSIONS", true); | |
set_time_limit(0); | |
require_once $_SERVER["DOCUMENT_ROOT"].'/bitrix/modules/main/include/prolog_before.php'; | |
require_once $_SERVER['DOCUMENT_ROOT'].'/local/templates/.default/functions.php'; |