</th>
                                <?php 
    $incorrectDestination = $show_the_value[1]['incorrectDestination'];
    ?>
								<td><select type="dropdown" name="incorrectDestination" id="incorrectDestination-dropdown"><?php 
    wpifw_utils::wpifw_get_scenes_in_act($incorrectDestination);
    ?>
</select></td>
                            </tr>
                            <tr>
                            	<th><?php 
    _e('Decline destination', 'wpifw_text');
    ?>
</th>
                                <?php 
    $declineDestination = $show_the_value[1]['declineDestination'];
    ?>
								<td><select type="dropdown" name="declineDestination" id="declineDestination-dropdown"><?php 
    wpifw_utils::wpifw_get_scenes_in_act($declineDestination);
    ?>
</select></td>
                            </tr>
                            


                            
						</tbody> 
					</table>    	
				<?php 
    echo '</div>';
}
Exemplo n.º 2
0
    /**
     * Create the HTML output for the scene navigator (screen) displayed when the menu item is clicked.
     * @link : http://codex.wordpress.org/Adding_Administration_Menus (Step 3)
     */
    public static function wpifw_scene_navigator()
    {
        if (!current_user_can('edit_others_scenes')) {
            wp_die(__('You do not have sufficient permissions to access this page.'));
        }
        ?>
        <div class="wrap scene-navigator">
            <h1>Scene Navigator<?php 
        echo $screen;
        ?>
</h1>
            <table id="navigator-filter-header">
            <tbody>
            <tr>
            <td>
            <div class="navigator-filter">
                <ul class="subsubsub" id="scene-sub">
                    <li><input type="radio" id="wpifw_opening_scene" name="wpifw_start_scene" value="openingScene" checked /><?php 
        echo _e('Opening', 'wpifw_text');
        ?>
</li>
                    <li><input type="radio" id="wpifw_most_recent" name="wpifw_start_scene" value="mostRecent" /><?php 
        echo _e('Most recent', 'wpifw_text');
        ?>
</li>
                    <li><input type="radio" id="wpifw_last_modified" name="wpifw_start_scene" value="lastModified" /><?php 
        echo _e('Last modified', 'wpifw_text');
        ?>
</li>
                    <li><select type="dropdown" id="wpifw_scene_navigator" name="wpifw_scene_navigator"><?php 
        wpifw_utils::wpifw_get_scenes_in_act();
        ?>
</select></li>
                </ul>
            </div>
            </td>
            </tr>
            </tbody>
            </table>
            <div id="navigator"><?php 
        $args = array('numberposts' => 1, 'offset' => 0, 'category' => 0, 'orderby' => 'post_date', 'order' => 'DESC', 'post_type' => 'scene', 'post_status' => 'publish', 'suppress_filters' => true);
        $recent_scene = wp_get_recent_posts($args, ARRAY_A);
        foreach ($recent_scene as $recent) {
            $most_recent_id = $recent["ID"];
        }
        $args = array('numberposts' => 1, 'offset' => 0, 'category' => 0, 'orderby' => 'modified', 'order' => 'DESC', 'post_type' => 'scene', 'post_status' => 'publish', 'suppress_filters' => true);
        $modified_scene = wp_get_recent_posts($args, ARRAY_A);
        foreach ($modified_scene as $recent) {
            $last_modified_id = $recent["ID"];
        }
        $base_url = "http://" . $_SERVER['HTTP_HOST'] . "/wp-json/wp/v2/scene/";
        $opening_scene_id = get_option('opening_scene', 'Select...');
        $opening_scene = $base_url . $opening_scene_id;
        $mostRecent = $base_url . $most_recent_id;
        $lastModified = $base_url . $last_modified_id;
        ?>
</div>
                <script>					
					openingScene = <?php 
        echo json_encode($opening_scene, JSON_FORCE_OBJECT);
        ?>
;
					mostRecent = <?php 
        echo json_encode($mostRecent, JSON_FORCE_OBJECT);
        ?>
;
					lastModified = <?php 
        echo json_encode($lastModified, JSON_FORCE_OBJECT);
        ?>
;
					baseUrl = <?php 
        echo json_encode($base_url, JSON_FORCE_OBJECT);
        ?>
;
				</script>
                
		</div><?php 
    }