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 // v. 2.0.2 | |
require_once dirname(dirname(dirname(__FILE__))).'/site/web/resources/getdata.class.php'; | |
class modWebResourcesGetdataProcessor extends modSiteWebResourcesGetdataProcessor { | |
public function initialize(){ | |
$this->setDefaultProperties(array( | |
'cache' => true, // Use cache | |
'cache_lifetime' => 3600, // cache seconds | |
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
requred pdoTools, phpthumbon, jevix | |
<?xml version="1.0" encoding="utf-8"?> | |
<rss xmlns:yandex="http://news.yandex.ru" xmlns:media="http://search.yahoo.com/mrss/" xmlns:turbo="http://turbo.yandex.ru" version="2.0"> | |
<channel> | |
<title>[[++site_name]]</title> | |
<link>[[++site_url]]</link> | |
<description>[[#[[++site_start]].description]]</description> | |
[[!pdoResources? | |
&parents=`0` |
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
const obj2get = function (obj) { | |
let data = [] | |
for (let key in obj) { | |
let value = obj[key] | |
if (typeof value === 'object') { | |
assignValue(data, value, key) | |
} else { | |
data.push(`${key}=${value}`) | |
} |
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
// рекурсивное преобразование урл параметров в js object | |
const get2obj = function () { | |
let obj = {} | |
let gets = location.search.substring(1).split('&') | |
for(var i = 0; i < gets.length; i++) { | |
let parts = gets[i].split('=') | |
let keys = decodeURIComponent(parts.shift()).replace(/\[(.*?)\]/g, '.$1').split(/\./) | |
obj = assignValue({...obj}, keys, parts.join('='), 0) |
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 | |
/** | |
* требуемые настройки сайта | |
* | |
* robokassa.env_test (1|0) - тестовый режим | |
* robokassa.login - идентификатор магазина | |
* robokassa.password_1 - пароль 1 | |
* robokassa.password_2 - пароль 2 | |
* robokassa.test_password_1 - тестовый пароль 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
<?php | |
if (!isset($modx)) return ''; | |
if (!function_exists('getParentIds')) | |
{ | |
function getParentIds($id = 0, $depth = 9, $finalWhere = array('parent' => 0), $alias = 'modResource') | |
{ | |
global $modx; | |
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 | |
// v1.0.1 | |
$file = $modx->getOption('input', $scriptProperties, false); | |
$options = $modx->getOption('options', $scriptProperties, false); | |
if ($file) | |
{ | |
$full_path = MODX_BASE_PATH . '/' . ltrim($file, '/'); | |
list($key, $dop) = explode(':', $options); | |
switch ($key) |
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 | |
$values = $hook->getValues(); | |
if (empty($values['captcha'])) | |
{ | |
$hook->addError('captcha', 'Введите символы с картинки'); | |
return false; | |
} | |
// modCaptcha Extra required. http://modx.com/extras/package/modcaptcha |
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 | |
// v.1.0.2 | |
// вывод тв полей из определенного раздела | |
$category = $modx->getOption('category', $scriptProperties, null); | |
$resourceId = $modx->getOption('resourceId', $scriptProperties, $modx->resource->id); | |
$limit = $modx->getOption('limit', $scriptProperties, 0); | |
$tvs = $modx->getOption('tvs', $scriptProperties, null); | |
$tpl = $modx->getOption('tpl', $scriptProperties, ''); |
NewerOlder