Skip to content

Instantly share code, notes, and snippets.

@Dmi3yy
Created June 17, 2017 21:52
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 Dmi3yy/d065729c3c37eb3f17eab247ae1dd10d to your computer and use it in GitHub Desktop.
Save Dmi3yy/d065729c3c37eb3f17eab247ae1dd10d to your computer and use it in GitHub Desktop.
sample widgets for modx evo. 1.2.1-d9.1.6 +
//<?
$e = &$modx->Event;
switch($e->name){
case 'OnManagerWelcomeHome':
//if($_SESSION['mgrRole']!=='2') return;
//unset($widgets['welcome']);
//unset($widgets['onlineinfo']);
//unset($widgets['recentinfo']);
//unset($widgets['news']);
//unset($widgets['security']);
$widgets['test'] = array(
'menuindex' =>'1',
'id' => 'test',
'cols' => 'col-sm-6',
'icon' => 'fa-rss',
'title' => 'test',
'body' => '<div style="max-height:200px;overflow-y: scroll;">[+modx_news_content+]</div>'
);
$e->output(serialize($widgets));
break;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment