This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Вывод ошибок | |
ini_set('display_errors', 1); | |
ini_set('memory_limit', '512M'); | |
error_reporting(E_ERROR); | |
// Подключаем | |
define('MODX_API_MODE', true); | |
require dirname(dirname(dirname(__FILE__))).'/index.php'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import xmlrpclib | |
def xmlrpc(url): | |
api = xmlrpclib.Server(url, transport=CookieTransport()) | |
return api | |
class CookieTransport(xmlrpclib.Transport): | |
cookies = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (!isset($id) || !isset($field)) return; | |
$resource = $modx->getObject('modResource', $id); | |
if (!$resource) return; | |
$data = $resource->toArray(); | |
if (isset($data[$field])) { | |
return $data[$field]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ($modx->event->name == 'OnPageNotFound') { | |
$config = $modx->getConfig(); | |
$uri = explode('/', $_SERVER['REQUEST_URI']); | |
array_shift($uri); | |
array_pop($uri); | |
return $modx->sendRedirect( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Preloading images. | |
* @public | |
* | |
* @param {Object} images | |
* @param {Function} callback | |
*/ | |
function preloadImages(images, callback) { | |
var callback = callback || null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$pdo = $modx->getService('pdoTools'); | |
$fieldName = $modx->getOption('fieldName', $scriptProperties, 'vendor'); | |
$fieldClass = $modx->getOption('fieldClass', $scriptProperties, ''); | |
$firstOption = $modx->getOption('firstOption', $scriptProperties, ''); | |
$parent = $modx->getOption('parent', $scriptProperties, 0); | |
$depth = $modx->getOption('depth', $scriptProperties, 10); | |
$limit = $modx->getOption('limit', $scriptProperties, 100); | |
$tplOuter = $modx->getOption('tplOuter', $scriptProperties, '@INLINE <select name="[[+name]]" class="[[+class]]">[[+rows]]</select>'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(bh) { | |
/** | |
* @block b-page | |
*/ | |
bh.match('b-page', function(ctx) { | |
ctx.tag('body'); | |
var html = { | |
tag: 'html', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(config) { | |
config.node('pages/index', function(nodeConfig) { | |
nodeConfig.addTechs([ | |
[ require('enb/techs/file-provider'), { target: '?.bemdecl.js' } ], | |
[ require('enb/techs/file-provider'), { target: '?.bemjson.js' } ], | |
[ require('enb/techs/levels'), { levels: getLevels(config) } ], | |
require('enb/techs/html-from-bemjson'), | |
require('enb-stylus/techs/css-stylus-with-autoprefixer'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"disallowMixedSpacesAndTabs": true, | |
"disallowTrailingWhitespace": true, | |
"requireLineFeedAtFileEnd": true, | |
"requireRightStickedOperators": ["!"], | |
"requireLeftStickedOperators": [","], | |
"disallowMultipleLineBreaks": true, | |
"requireRightStickedOperators": ["!"], | |
"requireLeftStickedOperators": [","], | |
"disallowImplicitTypeConversion": ["string"], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$grid ?= { | |
gutter: 0 | |
columns: 16 | |
padding: 20px | |
} | |
.grid | |
float: left | |
box-sizing: border-box | |
border-left: $grid.gutter solid transparent |
OlderNewer