Wassi Wassinen

Wassi Wassinen

Был в сети 27 июня 2026, 01:27
Заказы не принимаю
<?php
function elements_modsnippet_20($scriptProperties= array()) {
global $modx;
if (is_array($scriptProperties)) {
extract($scriptProperties, EXTR_SKIP);
}
/**
 * FormIt
 *
 * Copyright 2009-2012 by Shaun McCormick <shaun@modx.com>
 *
 * FormIt 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.
 *
 * FormIt 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
 * FormIt; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 * Suite 330, Boston, MA 02111-1307 USA
 *
 * @package formit
 */
/**
 * Custom output filter that returns checked="checked" if the value is set
 *
 * @var string $input
 * @var string $options
 * @package formit
 */
$output = ' ';
if ($input == $options) {
    $output = ' selected="selected"';
}
$input = $modx->fromJSON($input);
if (in_array($options,$input)) {
  $output = ' selected="selected"';
}
return $output;
}
У тебя есть системная настройка «ориентация страницы ». Почему нет возможности указать ориентацию для снипета? Это универсально. Согласись, не всегда нужно все документы распечатать в книжной ориентации или в альбомной. Для таблиц можно было бы указать одни настройки, для статей — другие.

Если будет такая возможность — обязательно куплю.

Заранее благодарен.
Спасибо, Василий. За инструмент — что-то позабыл про него. И за пример — сам бы не додумался. Василий, подскажи еще один момент — используя присоединение таблиц, можно построить более сложный запрос и искать в имени файлов по галерее изображений каждого продукта? И если да, как это сделать?

Заранее благодарен.