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 | |
/** | |
* | |
* Example usage: [[*filepath:fmt.fileSize=`mb`]] | |
* | |
*/ | |
$units = array( | |
'gb' => array('size' => 1073741824, 'label' => 'GB'), | |
'mb' => array('size' => 1048576, 'label' => 'MB'), |
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 | |
$model = $modx->getOption('model', $scriptProperties); | |
$prompt = $modx->getOption('prompt', $scriptProperties); | |
$api_url = $modx->getOption('api_url', $scriptProperties); | |
$api_key = $modx->getOption('api_key', $scriptProperties); | |
switch($modx->event->name) { | |
case 'OnDocFormSave': | |
// Check if the resource has a summary | |
if (!$resource->get('introtext')) { |
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 | |
$modx->regClientStartupScript('https://cdnjs.cloudflare.com/ajax/libs/lottie-web/5.10.2/lottie.min.js'); | |
$background = $modx->getOption('background', $scriptProperties, 'transparent'); | |
$speed = $modx->getOption('speed', $scriptProperties, 1); | |
$width = $modx->getOption('width', $scriptProperties, '100%'); | |
$height = $modx->getOption('height', $scriptProperties, '100%'); | |
$loop = $modx->getOption('loop', $scriptProperties, 0); | |
$autoplay = $modx->getOption('autoplay', $scriptProperties, 1); | |
$json = $modx->getOption('lottieJSON', $scriptProperties, ''); |
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 | |
$modx->regClientStartupScript('https://unpkg.com/@lottiefiles/lottie-player@latest/dist/lottie-player.js'); | |
$background = $modx->getOption('background', $scriptProperties, 'transparent'); | |
$speed = $modx->getOption('speed', $scriptProperties, 1); | |
$width = $modx->getOption('width', $scriptProperties, '100%'); | |
$height = $modx->getOption('height', $scriptProperties, '100%'); | |
$hover = $modx->getOption('hover', $scriptProperties, 0); | |
$loop = $modx->getOption('loop', $scriptProperties, 0); | |
$controls = $modx->getOption('controls', $scriptProperties, 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
<?php | |
/** | |
* saveContextCss | |
* modified @bwente, which was modified by @sottwell | |
* | |
* saveCustomCss | |
* @author @sepiariver | |
* Copyright 2013 - 2015 by YJ Tso <[email protected]> <[email protected]> | |
* | |
* saveCustomCss and cssSweet is free software; |
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 'OnBeforeDocFormSave': | |
if ( $mode == modSystemEvent::MODE_NEW ) { | |
// stuff to do before saving a new resource | |
// this example checks the parent document, and updates various resource fields |
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 | |
/** | |
* jsonToPlaceholders snippet for JM Customer Database extra | |
* | |
* Copyright 2013 by JM Addington [email protected] | |
* Created on 04-28-2013 | |
* | |
* @package jmc | |
* |
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 | |
// [[!getImage? &path=`/images/` &image=`email_hero.jpg` &options=`&w=540`]] | |
$path = $modx->getOption('path', $scriptProperties, ''); | |
$image = $modx->getOption('image', $scriptProperties, ''); | |
$options = $modx->getOption('options', $scriptProperties, ''); | |
$resizer = $modx->getOption('useResizer', $scriptProperties, 1); | |
$imagePath = $modx->runSnippet('pthumb', array( |
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 | |
$path = $modx->getOption('path', $scriptProperties, ''); | |
$image = $modx->getOption('image', $scriptProperties, ''); | |
$options = $modx->getOption('options', $scriptProperties, ''); | |
$resizer = $modx->getOption('useResizer', $scriptProperties, 1); | |
$imagePath = $modx->runSnippet('pthumb', array( | |
'input' => $path.$image, |
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 | |
# Snippet to read and parse XML input | |
$sourcePath = $scriptProperties['source']; | |
if (is_numeric($sourcePath)) | |
{ | |
$sourcePath = $modx->makeUrl($sourcePath, '', '', 'full'); | |
} |
NewerOlder