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 | |
function getUserGeo() { | |
if (!empty($_SERVER['HTTP_CLIENT_IP'])) { | |
$ip = $_SERVER['HTTP_CLIENT_IP']; | |
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { | |
$ip = explode(",",$_SERVER['HTTP_X_FORWARDED_FOR'])[0]; | |
} elseif (!empty($_SERVER['REMOTE_ADDR'])){ | |
$ip = $_SERVER['REMOTE_ADDR']; | |
} | |
else{ |
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
let myconfig = { | |
selector: selector_myconfig, | |
document_base_url: modx_site_url, | |
language: lang, | |
language_url: modx_site_url + 'assets/plugins/tinymce5/langs/' + lang + '.js', | |
plugins: 'print preview importcss searchreplace autolink directionality visualblocks visualchars fullscreen image link media template table charmap hr paste pagebreak nonbreaking anchor toc insertdatetime advlist save lists wordcount imagetools textpattern noneditable charmap emoticons code', | |
toolbar1: 'undo | bold italic | alignleft aligncenter alignright | bullist numlist blockquote table | link unlink image insertfile formatselect | visualblocks removeformat code ', | |
mobile:{ | |
theme: "mobile" |
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 | |
date_default_timezone_set('Europe/Moscow'); | |
$host ='http://ursite.ru/manager/'; | |
$auth_fields = [ | |
'username' => 'administrator', | |
'password' => '******', | |
]; | |
$header = [ | |
'Accept: */*', | |
'Accept-Encoding: gzip, deflate', |
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
public static function prepare(array $data = array(), DocumentParser $modx, $_DocLister, prepare_DL_Extender $_extDocLister){ | |
return $data; | |
} | |
//FormLister preare нельзять анонимно только название функции или метода | |
function setSubject(DocumentParser $modx,array $data,\FormLister\Form $Fl,string $name) | |
{ | |
} | |
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
/** | |
* categoryUpdate | |
* | |
* При сохранении и перемещении товаров обновляет их категорию | |
* | |
* @category plugins | |
* @internal @events onAfterMoveDocument,OnDocFormSave | |
*/ | |
$e = $modx->Event; |
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
switch ($modx->event->name) { | |
case 'OnManagerBeforeOrdersListRender': { | |
// добавляем столбец в таблицу заказов | |
$params['columns']['name'] = [ | |
'title' => 'Имя', | |
'content' => function($data, $DL, $eDL) { | |
return !empty($data['fields']['fullname']) ? $data['fields']['fullname'] : ''; | |
}, | |
'sort' => 20, |
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
params: | |
&chunk=Redirect Map Chunk;text;redirectMap | |
OnPageNotFound | |
global $modx; | |
$map = $modx->getChunk($chunk); | |
$lines = explode("\r\n",$map); | |
$redirectArray = array(); | |
foreach($lines as $line) { | |
list($link,$redirectId) = explode('||',$line); |
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 | |
return [ | |
'settings' => [], | |
'templates' => [ | |
'region_block' => [ | |
'value' => true, | |
'type' => 'row', | |
'title' => 'Один таб', | |
'label' => 'Один таб', |
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 | |
return [ | |
'settings' => [], | |
'templates' => [ | |
'newsimage' => [ | |
'type' => 'row', | |
'value' => false, | |
'label' => 'Фото', | |
'items.class' => 'd-block', |
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
<tr class="orders_history_one"> | |
<td>[+position+]</td> | |
<td></span><a href="[~[+product_id+]~]" target="_blank">[+title+]</a></td> | |
<td style="text-align:center;"><span class="showmobile">Опции</span>[+options+]</td> | |
<td style="text-align:center;"><span class="showmobile">Количество</span>[+count+]</td> | |
<td style="text-align:center;"><span class="showmobile">Цена</span>[[PriceFormat? &price=`[+price+]` &convert=`1`]]</td> | |
<td style="text-align: right; white-space: nowrap;"><span class="showmobile">Стоимость</span>[[PriceFormat? &price=`[+total+]` &convert=`1`]]</td> | |
</tr> |