libs/bootstrap/js/bootstrap.min.js" type="text/javascript">
[[*id:is=`50`:then=``:else=``]]',
'locked' => false,
'properties' =>
array (
),
'static' => false,
'static_file' => '',
'content' => '
[[*id:is=`50`:then=``:else=``]]',
),
'policies' =>
array (
'web' =>
array (
),
),
'source' =>
array (
'id' => 1,
'name' => 'Filesystem',
'description' => '',
'class_key' => 'sources.modFileMediaSource',
'properties' =>
array (
),
'is_stream' => true,
),
),
'consultModal' =>
array (
'fields' =>
array (
'id' => 180,
'source' => 1,
'property_preprocess' => false,
'name' => 'consultModal',
'description' => '',
'editor_type' => 0,
'category' => 32,
'cache_type' => 0,
'snippet' => '
',
'locked' => false,
'properties' =>
array (
),
'static' => false,
'static_file' => '',
'content' => '',
),
'policies' =>
array (
'web' =>
array (
),
),
'source' =>
array (
'id' => 1,
'name' => 'Filesystem',
'description' => '',
'class_key' => 'sources.modFileMediaSource',
'properties' =>
array (
),
'is_stream' => true,
),
),
'callbackModal' =>
array (
'fields' =>
array (
'id' => 179,
'source' => 1,
'property_preprocess' => false,
'name' => 'callbackModal',
'description' => '',
'editor_type' => 0,
'category' => 32,
'cache_type' => 0,
'snippet' => '',
'locked' => false,
'properties' =>
array (
),
'static' => false,
'static_file' => '',
'content' => '',
),
'policies' =>
array (
'web' =>
array (
),
),
'source' =>
array (
'id' => 1,
'name' => 'Filesystem',
'description' => '',
'class_key' => 'sources.modFileMediaSource',
'properties' =>
array (
),
'is_stream' => true,
),
),
'recaptchav3_html' =>
array (
'fields' =>
array (
'id' => 81,
'source' => 0,
'property_preprocess' => false,
'name' => 'recaptchav3_html',
'description' => '',
'editor_type' => 0,
'category' => 24,
'cache_type' => 0,
'snippet' => '
',
'locked' => false,
'properties' =>
array (
),
'static' => false,
'static_file' => '',
'content' => '
',
),
'policies' =>
array (
'web' =>
array (
),
),
'source' =>
array (
),
),
),
'modSnippet' =>
array (
'cfCities' =>
array (
'fields' =>
array (
'id' => 73,
'source' => 1,
'property_preprocess' => false,
'name' => 'cfCities',
'description' => '',
'editor_type' => 0,
'category' => 51,
'cache_type' => 0,
'snippet' => 'if (!$modx->getOption(\'cityfields_active\')) return false;
$cityFields = $modx->getService(\'cityfields\',\'cityFields\',$modx->getOption(\'cityfields.core_path\',null,$modx->getOption(\'core_path\').\'components/cityfields/\').\'model/cityfields/\',$scriptProperties);
if (!($cityFields instanceof cityFields)) return false;
$pdoFetch = $modx->getService(\'pdoFetch\');
if ( empty($selected) ) $selected = \' selected="selected"\';
if ( empty($where) ) $where = array();
else $where = is_array($where) ? $where : $modx->fromJSON($where);
if ( empty($sortby) ) $sortby = \'id\';
if ( empty($sortdir) ) $sortdir = \'ASC\';
if ( !empty($limit) ) $limit = intval($limit);
if ( empty($tplWrapper) ) $tplWrapper = \'cfCities.outer\';
if ( empty($tpl) ) $tpl = \'cfCities.row\';
if ( $cityFields->cityInDomain ) {
$default = $modx->getOption(\'cityfields_default_city\', $scriptProperties, 1);
$host = function_exists(\'idn_to_utf8\') ? idn_to_utf8(MODX_HTTP_HOST) : MODX_HTTP_HOST;
$cities = $modx->getObject(\'cfCity\', $cityFields->currentCityId);
if ( $cities && $cities->get(\'id\') != $default ) $host = preg_replace(\'/^\'.$cities->get(\'key\').\'\\./ui\', \'\', $host, 1);
}
$q = $modx->newQuery(\'cfCity\');
$q->where(array_merge(array(
\'active\' => 1
), $where));
$q->sortby($sortby, $sortdir);
if ( isset($limit) && $limit > 0 ) $q->limit($limit);
$cities = $modx->getCollection(\'cfCity\', $q);
$rows = \'\';
foreach ( $cities as $city ) {
$row = $city->toArray();
if ( $cityFields->cityInDomain ) {
$row[\'link\'] = MODX_URL_SCHEME . ($city->get(\'id\') == $default ? \'\' : $city->get(\'key\') . \'.\') . $host . \'/\' . ltrim($modx->makeUrl($modx->resource->id), \'/\');
} else {
//$row[\'link\'] = MODX_URL_SCHEME . MODX_HTTP_HOST . \'/\' . ltrim($modx->makeUrl($modx->resource->id), \'/\') . \'?city=\'.$row[\'id\'];
if($modx->getOption(\'cityfields_default_city\') != $city->get(\'id\') ){
$row[\'link\'] = MODX_URL_SCHEME . MODX_HTTP_HOST . \'/\' . $row[\'key\'] . \'/\' . ltrim($modx->makeUrl($modx->resource->id), \'/\');
}else{
$row[\'link\'] = MODX_URL_SCHEME . MODX_HTTP_HOST . \'/\' . ltrim($modx->makeUrl($modx->resource->id), \'/\');
}
//$row[\'link\'] = MODX_URL_SCHEME . MODX_HTTP_HOST . \'/\' . $row[\'key\'] . \'/\' . ltrim($modx->makeUrl($modx->resource->id), \'/\') . $modx->getOption(\'cityfields_default_city\') . \'-\' . $city->get(\'id\');
}
$row[\'selected\'] = ( $cityFields->currentCityId == $city->get(\'id\') ) ? $selected : \'\';
$rows .= $pdoFetch ? $pdoFetch->getChunk($tpl, $row) : $modx->getChunk($tpl, $row);
}
if ( !empty($cityFields->frontendCSS) ) {
$modx->regClientCSS($cityFields->frontendCSS);
}
if ( !empty($cityFields->frontendJS) ) {
$modx->regClientScript(preg_replace(\'/(\\t|\\n)/\', \'\', \'
\'));
$modx->regClientScript($cityFields->frontendJS);
}
return $pdoFetch ? $pdoFetch->getChunk($tplWrapper, array(\'rows\' => $rows)) : $modx->getChunk($tplWrapper, array(\'rows\' => $rows));',
'locked' => false,
'properties' =>
array (
'selected' =>
array (
'name' => 'selected',
'desc' => 'cityfields_prop_selected',
'type' => 'textfield',
'options' =>
array (
),
'value' => ' selected="selected"',
'lexicon' => 'cityfields:properties',
'area' => '',
'desc_trans' => 'Строка, если текущий',
'area_trans' => '',
),
'sortby' =>
array (
'name' => 'sortby',
'desc' => 'cityfields_prop_sortby',
'type' => 'textfield',
'options' =>
array (
),
'value' => 'id',
'lexicon' => 'cityfields:properties',
'area' => '',
'desc_trans' => 'Поле сортировки',
'area_trans' => '',
),
'sortdir' =>
array (
'name' => 'sortdir',
'desc' => 'cityfields_prop_sortdir',
'type' => 'textfield',
'options' =>
array (
),
'value' => 'ASC',
'lexicon' => 'cityfields:properties',
'area' => '',
'desc_trans' => 'Направление сортировки',
'area_trans' => '',
),
'tpl' =>
array (
'name' => 'tpl',
'desc' => 'cityfields_prop_tpl',
'type' => 'textfield',
'options' =>
array (
),
'value' => 'cfCities.row',
'lexicon' => 'cityfields:properties',
'area' => '',
'desc_trans' => 'Чанк города',
'area_trans' => '',
),
'tplWrapper' =>
array (
'name' => 'tplWrapper',
'desc' => 'cityfields_prop_tplWrapper',
'type' => 'textfield',
'options' =>
array (
),
'value' => 'cfCities.outer',
'lexicon' => 'cityfields:properties',
'area' => '',
'desc_trans' => 'Чанк обертки',
'area_trans' => '',
),
),
'moduleguid' => '',
'static' => false,
'static_file' => 'core/components/cityfields/elements/snippets/snippet.cfcities.php',
'content' => 'if (!$modx->getOption(\'cityfields_active\')) return false;
$cityFields = $modx->getService(\'cityfields\',\'cityFields\',$modx->getOption(\'cityfields.core_path\',null,$modx->getOption(\'core_path\').\'components/cityfields/\').\'model/cityfields/\',$scriptProperties);
if (!($cityFields instanceof cityFields)) return false;
$pdoFetch = $modx->getService(\'pdoFetch\');
if ( empty($selected) ) $selected = \' selected="selected"\';
if ( empty($where) ) $where = array();
else $where = is_array($where) ? $where : $modx->fromJSON($where);
if ( empty($sortby) ) $sortby = \'id\';
if ( empty($sortdir) ) $sortdir = \'ASC\';
if ( !empty($limit) ) $limit = intval($limit);
if ( empty($tplWrapper) ) $tplWrapper = \'cfCities.outer\';
if ( empty($tpl) ) $tpl = \'cfCities.row\';
if ( $cityFields->cityInDomain ) {
$default = $modx->getOption(\'cityfields_default_city\', $scriptProperties, 1);
$host = function_exists(\'idn_to_utf8\') ? idn_to_utf8(MODX_HTTP_HOST) : MODX_HTTP_HOST;
$cities = $modx->getObject(\'cfCity\', $cityFields->currentCityId);
if ( $cities && $cities->get(\'id\') != $default ) $host = preg_replace(\'/^\'.$cities->get(\'key\').\'\\./ui\', \'\', $host, 1);
}
$q = $modx->newQuery(\'cfCity\');
$q->where(array_merge(array(
\'active\' => 1
), $where));
$q->sortby($sortby, $sortdir);
if ( isset($limit) && $limit > 0 ) $q->limit($limit);
$cities = $modx->getCollection(\'cfCity\', $q);
$rows = \'\';
foreach ( $cities as $city ) {
$row = $city->toArray();
if ( $cityFields->cityInDomain ) {
$row[\'link\'] = MODX_URL_SCHEME . ($city->get(\'id\') == $default ? \'\' : $city->get(\'key\') . \'.\') . $host . \'/\' . ltrim($modx->makeUrl($modx->resource->id), \'/\');
} else {
//$row[\'link\'] = MODX_URL_SCHEME . MODX_HTTP_HOST . \'/\' . ltrim($modx->makeUrl($modx->resource->id), \'/\') . \'?city=\'.$row[\'id\'];
if($modx->getOption(\'cityfields_default_city\') != $city->get(\'id\') ){
$row[\'link\'] = MODX_URL_SCHEME . MODX_HTTP_HOST . \'/\' . $row[\'key\'] . \'/\' . ltrim($modx->makeUrl($modx->resource->id), \'/\');
}else{
$row[\'link\'] = MODX_URL_SCHEME . MODX_HTTP_HOST . \'/\' . ltrim($modx->makeUrl($modx->resource->id), \'/\');
}
//$row[\'link\'] = MODX_URL_SCHEME . MODX_HTTP_HOST . \'/\' . $row[\'key\'] . \'/\' . ltrim($modx->makeUrl($modx->resource->id), \'/\') . $modx->getOption(\'cityfields_default_city\') . \'-\' . $city->get(\'id\');
}
$row[\'selected\'] = ( $cityFields->currentCityId == $city->get(\'id\') ) ? $selected : \'\';
$rows .= $pdoFetch ? $pdoFetch->getChunk($tpl, $row) : $modx->getChunk($tpl, $row);
}
if ( !empty($cityFields->frontendCSS) ) {
$modx->regClientCSS($cityFields->frontendCSS);
}
if ( !empty($cityFields->frontendJS) ) {
$modx->regClientScript(preg_replace(\'/(\\t|\\n)/\', \'\', \'
\'));
$modx->regClientScript($cityFields->frontendJS);
}
return $pdoFetch ? $pdoFetch->getChunk($tplWrapper, array(\'rows\' => $rows)) : $modx->getChunk($tplWrapper, array(\'rows\' => $rows));',
),
'policies' =>
array (
'web' =>
array (
),
),
'source' =>
array (
'id' => 1,
'name' => 'Filesystem',
'description' => '',
'class_key' => 'sources.modFileMediaSource',
'properties' =>
array (
),
'is_stream' => true,
),
),
'pdoResources' =>
array (
'fields' =>
array (
'id' => 3,
'source' => 1,
'property_preprocess' => false,
'name' => 'pdoResources',
'description' => '',
'editor_type' => 0,
'category' => 3,
'cache_type' => 0,
'snippet' => '/** @var array $scriptProperties */
if (isset($parents) && $parents === \'\') {
$scriptProperties[\'parents\'] = $modx->resource->id;
}
if (!empty($returnIds)) {
$scriptProperties[\'return\'] = \'ids\';
}
// Adding extra parameters into special place so we can put them in a results
/** @var modSnippet $snippet */
$additionalPlaceholders = $properties = array();
if (isset($this) && $this instanceof modSnippet) {
$properties = $this->get(\'properties\');
}
elseif ($snippet = $modx->getObject(\'modSnippet\', array(\'name\' => \'pdoResources\'))) {
$properties = $snippet->get(\'properties\');
}
if (!empty($properties)) {
foreach ($scriptProperties as $k => $v) {
if (!isset($properties[$k])) {
$additionalPlaceholders[$k] = $v;
}
}
}
$scriptProperties[\'additionalPlaceholders\'] = $additionalPlaceholders;
/** @var pdoFetch $pdoFetch */
$fqn = $modx->getOption(\'pdoFetch.class\', null, \'pdotools.pdofetch\', true);
$path = $modx->getOption(\'pdofetch_class_path\', null, MODX_CORE_PATH . \'components/pdotools/model/\', true);
if ($pdoClass = $modx->loadClass($fqn, $path, false, true)) {
$pdoFetch = new $pdoClass($modx, $scriptProperties);
} else {
return false;
}
$pdoFetch->addTime(\'pdoTools loaded\');
$output = $pdoFetch->run();
$log = \'\';
if ($modx->user->hasSessionContext(\'mgr\') && !empty($showLog)) {
$log .= \'\' . print_r($pdoFetch->getTime(), 1) . \' \';
}
// Return output
if (!empty($returnIds)) {
$modx->setPlaceholder(\'pdoResources.log\', $log);
if (!empty($toPlaceholder)) {
$modx->setPlaceholder($toPlaceholder, $output);
} else {
return $output;
}
} elseif (!empty($toSeparatePlaceholders)) {
$output[\'log\'] = $log;
$modx->setPlaceholders($output, $toSeparatePlaceholders);
} else {
$output .= $log;
if (!empty($tplWrapper) && (!empty($wrapIfEmpty) || !empty($output))) {
$output = $pdoFetch->getChunk($tplWrapper, array_merge($additionalPlaceholders, array(\'output\' => $output)),
$pdoFetch->config[\'fastMode\']);
}
if (!empty($toPlaceholder)) {
$modx->setPlaceholder($toPlaceholder, $output);
} else {
return $output;
}
}',
'locked' => false,
'properties' =>
array (
'tpl' =>
array (
'name' => 'tpl',
'desc' => 'pdotools_prop_tpl',
'type' => 'textfield',
'options' =>
array (
),
'value' => '',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Имя чанка для оформления ресурса. Если не указан, то содержимое полей ресурса будет распечатано на экран.',
'area_trans' => '',
),
'returnIds' =>
array (
'name' => 'returnIds',
'desc' => 'pdotools_prop_returnIds',
'type' => 'combo-boolean',
'options' =>
array (
),
'value' => false,
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Возвращать строку со списком id ресурсов, вместо оформленных результатов.',
'area_trans' => '',
),
'showLog' =>
array (
'name' => 'showLog',
'desc' => 'pdotools_prop_showLog',
'type' => 'combo-boolean',
'options' =>
array (
),
'value' => false,
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Показывать дополнительную информацию о работе сниппета. Только для авторизованных в контекте "mgr".',
'area_trans' => '',
),
'fastMode' =>
array (
'name' => 'fastMode',
'desc' => 'pdotools_prop_fastMode',
'type' => 'combo-boolean',
'options' =>
array (
),
'value' => false,
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Быстрый режим обработки чанков. Все необработанные теги (условия, сниппеты и т.п.) будут вырезаны.',
'area_trans' => '',
),
'sortby' =>
array (
'name' => 'sortby',
'desc' => 'pdotools_prop_sortby',
'type' => 'textfield',
'options' =>
array (
),
'value' => 'publishedon',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Любое поле ресурса для сортировки, включая ТВ параметр, если он указан в параметре "includeTVs". Можно указывать JSON строку с массивом нескольких полей. Для случайно сортировки укажите "RAND()"',
'area_trans' => '',
),
'sortbyTV' =>
array (
'name' => 'sortbyTV',
'desc' => 'pdotools_prop_sortbyTV',
'type' => 'textfield',
'options' =>
array (
),
'value' => '',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Сортировка по ТВ параметру. Если он не указан в &includeTVs, то будет подключен автоматически.',
'area_trans' => '',
),
'sortbyTVType' =>
array (
'name' => 'sortbyTVType',
'desc' => 'pdotools_prop_sortbyTVType',
'type' => 'textfield',
'options' =>
array (
),
'value' => '',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Тип сортировки по ТВ параметру. Возможные варианты: string, integer, decimal и datetime. Если пусто, то ТВ будет отсортирован в зависимости от его типа: как текст, число или дата.',
'area_trans' => '',
),
'sortdir' =>
array (
'name' => 'sortdir',
'desc' => 'pdotools_prop_sortdir',
'type' => 'list',
'options' =>
array (
0 =>
array (
'text' => 'ASC',
'value' => 'ASC',
'name' => 'ASC',
),
1 =>
array (
'text' => 'DESC',
'value' => 'DESC',
'name' => 'DESC',
),
),
'value' => 'DESC',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Направление сортировки: по убыванию или возрастанию.',
'area_trans' => '',
),
'sortdirTV' =>
array (
'name' => 'sortdirTV',
'desc' => 'pdotools_prop_sortdirTV',
'type' => 'list',
'options' =>
array (
0 =>
array (
'text' => 'ASC',
'value' => 'ASC',
'name' => 'ASC',
),
1 =>
array (
'text' => 'DESC',
'value' => 'DESC',
'name' => 'DESC',
),
),
'value' => 'ASC',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Направление сортировки ТВ: по убыванию или возрастанию. Если не указан, то будет равен параметру &sortdir.',
'area_trans' => '',
),
'limit' =>
array (
'name' => 'limit',
'desc' => 'pdotools_prop_limit',
'type' => 'numberfield',
'options' =>
array (
),
'value' => 10,
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Ограничение количества результатов выборки. Можно использовать "0".',
'area_trans' => '',
),
'offset' =>
array (
'name' => 'offset',
'desc' => 'pdotools_prop_offset',
'type' => 'numberfield',
'options' =>
array (
),
'value' => 0,
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Пропуск результатов от начала.',
'area_trans' => '',
),
'depth' =>
array (
'name' => 'depth',
'desc' => 'pdotools_prop_depth',
'type' => 'numberfield',
'options' =>
array (
),
'value' => 10,
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Глубина поиска дочерних ресурсов от родителя.',
'area_trans' => '',
),
'outputSeparator' =>
array (
'name' => 'outputSeparator',
'desc' => 'pdotools_prop_outputSeparator',
'type' => 'textfield',
'options' =>
array (
),
'value' => '
',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Необязательная строка для разделения результатов работы.',
'area_trans' => '',
),
'toPlaceholder' =>
array (
'name' => 'toPlaceholder',
'desc' => 'pdotools_prop_toPlaceholder',
'type' => 'textfield',
'options' =>
array (
),
'value' => '',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Если не пусто, сниппет сохранит все данные в плейсхолдер с этим именем, вместо вывода не экран.',
'area_trans' => '',
),
'parents' =>
array (
'name' => 'parents',
'desc' => 'pdotools_prop_parents',
'type' => 'textfield',
'options' =>
array (
),
'value' => '',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Список родителей, через запятую, для поиска результатов. По умолчанию выборка ограничена текущим родителем. Если поставить 0 - выборка не ограничивается. Если id родителя начинается с дефиса, он и его потомки исключается из выборки.',
'area_trans' => '',
),
'includeContent' =>
array (
'name' => 'includeContent',
'desc' => 'pdotools_prop_includeContent',
'type' => 'combo-boolean',
'options' =>
array (
),
'value' => false,
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Включаем поле "content" в выборку.',
'area_trans' => '',
),
'includeTVs' =>
array (
'name' => 'includeTVs',
'desc' => 'pdotools_prop_includeTVs',
'type' => 'textfield',
'options' =>
array (
),
'value' => '',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Список ТВ параметров для выборки, через запятую. Например: "action,time" дадут плейсхолдеры [[+action]] и [[+time]].',
'area_trans' => '',
),
'prepareTVs' =>
array (
'name' => 'prepareTVs',
'desc' => 'pdotools_prop_prepareTVs',
'type' => 'textfield',
'options' =>
array (
),
'value' => '1',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Список ТВ параметров, которые нужно подготовить перед выводом. По умолчанию, установлено в "1", что означает подготовку всех ТВ, указанных в "&includeTVs=``"',
'area_trans' => '',
),
'processTVs' =>
array (
'name' => 'processTVs',
'desc' => 'pdotools_prop_processTVs',
'type' => 'textfield',
'options' =>
array (
),
'value' => '',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Список ТВ параметров, которые нужно обработать перед выводом. Если установить в "1" - будут обработаны все ТВ, указанные в "&includeTVs=``". По умолчанию параметр пуст.',
'area_trans' => '',
),
'tvPrefix' =>
array (
'name' => 'tvPrefix',
'desc' => 'pdotools_prop_tvPrefix',
'type' => 'textfield',
'options' =>
array (
),
'value' => 'tv.',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Префикс для ТВ параметров.',
'area_trans' => '',
),
'tvFilters' =>
array (
'name' => 'tvFilters',
'desc' => 'pdotools_prop_tvFilters',
'type' => 'textfield',
'options' =>
array (
),
'value' => '',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Список фильтров по ТВ, с разделителями AND и OR. Разделитель, указанный в параметре "&tvFiltersOrDelimiter" представляет логическое условие OR и по нему условия группируются в первую очередь. Внутри каждой группы вы можете задать список значений, разделив их "&tvFiltersAndDelimiter". Поиск значений может проводиться в каком-то конкретном ТВ, если он указан ("myTV==value"), или в любом ("value"). Пример вызова: "&tvFilters=`filter2==one,filter1==bar%||filter1==foo`". Обратите внимание: фильтрация использует оператор LIKE и знак "%" является метасимволом. И еще: Поиск идёт по значениям, которые физически находятся в БД, то есть, сюда не подставляются значения по умолчанию из настроек ТВ.',
'area_trans' => '',
),
'tvFiltersAndDelimiter' =>
array (
'name' => 'tvFiltersAndDelimiter',
'desc' => 'pdotools_prop_tvFiltersAndDelimiter',
'type' => 'textfield',
'options' =>
array (
),
'value' => ',',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Разделитель для условий AND в параметре "&tvFilters". По умолчанию: ",".',
'area_trans' => '',
),
'tvFiltersOrDelimiter' =>
array (
'name' => 'tvFiltersOrDelimiter',
'desc' => 'pdotools_prop_tvFiltersOrDelimiter',
'type' => 'textfield',
'options' =>
array (
),
'value' => '||',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Разделитель для условий OR в параметре "&tvFilters". По умолчанию: "||".',
'area_trans' => '',
),
'where' =>
array (
'name' => 'where',
'desc' => 'pdotools_prop_where',
'type' => 'textfield',
'options' =>
array (
),
'value' => '',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Массив дополнительных параметров выборки, закодированный в JSON.',
'area_trans' => '',
),
'showUnpublished' =>
array (
'name' => 'showUnpublished',
'desc' => 'pdotools_prop_showUnpublished',
'type' => 'combo-boolean',
'options' =>
array (
),
'value' => false,
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Показывать неопубликованные ресурсы.',
'area_trans' => '',
),
'showDeleted' =>
array (
'name' => 'showDeleted',
'desc' => 'pdotools_prop_showDeleted',
'type' => 'combo-boolean',
'options' =>
array (
),
'value' => false,
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Показывать удалённые ресурсы.',
'area_trans' => '',
),
'showHidden' =>
array (
'name' => 'showHidden',
'desc' => 'pdotools_prop_showHidden',
'type' => 'combo-boolean',
'options' =>
array (
),
'value' => true,
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Показывать ресурсы, скрытые в меню.',
'area_trans' => '',
),
'hideContainers' =>
array (
'name' => 'hideContainers',
'desc' => 'pdotools_prop_hideContainers',
'type' => 'combo-boolean',
'options' =>
array (
),
'value' => false,
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Отключает вывод контейнеров, то есть, ресурсов с isfolder = 1.',
'area_trans' => '',
),
'context' =>
array (
'name' => 'context',
'desc' => 'pdotools_prop_context',
'type' => 'textfield',
'options' =>
array (
),
'value' => '',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Ограничение выборки по контексту ресурсов.',
'area_trans' => '',
),
'idx' =>
array (
'name' => 'idx',
'desc' => 'pdotools_prop_idx',
'type' => 'numberfield',
'options' =>
array (
),
'value' => '',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Вы можете указать стартовый номер итерации вывода результатов.',
'area_trans' => '',
),
'first' =>
array (
'name' => 'first',
'desc' => 'pdotools_prop_first',
'type' => 'numberfield',
'options' =>
array (
),
'value' => '',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Номер первой итерации вывода результатов.',
'area_trans' => '',
),
'last' =>
array (
'name' => 'last',
'desc' => 'pdotools_prop_last',
'type' => 'numberfield',
'options' =>
array (
),
'value' => '',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Номер последней итерации вывода результатов. По умолчанию он рассчитается автоматически, по формуле (total + first - 1).',
'area_trans' => '',
),
'tplFirst' =>
array (
'name' => 'tplFirst',
'desc' => 'pdotools_prop_tplFirst',
'type' => 'textfield',
'options' =>
array (
),
'value' => '',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Имя чанка для первого ресурса в результатах.',
'area_trans' => '',
),
'tplLast' =>
array (
'name' => 'tplLast',
'desc' => 'pdotools_prop_tplLast',
'type' => 'textfield',
'options' =>
array (
),
'value' => '',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Имя чанка для последнего ресурса в результатах.',
'area_trans' => '',
),
'tplOdd' =>
array (
'name' => 'tplOdd',
'desc' => 'pdotools_prop_tplOdd',
'type' => 'textfield',
'options' =>
array (
),
'value' => '',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Имя чанка для каждого второго ресурса.',
'area_trans' => '',
),
'tplWrapper' =>
array (
'name' => 'tplWrapper',
'desc' => 'pdotools_prop_tplWrapper',
'type' => 'textfield',
'options' =>
array (
),
'value' => '',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Чанк-обёртка, для заворачивания всех результатов. Понимает один плейсхолдер: [[+output]]. Не работает вместе с параметром "toSeparatePlaceholders".',
'area_trans' => '',
),
'wrapIfEmpty' =>
array (
'name' => 'wrapIfEmpty',
'desc' => 'pdotools_prop_wrapIfEmpty',
'type' => 'combo-boolean',
'options' =>
array (
),
'value' => false,
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Включает вывод чанка-обертки (tplWrapper) даже если результатов нет.',
'area_trans' => '',
),
'totalVar' =>
array (
'name' => 'totalVar',
'desc' => 'pdotools_prop_totalVar',
'type' => 'textfield',
'options' =>
array (
),
'value' => 'total',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Имя плейсхолдера для сохранения общего количества результатов.',
'area_trans' => '',
),
'resources' =>
array (
'name' => 'resources',
'desc' => 'pdotools_prop_resources',
'type' => 'textfield',
'options' =>
array (
),
'value' => '',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Список ресурсов, через запятую, для вывода в результатах. Если id ресурса начинается с дефиса, этот ресурс исключается из выборки.',
'area_trans' => '',
),
'tplCondition' =>
array (
'name' => 'tplCondition',
'desc' => 'pdotools_prop_tplCondition',
'type' => 'textfield',
'options' =>
array (
),
'value' => '',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Поле ресурса, из которого будет получено значение для выбора чанка по условию в "conditionalTpls".',
'area_trans' => '',
),
'tplOperator' =>
array (
'name' => 'tplOperator',
'desc' => 'pdotools_prop_tplOperator',
'type' => 'list',
'options' =>
array (
0 =>
array (
'text' => 'is equal to',
'value' => '==',
'name' => 'is equal to',
),
1 =>
array (
'text' => 'is not equal to',
'value' => '!=',
'name' => 'is not equal to',
),
2 =>
array (
'text' => 'less than',
'value' => '<',
'name' => 'less than',
),
3 =>
array (
'text' => 'less than or equal to',
'value' => '<=',
'name' => 'less than or equal to',
),
4 =>
array (
'text' => 'greater than or equal to',
'value' => '>=',
'name' => 'greater than or equal to',
),
5 =>
array (
'text' => 'is empty',
'value' => 'empty',
'name' => 'is empty',
),
6 =>
array (
'text' => 'is not empty',
'value' => '!empty',
'name' => 'is not empty',
),
7 =>
array (
'text' => 'is null',
'value' => 'null',
'name' => 'is null',
),
8 =>
array (
'text' => 'is in array',
'value' => 'inarray',
'name' => 'is in array',
),
9 =>
array (
'text' => 'is between',
'value' => 'between',
'name' => 'is between',
),
),
'value' => '==',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Необязательный оператор для проведения сравнения поля ресурса в "tplCondition" с массивом значений и чанков в "conditionalTpls".',
'area_trans' => '',
),
'conditionalTpls' =>
array (
'name' => 'conditionalTpls',
'desc' => 'pdotools_prop_conditionalTpls',
'type' => 'textarea',
'options' =>
array (
),
'value' => '',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'JSON строка с массивом, у которого в ключах указано то, с чем будет сравниваться "tplCondition", а в значениях - чанки, которые будут использованы для вывода, если сравнение будет успешно. Оператор сравнения указывается в "tplOperator". Для операторов типа "isempty" можно использовать массив без ключей.',
'area_trans' => '',
),
'select' =>
array (
'name' => 'select',
'desc' => 'pdotools_prop_select',
'type' => 'textarea',
'options' =>
array (
),
'value' => '',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Список полей для выборки, через запятую. Можно указывать JSON строку с массивом, например {"modResource":"id,pagetitle,content"}.',
'area_trans' => '',
),
'toSeparatePlaceholders' =>
array (
'name' => 'toSeparatePlaceholders',
'desc' => 'pdotools_prop_toSeparatePlaceholders',
'type' => 'textfield',
'options' =>
array (
),
'value' => '',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Если вы укажете слово в этом параметре, то ВСЕ результаты будут выставлены в разные плейсхолдеры, начинающиеся с этого слова и заканчивающиеся порядковым номером строки, от нуля. Например, указав в параметре "myPl", вы получите плейсхолдеры [[+myPl0]], [[+myPl1]] и т.д.',
'area_trans' => '',
),
'loadModels' =>
array (
'name' => 'loadModels',
'desc' => 'pdotools_prop_loadModels',
'type' => 'textfield',
'options' =>
array (
),
'value' => '',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Список компонентов, через запятую, чьи модели нужно загрузить для построения запроса. Например: "&loadModels=`ms2gallery,msearch2`".',
'area_trans' => '',
),
'scheme' =>
array (
'name' => 'scheme',
'desc' => 'pdotools_prop_scheme',
'type' => 'list',
'options' =>
array (
0 =>
array (
'value' => '',
'text' => 'System default',
'name' => 'System default',
),
1 =>
array (
'value' => -1,
'text' => '-1 (relative to site_url)',
'name' => '-1 (relative to site_url)',
),
2 =>
array (
'value' => 'full',
'text' => 'full (absolute, prepended with site_url)',
'name' => 'full (absolute, prepended with site_url)',
),
3 =>
array (
'value' => 'abs',
'text' => 'abs (absolute, prepended with base_url)',
'name' => 'abs (absolute, prepended with base_url)',
),
4 =>
array (
'value' => 'http',
'text' => 'http (absolute, forced to http scheme)',
'name' => 'http (absolute, forced to http scheme)',
),
5 =>
array (
'value' => 'https',
'text' => 'https (absolute, forced to https scheme)',
'name' => 'https (absolute, forced to https scheme)',
),
),
'value' => '',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Схема формирования ссылок: "uri" для подстановки поля uri документа (очень быстро) или параметр для modX::makeUrl().',
'area_trans' => '',
),
'useWeblinkUrl' =>
array (
'name' => 'useWeblinkUrl',
'desc' => 'pdotools_prop_useWeblinkUrl',
'type' => 'combo-boolean',
'options' =>
array (
),
'value' => false,
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Генерировать ссылку с учетом класса ресурса.',
'area_trans' => '',
),
),
'moduleguid' => '',
'static' => false,
'static_file' => 'core/components/pdotools/elements/snippets/snippet.pdoresources.php',
'content' => '/** @var array $scriptProperties */
if (isset($parents) && $parents === \'\') {
$scriptProperties[\'parents\'] = $modx->resource->id;
}
if (!empty($returnIds)) {
$scriptProperties[\'return\'] = \'ids\';
}
// Adding extra parameters into special place so we can put them in a results
/** @var modSnippet $snippet */
$additionalPlaceholders = $properties = array();
if (isset($this) && $this instanceof modSnippet) {
$properties = $this->get(\'properties\');
}
elseif ($snippet = $modx->getObject(\'modSnippet\', array(\'name\' => \'pdoResources\'))) {
$properties = $snippet->get(\'properties\');
}
if (!empty($properties)) {
foreach ($scriptProperties as $k => $v) {
if (!isset($properties[$k])) {
$additionalPlaceholders[$k] = $v;
}
}
}
$scriptProperties[\'additionalPlaceholders\'] = $additionalPlaceholders;
/** @var pdoFetch $pdoFetch */
$fqn = $modx->getOption(\'pdoFetch.class\', null, \'pdotools.pdofetch\', true);
$path = $modx->getOption(\'pdofetch_class_path\', null, MODX_CORE_PATH . \'components/pdotools/model/\', true);
if ($pdoClass = $modx->loadClass($fqn, $path, false, true)) {
$pdoFetch = new $pdoClass($modx, $scriptProperties);
} else {
return false;
}
$pdoFetch->addTime(\'pdoTools loaded\');
$output = $pdoFetch->run();
$log = \'\';
if ($modx->user->hasSessionContext(\'mgr\') && !empty($showLog)) {
$log .= \'\' . print_r($pdoFetch->getTime(), 1) . \' \';
}
// Return output
if (!empty($returnIds)) {
$modx->setPlaceholder(\'pdoResources.log\', $log);
if (!empty($toPlaceholder)) {
$modx->setPlaceholder($toPlaceholder, $output);
} else {
return $output;
}
} elseif (!empty($toSeparatePlaceholders)) {
$output[\'log\'] = $log;
$modx->setPlaceholders($output, $toSeparatePlaceholders);
} else {
$output .= $log;
if (!empty($tplWrapper) && (!empty($wrapIfEmpty) || !empty($output))) {
$output = $pdoFetch->getChunk($tplWrapper, array_merge($additionalPlaceholders, array(\'output\' => $output)),
$pdoFetch->config[\'fastMode\']);
}
if (!empty($toPlaceholder)) {
$modx->setPlaceholder($toPlaceholder, $output);
} else {
return $output;
}
}',
),
'policies' =>
array (
'web' =>
array (
),
),
'source' =>
array (
'id' => 1,
'name' => 'Filesystem',
'description' => '',
'class_key' => 'sources.modFileMediaSource',
'properties' =>
array (
),
'is_stream' => true,
),
),
'cfField' =>
array (
'fields' =>
array (
'id' => 74,
'source' => 1,
'property_preprocess' => false,
'name' => 'cfField',
'description' => '',
'editor_type' => 0,
'category' => 51,
'cache_type' => 0,
'snippet' => 'if (!$modx->getOption(\'cityfields_active\')) return false;
$cityFields = $modx->getService(\'cityfields\',\'cityFields\',$modx->getOption(\'cityfields.core_path\',null,$modx->getOption(\'core_path\').\'components/cityfields/\').\'model/cityfields/\',$scriptProperties);
if (!($cityFields instanceof cityFields)) return false;
if ( empty($key) && empty($input) ) return false;
if ( empty($city) && empty($options) ) $city = $cityFields->currentCityId;
if ( !is_numeric($city) && !is_numeric($options) ) {
$tmp = $modx->getObject(\'cfCity\', array(
array(
\'key\' => $city ?: $options,
\'OR:name:=\' => $city ?: $options
),
\'active\' => 1
));
if ( $tmp ) $city = $tmp->get(\'id\');
else return false;
}
$field = $modx->getObject(\'cfField\', array(
\'city_id\' => $city ?: $options,
\'placeholder\' => $key ?: $input
));
return ( $field ) ? $field->get(\'value\') : false;',
'locked' => false,
'properties' =>
array (
'city' =>
array (
'name' => 'city',
'desc' => 'cityfields_prop_city',
'type' => 'textfield',
'options' =>
array (
),
'value' => '',
'lexicon' => 'cityfields:properties',
'area' => '',
'desc_trans' => 'Город',
'area_trans' => '',
),
'key' =>
array (
'name' => 'key',
'desc' => 'cityfields_prop_key',
'type' => 'textfield',
'options' =>
array (
),
'value' => '',
'lexicon' => 'cityfields:properties',
'area' => '',
'desc_trans' => 'Плейсхолдер',
'area_trans' => '',
),
),
'moduleguid' => '',
'static' => false,
'static_file' => 'core/components/cityfields/elements/snippets/snippet.cffield.php',
'content' => 'if (!$modx->getOption(\'cityfields_active\')) return false;
$cityFields = $modx->getService(\'cityfields\',\'cityFields\',$modx->getOption(\'cityfields.core_path\',null,$modx->getOption(\'core_path\').\'components/cityfields/\').\'model/cityfields/\',$scriptProperties);
if (!($cityFields instanceof cityFields)) return false;
if ( empty($key) && empty($input) ) return false;
if ( empty($city) && empty($options) ) $city = $cityFields->currentCityId;
if ( !is_numeric($city) && !is_numeric($options) ) {
$tmp = $modx->getObject(\'cfCity\', array(
array(
\'key\' => $city ?: $options,
\'OR:name:=\' => $city ?: $options
),
\'active\' => 1
));
if ( $tmp ) $city = $tmp->get(\'id\');
else return false;
}
$field = $modx->getObject(\'cfField\', array(
\'city_id\' => $city ?: $options,
\'placeholder\' => $key ?: $input
));
return ( $field ) ? $field->get(\'value\') : false;',
),
'policies' =>
array (
'web' =>
array (
),
),
'source' =>
array (
'id' => 1,
'name' => 'Filesystem',
'description' => '',
'class_key' => 'sources.modFileMediaSource',
'properties' =>
array (
),
'is_stream' => true,
),
),
'cfFieldMenu' =>
array (
'fields' =>
array (
'id' => 79,
'source' => 1,
'property_preprocess' => false,
'name' => 'cfFieldMenu',
'description' => '',
'editor_type' => 0,
'category' => 51,
'cache_type' => 0,
'snippet' => 'if (!$modx->getOption(\'cityfields_active\')) return false;
$cityFields = $modx->getService(\'cityfields\',\'cityFields\',$modx->getOption(\'cityfields.core_path\',null,$modx->getOption(\'core_path\').\'components/cityfields/\').\'model/cityfields/\',$scriptProperties);
if (!($cityFields instanceof cityFields)) return false;
if ( empty($key) && empty($input) ) return false;
if ( empty($city) && empty($options) ) $city = $cityFields->currentCityId;
$default = $modx->getOption(\'cityfields_default_city\', $config, 1);
if($city == $default){
return;
}
if(is_numeric($city)){
$tmp = $modx->getObject(\'cfCity\', $city);
print_r($tmp->get(\'key\'));
}',
'locked' => false,
'properties' =>
array (
'city' =>
array (
'name' => 'city',
'desc' => 'cityfields_prop_city',
'type' => 'textfield',
'options' =>
array (
),
'value' => '',
'lexicon' => 'cityfields:properties',
'area' => '',
'desc_trans' => 'Город',
'area_trans' => '',
),
'key' =>
array (
'name' => 'key',
'desc' => 'cityfields_prop_key',
'type' => 'textfield',
'options' =>
array (
),
'value' => '',
'lexicon' => 'cityfields:properties',
'area' => '',
'desc_trans' => 'Плейсхолдер',
'area_trans' => '',
),
),
'moduleguid' => '',
'static' => false,
'static_file' => 'core/components/cityfields/elements/snippets/snippet.cffield.php',
'content' => 'if (!$modx->getOption(\'cityfields_active\')) return false;
$cityFields = $modx->getService(\'cityfields\',\'cityFields\',$modx->getOption(\'cityfields.core_path\',null,$modx->getOption(\'core_path\').\'components/cityfields/\').\'model/cityfields/\',$scriptProperties);
if (!($cityFields instanceof cityFields)) return false;
if ( empty($key) && empty($input) ) return false;
if ( empty($city) && empty($options) ) $city = $cityFields->currentCityId;
$default = $modx->getOption(\'cityfields_default_city\', $config, 1);
if($city == $default){
return;
}
if(is_numeric($city)){
$tmp = $modx->getObject(\'cfCity\', $city);
print_r($tmp->get(\'key\'));
}',
),
'policies' =>
array (
'web' =>
array (
),
),
'source' =>
array (
'id' => 1,
'name' => 'Filesystem',
'description' => '',
'class_key' => 'sources.modFileMediaSource',
'properties' =>
array (
),
'is_stream' => true,
),
),
'pdoMenu' =>
array (
'fields' =>
array (
'id' => 10,
'source' => 1,
'property_preprocess' => false,
'name' => 'pdoMenu',
'description' => '',
'editor_type' => 0,
'category' => 3,
'cache_type' => 0,
'snippet' => '/** @var array $scriptProperties */
// Convert parameters from Wayfinder if exists
if (isset($startId)) {
$scriptProperties[\'parents\'] = $startId;
}
if (!empty($includeDocs)) {
$tmp = array_map(\'trim\', explode(\',\', $includeDocs));
foreach ($tmp as $v) {
if (!empty($scriptProperties[\'resources\'])) {
$scriptProperties[\'resources\'] .= \',\' . $v;
} else {
$scriptProperties[\'resources\'] = $v;
}
}
}
if (!empty($excludeDocs)) {
$tmp = array_map(\'trim\', explode(\',\', $excludeDocs));
foreach ($tmp as $v) {
if (!empty($scriptProperties[\'resources\'])) {
$scriptProperties[\'resources\'] .= \',-\' . $v;
} else {
$scriptProperties[\'resources\'] = \'-\' . $v;
}
}
}
if (!empty($previewUnpublished) && $modx->hasPermission(\'view_unpublished\')) {
$scriptProperties[\'showUnpublished\'] = 1;
}
$scriptProperties[\'depth\'] = empty($level) ? 100 : abs($level) - 1;
if (!empty($contexts)) {
$scriptProperties[\'context\'] = $contexts;
}
if (empty($scriptProperties[\'context\'])) {
$scriptProperties[\'context\'] = $modx->resource->context_key;
}
// Save original parents specified by user
$specified_parents = array_map(\'trim\', explode(\',\', $scriptProperties[\'parents\']));
if ($scriptProperties[\'parents\'] === \'\') {
$scriptProperties[\'parents\'] = $modx->resource->id;
} elseif ($scriptProperties[\'parents\'] === 0 || $scriptProperties[\'parents\'] === \'0\') {
if ($scriptProperties[\'depth\'] !== \'\' && $scriptProperties[\'depth\'] !== 100) {
$contexts = array_map(\'trim\', explode(\',\', $scriptProperties[\'context\']));
$parents = array();
if (!empty($scriptProperties[\'showDeleted\'])) {
$pdoFetch = $modx->getService(\'pdoFetch\');
foreach ($contexts as $ctx) {
$parents = array_merge($parents,
$pdoFetch->getChildIds(\'modResource\', 0, $scriptProperties[\'depth\'], array(\'context\' => $ctx)));
}
} else {
foreach ($contexts as $ctx) {
$parents = array_merge($parents,
$modx->getChildIds(0, $scriptProperties[\'depth\'], array(\'context\' => $ctx)));
}
}
$scriptProperties[\'parents\'] = !empty($parents) ? implode(\',\', $parents) : \'+0\';
$scriptProperties[\'depth\'] = 0;
}
$scriptProperties[\'includeParents\'] = 1;
$scriptProperties[\'displayStart\'] = 0;
} else {
$parents = array_map(\'trim\', explode(\',\', $scriptProperties[\'parents\']));
$parents_in = $parents_out = array();
foreach ($parents as $v) {
if (!is_numeric($v)) {
continue;
}
if ($v[0] == \'-\') {
$parents_out[] = abs($v);
} else {
$parents_in[] = abs($v);
}
}
if (empty($parents_in)) {
$scriptProperties[\'includeParents\'] = 1;
$scriptProperties[\'displayStart\'] = 0;
}
}
if (!empty($displayStart)) {
$scriptProperties[\'includeParents\'] = 1;
}
if (!empty($ph)) {
$toPlaceholder = $ph;
}
if (!empty($sortOrder)) {
$scriptProperties[\'sortdir\'] = $sortOrder;
}
if (!empty($sortBy)) {
$scriptProperties[\'sortby\'] = $sortBy;
}
if (!empty($permissions)) {
$scriptProperties[\'checkPermissions\'] = $permissions;
}
if (!empty($cacheResults)) {
$scriptProperties[\'cache\'] = $cacheResults;
}
if (!empty($ignoreHidden)) {
$scriptProperties[\'showHidden\'] = $ignoreHidden;
}
$wfTemplates = array(
\'outerTpl\' => \'tplOuter\',
\'rowTpl\' => \'tpl\',
\'parentRowTpl\' => \'tplParentRow\',
\'parentRowHereTpl\' => \'tplParentRowHere\',
\'hereTpl\' => \'tplHere\',
\'innerTpl\' => \'tplInner\',
\'innerRowTpl\' => \'tplInnerRow\',
\'innerHereTpl\' => \'tplInnerHere\',
\'activeParentRowTpl\' => \'tplParentRowActive\',
\'categoryFoldersTpl\' => \'tplCategoryFolder\',
\'startItemTpl\' => \'tplStart\',
);
foreach ($wfTemplates as $k => $v) {
if (isset(${$k})) {
$scriptProperties[$v] = ${$k};
}
}
//---
/** @var pdoMenu $pdoMenu */
$fqn = $modx->getOption(\'pdoMenu.class\', null, \'pdotools.pdomenu\', true);
$path = $modx->getOption(\'pdomenu_class_path\', null, MODX_CORE_PATH . \'components/pdotools/model/\', true);
if ($pdoClass = $modx->loadClass($fqn, $path, false, true)) {
$pdoMenu = new $pdoClass($modx, $scriptProperties);
} else {
return false;
}
$pdoMenu->pdoTools->addTime(\'pdoTools loaded\');
$cache = !empty($cache) || (!$modx->user->id && !empty($cacheAnonymous));
if (empty($scriptProperties[\'cache_key\'])) {
$scriptProperties[\'cache_key\'] = \'pdomenu/\' . sha1(serialize($scriptProperties));
}
$output = \'\';
$tree = array();
if ($cache) {
$tree = $pdoMenu->pdoTools->getCache($scriptProperties);
}
if (empty($tree)) {
$data = $pdoMenu->pdoTools->run();
$data = $pdoMenu->pdoTools->buildTree($data, \'id\', \'parent\', $specified_parents);
$tree = array();
foreach ($data as $k => $v) {
if (empty($v[\'id\'])) {
if (!in_array($k, $specified_parents) && !$pdoMenu->checkResource($k)) {
continue;
} else {
$tree = array_merge($tree, $v[\'children\']);
}
} else {
$tree[$k] = $v;
}
}
if ($cache) {
$pdoMenu->pdoTools->setCache($tree, $scriptProperties);
}
}
if (!empty($tree)) {
$output = $pdoMenu->templateTree($tree);
}
if ($modx->user->hasSessionContext(\'mgr\') && !empty($showLog)) {
$output .= \'\';
}
if (!empty($toPlaceholder)) {
$modx->setPlaceholder($toPlaceholder, $output);
} else {
return $output;
}',
'locked' => false,
'properties' =>
array (
'showLog' =>
array (
'name' => 'showLog',
'desc' => 'pdotools_prop_showLog',
'type' => 'combo-boolean',
'options' =>
array (
),
'value' => false,
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Показывать дополнительную информацию о работе сниппета. Только для авторизованных в контекте "mgr".',
'area_trans' => '',
),
'fastMode' =>
array (
'name' => 'fastMode',
'desc' => 'pdotools_prop_fastMode',
'type' => 'combo-boolean',
'options' =>
array (
),
'value' => false,
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Быстрый режим обработки чанков. Все необработанные теги (условия, сниппеты и т.п.) будут вырезаны.',
'area_trans' => '',
),
'level' =>
array (
'name' => 'level',
'desc' => 'pdotools_prop_level',
'type' => 'numberfield',
'options' =>
array (
),
'value' => 0,
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Уровень генерируемого меню.',
'area_trans' => '',
),
'parents' =>
array (
'name' => 'parents',
'desc' => 'pdotools_prop_parents',
'type' => 'textfield',
'options' =>
array (
),
'value' => '',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Список родителей, через запятую, для поиска результатов. По умолчанию выборка ограничена текущим родителем. Если поставить 0 - выборка не ограничивается. Если id родителя начинается с дефиса, он и его потомки исключается из выборки.',
'area_trans' => '',
),
'displayStart' =>
array (
'name' => 'displayStart',
'desc' => 'pdotools_prop_displayStart',
'type' => 'combo-boolean',
'options' =>
array (
),
'value' => false,
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Включить показ начальных узлов меню. Полезно при указании более одного "parents".',
'area_trans' => '',
),
'resources' =>
array (
'name' => 'resources',
'desc' => 'pdotools_prop_resources',
'type' => 'textfield',
'options' =>
array (
),
'value' => '',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Список ресурсов, через запятую, для вывода в результатах. Если id ресурса начинается с дефиса, этот ресурс исключается из выборки.',
'area_trans' => '',
),
'templates' =>
array (
'name' => 'templates',
'desc' => 'pdotools_prop_templates',
'type' => 'textfield',
'options' =>
array (
),
'value' => '',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Список шаблонов, через запятую, для фильтрации результатов. Если id шаблона начинается с дефиса, ресурсы с ним исключается из выборки.',
'area_trans' => '',
),
'context' =>
array (
'name' => 'context',
'desc' => 'pdotools_prop_context',
'type' => 'textfield',
'options' =>
array (
),
'value' => '',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Ограничение выборки по контексту ресурсов.',
'area_trans' => '',
),
'cache' =>
array (
'name' => 'cache',
'desc' => 'pdotools_prop_cache',
'type' => 'combo-boolean',
'options' =>
array (
),
'value' => false,
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Кэширование результатов работы сниппета.',
'area_trans' => '',
),
'cacheTime' =>
array (
'name' => 'cacheTime',
'desc' => 'pdotools_prop_cacheTime',
'type' => 'numberfield',
'options' =>
array (
),
'value' => 3600,
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Время актуальности кэша в секундах.',
'area_trans' => '',
),
'cacheAnonymous' =>
array (
'name' => 'cacheAnonymous',
'desc' => 'pdotools_prop_cacheAnonymous',
'type' => 'combo-boolean',
'options' =>
array (
),
'value' => false,
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Включить кэширование только для неавторизованных посетителей.',
'area_trans' => '',
),
'plPrefix' =>
array (
'name' => 'plPrefix',
'desc' => 'pdotools_prop_plPrefix',
'type' => 'textfield',
'options' =>
array (
),
'value' => 'wf.',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Префикс для выставляемых плейсхолдеров, по умолчанию "wf.".',
'area_trans' => '',
),
'showHidden' =>
array (
'name' => 'showHidden',
'desc' => 'pdotools_prop_showHidden',
'type' => 'combo-boolean',
'options' =>
array (
),
'value' => false,
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Показывать ресурсы, скрытые в меню.',
'area_trans' => '',
),
'showUnpublished' =>
array (
'name' => 'showUnpublished',
'desc' => 'pdotools_prop_showUnpublished',
'type' => 'combo-boolean',
'options' =>
array (
),
'value' => false,
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Показывать неопубликованные ресурсы.',
'area_trans' => '',
),
'showDeleted' =>
array (
'name' => 'showDeleted',
'desc' => 'pdotools_prop_showDeleted',
'type' => 'combo-boolean',
'options' =>
array (
),
'value' => false,
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Показывать удалённые ресурсы.',
'area_trans' => '',
),
'previewUnpublished' =>
array (
'name' => 'previewUnpublished',
'desc' => 'pdotools_prop_previewUnpublished',
'type' => 'combo-boolean',
'options' =>
array (
),
'value' => false,
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Включить показ неопубликованных документов, если у пользователя есть на это разрешение.',
'area_trans' => '',
),
'hideSubMenus' =>
array (
'name' => 'hideSubMenus',
'desc' => 'pdotools_prop_hideSubMenus',
'type' => 'combo-boolean',
'options' =>
array (
),
'value' => false,
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Спрятать неактивные ветки меню.',
'area_trans' => '',
),
'useWeblinkUrl' =>
array (
'name' => 'useWeblinkUrl',
'desc' => 'pdotools_prop_useWeblinkUrl',
'type' => 'combo-boolean',
'options' =>
array (
),
'value' => true,
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Генерировать ссылку с учетом класса ресурса.',
'area_trans' => '',
),
'sortdir' =>
array (
'name' => 'sortdir',
'desc' => 'pdotools_prop_sortdir',
'type' => 'list',
'options' =>
array (
0 =>
array (
'text' => 'ASC',
'value' => 'ASC',
'name' => 'ASC',
),
1 =>
array (
'text' => 'DESC',
'value' => 'DESC',
'name' => 'DESC',
),
),
'value' => 'ASC',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Направление сортировки: по убыванию или возрастанию.',
'area_trans' => '',
),
'sortby' =>
array (
'name' => 'sortby',
'desc' => 'pdotools_prop_sortby',
'type' => 'textfield',
'options' =>
array (
),
'value' => 'menuindex',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Любое поле ресурса для сортировки, включая ТВ параметр, если он указан в параметре "includeTVs". Можно указывать JSON строку с массивом нескольких полей. Для случайно сортировки укажите "RAND()"',
'area_trans' => '',
),
'limit' =>
array (
'name' => 'limit',
'desc' => 'pdotools_prop_limit',
'type' => 'numberfield',
'options' =>
array (
),
'value' => 0,
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Ограничение количества результатов выборки. Можно использовать "0".',
'area_trans' => '',
),
'offset' =>
array (
'name' => 'offset',
'desc' => 'pdotools_prop_offset',
'type' => 'numberfield',
'options' =>
array (
),
'value' => 0,
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Пропуск результатов от начала.',
'area_trans' => '',
),
'rowIdPrefix' =>
array (
'name' => 'rowIdPrefix',
'desc' => 'pdotools_prop_rowIdPrefix',
'type' => 'textfield',
'options' =>
array (
),
'value' => '',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Префикс id="" для выставления идентификатора в чанк.',
'area_trans' => '',
),
'firstClass' =>
array (
'name' => 'firstClass',
'desc' => 'pdotools_prop_firstClass',
'type' => 'textfield',
'options' =>
array (
),
'value' => 'first',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Класс для первого пункта меню.',
'area_trans' => '',
),
'lastClass' =>
array (
'name' => 'lastClass',
'desc' => 'pdotools_prop_lastClass',
'type' => 'textfield',
'options' =>
array (
),
'value' => 'last',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Класс последнего пункта меню.',
'area_trans' => '',
),
'hereClass' =>
array (
'name' => 'hereClass',
'desc' => 'pdotools_prop_hereClass',
'type' => 'textfield',
'options' =>
array (
),
'value' => 'active',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Класс для активного пункта меню.',
'area_trans' => '',
),
'parentClass' =>
array (
'name' => 'parentClass',
'desc' => 'pdotools_prop_parentClass',
'type' => 'textfield',
'options' =>
array (
),
'value' => '',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Класс категории меню.',
'area_trans' => '',
),
'rowClass' =>
array (
'name' => 'rowClass',
'desc' => 'pdotools_prop_rowClass',
'type' => 'textfield',
'options' =>
array (
),
'value' => '',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Класс одной строки меню.',
'area_trans' => '',
),
'outerClass' =>
array (
'name' => 'outerClass',
'desc' => 'pdotools_prop_outerClass',
'type' => 'textfield',
'options' =>
array (
),
'value' => '',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Класс обертки меню.',
'area_trans' => '',
),
'innerClass' =>
array (
'name' => 'innerClass',
'desc' => 'pdotools_prop_innerClass',
'type' => 'textfield',
'options' =>
array (
),
'value' => '',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Класс внутренних ссылок меню.',
'area_trans' => '',
),
'levelClass' =>
array (
'name' => 'levelClass',
'desc' => 'pdotools_prop_levelClass',
'type' => 'textfield',
'options' =>
array (
),
'value' => '',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Класс уровня меню. Например, если укажите "level", то будет "level1", "level2" и т.д.',
'area_trans' => '',
),
'selfClass' =>
array (
'name' => 'selfClass',
'desc' => 'pdotools_prop_selfClass',
'type' => 'textfield',
'options' =>
array (
),
'value' => '',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Класс текущего документа в меню.',
'area_trans' => '',
),
'webLinkClass' =>
array (
'name' => 'webLinkClass',
'desc' => 'pdotools_prop_webLinkClass',
'type' => 'textfield',
'options' =>
array (
),
'value' => '',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Класс документа-ссылки.',
'area_trans' => '',
),
'tplOuter' =>
array (
'name' => 'tplOuter',
'desc' => 'pdotools_prop_tplOuter',
'type' => 'textfield',
'options' =>
array (
),
'value' => '@INLINE ',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Чанк-обёртка всего блока меню.',
'area_trans' => '',
),
'tpl' =>
array (
'name' => 'tpl',
'desc' => 'pdotools_prop_tpl',
'type' => 'textfield',
'options' =>
array (
),
'value' => '@INLINE [[+menutitle]] [[+wrapper]] ',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Имя чанка для оформления ресурса. Если не указан, то содержимое полей ресурса будет распечатано на экран.',
'area_trans' => '',
),
'tplParentRow' =>
array (
'name' => 'tplParentRow',
'desc' => 'pdotools_prop_tplParentRow',
'type' => 'textfield',
'options' =>
array (
),
'value' => '',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Чанк оформления контейнера с потомками.',
'area_trans' => '',
),
'tplParentRowHere' =>
array (
'name' => 'tplParentRowHere',
'desc' => 'pdotools_prop_tplParentRowHere',
'type' => 'textfield',
'options' =>
array (
),
'value' => '',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Чанк оформления текущего контейнера с потомками.',
'area_trans' => '',
),
'tplHere' =>
array (
'name' => 'tplHere',
'desc' => 'pdotools_prop_tplHere',
'type' => 'textfield',
'options' =>
array (
),
'value' => '',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Чанк текущего документа',
'area_trans' => '',
),
'tplInner' =>
array (
'name' => 'tplInner',
'desc' => 'pdotools_prop_tplInner',
'type' => 'textfield',
'options' =>
array (
),
'value' => '',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Чанк-обёртка внутренних пунктов меню. Если пуст - будет использовать "tplInner".',
'area_trans' => '',
),
'tplInnerRow' =>
array (
'name' => 'tplInnerRow',
'desc' => 'pdotools_prop_tplInnerRow',
'type' => 'textfield',
'options' =>
array (
),
'value' => '',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Чанк-обёртка активного пункта меню.',
'area_trans' => '',
),
'tplInnerHere' =>
array (
'name' => 'tplInnerHere',
'desc' => 'pdotools_prop_tplInnerHere',
'type' => 'textfield',
'options' =>
array (
),
'value' => '',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Чанк-обёртка активного пункта меню.',
'area_trans' => '',
),
'tplParentRowActive' =>
array (
'name' => 'tplParentRowActive',
'desc' => 'pdotools_prop_tplParentRowActive',
'type' => 'textfield',
'options' =>
array (
),
'value' => '',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Чанк оформления активного контейнера с потомками.',
'area_trans' => '',
),
'tplCategoryFolder' =>
array (
'name' => 'tplCategoryFolder',
'desc' => 'pdotools_prop_tplCategoryFolder',
'type' => 'textfield',
'options' =>
array (
),
'value' => '',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Специальный чанк оформления категории. Категория - это документ с потомками и или нулевым шаблоном, или с атрибутом "rel=\\"category\\"".',
'area_trans' => '',
),
'tplStart' =>
array (
'name' => 'tplStart',
'desc' => 'pdotools_prop_tplStart',
'type' => 'textfield',
'options' =>
array (
),
'value' => '@INLINE [[+menutitle]] [[+wrapper]]',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Чанк оформления корневого пункта, при условии, что включен "displayStart".',
'area_trans' => '',
),
'checkPermissions' =>
array (
'name' => 'checkPermissions',
'desc' => 'pdotools_prop_checkPermissions',
'type' => 'textfield',
'options' =>
array (
),
'value' => '',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Укажите, какие разрешения нужно проверять у пользователя при выводе документов.',
'area_trans' => '',
),
'hereId' =>
array (
'name' => 'hereId',
'desc' => 'pdotools_prop_hereId',
'type' => 'numberfield',
'options' =>
array (
),
'value' => '',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Id документа, текущего для генерируемого меню. Нужно указывать только если скрипт сам его неверно определяет, например при выводе меню из чанка другого сниппета.',
'area_trans' => '',
),
'where' =>
array (
'name' => 'where',
'desc' => 'pdotools_prop_where',
'type' => 'textfield',
'options' =>
array (
),
'value' => '',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Массив дополнительных параметров выборки, закодированный в JSON.',
'area_trans' => '',
),
'select' =>
array (
'name' => 'select',
'desc' => 'pdotools_prop_select',
'type' => 'textfield',
'options' =>
array (
),
'value' => '',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Список полей для выборки, через запятую. Можно указывать JSON строку с массивом, например {"modResource":"id,pagetitle,content"}.',
'area_trans' => '',
),
'scheme' =>
array (
'name' => 'scheme',
'desc' => 'pdotools_prop_scheme',
'type' => 'list',
'options' =>
array (
0 =>
array (
'value' => '',
'text' => 'System default',
'name' => 'System default',
),
1 =>
array (
'value' => -1,
'text' => '-1 (relative to site_url)',
'name' => '-1 (relative to site_url)',
),
2 =>
array (
'value' => 'full',
'text' => 'full (absolute, prepended with site_url)',
'name' => 'full (absolute, prepended with site_url)',
),
3 =>
array (
'value' => 'abs',
'text' => 'abs (absolute, prepended with base_url)',
'name' => 'abs (absolute, prepended with base_url)',
),
4 =>
array (
'value' => 'http',
'text' => 'http (absolute, forced to http scheme)',
'name' => 'http (absolute, forced to http scheme)',
),
5 =>
array (
'value' => 'https',
'text' => 'https (absolute, forced to https scheme)',
'name' => 'https (absolute, forced to https scheme)',
),
),
'value' => '',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Схема формирования ссылок: "uri" для подстановки поля uri документа (очень быстро) или параметр для modX::makeUrl().',
'area_trans' => '',
),
'toPlaceholder' =>
array (
'name' => 'toPlaceholder',
'desc' => 'pdotools_prop_toPlaceholder',
'type' => 'textfield',
'options' =>
array (
),
'value' => '',
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Если не пусто, сниппет сохранит все данные в плейсхолдер с этим именем, вместо вывода не экран.',
'area_trans' => '',
),
'countChildren' =>
array (
'name' => 'countChildren',
'desc' => 'pdotools_prop_countChildren',
'type' => 'combo-boolean',
'options' =>
array (
),
'value' => false,
'lexicon' => 'pdotools:properties',
'area' => '',
'desc_trans' => 'Вывести точное количество активных потомков документа в плейсхолдер [[+children]].',
'area_trans' => '',
),
),
'moduleguid' => '',
'static' => false,
'static_file' => 'core/components/pdotools/elements/snippets/snippet.pdomenu.php',
'content' => '/** @var array $scriptProperties */
// Convert parameters from Wayfinder if exists
if (isset($startId)) {
$scriptProperties[\'parents\'] = $startId;
}
if (!empty($includeDocs)) {
$tmp = array_map(\'trim\', explode(\',\', $includeDocs));
foreach ($tmp as $v) {
if (!empty($scriptProperties[\'resources\'])) {
$scriptProperties[\'resources\'] .= \',\' . $v;
} else {
$scriptProperties[\'resources\'] = $v;
}
}
}
if (!empty($excludeDocs)) {
$tmp = array_map(\'trim\', explode(\',\', $excludeDocs));
foreach ($tmp as $v) {
if (!empty($scriptProperties[\'resources\'])) {
$scriptProperties[\'resources\'] .= \',-\' . $v;
} else {
$scriptProperties[\'resources\'] = \'-\' . $v;
}
}
}
if (!empty($previewUnpublished) && $modx->hasPermission(\'view_unpublished\')) {
$scriptProperties[\'showUnpublished\'] = 1;
}
$scriptProperties[\'depth\'] = empty($level) ? 100 : abs($level) - 1;
if (!empty($contexts)) {
$scriptProperties[\'context\'] = $contexts;
}
if (empty($scriptProperties[\'context\'])) {
$scriptProperties[\'context\'] = $modx->resource->context_key;
}
// Save original parents specified by user
$specified_parents = array_map(\'trim\', explode(\',\', $scriptProperties[\'parents\']));
if ($scriptProperties[\'parents\'] === \'\') {
$scriptProperties[\'parents\'] = $modx->resource->id;
} elseif ($scriptProperties[\'parents\'] === 0 || $scriptProperties[\'parents\'] === \'0\') {
if ($scriptProperties[\'depth\'] !== \'\' && $scriptProperties[\'depth\'] !== 100) {
$contexts = array_map(\'trim\', explode(\',\', $scriptProperties[\'context\']));
$parents = array();
if (!empty($scriptProperties[\'showDeleted\'])) {
$pdoFetch = $modx->getService(\'pdoFetch\');
foreach ($contexts as $ctx) {
$parents = array_merge($parents,
$pdoFetch->getChildIds(\'modResource\', 0, $scriptProperties[\'depth\'], array(\'context\' => $ctx)));
}
} else {
foreach ($contexts as $ctx) {
$parents = array_merge($parents,
$modx->getChildIds(0, $scriptProperties[\'depth\'], array(\'context\' => $ctx)));
}
}
$scriptProperties[\'parents\'] = !empty($parents) ? implode(\',\', $parents) : \'+0\';
$scriptProperties[\'depth\'] = 0;
}
$scriptProperties[\'includeParents\'] = 1;
$scriptProperties[\'displayStart\'] = 0;
} else {
$parents = array_map(\'trim\', explode(\',\', $scriptProperties[\'parents\']));
$parents_in = $parents_out = array();
foreach ($parents as $v) {
if (!is_numeric($v)) {
continue;
}
if ($v[0] == \'-\') {
$parents_out[] = abs($v);
} else {
$parents_in[] = abs($v);
}
}
if (empty($parents_in)) {
$scriptProperties[\'includeParents\'] = 1;
$scriptProperties[\'displayStart\'] = 0;
}
}
if (!empty($displayStart)) {
$scriptProperties[\'includeParents\'] = 1;
}
if (!empty($ph)) {
$toPlaceholder = $ph;
}
if (!empty($sortOrder)) {
$scriptProperties[\'sortdir\'] = $sortOrder;
}
if (!empty($sortBy)) {
$scriptProperties[\'sortby\'] = $sortBy;
}
if (!empty($permissions)) {
$scriptProperties[\'checkPermissions\'] = $permissions;
}
if (!empty($cacheResults)) {
$scriptProperties[\'cache\'] = $cacheResults;
}
if (!empty($ignoreHidden)) {
$scriptProperties[\'showHidden\'] = $ignoreHidden;
}
$wfTemplates = array(
\'outerTpl\' => \'tplOuter\',
\'rowTpl\' => \'tpl\',
\'parentRowTpl\' => \'tplParentRow\',
\'parentRowHereTpl\' => \'tplParentRowHere\',
\'hereTpl\' => \'tplHere\',
\'innerTpl\' => \'tplInner\',
\'innerRowTpl\' => \'tplInnerRow\',
\'innerHereTpl\' => \'tplInnerHere\',
\'activeParentRowTpl\' => \'tplParentRowActive\',
\'categoryFoldersTpl\' => \'tplCategoryFolder\',
\'startItemTpl\' => \'tplStart\',
);
foreach ($wfTemplates as $k => $v) {
if (isset(${$k})) {
$scriptProperties[$v] = ${$k};
}
}
//---
/** @var pdoMenu $pdoMenu */
$fqn = $modx->getOption(\'pdoMenu.class\', null, \'pdotools.pdomenu\', true);
$path = $modx->getOption(\'pdomenu_class_path\', null, MODX_CORE_PATH . \'components/pdotools/model/\', true);
if ($pdoClass = $modx->loadClass($fqn, $path, false, true)) {
$pdoMenu = new $pdoClass($modx, $scriptProperties);
} else {
return false;
}
$pdoMenu->pdoTools->addTime(\'pdoTools loaded\');
$cache = !empty($cache) || (!$modx->user->id && !empty($cacheAnonymous));
if (empty($scriptProperties[\'cache_key\'])) {
$scriptProperties[\'cache_key\'] = \'pdomenu/\' . sha1(serialize($scriptProperties));
}
$output = \'\';
$tree = array();
if ($cache) {
$tree = $pdoMenu->pdoTools->getCache($scriptProperties);
}
if (empty($tree)) {
$data = $pdoMenu->pdoTools->run();
$data = $pdoMenu->pdoTools->buildTree($data, \'id\', \'parent\', $specified_parents);
$tree = array();
foreach ($data as $k => $v) {
if (empty($v[\'id\'])) {
if (!in_array($k, $specified_parents) && !$pdoMenu->checkResource($k)) {
continue;
} else {
$tree = array_merge($tree, $v[\'children\']);
}
} else {
$tree[$k] = $v;
}
}
if ($cache) {
$pdoMenu->pdoTools->setCache($tree, $scriptProperties);
}
}
if (!empty($tree)) {
$output = $pdoMenu->templateTree($tree);
}
if ($modx->user->hasSessionContext(\'mgr\') && !empty($showLog)) {
$output .= \'\';
}
if (!empty($toPlaceholder)) {
$modx->setPlaceholder($toPlaceholder, $output);
} else {
return $output;
}',
),
'policies' =>
array (
'web' =>
array (
),
),
'source' =>
array (
'id' => 1,
'name' => 'Filesystem',
'description' => '',
'class_key' => 'sources.modFileMediaSource',
'properties' =>
array (
),
'is_stream' => true,
),
),
'getImageList' =>
array (
'fields' =>
array (
'id' => 23,
'source' => 0,
'property_preprocess' => false,
'name' => 'getImageList',
'description' => '',
'editor_type' => 0,
'category' => 8,
'cache_type' => 0,
'snippet' => '/**
* getImageList
*
* Copyright 2009-2014 by Bruno Perner
*
* getImageList is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option) any
* later version.
*
* getImageList is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
* A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with
* getImageList; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
* Suite 330, Boston, MA 02111-1307 USA
*
* @package migx
*/
/**
* getImageList
*
* display Items from outputvalue of TV with custom-TV-input-type MIGX or from other JSON-string for MODx Revolution
*
* @version 1.4
* @author Bruno Perner
* @copyright Copyright © 2009-2014
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU General Public License
* version 2 or (at your option) any later version.
* @package migx
*/
/*example: [[!getImageList? &tvname=`myTV`&tpl=`@CODE:[[+idx]][[+imageAlt]]
`]] */
/* get default properties */
$tvname = $modx->getOption(\'tvname\', $scriptProperties, \'\');
$inherit_children_tvname = $modx->getOption(\'inherit_children_tvname\', $scriptProperties, \'\');
$tpl = $modx->getOption(\'tpl\', $scriptProperties, \'\');
$wrapperTpl = $modx->getOption(\'wrapperTpl\', $scriptProperties, \'\');
$emptyTpl = $modx->getOption(\'emptyTpl\', $scriptProperties, \'\');
$limit = $modx->getOption(\'limit\', $scriptProperties, \'0\');
$offset = $modx->getOption(\'offset\', $scriptProperties, 0);
$totalVar = $modx->getOption(\'totalVar\', $scriptProperties, \'total\');
$randomize = $modx->getOption(\'randomize\', $scriptProperties, false);
$preselectLimit = $modx->getOption(\'preselectLimit\', $scriptProperties, 0); // when random preselect important images
$where = $modx->getOption(\'where\', $scriptProperties, \'\');
$where = !empty($where) ? $modx->fromJSON($where) : array();
$sort = $modx->getOption(\'sort\', $scriptProperties, \'\');
$sort = !empty($sort) ? $modx->fromJSON($sort) : array();
$toSeparatePlaceholders = $modx->getOption(\'toSeparatePlaceholders\', $scriptProperties, false);
$toPlaceholder = $modx->getOption(\'toPlaceholder\', $scriptProperties, false);
$outputSeparator = $modx->getOption(\'outputSeparator\', $scriptProperties, \'\');
$splitSeparator = $modx->getOption(\'splitSeparator\', $scriptProperties, \'\');
$placeholdersKeyField = $modx->getOption(\'placeholdersKeyField\', $scriptProperties, \'MIGX_id\');
$toJsonPlaceholder = $modx->getOption(\'toJsonPlaceholder\', $scriptProperties, false);
$jsonVarKey = $modx->getOption(\'jsonVarKey\', $scriptProperties, \'migx_outputvalue\');
$outputvalue = $modx->getOption(\'value\', $scriptProperties, \'\');
$outputvalue = isset($_REQUEST[$jsonVarKey]) ? $_REQUEST[$jsonVarKey] : $outputvalue;
$docidVarKey = $modx->getOption(\'docidVarKey\', $scriptProperties, \'migx_docid\');
$docid = $modx->getOption(\'docid\', $scriptProperties, (isset($modx->resource) ? $modx->resource->get(\'id\') : 1));
$docid = isset($_REQUEST[$docidVarKey]) ? $_REQUEST[$docidVarKey] : $docid;
$processTVs = $modx->getOption(\'processTVs\', $scriptProperties, \'1\');
$reverse = $modx->getOption(\'reverse\', $scriptProperties, \'0\');
$sumFields = $modx->getOption(\'sumFields\', $scriptProperties, \'\');
$sumPrefix = $modx->getOption(\'sumPrefix\', $scriptProperties, \'summary_\');
$addfields = $modx->getOption(\'addfields\', $scriptProperties, \'\');
$addfields = !empty($addfields) ? explode(\',\', $addfields) : null;
//split json into parts
$splits = $modx->fromJson($modx->getOption(\'splits\', $scriptProperties, 0));
$splitTpl = $modx->getOption(\'splitTpl\', $scriptProperties, \'\');
$splitSeparator = $modx->getOption(\'splitSeparator\', $scriptProperties, \'\');
$inheritFrom = $modx->getOption(\'inheritFrom\', $scriptProperties, \'\'); //commaseparated list of resource-ids or/and the keyword \'parents\' where to inherit from
$inheritFrom = !empty($inheritFrom) ? explode(\',\', $inheritFrom) : \'\';
$modx->setPlaceholder(\'docid\', $docid);
$base_path = $modx->getOption(\'base_path\', null, MODX_BASE_PATH);
$base_url = $modx->getOption(\'base_url\', null, MODX_BASE_URL);
$migx = $modx->getService(\'migx\', \'Migx\', $modx->getOption(\'migx.core_path\', null, $modx->getOption(\'core_path\') . \'components/migx/\') . \'model/migx/\', $scriptProperties);
if (!($migx instanceof Migx))
return \'\';
$migx->working_context = isset($modx->resource) ? $modx->resource->get(\'context_key\') : \'web\';
if (!empty($tvname)) {
if ($tv = $modx->getObject(\'modTemplateVar\', array(\'name\' => $tvname))) {
/*
* get inputProperties
*/
$properties = $tv->get(\'input_properties\');
$properties = isset($properties[\'formtabs\']) ? $properties : $tv->getProperties();
$migx->config[\'configs\'] = $modx->getOption(\'configs\', $properties, \'\');
if (!empty($migx->config[\'config