Skip to content

Instantly share code, notes, and snippets.

@netProphET
Created June 22, 2012 15:05
Show Gist options
  • Save netProphET/2973318 to your computer and use it in GitHub Desktop.
Save netProphET/2973318 to your computer and use it in GitHub Desktop.
plugin fragment for setting width of MODX Manager left panel
<?php
/**
* plugin fragment for setting width of MODX Manager left panel
*/
if($modx->event->name == 'OnBeforeManagerPageInit') {
// update layout manager state
$state = $modx->controller->getDefaultState();
$state['modx-leftbar-tabs']['width'] = 525;
$response = $modx->runProcessor('system/registry/register/send',array(
'register' => 'state',
'topic' => '/ys/user-'.$modx->user->get('id').'/',
'message'=> $modx->toJSON($state),
'message_key'=> '',
'message_format'=> 'json',
'delay'=> 0,
'ttl'=> 0,
'kill'=> 0,
));
}
@Mark-H
Copy link

Mark-H commented Jun 23, 2012

The following bit of javascript executed seems an alternative yet not exactly pretty method to do the same:

Ext.getCmp('modx-layout').items.items[1].setWidth(525);
Ext.getCmp('modx-layout').doLayout();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment