Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* Default Russian Lexicon Entries for ClicheThumbnail
*
* @package cliche
* @subpackage lexicon
*/
$_lang['clichethumbnail.main_default_text'] = '<h4>Нажмите на кнопку выше, чтобы выбрать изображение</h4>Предварительный просмотре выбранного изображения заменит этот текст';
$_lang['clichethumbnail.main_your_preview'] = 'Предварительный просмотр миниатюры';
<?php
/**
* Default Russian Lexicon Entries for Cliche
*
* @package cliche
* @subpackage lexicon
*/
/* System settings */
$_lang['setting_cliche.upload_size_limit'] = 'Лимит размера файла';
$_lang['setting_cliche.upload_size_limit_desc'] = 'Максимальный размер файла для загрузки';
<?php
/**
* Default Manager Russian Lexicon Entries for Cliche
*
* @package cliche
* @subpackage lexicon
*/
$_lang['cliche.main_title'] = 'Cliche';
<?php
require_once dirname(dirname(__FILE__)).'/core/config/config.inc.php';
include_once MODX_CORE_PATH . 'model/modx/modx.class.php';
$modx= new modX();
$modx->initialize('mgr');
$modx->setLogLevel(modX::LOG_LEVEL_INFO);
$modx->setLogTarget(XPDO_CLI_MODE ? 'ECHO' : 'HTML');
// Settings
@argnist
argnist / far7.user.js
Last active December 17, 2015 07:39
far7 tradelog greasemonkey userscript
// ==UserScript==
// @name far7 TradeLog
// @namespace far7
// @description Log for trading
// @include http://game.far7.by/*
// @include http://far7.versus.im/tradelog/*
// @grant none
// @version 1
// ==/UserScript==
/*! jQuery v2.0.0 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license
@argnist
argnist / far7.user.js
Created May 14, 2013 13:10
Tradelog for far7 with panel
// ==UserScript==
// @name far7 TradeLog
// @namespace far7
// @description Log for trading
// @include http://game.far7.by/*
// @include http://far7.versus.im/tradelog/*
// @grant none
// @version 1
// ==/UserScript==
/*! jQuery v2.0.0 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license
@argnist
argnist / msorderbyphonehandler.class.php
Created July 4, 2013 10:22
Minishop2 OrderHandler с привязкой к телефону вместо емейла
<?php
class msOrderByPhoneHandler extends msOrderHandler {
public function getCustomerId() {
$order = $this->ms2->order->get();
if (empty($order['phone'])) {return false;}
if ($this->modx->user->isAuthenticated()) {
$profile = $this->modx->user->Profile;
@argnist
argnist / templatizerX.php
Created November 26, 2013 03:26
TemplatizerX - Дополнительно к кастомизации форм устанавливает шаблон в зависимости от шаблона родителя
<?php
switch ($modx->event->name) {
case 'OnDocFormRender':
if (!isset($_GET['template'])) {
$parent = isset($_GET['parent']) ? intval($_GET['parent']) : 0;
$templates = array(1 => 4, 6 => 13, 8 => 6, 5 => 6, 4 => 15, 7 => 11, 17 => array(16, 17));
if (isset($templates[$parent])) {
$template = $templates[$parent];
if (is_array($template)) {
@argnist
argnist / orRequired.php
Last active December 30, 2015 02:49
Валидатор на заполненность телефона либо почты
<?php
if (($validator->required($param, $validator->fields[$param]) === true) || ($validator->required($key, $value) === true))
{
return true;
}
$validator->addError($key,'Почта и телефон пусты');
return false;
/*
<?php
// change:
/* handle file fields */
foreach ($origFields as $k => $v) {
$attachmentIndex = 0;
if (is_array($v) && !empty($v['tmp_name']) && isset($v['error']) && $v['error'] == UPLOAD_ERR_OK) {
if (empty($v['name'])) {
$v['name'] = 'attachment'.$attachmentIndex;
}
$this->modx->mail->mailer->AddAttachment($v['tmp_name'],$v['name'],'base64',!empty($v['type']) ? $v['type'] : 'application/octet-stream');