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.1.3 | |
$expires = $modx->getOption('expires', $scriptProperties, 3600); | |
$noindex = $modx->getOption('noindex', $scriptProperties, false); | |
$keywordsField = $modx->getOption('keywordsField', $scriptProperties, 'keywords'); | |
$imageField = $modx->getOption('imageField', $scriptProperties, 'image'); | |
$viewport = $modx->getOption('viewport', $scriptProperties, 'width=device-width, initial-scale=1'); | |
$hasSchema = $modx->getOption('hasSchema', $scriptProperties, true); | |
$hasOpenGraph = $modx->getOption('hasOpenGraph', $scriptProperties, true); |
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 | |
/** | |
* snippet requestForm v.2.0.3 | |
* for ModX & Bootstrap ^3 | |
* | |
* @param string [type] (normal|modal|modal-sm) - form type | |
* @param string [title] - form title | |
* @param string [code] - form id | |
* @param string [prefixCode] - prefix form id | |
* @param json|array [btns] - btns properties |
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.7 | |
/** | |
* string fileList - список файлов из директории | |
* @param validExts - список разрешенных типов файлов для вывода | |
* @param sortby - сортировка (name)(asc,desc) | |
* @param totalVar = 'total' | |
* @param limit | |
* @param page | |
* @param path - относительный путь к папке с файлом |
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.1.0 | |
/** | |
* string link(id = $modx->resource->id [, get, implode, rm, type, request_uri]) - генерация произвольного URL с параметрами GET | |
* @param id - ид ресурса, для которого генерируется урл, по умолчанию, текущий ресурс | |
* @param type = full, необязательно | |
* @param get - список GET параметров в виде json строки | |
* @param merge = false|1|2 - следует ли объединять дополнительные GET с текущими, 1 - с перезаписью, 2 - добавляет дополнительный элемент массива | |
* @param rm - удалить ненужный GET параметр из строки. может быть использовано несколько параметров через запятую, либо json если понадобится удалить конкретное значение | |
* @param request_uri = false|true - флаг, вместо makeUrl использовать SERVER[REQUEST_URI] |
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.1.0 | |
/** | |
* Модификатор для несложных математических вычислений (знаки /+-*). | |
* Примеры использования: | |
* прибавим к этому значение 0.5 и получим [[+value:math=`+0.5`]] | |
* (2+2)*2 равно [[math?input=`(2+2)*2`]] | |
**/ | |
if(!$input) return; |
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 | |
/** | |
* snippet migxParse v.1.1.0 | |
* &input - входящая JSON строка, обязательный параметр | |
* &processFields - добавляет источники файлов для полей | |
* (ввод через запятую, двойной знак равно. первый параметр - поле, второй - название источника файлов). например src==Images,img==Images | |
* &tpl - шаблон строкового представления, для @INLINE (и для специального синтаксиса тегов {{+field:phx=^params^}} ) | |
* &where - условие в JSON формате, {"active":1} | |
* &limit - лимит | |
* &one - если нужно получить одно поле, ввод названия поля, параметр tpl не нужен (&one=`image`) |
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.7 | |
* переключение контекстов в зависимости от домена и/или урла | |
* | |
* необходимые для работы настройки контекста | |
* error_page | |
* site_start | |
* base_url - если нужно переключать контекст в пределах сайта (указывается раздел, напр. "/folder/") | |
* http_host - если контекст на другом домене (поддомене), напр. "http://site.ru" |
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 | |
$out = array(); | |
if( | |
!empty($loadModels) | |
&& !empty($class) | |
){ | |
$loadModels = explode(',',$loadModels); | |
$class = explode(',',$class); | |
foreach($loadModels as $i=>$package){ | |
$className = $class[$i]; |
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
ls – список файлов и каталогов | |
ls -al – форматированный список со скрытыми каталогами и файлами | |
cd dir – сменить директорию на dir | |
cd – сменить на домашний каталог | |
pwd – показать текущий каталог | |
mkdir dir – создать каталог dir | |
rm file – удалить file | |
rm -r dir – удалить каталог dir | |
rm -f file – удалить форсированно file | |
rm -rf dir – удалить форсированно каталог dir * |
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.1 | |
class modWebResourcesGetfilterProcessor extends modProcessor { | |
public function process() { | |
$response = array('total' => 0, 'success' => 0); | |
$tvs = $this->getProperty('tvs') ? $this->getProperty('tvs') : array(); | |
$resource_fields = array_keys($this->modx->newObject('modResource')->toArray()); | |
$select = $excl = $tvs_name = []; | |
OlderNewer