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 (!$input) { | |
return ''; | |
} | |
$doc = new DOMDocument(); | |
$doc->loadHTML("\xEF\xBB\xBF" . $input, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); | |
// Find all tables and wrap them with div.table-responsive element | |
$tables = $doc->getElementsByTagName('table'); |
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
@use "sass:map"; | |
@mixin preset-slides-width($configuration: (), $gutter: $grid-gutter-width) { | |
@if type-of($gutter) == 'string' { | |
@error 'The second parameter of mixin must be a number. String is provided.'; | |
} | |
width: 100%; | |
margin-right: $gutter; |
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 | |
$tplOuter = $modx->getOption('tplOuter', $scriptProperties); | |
if (!$tplOuter) { return 'Error: \'tplOuter\' is not provided.'; } | |
$tabs = $modx->getOption('tabs', $scriptProperties); | |
$tplTab = $modx->getOption('tplTab', $scriptProperties); | |
if (!$tplTab) { return 'Error: \'tplTab\' is not provided.'; } | |
$tplContent = $modx->getOption('tplContent', $scriptProperties); | |
if (!$tplContent) { return 'Error: \'tplContent\' is not provided.'; } | |
$prefix = $modx->getOption('prefix', $scriptProperties); | |
if (!$pdo = $modx->getService('pdoTools')) { return 'Couldn\'t load pdoTools!'; } |
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 | |
switch ($modx->event->name) { | |
case 'OnDocFormPrerender': | |
if (!$modx->controller->resourceArray) { | |
return; | |
} | |
// Array of TV ids to replace | |
$tvIDs = [108]; | |
$mimeType = $modx->getObject('modContentType', $modx->controller->resourceArray['content_type'])->get('mime_type'); | |
if ($mimeType == 'text/html' && $modx->getOption('pdotools_fenom_parser')) { |
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
// _decimal.scss | MIT License | gist.github.com/terkel/4373420 | |
// Round a number to specified digits. | |
// | |
// @param {Number} $number A number to round | |
// @param {Number} [$digits:0] Digits to output | |
// @param {String} [$mode:round] (round|ceil|floor) How to round a number | |
// @return {Number} A rounded number | |
// @example | |
// decimal-round(0.333) => 0 |
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
serialize: function serialize(form) | |
{ | |
if (!form || form.nodeName !== "FORM") { | |
return; | |
} | |
var i, j, | |
obj = {}; | |
for (i = form.elements.length - 1; i >= 0; i = i - 1) { | |
if (form.elements[i].name === "") { | |
continue; |
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 | |
$step = 5; | |
$offset = isset($_SESSION['galgenoffset']) && $_SESSION['galgenoffset'] ? $_SESSION['galgenoffset'] : 0; | |
$ms2Gallery = $modx->getService('ms2gallery', 'ms2Gallery', MODX_CORE_PATH . 'components/ms2gallery/model/ms2gallery/'); | |
$modx->setLogLevel(MODX_LOG_LEVEL_ERROR); | |
$q = $modx->newQuery('msResourceFile', array('parent' => 0)); | |
$total = $modx->getCount('msResourceFile', $q); | |
$q->sortby('resource_id', 'ASC'); | |
$q->sortby('rank', 'DESC'); | |
$q->limit($step,$offset); |
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 | |
$pdoFetch = $modx->getService('pdoFetch'); | |
$parents = '30641'; | |
$counter = 0; | |
$origin_context = null; | |
if ($modx->context->key == 'mgr') { | |
$origin_context = $modx->context->key; | |
$modx->switchContext('web'); |