$the_focus = new $the_class();
$type = $sp->getFileType($studioDef['type']);
$GLOBALS['layout_edit_mode'] = true;
$sp->loadFile($file);
$sp->parse($sp->curText);
$sp->workingModule = $the_module;
$sp->focus =& $the_focus;
$view = $sp->prepSlots();
$xtpl = $sp->writeToCache($file, $view);
echo $sp->yahooJS();
echo $sp->getFormButtons();
//change mod strings to module
$prev_mod = $mod_strings;
$mod_strings = return_module_language($current_language, $the_module);
include_once $xtpl;
echo $sp->getForm();
if ($sp->fieldEditor) {
    $sf = new StudioFields();
    $sf->module =& $the_focus;
    $sf->getExistingFields($view);
    echo $sf->addFields($type);
}
$my_list_strings = $GLOBALS['app_list_strings'];
foreach ($my_list_strings as $key => $value) {
    if (is_string($value)) {
        unset($my_list_strings[$key]);
    }
}
require_once 'include/JSON.php';
$json = new JSON(JSON_LOOSE_TYPE);
echo '<script>var app_list_strings = ' . $json->encode($my_list_strings) . '</script>';
require_once 'modules/Studio/parsers/SubpanelParser.php';
require_once 'modules/Studio/StudioFields.php';
echo "\n<p>\n";
echo get_module_title($mod_strings['LBL_MODULE_TITLE'], $mod_strings['LBL_MODULE_TITLE'], true);
echo "\n</p>\n";
$GLOBALS['layout_edit_mode'] = true;
$parser = 'SubpanelParser';
if (!empty($_REQUEST['parser'])) {
    $parser = $_REQUEST['parser'];
    require_once $GLOBALS['studioConfig']['parsers'][$_REQUEST['parser']];
} else {
    require_once 'modules/Studio/parsers/' . $parser . '.php';
}
$sp = new $parser();
$sp->loadSubpanel($the_module, $_REQUEST['subpanel']);
$sp->parse($sp->curText);
$view = $sp->prepSlots();
echo $sp->yahooJS();
echo $sp->getFormButtons();
echo $view;
echo $sp->getForm();
$submodulename = $sp->panel->_instance_properties['module'];
$submoduleclass = $beanList[$submodulename];
require_once $beanFiles[$submoduleclass];
$subbean = new $submoduleclass();
if ($sp->fieldEditor) {
    $sf = new StudioFields();
    $sf->module =& $subbean;
    $sf->getExistingFields($view);
    echo $sf->addFields('detail');
}