Created
July 14, 2017 11:07
-
-
Save davidpede/89ea36465147074e32210bba5a4e7f10 to your computer and use it in GitHub Desktop.
Load lexicons in controller examples
This file contains hidden or 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
public function render() { | |
//$this->modx->controller->addLexiconTopic('core:dashboard'); | |
$this->controller->addJavascript($this->modx->getOption('manager_url').'assets/modext/widgets/security/modx.grid.user.online.js'); | |
$this->controller->addHtml(' | |
<script type="text/javascript"> | |
Ext.applyIf(MODx.lang, '. $this->modx->toJSON($this->modx->lexicon->loadCache('core', 'dashboard')) .'); | |
Ext.onReady(function() { | |
MODx.load({ | |
xtype: "modx-grid-user-online" | |
,renderTo: "modx-grid-user-online" | |
}); | |
}); | |
</script>'); | |
return $this->getFileChunk('dashboard/onlineusers.tpl'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment