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 | |
switch ($modx->event->name) { | |
case 'OnWebPagePrerender': | |
$output = &$modx->resource->_output; // перехватываем содержимое страницы | |
$output = str_replace(' type="text/javascript"',"",$output); | |
break; | |
} |
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
$('button#cart_add').click(function(e){ // не забудьте изменить селектор | |
// Добавляем товары в корзину | |
var products = []; | |
$('input[name="price"]:checked').each(function () { | |
var product = {}; | |
product['id'] = $(this).data('dop'); | |
product['count'] = $(this).parents('.tm-dop').find('input.number-input').val(); | |
products.push(product); | |
}); | |
// Добавляем услуги в корзину |
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 | |
$user = $modx->getObject('modUser', 7371); | |
echo $user->get('username'); | |
$user->addSessionContext('web'); |
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
{* К одному региону может принадлежать несколько магазинов *} | |
{set $fdkRegions = '!pdoResources' | snippet : [ | |
'class' => 'fdkRegion', | |
'select' => '{ | |
"fdkRegion":"*", | |
"Shop":"GROUP_CONCAT(Shop.region_id) AS region_id, Shop.main_contact_phone as main_contact_phone" | |
}', | |
'groupby' => 'code', | |
'leftJoin' => '{ | |
"fdkShop": { |
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 | |
ini_set('max_execution_time', 0); | |
ignore_user_abort(true); | |
$c = 'modResource'; | |
$q = $modx->newQuery($c); | |
$q->where(array('class_key' => 'msProduct')); | |
$q->sortby('id'); | |
$q->select(array( | |
"{$c}.*", | |
)); |
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
{if ($idx - 1) % 3 == 0} | |
<div class="row"> | |
{/if} | |
<div class="col-12 col-md-4 in-item"> | |
<div class="card"> | |
{switch $type} | |
{case 'carousel'} | |
<div id="carouselInstagram" class="carousel slide" data-ride="carousel"> | |
<div class="carousel-inner"> | |
{foreach $carousel as $item} |
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
# /etc/monit/monitrc | |
############################################################################### | |
## Monit control file | |
############################################################################### | |
## | |
## Comments begin with a '#' and extend through the end of the line. Keywords | |
## are case insensitive. All path's MUST BE FULLY QUALIFIED, starting with '/'. | |
## | |
## Below you will find examples of some frequently used statements. For |
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
Ext.onReady(function() { | |
MODx.renameLabel("modx-panel-resource", ["description", "introtext"], ["Краткое описание", "Текст перед характеристиками"]); | |
if (MODx.loadRTE) { | |
MODx.loadRTE("modx-resource-description"); | |
MODx.loadRTE("modx-resource-introtext"); | |
} | |
}); |
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 | |
switch($modx->event->name){ | |
case 'OnFileManagerUpload': | |
$source = & $scriptProperties['source']; | |
if(!$source->hasErrors()){ | |
/* | |
Запрещаем загрузку в корень, точнее удаляем новый файл, |