Skip to content

Instantly share code, notes, and snippets.

View pmfx's full-sized avatar

Piotr Matysiak pmfx

View GitHub Profile
@sashabeep
sashabeep / BaseController_pagebuilder_part.php
Last active January 19, 2021 22:28
Evo 2.0 pagebuilder controller
...
$this->data['pagebuilder'] = $this->evo->runSnippet('PageBuilder', ['renderTo' => 'array'])[0];
...
@mnoskov
mnoskov / UploadSeparator.plugin.php
Created December 18, 2018 08:30
Separate upload folders for each user group in Evolution CMS
//<?php
/**
* UploadSeparator
*
* Separate upload folders for each user group
*
* @category plugin
* @version 0.1.0
* @author kassio
* @internal @properties &folders=Groups to folders relation;text;1==44w9mFQp||2==jG7h8-Mv &common_folder=Name of the common folder;text;common
@keslo
keslo / plugin_livereload.php
Last active November 12, 2018 19:31
LiveReload in MODX Evo (Evo CMS)
global $modx;
// проверяем авторизацию менеджера
if ($_SESSION['mgrInternalKey'] == 1) {
// вешаем запись в localStorage при сохранении чанка
$e = $modx->Event;
if ($e->name == "OnChunkFormRender" || $e->name == "OnTempFormRender") {
$script = '<script>
var btn = document.getElementById("Button1");
btn.addEventListener("click", function() {
<?php
/* filter by TV of date format */
/* &filters=`tvdate:mytv:=:2017-09-28` */
include_once ('tv.filter.php');
/**
* Created by PhpStorm.
* User: Pathologic
* Date: 28.09.17
* Time: 13:09
*/
@AgelxNash
AgelxNash / plugin.LoadElement.php
Last active February 8, 2022 03:39
[MODX Evolution] Плагин загрузки элементов (чанков и сниппетов) из файлов
<?php
/**
* LoadElement
*
* Загрузка элементов из файлов
*
* @version 2.0.0
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License (GPL)
* @category plugin
* @author Agel Nash <modx@agel-nash.ru>
@Dmi3yy
Dmi3yy / gist:2d54571209afcb770d95
Last active October 1, 2016 20:25
Elements Tab in Tree
//<?php
//OnManagerTreePrerender,OnManagerTreeRender
//Autor: Dmi3yy
//Version: 0.1
if($_SESSION['mgrRole']=='1') {
$e = &$modx->Event;
if($e->name == 'OnManagerTreePrerender'){
$output = '
<style>
@marcedwards
marcedwards / high-dpi-media.css
Last active November 19, 2023 12:56
A CSS media query that captures almost all high DPI aware devices.
/* ---------------------------------------------------------- */
/* */
/* A media query that captures: */
/* */
/* - Retina iOS devices */
/* - Retina Macs running Safari */
/* - High DPI Windows PCs running IE 8 and above */
/* - Low DPI Windows PCs running IE, zoomed in */
/* - Low DPI Windows PCs and Macs running Firefox, zoomed in */
/* - Android hdpi devices and above */
@dave1010
dave1010 / strip_word_html.php
Created November 12, 2010 13:14
Strip MS Word HTML. From php.net
<?php
function strip_word_html($text, $allowed_tags = '<b><i><sup><sub><em><strong><u><br>')
{
mb_regex_encoding('UTF-8');
//replace MS special characters first
$search = array('/&lsquo;/u', '/&rsquo;/u', '/&ldquo;/u', '/&rdquo;/u', '/&mdash;/u');
$replace = array('\'', '\'', '"', '"', '-');
$text = preg_replace($search, $replace, $text);
//make sure _all_ html entities are converted to the plain ascii equivalents - it appears
//in some MS headers, some html entities are encoded and some aren't