Skip to content

Instantly share code, notes, and snippets.

@mrogalsky
Created December 12, 2011 13:41
Show Gist options
  • Save mrogalsky/1467200 to your computer and use it in GitHub Desktop.
Save mrogalsky/1467200 to your computer and use it in GitHub Desktop.
[MODx EVO] Sape.RU Context Plugin
/*
Sape.RU Context Plugin for MODx Evolution
*/
if (!defined('_SAPE_USER')){
define('_SAPE_USER', ' _USER_FOLDER_ ');
}
require_once($_SERVER['DOCUMENT_ROOT'].'/'._SAPE_USER.'/sape.php');
$sape_context = new SAPE_context();
$e = &$modx->Event;
switch($e->name) {
case 'OnLoadWebDocument':
$content = $modx->documentObject['content'];
$content = $sape_context->replace_in_text_segment($content);
$modx->documentObject['content'] = $content;
break;
default:
return;
break;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment