Skip to content

Instantly share code, notes, and snippets.

View lector1982's full-sized avatar

Alexey "Lector" Perepelka lector1982

View GitHub Profile
@lector1982
lector1982 / altPlus.php
Created October 1, 2021 08:16 — forked from navt/altPlus.php
Плагин altPlus для MODX Evolution. Заполняет отсутствующий/незаполненный атрибут alt в теге img для поля content. На сайте предполагается использование визуального редактора TyniMCE4.
<?php
/**
* @internal @properties &meatAltBase=предполагаемое содержимое атрибута alt;text;[*pagetitle*] &numImg=добавить нумерацию изображений в alt;list;да,нет;да
* @internal @events OnDocFormSave
* @author Борис Федоров <w-navt@yandex.ru>
*/
if (!isset($meatAltBase)) {
$meatAltBase = '[*pagetitle*]'; // предполагаемое содержимое атрибута alt
}
if (!isset($numImg)) {
@lector1982
lector1982 / myconfig.js
Created May 24, 2021 07:58 — forked from 0test/myconfig.js
Ex. config Tiny 5
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"
@lector1982
lector1982 / switch
Created May 19, 2021 06:49 — forked from 64j/switch
Snippet switch
<?php
$switch = !empty($switch) ? $switch : '';
$default = !empty($default) ? $default : '';
$out = '';
if (!empty($params)) {
$out = $default;
foreach($params as $k => $v) {
$value = mb_substr($k, 5);
if (mb_substr($k, 0, 5) === 'case:' && $value === $switch) {
$out = $v;
@lector1982
lector1982 / evo.sh
Created March 18, 2021 03:21 — forked from Dmi3yy/evo.sh
evo.sh
#!/bin/bash
# basic script, before use need change logins,passwords in this script
# put this script in project folder and run: sh evo.sh
#variables
EVO_VERSION="3.x-dev"
INSTALL_TYPE=1
DATABASE_TYPE="mysql"
DATABASE_SERVER="localhost"
DATABASE_NAME="DB"
@lector1982
lector1982 / market.yml
Created December 23, 2020 12:13 — forked from 0test/market.yml
market.yml for Yandex
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE yml_catalog SYSTEM "shops.dtd">
<yml_catalog date="[!mDate? &date=`[*editedon*]`!]">
<shop>
<name>[(site_name)]</name>
<company>[(site_name)]</company>
<url>[(site_url)]</url>
<currencies>
<currency id="RUR" rate="1"/>
</currencies>
@lector1982
lector1982 / ChangeManagerThree
Created August 30, 2019 01:54 — forked from 0test/ChangeManagerThree
Изменяем некоторые иконки в дереве
$e = &$modx->Event;
if($e->name = 'OnManagerNodePrerender'){
/* Разделы каталога */
if($ph['template'] == '6'){
$ph['icon'] = "<i class='fa fa-table'></i>";
$ph['icon_folder_open'] = "<i class='fa fa-table'></i>";
$ph['icon_folder_close'] = "<i class='fa fa-table'></i>";
$ph['contextmenu'] = array(
'header1' => array(