echo ' maxZoom: ' . $the_map->meta_data['maxZoom'] . ', '; echo ' inverseY: ' . $the_map->meta_data['inverseY'] . ' }'; } ?> ], p: [ <?php $all_prspctvs = ProspectPerspective::get_exhibit_perspectives($the_xhbt->id); // Output each entry $first = true; foreach ($all_prspctvs as $the_prspctv) { if (!$first) { echo ', '; } $first = false; echo '{ id: "' . $the_prspctv->id . '", '; echo ' l: "' . $the_prspctv->l . '", '; echo ' n: "' . $the_prspctv->note . '", '; echo ' s: ' . $the_prspctv->meta_state . ' }'; } ?> ] }; </script> <?php echo ProspectAdmin::get_script_text('view-exhibit.txt'); ?> </body> </html>
public function prsp_page_template($page_template) { global $post; $post_type = get_query_var('post_type'); // What kind of page viewed? switch ($post_type) { case 'prsp-attribute': case 'prsp-template': break; case 'prsp-record': $blog_id = get_current_blog_id(); $ajax_url = get_admin_url($blog_id, 'admin-ajax.php'); $tmplt_id = get_post_meta($post->ID, 'tmplt-id', true); if ($tmplt_id != '') { // Load Template definition $the_template = new ProspectTemplate(false, $tmplt_id, true, true, true); // Get dependent Templates needed for Joins $d_templates = $the_template->get_dependent_templates(true); // Get associative array for all Attribute definitions $assoc_atts = ProspectAttribute::get_assoc_defs(); $record = new ProspectRecord(true, $post->ID, false, $the_template, $d_templates, $assoc_atts); wp_enqueue_script('jquery'); wp_enqueue_script('underscore'); wp_enqueue_style('view-record-css', plugins_url('/css/view-record.css', dirname(__FILE__))); if ($the_template->view->sc != null && $the_template->view->sc != 'disable') { wp_enqueue_script('soundcloud-api', 'http://w.soundcloud.com/player/api.js'); } wp_enqueue_script('view-record', plugins_url('/js/view-record.js', dirname(__FILE__)), array('jquery', 'underscore')); // Convert attributes to serial array $att_array = array(); foreach ($assoc_atts as $key => $value) { $att_entry = array(); $att_entry['id'] = $key; $att_entry['def'] = $value; array_push($att_array, $att_entry); } // Sort by ID usort($att_array, array('Prospect', 'cmp_ids')); // Compile Dependent Template view data $d_t_array = array(); foreach ($d_templates as $this_temp) { $d_t_entry = array(); $d_t_entry['id'] = $this_temp->id; $d_t_entry['v'] = $this_temp->view; array_push($d_t_array, $d_t_entry); } wp_localize_script('view-record', 'prspdata', array('ajax_url' => $ajax_url, 'd' => $record->att_data, 'a' => $att_array, 'v' => $the_template->view, 'j' => $the_template->joins, 't' => $d_t_array)); $dltext = ProspectAdmin::get_script_text('view-record.txt'); echo $dltext; } break; case 'prsp-exhibit': $page_template = dirname(__FILE__) . '/view-exhibit.php'; break; // Don't currently support any special views as they are meant for backend // Don't currently support any special views as they are meant for backend case 'prsp-map': case 'prsp-prspctv': break; } // switch return $page_template; }