Skip to content

Instantly share code, notes, and snippets.

@akool
akool / custom-table.html
Created November 7, 2023 13:22
Web component of a table with customizable number of cells
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
@akool
akool / plugin.manageuserfields.php
Last active March 20, 2019 11:36
Плагин для скрытия и переименования полей веб-пользователей в админ-панели Evolution CMS
//<?php
/**
* ManageUserFields
* Плагин для скрытия и переименования полей веб-пользователей в админ-панели
*
* @category plugin
* @version 0.2
* @author Akool
* @internal @properties &hideFields=Скрываем;text; &renameFields=Переименовываем;text;
* @internal @events OnWUsrFormRender
@akool
akool / ManagerCssContexts.php
Created March 10, 2019 11:42 — forked from pmfx/ManagerCssContexts.php
Plugin for Evolution CMS. Adds some style to the first level tree elements, to make them stand out more. Usefull when you are using first level documents as "context" folders.
<?php
// ManagerCssContexts
// Add some style too the first level tree elements.
// Event: OnManagerTreePrerender
// Modify $contexts variable for your needs.
$e = & $modx->Event;
if ( $e->name == "OnManagerTreePrerender" ) {
@akool
akool / makearchive.bat
Created July 28, 2017 12:48
Create archive with name as current date
@ECHO OFF
7z a html%date:~-2%%date:~-7,2%%date:~-10,2%%time:~0,2%dev.zip src\* gulpfile.js package.json
PAUSE
//<?php
$manager_theme = $modx->config['manager_theme'];
$data = $modx->runSnippet('DocLister', array(
'debug' => 0,
'idType' => 'documents',
'ignoreEmpty' => 1,
'controller' => 'onetable',
'table' => 'subscribers',
'dateSource' => 'createdon',
/*
*
* TreeAppend
* Плагин для добавления содержимого в дерево ресурсов
* MODX Evo 1.0.11+
*
* @category plugin
* @version 0.1
* @internal @events OnManagerTreeRender
* @internal @modx_category Manager and Admin
@akool
akool / gulpfile.js
Last active April 9, 2021 03:32
Gulp file fo build html, css, js. Use gulp 4
'use strict';
const gulp = require('gulp');
const del = require("del");
const notify = require('gulp-notify');
const rename = require('gulp-rename');
const postcss = require('gulp-postcss');
const cssnano = require('gulp-cssnano');
const mqpacker = require("css-mqpacker");
const svgmin = require('gulp-svgmin');
@akool
akool / Emmet.sublime-settings
Last active June 14, 2017 11:15
sublime-settings
{
"preferences": {
"css.autoInsertVendorPrefixes": false
}
}
@akool
akool / SeparatedList
Created February 11, 2015 10:26
Modx Evo snippet to output separated list of documents.
<?php
$cid = $modx->documentIdentifier;
$parent = isset($startId) ? (int)$startId : $cid;
$parentTree = $modx->getParentIds($cid);
$outerTpl = isset($outerTpl) ? $outerTpl : '[+wrapper+]';
$parentClass = isset($parentClass) ? ' class="'.$parentClass.'"' : '';
$rowClass = isset($rowClass) ? ' class="'.$rowClass.'"' : '';
$rowTpl = isset($rowTpl) ? $rowTpl : '<li[+class+]><a href="[+url+]"[+active+]>[+title+]</a></li>';
$rows = isset($rows) ? (int)$rows : 3;
$out = '';
@akool
akool / getFirstImageInResource
Created December 4, 2014 11:50
Get the first image from content
<?php
$content = $modx->resource->content;
if(preg_match("/src=\"(.*?)\"/",$content,&$matches)){
$img = substr($matches[1],1,strlen($matches[1]));
}
else {
$img = "assets/images/defaultImage.png";
}
return $img;