I spent some time with my example and found that it is not very good and it is the same as using preview tab. Because in this case we are need to create new document for editing of each gallery.
So i decided to use preview tab of document where MG called. All that we need is hide all site design and show only Maxygallery. jQuery and MM helps us in this.
1st. need to create new widget to run custom jQuery code ftom MM.
In \assets\plugins\managermanager\widgets\ create folder jcustom and file jcustom.php inside it with this code:
<?php
//---------------------------------------------------------------------------------
// mm_widget_jcustom
//---------------------------------------------------------------------------------
function mm_widget_jcustom($code='', $roles='', $templates='') {
global $modx, $content;
$e = &$modx->Event;
if (useThisRule($roles, $templates) && !empty($code)) {
$output = "// -------------- jcustom widget include ------------- \n";
$output .= $code;
}
$e->output($output . "\n");
}
?>
Then in MM rules file add this:
$text = '
$("#previewIframe").load( function(){
cln = $("#previewIframe").contents().find(".managecontainer").clone();
$("#previewIframe").contents().find("body").replaceWith(cln);
});
';
mm_widget_jcustom($text);
Add roles and templates as parameters of mm_widget_jcustom() that you needed.
Add "&manage_gallery=`[*id*]`" to your MG call in this document. This will show normal gallery on the frontend, and only manager form on the backend.
That’s all.
BUT it is absolutely not working on IE. May be someone can rewrite this jQuery code to work in IE.