Created
December 12, 2011 13:41
-
-
Save mrogalsky/1467200 to your computer and use it in GitHub Desktop.
[MODx EVO] Sape.RU Context Plugin
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
/* | |
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