return; } // load inserts and groups for template $inserts = Insertable::ElementsFrom($full_template); $groups = Insertable::GroupsFrom($full_template); // get revision id, if any $revisionid = @$_REQUEST['revisionid']; // process form if ('POST' == $_SERVER['REQUEST_METHOD']) { // build content array from post $content = Content::ProcessPOST($inserts, $groups); // add/edit content //$content_plug = new Content_Plug($plugid, $revisionid); $content_plug = Model_Content_Plug::Get($plugid); if (!$content_plug->exists()) { $content_plug = Model_Content_Plug::Create(); $content_plug['plugid'] = $plugid; } $content_plug->set('content', $content); $content_plug->save(); // done; redirect Typeframe::Redirect('Plugin content updated.', $typef_app_dir); return; } // load values from content; add inserts and groups to template //list($plug_content, $inserts, $groups) = Content_Plug::LoadData($plugid, $revisionid, $inserts, $groups); $plug = Model_Content_Plug::Get($plugid); if ($revisionid) { $revision = Model_Content_Plug::Get($revisionid); $plug_content = $revision['data']; } else {