function __construct($id) { // get the pano based on the id supplied if (is_numeric($id)) { $pano_row = get_pano($id); $this->build($pano_row); } }
function check_description_onload_ajax() { $pano_id = $_GET['pano_id']; $pano = get_pano($pano_id); $result = $pano->show_desc_onload; if ($result == 0) { echo 'false'; } else { echo 'true'; } }
function add_nav_script($quest, $pano_id) { $current_pano_url = get_site_url() . "?pano=" . $pano_id; $script = "\n<script type='text/javascript'>\n"; $script .= "var krpano;\n"; $script .= "var siteAdr = '" . get_permalink() . "?pano_id=';\n"; // Build the array of names $script .= build_names_array(); // Build the array of ids $script .= build_ids_array(); // The default pointer $script .= "var pointer = 0;\n"; $script .= "var defaultVar = 1;\n"; if (get_pano($pano_id)->show_desc_onload == 1) { $script .= "if(window.location.href.indexOf('pano_editor') == -1){\n"; $script .= "loadFrame(0, 'wp-content/plugins/panomanager/js/featherlight/pano_info.php');}\n"; } $script .= "var magnificPopup;"; $script .= build_launch_message($pano_id); $script .= build_find_array(); $script .= build_get_scene_name(); //MY SCRIPTS //////////////////////// $script .= build_launch_hairstyling($quest); $script .= build_launch_image($quest); $script .= build_launch_game($quest); // $script .= build_manage_lightbox($quest, $current_pano_url); $script .= build_launch_quizlet($quest); $script .= build_launch_khan($quest); $script .= build_launch_hazard($quest); $script .= "\$(document).ready(function() {\n"; $script .= "\$('#my-menu').mmenu({ slidingSubmenus: false });\n"; $script .= "krpano = document.getElementById('krpanoSWFObject');\n"; $script .= "});\n"; $script .= build_menu_launch(); $script .= build_leader_launch(); $script .= redirect_pano(); $script .= build_points_callback_function(); $script .= build_bonus_points_callback_function(); $script .= build_new_hotspot_callback_function(); $script .= build_login_button(); $script .= "</script>"; return $script; }
function pano_hotspot_settings_page() { $hotspots = get_hotspots(); $panos = get_panos(); $types = get_types(); $semantic = WP_PLUGIN_URL . '/panomanager/css/semantic.css'; $hotspot_types = admin_url() . "admin.php?page=pano_hotspot_type_settings"; $new_hotspot_url = admin_url() . "admin.php?page=new_hotspot_settings"; $edit_hotspot_url = admin_url() . "admin.php?page=edit_hotspot_settings"; $pano_editor = admin_url() . "admin.php?page=view_panos_settings"; ?> <!-- style sheet so our admin page looks nice --> <link rel="stylesheet" type="text/css" href="<?php echo $semantic; ?> "/> <hr> <?php if (isset($_GET['settings-saved'])) { ?> <div class="updated"><p>Settings updated successfully.</p></div> <?php } ?> <div> <h2>Hotspots</h2> <p>Filter hotspots by:</p> <label>Pano </label> <select id="pano_select"> <option value="NA">Select a pano</option> <?php foreach ($panos as $pano) { ?> <option value="<?php echo $pano->id; ?> "><?php echo $pano->title; ?> </option> <?php } ?> </select> <label>Hotspot Type </label> <select id="type_select"> <option value="NA">Select a type</option> <?php foreach ($types as $type) { ?> <option value="<?php echo $type->id; ?> "><?php echo $type->name; ?> </option> <?php } ?> </select> </div> <table id="hostpotTable" class="ui table segment tablesorter"> <thead> <tr> <th>Pano</th> <th>Hotspot</th> <th>Menu Name</th> <th>Hotspot Info</th> <th>Points</th> <th>Attempts</th> <th>Type</th> <th>Edit</th> <th>Delete</th> </tr> </thead> <tbody> <?php foreach ($hotspots as $hotspot) { ?> <?php $current_hotspot = build_hotspot($hotspot->id); ?> <tr class="hotspot pano<?php echo $hotspot->pano_id; ?> type<?php echo $hotspot->type_id; ?> "> <td><?php echo get_pano($hotspot->pano_id)->title; ?> </td> <td><?php echo $current_hotspot->get_name(); ?> </td> <td><?php echo $current_hotspot->get_menu_name(); ?> </td> <td><?php echo substr($current_hotspot->get_hotspot_info(), 0, 20) . "..."; ?> </td> <td><?php echo $current_hotspot->get_points(); ?> </td> <td><?php echo $current_hotspot->get_attempts(); ?> </td> <td><?php echo $current_hotspot->get_type_name(); ?> </td> <td><a class="ui blue icon button" href="<?php echo $edit_hotspot_url; ?> &id=<?php echo $current_hotspot->get_id(); ?> " style="padding: 7px">Edit</a></td> <td> <form method="post" action="admin-post.php" id="delete_hotspot_form<?php echo $current_hotspot->get_id(); ?> "> <!-- pano processing hook --> <input type="hidden" name="action" value="delete_hotspot" /> <input type="hidden" name="hotspot_id" value="<?php echo $current_hotspot->get_id(); ?> " /> <input type="submit" class="ui blue icon button" value="Delete" style="padding: 7px" > </form> </td> </tr> <?php } ?> </tbody> </table> <form method="POST" action="<?php echo $pano_editor; ?> &"> <!-- word processing hook --> <input type="submit" class="ui blue icon button" value="Create Hotspot" style="padding: 7px;" /> </form> <br/> <script> jQuery(document).ready(function(){ jQuery("#hostpotTable").tablesorter(); jQuery("#pano_select").change( function() { filter_hotspots(); }); jQuery("#type_select").change( function(){ filter_hotspots(); }); function filter_hotspots() { var pano = jQuery("#pano_select").prop("value"); var type = jQuery("#type_select").prop("value"); if (pano == "NA" && type == "NA") { jQuery(".hotspot").show(); } else if (pano == "NA" && type != "NA") { jQuery(".hotspot").hide(); jQuery(".type" + type).show(); } else if (pano != "NA" && type == "NA") { jQuery(".hotspot").hide(); jQuery(".pano" + pano).show(); } else { jQuery(".hotspot").hide(); jQuery(".pano" + pano + ".type" + type).show(); } } }) </script> <?php }