<?php
/*
Plugin Name: Daemon Synesis Plugin
Description: Um plugin para criar um ambiente operacional com todos os controles visíveis por padrão.
Version: 1.5
Author: Sally Syntelos - Arquiteto: Bruno Accioly
*/

// Enfileirar scripts e estilos
function daemon_synesis_enqueue_scripts() {
    // Estilos
    wp_enqueue_style('jquery-ui', plugin_dir_url(__FILE__) . 'assets/plugins/jqueryui/jquery-ui.css');
    wp_enqueue_style('daemon-synesis-style', plugin_dir_url(__FILE__) . 'assets/daemon-synesis.css'); // Estilo customizado

    // Scripts
    wp_enqueue_script('jquery');
    wp_enqueue_script('jquery-ui-dialog');
    wp_enqueue_script('daemon-synesis-js', plugin_dir_url(__FILE__) . 'assets/daemon-synesis.js', array('jquery', 'jquery-ui-dialog'), null, true);
}
add_action('wp_enqueue_scripts', 'daemon_synesis_enqueue_scripts');

// Shortcode para exibir os controles
function daemon_synesis_shortcode() {
    ob_start();
    ?>
    <div id="daemon-synesis-container">
        <div id="daemon-controls">
            <form id="my-form">
                <h2>Configuration</h2>
                <div style="float: left;">
                    <fieldset id="config-button">
                        <legend>Buttons</legend>
                        <div>
                            <input type="checkbox" id="button-close" checked="checked" />
                            <label for="button-close">Close button</label>
                        </div>
                        <div>
                            <input type="checkbox" id="button-maximize" checked="checked" />
                            <label for="button-maximize">Maximize button</label>
                        </div>
                        <div>
                            <input type="checkbox" id="button-minimize" checked="checked" />
                            <label for="button-minimize">Minimize button</label>
                        </div>
                        <div>
                            <input type="checkbox" id="button-collapse" checked="checked" />
                            <label for="button-collapse">Collapse button</label>
                        </div>
                    </fieldset>
                </div>
                <div style="float: left;">
                    <fieldset id="config-dim">
                        <legend>Width Height</legend>
                        <div>
                            <input type="text" name="width" id="window-width" value="584" />
                            <label for="window-width">Width</label>
                        </div>
                        <div>
                            <input type="text" name="height" id="window-height" value="297" />
                            <label for="window-height">Height</label>
                        </div>
                    </fieldset>
                </div>
                <div style="float: left;">
                    <fieldset id="config-event">
                        <legend>Events</legend>
                        <div>
                            <input type="checkbox" name="event" id="event-load" rel="load" checked="checked" />
                            <label for="event-load">Load</label>
                        </div>
                        <div>
                            <input type="checkbox" name="event" id="event-collapse" rel="collapse" checked="checked" />
                            <label for="event-collapse">Collapse</label>
                        </div>
                    </fieldset>
                </div>
                <br clear="both" />
                <footer>
                    <button type="button" id="new-dialog">New dialog</button>
                    <button type="button" id="iframe-dialog">iFrame dialog</button>
                </footer>
            </form>
        </div>
    </div>
    <?php
    return ob_get_clean();
}
add_shortcode('daemon_synesis', 'daemon_synesis_shortcode');
?>
