Skip to content

Instantly share code, notes, and snippets.

@davidpede
Created July 14, 2017 11:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidpede/89ea36465147074e32210bba5a4e7f10 to your computer and use it in GitHub Desktop.
Save davidpede/89ea36465147074e32210bba5a4e7f10 to your computer and use it in GitHub Desktop.
Load lexicons in controller examples
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