Skip to content

Instantly share code, notes, and snippets.

View Dmi3yy's full-sized avatar

Dmytro Lukianenko Dmi3yy

View GitHub Profile

#Релиз 1.0.13 от 03.03.2014.

Данный релиз включает довольно много исправлений а так же нововведений которые упростят разработку сайтов на MODX EVO.

Исправлений: 44
Рефактор: 42
Улучшений: 24
Безопасность: 1

##Над версией 1.0.13 работали:

#Release 1.0.13 from 03.03.2014.

This release includes quite a few changes and improvements that would make simpler of creating sites on MODX EVO.

Fixes: 44
Refactoring: 42
Improvements: 24
Security: 1

<?php
$core->event->params['TplMainOwner'] = '@CODE: <ul id="nav" class="menu level-1">[+dl.wrap+]</ul>';
$core->event->params['TplSubOwner'] = '@CODE: <ul class="sub-menu level-[+dl.currentDepth+]">[+dl.wrap+]</ul>';
$core->event->params['TplOneItem'] ='@CODE: <li id="menu-item-[+id+]" class="menu-item [+dl.class+]"><a href="[+url+]" title="[+e.title+]">[+title+]</a>[+dl.submenu+]</li>';
$core->event->params['addWhereList'] = 'c.hidemenu = 0';
$currentDepth = getkey($core->event->params, 'currentDepth', 1);
$currentTpl = getkey($core->event->params, 'TplDepth'.$currentDepth);
if(empty($currentTpl)){
$currentTpl = getkey($core->event->params, 'TplOneItem', '@CODE: <li>[+pagetitle+]</li>');
<?php
/*
* Получает имена и значения всех TV в одной категории для указанного документа
*
* version: 0.2
*
* Author:
* darksmoke from modx.im
* dsmoke@ukr.net
*
@Dmi3yy
Dmi3yy / choiceTV.php
Last active December 14, 2015 04:09
choiceTV - выбор значений из уже заполненных тв или запись нового
<?php
/**
* @copyright 2013 Dmi3yy
* @version 0.2
* @license http://opensource.org/licenses/MIT MIT License
* @author Dmi3yy <dmi3yy@gmail.com>
* @link http://dmi3yy.com author home page
*/
$sql = 'SELECT DISTINCT `value` FROM '.$modx->getFullTableName('site_tmplvar_contentvalues').' WHERE tmplvarid = '.$field_id;
$result = $modx->db->query( $sql );
@Dmi3yy
Dmi3yy / ph.snippet.php
Last active December 17, 2015 22:59
ph snippet PHx alternative
<?php
/*
* Замена PHx для обработки плейсхолдеров
* Версия: 0.1
* Пример: [[ph? &fn=`mydate` &input=`[*pub_date*]` &options=`%d-%m-%Y %H:%M`]]
* Автор: Dmi3yy (dmi3yy@gmail.com)
*/
$output = isset($input)?$input:'';
$options = isset($options)?$options:'';
$fn = isset($fn)?$fn:'none';
@Dmi3yy
Dmi3yy / gist:7246860
Created October 31, 2013 09:31
cheats sampe
<?php include '../inc/header.php'; ?>
<div class="container">
<div class="row">
<div class="col-md-6">
<h3><a name="ditto" href="#wayfinder">Wayfinder</a></h3>
<h4><a name="wayfinderpar" href="#wayfinderpar">Parameters</a></h4>
<pre class="prettyprint lang-php">
//Шаблон родителей текущего пункта меню
&activeParentRowTpl=`false`
//Шаблон вывода категории
//<?php
//***********************************
// TVCurrencyConverter plugin v1.1 for MODx 1.0.x
//***********************************
// Eugeny `zk` Krylov - http://nopreset.ru
// Support topic: http://modx-shopkeeper.ru/forum/viewtopic.php?id=239
//***********************************
// Description: TV Currency Converter
// Configuration: &tv_price=TV цены;string;цена &tv_valuta=TV цены в валюте;string;доллары &id_curr=id ресурса с курсом;string;1 &tv_curr=TV курса;string;курс
@Dmi3yy
Dmi3yy / Asset.php
Created January 28, 2014 07:34
TSVpreReplace - Замена квадратных скобок в вызовах сниппетов, плейсхолдерах и TV
/**
* TSVpreReplace
*
* Замена квадратных скобок в вызовах сниппетов, плейсхолдерах и TV, находящихся между тегами <pre></pre>
*
* @author Serg24, update by Boomka
* @category plugin
* @version 1.0
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License (GPL)
* @internal @events OnLoadWebDocument
@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>