Exemplo n.º 1
0
        <div class="left-block">
            <?php 
$listtable->display();
?>
            
            <form name="action_form" action="" method="POST" enctype="multipart/form-data" class="html5-map full">
                <input type="hidden" name="action" value="new" />
                <input type="hidden" name="maps" value="" />
                
                <fieldset>
                    <legend>Add new map</legend>
                    <span>New map name:</span>
                    <input type="text" name="name" value="New map" />
                    
                    <?php 
$types = free_map_get_map_types();
?>
                    
                    <select name="map_type">
                        <option value="">Please select the map</option>
                        <?php 
foreach ($types as $id => $type) {
    ?>
                            <option value="<?php 
    echo $id;
    ?>
"><?php 
    echo $type->name;
    ?>
</option>
                        <?php 
Exemplo n.º 2
0
function free_map_plugin_map_defaults($name = 'New map', $type = 0)
{
    $type = free_map_get_map_types($type);
    $initialStatesPath = dirname(__FILE__) . '/static/settings/' . $type->defaultSettings;
    if (!file_exists($initialStatesPath)) {
        echo '<div class="error"><p>' . __('Settings file not found for map of ' . $type->name, 'free-html5-map') . '</p></div>';
        return false;
    }
    $map_data = file_get_contents($initialStatesPath);
    $defaults = array('name' => $name, 'type' => "", 'map_data' => $map_data, 'mapWidth' => 500, 'mapHeight' => 400, 'maxWidth' => 780, 'shadowWidth' => 2, 'shadowOpacity' => 0.3, 'shadowColor' => "black", 'shadowX' => 0, 'shadowY' => 0, 'iPhoneLink' => "true", 'isNewWindow' => "false", 'borderColor' => "#ffffff", 'borderColorOver' => "#ffffff", 'nameColor' => "#ffffff", 'popupNameColor' => "#000000", 'nameFontSize' => "10", 'popupNameFontSize' => "20", 'nameFontWeight' => "bold", 'overDelay' => 300, 'statesInfoArea' => "bottom", 'isResponsive' => "1", 'nameStroke' => true, 'nameStrokeColor' => "#000000", 'defaultDataFile' => "");
    $type->type = $type->name;
    $type->name = $name;
    $defaults = wp_parse_args((array) $type, $defaults);
    $map_data = json_decode($map_data);
    $count = count((array) $map_data);
    for ($i = 1; $i <= $count; $i++) {
        $defaults['state_info'][$i] = '';
    }
    return $defaults;
}