Skip to content

Instantly share code, notes, and snippets.

@rtripault
Created June 8, 2011 09:53
Show Gist options
  • Save rtripault/1014126 to your computer and use it in GitHub Desktop.
Save rtripault/1014126 to your computer and use it in GitHub Desktop.
<?php
/**
* Babel
*
* @package babel
*/
/**
*
* Events:
* OnDocFormPrerender,OnDocFormSave,OnEmptyTrash,OnContextRemove,OnResourceDuplicate
*
* @author Jakob Class <jakob.class@class-zec.de>
*
* @package babel
*
*/
switch ($modx->event->name) {
case 'OnDocFormPrerender':
$currentContextKey = $resource->get('context_key');
if ($currentContextKey != 'newsletter') { return; }
$output = '';
$output .= '<div id="babel-box" style="background: red; width: 150px; height: 50px">I AM A TEST</div>';
$modx->event->output($output);
/* include CSS */
/*
$modx->regClientCSS($babel->config['cssUrl'].'babel.css?v=5');
$modx->regClientStartupScript($babel->config['jsUrl'].'babel.js?v=3');
*/
break;
case 'OnDocFormSave':
break;
case 'OnEmptyTrash':
break;
case 'OnContextRemove':
break;
case 'OnResourceDuplicate':
break;
}
return;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment