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 | |
/* | |
Fork of the original executioner snippet by opengeek | |
Usage: | |
[[!Executioner? | |
&tElementClass=`modSnippet` | |
&tEcho=`comment` | |
&tElement=`getResourceField` | |
&id=`27` |
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
$(function() { | |
var t = $('#thetable tbody').eq(0); | |
var r = t.find('tr'); | |
var cols= r.length; | |
var rows= r.eq(0).find('td').length; | |
var cell, next, tem, i = 0; | |
var tb= $('<tbody></tbody>'); | |
while(i<rows){ | |
cell= 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
[[[[*page-image:notempty=`$wrapImgThumb? | |
&src=`*page-image` | |
&alt=`[[*pagetitle]]` | |
&thumbOpts=`w=480&h=320` | |
`]]]] |
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
<p>Hi there!</p> | |
<p>The resource [[+pagetitle]] (ID: [[+id]]) has been [[+mode]].</p> | |
<p>You can login to the manager at www.mysite.com/manager/ to review and if needed publish the resource.</p> | |
<p>Thank you!</p> |
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 | |
/** | |
* Use the cbGetFieldContent snippet to get the content of a particular field. | |
* | |
* For example, this can be useful if you need to get a bit of content | |
* in a getResources call | |
* | |
* Example usage: | |
* | |
* [[cbGetFieldContent? |
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 | |
// get user-defined source document and target parents | |
$source = intval($modx->getOption('sourceId', $scriptProperties, '')); | |
$targets = array_map('trim', explode(',', $modx->getOption('targetIds', $scriptProperties, ''))); | |
// to prevent accidents... | |
$_allowedUsers = explode(',', 'username1,username2'); | |
// check stuff, and if passed then get the source document object | |
if ( !in_array($modx->user->get('username'), $_allowedUsers) || empty($source) || $source == 0 || !is_array($targets) || empty($targets) ) return; | |
$sourceDoc = $modx->getObject('modResource', $source); |
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 | |
include 'config.core.php'; | |
include MODX_CORE_PATH . 'model/modx/modx.class.php'; | |
$modx = new modX(); | |
$modx->initialize('web'); | |
$modx->setLogTarget(XPDO_CLI_MODE ? 'ECHO' : 'HTML'); | |
$modx->setLogLevel(xPDO::LOG_LEVEL_INFO); | |
$tstart = $modx->getMicroTime(); |
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 | |
// Add RTE for introtext if richtext option is enabled for the resource | |
// check "OnDocFormRender" event | |
$modx->regClientStartupHTMLBlock('<script>Ext.onReady(function() { | |
if(MODx.loadRTE) MODx.loadRTE("modx-resource-introtext"); | |
});</script>'); |
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
Collections.renderer.imageplus = function(value, metaData, record, rowIndex, colIndex, store) { | |
if (value != '' && value != null) { | |
var data = Ext.decode(value); | |
var url = MODx.config.connectors_url + 'system/phpthumb.php?imageplus=1'; | |
var params = {}; | |
params.src = MODx.config['collections.renderer_image_path'] + data.sourceImg.src; | |
params.w = 100; | |
if (data.sourceImg.src.indexOf('.png') !== -1) { | |
params.f = 'png'; |