public static function get_sets() { global $wf, $meow_provider; $object_id = $_REQUEST["object_id"]; $post = $wf->post($object_id); $template = $_REQUEST["template"]; if ($template != "") { // switch the template in the $meow_provider $meow_provider->template_switch = $template; } $info = array(); $info["sets"] = array(); $set_ids = $_REQUEST["set_ids"]; if (isset($_REQUEST["set_ids"])) { foreach ($set_ids as $set_id) { if (trim($set_id) != "") { $is = array(); $set = MPM_FieldSet::find_by_id($set_id); if ($set) { $is["title"] = $set->display_label(); $is["id"] = $set_id; $meow_set = $post->set($set->name); $is["html"] = MPV_Meta::get_set($post, $meow_set); $is["templates"] = MPV_Meta::get_set_templates($post, $set); $info["sets"][] = $is; } } } } unset($meow_provider->template_switch); self::ajax_success($info); }