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 | |
/** | |
* getImgSizeFromUrl snippet for MODX | |
* Retrieves the height and width of an image from a remote url | |
* | |
* example usage: [[!getImgSizeFromUrl? &url='https://path/to/myimg.jpg' &tpl=`myTpl`]] | |
* placeholders to use in the myTpl chunk are [[+height]]] and [[+width]] | |
* | |
* @author Jon Leverrier (jon@youandmedigital.com) | |
* @version 1.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 | |
/** | |
* PDF Crowd MODX Plugin | |
* | |
* Using the API from PDF Crowd, this plugin will convert a MODX resource in to | |
* PDF format and then save it to your web server in a specified location. | |
* | |
* The plugin is setup to trigger witin a certain MODX context. | |
* For example, a "pdf" context. | |
* |
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 | |
/** | |
* getFromSteps v.1.0 | |
* An unoffical utility snippet for Formalicious by Sterc | |
* | |
* This utility snippet outputs all the steps for a multistep form | |
* based on a given form ID | |
* | |
* Usage: | |
* Put the snippet in your &stepTpl and call the snippet like this: |
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 | |
/** | |
* A sample plugin to display the "welcome message" to all users, login for the first time in Revo manager | |
* | |
* @var modX $modx | |
* @var array $scriptProperties | |
* @var modPlugin $this | |
* | |
* @see modPlugin::process() | |
* |
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 | |
/* | |
logOutput snippet for MODX | |
Use like this: | |
[[!logOutput? &input=`[[+placeholder]]`]] or | |
*/ | |
if (empty($input)) { |
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 | |
/** | |
* minifyHTML Plugin for MODX | |
* Based on the PHPWee PHP Minifier class | |
* | |
* This plugin uses a forked version of PHPWee PHP Minifier | |
* which has been patched and updated | |
* | |
* For more info see; | |
* https://github.com/ashucg/phpwee-php-minifier |
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
// folder selector for content blocks | |
// put this snippet inside a field setting with the field type of "select" | |
// get current resource id | |
$id = (!empty($id) ? $id : $modx->resource->get('id')); | |
// get current context key | |
// if $resourceid isn't a resource object, it will fallback to web | |
if ($resourceid = $modx->getObject('modResource', $id)) { |
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 | |
$contexts = $modx->getCollection('modContext', array('key:!=' => 'mgr')); | |
foreach($contexts as $context) | |
{ | |
$context_keys[] = $context->get('key'); | |
} | |
return implode(',', $context_keys); |
NewerOlder