示例#1
0
function get_theme_option($option_name)
{
    $option = wp_parse_args(get_option('theme_options'), get_theme_default_options());
    return isset($option[$option_name]) ? $option[$option_name] : false;
}
示例#2
0
function theme_options_page_callback_function()
{
    // hack alert: limpa o cache das regras de redirecionamento para atualizar os links
    // dos customs post types quando muda o slug de um deles. não dá para fazer isso logo
    // depois de salvar a opção pois nesse momento o valor do slug do objeto em si ainda não
    // foi atualizado.
    global $wp_rewrite;
    $wp_rewrite->flush_rules();
    ?>

    <style>
    #abas-secoes { padding-left: 4px; border-bottom: 1px solid #DDDDDD; list-style: none; margin: 0px 0px 22px }
    #abas-secoes:after {
      content: "\0020";
      display: block;
      height: 0;
      clear: both;
      visibility: hidden;
      overflow:hidden;
    }
    #abas-secoes li { float: left; margin-right: 4px; margin-bottom: -1px; padding: 5px 6px; border: 1px solid #DDDDDD; border-radius: 6px 6px 0 0; -moz-border-radius: 6px 6px 0 0; -webkit-border-radius: 6px 6px 0 0; font-weight: bold; }
    #abas-secoes li:hover { background-color: #EEEEEE; } 
    #abas-secoes li.active:hover { background-color: #FFF; } 
    #abas-secoes li.active { border-bottom: 1px solid #fff; }
    #abas-secoes a { display: block; color: #999; cursor: pointer; }
    #abas-secoes a:hover { text-decoration: none;  }
    
    #exemplo_resultado { padding: 15px; border: 1px solid grey; }
    </style>
    
    <div class="wrap span-20">
        <h2><?php 
    echo __('Opções da Consulta', 'consulta');
    ?>
</h2>
        
        <form action="options.php" method="post" class="clear prepend-top">
            <?php 
    settings_fields('theme_options_options');
    $options = wp_parse_args(get_option('theme_options'), get_theme_default_options());
    ?>
            
            
            <ul id="abas-secoes" >
                <li class="active"><a id="aba-outras">Opções Gerais</a></li>
                <li><a id="aba-objeto">Objeto da consulta</a></li>
                <li><a id="aba-listagem">Tipo de listagem</a></li>
                <li><a id="aba-quantitativa">Avaliação quantitativa</a></li>
            </ul>
            
            <div id="aba-objeto-container" class="aba-container">
            <div class="span-20 ">
                <div class="span-6 last">
                    <h3><?php 
    _e('Objeto da Consulta', 'consulta');
    ?>
</h3>
                    <p>
                    <?php 
    _e('Quais são os objetos da sua consulta? Itens de um projeto de lei? Metas de um Plano? Utilize esta página para dar o nome adequado aquilo que você está colocando sob consulta. Preencha as opções abaixo substituindo o termo "objeto" pelo nome do objeto da sua consulta.', 'consulta');
    ?>
                    </p>
                    <table class="wp-list-table widefat fixed">
                        <tr>
                            <td><label for="name">Nome do objeto da consulta (plural)</label></td>
                            <td><input type="text" id="name" class="text" name="theme_options[object_labels][name]" value="<?php 
    echo htmlspecialchars($options['object_labels']['name']);
    ?>
"/></td>
                        </tr>
                        <tr>
                            <td><label for="singular_name">Nome do objeto da consulta (singular)</label></td>
                            <td><input type="text" id="singular_name" class="text" name="theme_options[object_labels][singular_name]" value="<?php 
    echo htmlspecialchars($options['object_labels']['singular_name']);
    ?>
"/></td>
                        </tr>
                        <tr>
                            <td><label for="add_new">Adicionar novo</label></td>
                            <td><input type="text" id="add_new" class="text" name="theme_options[object_labels][add_new]" value="<?php 
    echo htmlspecialchars($options['object_labels']['add_new']);
    ?>
"/></td>
                        </tr>
                        <tr>
                            <td><label for="add_new_item">Adicionar novo objeto</label></td>
                            <td><input type="text" id="add_new_item" class="text" name="theme_options[object_labels][add_new_item]" value="<?php 
    echo htmlspecialchars($options['object_labels']['add_new_item']);
    ?>
"/></td>
                        </tr>
                        <tr>
                            <td><label for="edit_item">Editar objeto</label></td>
                            <td><input type="text" id="edit_item" class="text" name="theme_options[object_labels][edit_item]" value="<?php 
    echo htmlspecialchars($options['object_labels']['edit_item']);
    ?>
"/></td>
                        </tr>
                        <tr>
                            <td><label for="new_item">Novo objeto</label></td>
                            <td><input type="text" id="new_item" class="text" name="theme_options[object_labels][new_item]" value="<?php 
    echo htmlspecialchars($options['object_labels']['new_item']);
    ?>
"/></td>
                        </tr>
                        <tr>
                            <td><label for="view_item">Ver objeto</label></td>
                            <td><input type="text" id="view_item" class="text" name="theme_options[object_labels][view_item]" value="<?php 
    echo htmlspecialchars($options['object_labels']['view_item']);
    ?>
"/></td>
                        </tr>
                        <tr>
                            <td><label for="search_items">Buscar objetos</label></td>
                            <td><input type="text" id="search_items" class="text" name="theme_options[object_labels][search_items]" value="<?php 
    echo htmlspecialchars($options['object_labels']['search_items']);
    ?>
"/></td>
                        </tr>
                        <tr>
                            <td><label for="not_found">Nenhum Objeto Encontrado</label></td>
                            <td><input type="text" id="not_found" class="text" name="theme_options[object_labels][not_found]" value="<?php 
    echo htmlspecialchars($options['object_labels']['not_found']);
    ?>
"/></td>
                        </tr>
                        <tr>
                            <td><label for="not_found_in_trash">Nenhum Objeto na Lixeira</label></td>
                            <td><input type="text" id="not_found_in_trash" class="text" name="theme_options[object_labels][not_found_in_trash]" value="<?php 
    echo htmlspecialchars($options['object_labels']['not_found_in_trash']);
    ?>
"/></td>
                        </tr>
                        <tr>
                            <td><label for="object_url">Endereço base para os objetos da consulta</label></td>
                            <td><?php 
    echo site_url();
    ?>
/<input type="text" id="object_url" class="text" name="theme_options[object_url]" value="<?php 
    echo htmlspecialchars($options['object_url']);
    ?>
"/></td>
                        </tr>
                    </table>
                </div>
            </div>
            
            <div class="span-20 ">
                <div class="span-6 last">
                    <h3><?php 
    echo __('Objeto criados por usuários', 'consulta');
    ?>
</h3>
                    
                    <input type="checkbox" id="allow_suggested" name="theme_options[allow_suggested]" <?php 
    checked('on', $options['allow_suggested']);
    ?>
 />
                    <label for="allow_suggested"><?php 
    echo __('Usuários podem criar novos objetos na consulta', 'consulta');
    ?>
</label>
                    
                    <div id="allow_suggested_labels_container">
                        <p><?php 
    _e('Use os campos abaixo para controlar os textos exibidos na página que permite ao usuário criar um novo objeto.', 'consulta');
    ?>
</p>
                        <table class="wp-list-table widefat fixed">
                            <tr>
                                <td><label for="suggested_object_title">Título da página para criar novo objeto</label></td>
                                <td><input type="text" id="suggested_object_title" class="text" name="theme_options[suggested_labels][title]" value="<?php 
    echo htmlspecialchars($options['suggested_labels']['title']);
    ?>
"/></td>
                            </tr>
                            <tr>
                                <td><label for="suggested_object_description">Descrição da página para criar novo objeto</label></td>
                                <td><input type="text" id="suggested_object_description" class="text" name="theme_options[suggested_labels][description]" value="<?php 
    echo htmlspecialchars($options['suggested_labels']['description']);
    ?>
"/></td>
                            </tr>
                            <tr>
                                <td><label for="suggested_object_success">Mensagem quando um novo objeto é criado</label></td>
                                <td><input type="text" id="suggested_object_success" class="text" name="theme_options[suggested_labels][success]" value="<?php 
    echo htmlspecialchars($options['suggested_labels']['success']);
    ?>
"/></td>
                            </tr>
                            <tr>
                                <td><label for="suggested_object_list">Título da listagem de objetos sugeridos</label></td>
                                <td><input type="text" id="suggested_object_list" class="text" name="theme_options[suggested_labels][list]" value="<?php 
    echo htmlspecialchars($options['suggested_labels']['list']);
    ?>
"/></td>
                            </tr>
                        </table>
                    </div>
                </div>
            </div>
            
            <div class="span-20 ">
                <div class="span-6 last">
                    <h3><?php 
    echo __('Categorização dos Objetos da Consulta', 'consulta');
    ?>
</h3>
                    
                    <p>
                    <?php 
    _e('Os objetos da sua consulta podem ser agrupados dentro de uma classificação. Por exemplo, as metas de um plano podem estar agrupadas em diferentes temas. Neste caso, sua taxonomia seria "temas". Use os campos abaixo para dar um nome para a sua classificação.', 'consulta');
    ?>
                    </p>
                    
                    <input type="checkbox" id="enable_taxonomy" name="theme_options[enable_taxonomy]" <?php 
    checked('on', $options['enable_taxonomy']);
    ?>
 />
                    <label for="enable_taxonomy"><?php 
    echo __('Habilitar categorização dos objetos', 'consulta');
    ?>
</label>
                    
                    <div id="taxonomy_labels_container">
                    <table class="wp-list-table widefat fixed">
                        <tr>
                            <td><label for="name">Nome da taxonomia (plural)</label></td>
                            <td><input type="text" id="name" class="text" name="theme_options[taxonomy_labels][name]" value="<?php 
    echo htmlspecialchars($options['taxonomy_labels']['name']);
    ?>
"/></td>
                        </tr>
                        <tr>
                            <td><label for="singular_name">Nome da taxonomia (singular)</label></td>
                            <td><input type="text" id="singular_name" class="text" name="theme_options[taxonomy_labels][singular_name]" value="<?php 
    echo htmlspecialchars($options['taxonomy_labels']['singular_name']);
    ?>
"/></td>
                        </tr>
                        <tr>
                            <td><label for="add_new_item">Adicionar novo tipo</label></td>
                            <td><input type="text" id="add_new_item" class="text" name="theme_options[taxonomy_labels][add_new_item]" value="<?php 
    echo htmlspecialchars($options['taxonomy_labels']['add_new_item']);
    ?>
"/></td>
                        </tr>
                        <tr>
                            <td><label for="edit_item">Editar tipo</label></td>
                            <td><input type="text" id="edit_item" class="text" name="theme_options[taxonomy_labels][edit_item]" value="<?php 
    echo htmlspecialchars($options['taxonomy_labels']['edit_item']);
    ?>
"/></td>
                        </tr>
                        <tr>
                            <td><label for="new_item_name">Nome do novo tipo</label></td>
                            <td><input type="text" id="new_item_name" class="text" name="theme_options[taxonomy_labels][new_item_name]" value="<?php 
    echo htmlspecialchars($options['taxonomy_labels']['new_item_name']);
    ?>
"/></td>
                        </tr>
                        <tr>
                            <td><label for="search_items">Buscar tipos</label></td>
                            <td><input type="text" id="search_items" class="text" name="theme_options[taxonomy_labels][search_items]" value="<?php 
    echo htmlspecialchars($options['taxonomy_labels']['search_items']);
    ?>
"/></td>
                        </tr>
                        <tr>
                            <td><label for="all_items">Todos os tipos</label></td>
                            <td><input type="text" id="all_items" class="text" name="theme_options[taxonomy_labels][all_items]" value="<?php 
    echo htmlspecialchars($options['taxonomy_labels']['all_items']);
    ?>
"/></td>
                        </tr>
                        <tr>
                            <td><label for="parent_item">Tipo pai</label></td>
                            <td><input type="text" id="parent_item" class="text" name="theme_options[taxonomy_labels][parent_item]" value="<?php 
    echo htmlspecialchars($options['taxonomy_labels']['parent_item']);
    ?>
"/></td>
                        </tr>
                        <tr>
                            <td><label for="parent_item_colon">Tipo pai:</label></td>
                            <td><input type="text" id="parent_item_colon" class="text" name="theme_options[taxonomy_labels][parent_item_colon]" value="<?php 
    echo htmlspecialchars($options['taxonomy_labels']['parent_item_colon']);
    ?>
"/></td>
                        </tr>
                        <tr>
                            <td><label for="update_item">Atualizar tipo</label></td>
                            <td><input type="text" id="update_item" class="text" name="theme_options[taxonomy_labels][update_item]" value="<?php 
    echo htmlspecialchars($options['taxonomy_labels']['update_item']);
    ?>
"/></td>
                        </tr>
                        <tr>
                            <td><label for="taxonomy_url">Endereço base para a taxonomia do objeto</label></td>
                            <td><?php 
    echo site_url();
    ?>
/<input type="text" id="taxonomy_url" class="text" name="theme_options[taxonomy_url]" value="<?php 
    echo htmlspecialchars($options['taxonomy_url']);
    ?>
"/></td>
                        </tr>
                    </table>
                    </div>
                </div>
            </div>
            </div>
            
            <div id="aba-listagem-container" class="aba-container">
            <div class="span-20 ">
                <div class="span-6 last">
                    <h3><?php 
    _e('Tipo de listagem', 'consulta');
    ?>
</h3>
                    
                    <p><?php 
    _e('Como você gostaria de listar seus objetos', 'consulta');
    ?>
</p>
                    
                    <input type="radio" name="theme_options[list_type]" id="list_type_normal" value="normal" <?php 
    checked('normal', $options['list_type']);
    ?>
/>
                    <label for="list_type_normal"><b>Normal - </b></label> Listagem corrida, estilo blog.
                    <br/><br/>
                    <input type="radio" name="theme_options[list_type]" id="list_type_title" value="title" <?php 
    checked('title', $options['list_type']);
    ?>
/>
                    <label for="list_type_title"><b>Apenas títulos - </b></label> Lista apenas com os títulos dos objetos
                    <br/><br/>
                    <input type="radio" name="theme_options[list_type]" id="list_type_title_taxonomy" value="title_taxonomy" <?php 
    checked('title_taxonomy', $options['list_type']);
    ?>
/>
                    <label for="list_type_title_taxonomy"><b>Apenas títulos agrupados por categoria - </b></label> Lista apenas com os títulos dos objetos agrupados por tipo de objeto.
                    <br/><br/>
                    <?php 
    _e('Texto introdutório para a página de listagem de objetos', 'consulta');
    ?>
<br/>
                    <textarea name="theme_options[object_list_intro]" id="object_list_intro" ><?php 
    echo $options['object_list_intro'];
    ?>
</textarea>
                    <br/><br/>
                    <label for="list_order_by">Ordernar objetos por</label>
                    <select name="theme_options[list_order_by]" id="list_order_by">
                        <option value="creation_date" <?php 
    selected('creation_date', $options['list_order_by']);
    ?>
>Data de criação</option>
                        <option value="title" <?php 
    selected('title', $options['list_order_by']);
    ?>
>Título</option>
                    </select>
                    <br/><br/>
                    <label for="list_order">Ordernar objetos em ordem</label>
                    <select name="theme_options[list_order]" id="list_order">
                        <option value="asc" <?php 
    selected('asc', $options['list_order']);
    ?>
>Ascendente</option>
                        <option value="desc" <?php 
    selected('desc', $options['list_order']);
    ?>
>Descendente</option>
                    </select>
                </div>
            </div>
            </div>
            
            <div id="aba-quantitativa-container" class="aba-container">
            <div class="span-20 ">
                <div class="span-6 last">
                    <h3><?php 
    echo __('Avaliação quantitativa dos objetos da consulta', 'consulta');
    ?>
</h3>
                    
                    <p><?php 
    _e('Os objetos da sua consulta podem avaliados pelos usuários. O sistema permite até cinco valores diferentes para a avaliação. Por exemplo, a avaliação pode usar dois valores ("concordo" e "não concordo").', 'consulta');
    ?>
</p>

                    <input type="checkbox" id="use_evaluation" name="theme_options[use_evaluation]" value="on" <?php 
    checked('on', $options['use_evaluation']);
    ?>
 />
                    <label for="use_evaluation"><?php 
    _e('Permitir que os usuários avaliem os objetos', 'consulta');
    ?>
</label>

                    <div id="use_evaluation_labels_container">
                        <br/><br/>
                        <input type="checkbox" id="evaluation_show_on_list" name="theme_options[evaluation_show_on_list]" value="on" <?php 
    checked('on', $options['evaluation_show_on_list']);
    ?>
 />
                        <label for="evaluation_show_on_list"><?php 
    _e('Exibir avaliação na listagem de objetos por título ou por título e taxonomia', 'consulta');
    ?>
</label>
                        <br/><br/>
                        <input type="checkbox" id="evaluation_public_results" name="theme_options[evaluation_public_results]" value="on" <?php 
    checked('on', $options['evaluation_public_results']);
    ?>
 />
                        <label for="evaluation_public_results"><?php 
    _e('Exibir resultado da avaliação para os usuários', 'consulta');
    ?>
</label>
                        <br/><br/>
                        <?php 
    _e('Texto introdutório para a avaliação quantitativa', 'consulta');
    ?>
<br/>
                        <textarea name="theme_options[evaluation_text]" id="object_list_intro" ><?php 
    echo $options['evaluation_text'];
    ?>
</textarea>
                        <br/><br/>
                        <table class="wp-list-table widefat fixed">
                            <tr>
                                <td><label for="evaluate_button"><?php 
    _e('Texto do botão para avaliar exibido na listagem de objetos', 'consulta');
    ?>
</label></td>
                                <td><input type="text" id="evaluate_button" class="text" name="theme_options[evaluate_button]" value="<?php 
    echo htmlspecialchars($options['evaluate_button']);
    ?>
"/></td>
                            </tr>
                            <tr>
                                <td><label for="label_1"><?php 
    _e('Nome do primeiro valor (1)', 'consulta');
    ?>
</label></td>
                                <td><input type="text" id="label_1" class="text" name="theme_options[evaluation_labels][label_1]" value="<?php 
    echo htmlspecialchars($options['evaluation_labels']['label_1']);
    ?>
"/></td>
                            </tr>
                            <tr>
                                <td><label for="label_2"><?php 
    _e('Nome do segundo valor (2)', 'consulta');
    ?>
</label></td>
                                <td><input type="text" id="label_2" class="text" name="theme_options[evaluation_labels][label_2]" value="<?php 
    echo htmlspecialchars($options['evaluation_labels']['label_2']);
    ?>
"/></td>
                            </tr>
                            <tr>
                                <td><label for="label_3"><?php 
    _e('Nome do terceiro valor (3)', 'consulta');
    ?>
</label></td>
                                <td><input type="text" id="label_3" class="text" name="theme_options[evaluation_labels][label_3]" value="<?php 
    echo htmlspecialchars($options['evaluation_labels']['label_3']);
    ?>
"/></td>
                            </tr>
                            <tr>
                                <td><label for="label_4"><?php 
    _e('Nome do quarto valor (4)', 'consulta');
    ?>
</label></td>
                                <td><input type="text" id="label_4" class="text" name="theme_options[evaluation_labels][label_4]" value="<?php 
    echo htmlspecialchars($options['evaluation_labels']['label_4']);
    ?>
"/></td>
                            </tr>
                            <tr>
                                <td><label for="label_5"><?php 
    _e('Nome do quinto valor (5)', 'consulta');
    ?>
</label></td>
                                <td><input type="text" id="label_5" class="text" name="theme_options[evaluation_labels][label_5]" value="<?php 
    echo htmlspecialchars($options['evaluation_labels']['label_5']);
    ?>
"/></td>
                            </tr>
                        </table>
                        
                        <h3><?php 
    _e('Tipo de resultado', 'consulta');
    ?>
</h3>
                    
                        <input type="radio" name="theme_options[evaluation_type]" id="evaluation_type_percentage" value="percentage" class="radio_evaluation_type" <?php 
    checked('percentage', $options['evaluation_type']);
    ?>
/>
                        <label for="evaluation_type_percentage"><b>Porcentagem de cada resposta</b></label><br/>
                        <br/>
                        
                        <input type="radio" name="theme_options[evaluation_type]" id="evaluation_type_average" value="average" class="radio_evaluation_type" <?php 
    checked('average', $options['evaluation_type']);
    ?>
/>
                        <label for="evaluation_type_average"><b>Média das respostas</b></label><br/>
                        <br/>
                        
                        <p>Exemplo de resultado:</p>
                        <div id="exemplo_resultado">
                            <?php 
    html::image('ex_avaliacao_perce.png', __('Exemplo de resultado', 'consulta'), array('id' => 'perce'));
    ?>
                            <?php 
    html::image('ex_avaliacao_media.png', __('Exemplo de resultado', 'consulta'), array('id' => 'media'));
    ?>
                        </div>
                    </div>
                </div>
            </div>
            </div>
            
            <div id="aba-outras-container" class="aba-container">
            <div class="span-20 ">
                <div class="span-6 last">
                    <h3><?php 
    echo __('Opções Gerais', 'consulta');
    ?>
</h3>
                    
                    <table class="wp-list-table widefat fixed">
                        
                        <tr>
                        <td><label for="pagina_participe"><?php 
    _e('Página com instruções para participação', 'consulta');
    ?>
</label></td>
                        <td>
                            <p><?php 
    _e('Selecione uma página para ativar o botão "Participe" na sua barra lateral.', 'consulta');
    ?>
</p>
                            <?php 
    wp_dropdown_pages(array('name' => 'theme_options[pagina_participe]', 'selected' => $options['pagina_participe'], 'show_option_none' => 'Não mostrar botão "Participe"'));
    ?>
                        </td>
                        </tr>
                        <tr>
                            <td><label for="data_encerramento"><?php 
    _e('Data de encerramento da consulta', 'consulta');
    ?>
</label></td>
                            <td><input type="text" id="data_encerramento" class="text" name="theme_options[data_encerramento]" value="<?php 
    echo htmlspecialchars($options['data_encerramento']);
    ?>
"/></td>
                        </tr>
                    </table>
                </div>
            </div>
            </div>
            
            <p class="textright clear prepend-top">
                <input type="submit" class="button-primary" value="<?php 
    _e('Save Changes');
    ?>
" />
            </p>
        </form>
    </div>

<?php 
}
function get_theme_options()
{
    $saved = (array) get_option('theme_options');
    $defaults = get_theme_default_options();
    $defaults = apply_filters('default_theme_options', $defaults);
    $options = wp_parse_args($saved, $defaults);
    $options = array_intersect_key($options, $defaults);
    return $options;
}
示例#4
0
function mapasdevista_theme_page()
{
    ?>
  <div class="wrap span-20">
    <h2><?php 
    echo __('Theme Options', 'mapasdevista');
    ?>
</h2>

    <form action="options.php" method="post" class="clear prepend-top">
      <?php 
    settings_fields('mapasdevista_theme_options_options');
    ?>
      <?php 
    $options = wp_parse_args(get_option('mapasdevista_theme_options'), get_theme_default_options());
    ?>
      
      <div class="span-20 ">
      
        <h3><?php 
    _e("Maps of View theme options");
    ?>
</h3>
        
        <div class="span-6 last">
          
          <style>
          
          .colorpicker_box{
              width: 32px;
              height: 32px;
              border: 2px solid #CCC;
          }
          
          </style>
          
          <label for="header_image"><strong><?php 
    _e("Header Image", "mapasdevista");
    ?>
</strong></label><br/>
          <input type="text" id="header_image" class="text" name="mapasdevista_theme_options[header_image]" value="<?php 
    echo htmlspecialchars($options['header_image']);
    ?>
"/>
          <br/><br/>
          <label for="google_key"><strong><?php 
    _e("GoogleMaps API Key", "mapasdevista");
    ?>
</strong></label><br/>
          <input type="text" id="google_key" class="text" name="mapasdevista_theme_options[google_key]" value="<?php 
    echo htmlspecialchars($options['google_key']);
    ?>
"/>
          <small><?php 
    _e('You will need this if you are running your site outside of your localhost. Even if you use Open Street Maps in the front end, you will use GoogleMaps API to place your posts in the map through the Edit Post interafce', 'mapasdevista');
    ?>
</small>
          <br/><br/>
          
          <label for="theme_color"><strong><?php 
    _e("Theme color", "mapasdevista");
    ?>
</strong></label><br/>
          <div id="theme_color_box" class="colorpicker_box"></div>
          <input type="hidden" id="theme_color_r" class="text" name="mapasdevista_theme_options[theme_color][r]" value="<?php 
    echo htmlspecialchars($options['theme_color']['r']);
    ?>
"/>
          <input type="hidden" id="theme_color_g" class="text" name="mapasdevista_theme_options[theme_color][g]" value="<?php 
    echo htmlspecialchars($options['theme_color']['g']);
    ?>
"/>
          <input type="hidden" id="theme_color_b" class="text" name="mapasdevista_theme_options[theme_color][b]" value="<?php 
    echo htmlspecialchars($options['theme_color']['b']);
    ?>
"/>
          <br/><br/>
          
          <label for="bg_color"><strong><?php 
    _e("Background color", "mapasdevista");
    ?>
</strong></label><br/>
          <div id="bg_color_box" class="colorpicker_box"></div>
          <input type="hidden" id="bg_color_r" class="text" name="mapasdevista_theme_options[bg_color][r]" value="<?php 
    echo htmlspecialchars($options['bg_color']['r']);
    ?>
"/>
          <input type="hidden" id="bg_color_g" class="text" name="mapasdevista_theme_options[bg_color][g]" value="<?php 
    echo htmlspecialchars($options['bg_color']['g']);
    ?>
"/>
          <input type="hidden" id="bg_color_b" class="text" name="mapasdevista_theme_options[bg_color][b]" value="<?php 
    echo htmlspecialchars($options['bg_color']['b']);
    ?>
"/>
          <br/><br/>
          
          <label for="bg_opacity"><strong><?php 
    _e("Background opacity", "mapasdevista");
    ?>
</strong></label><br/>
          <input type="text" id="bg_opacity" class="text" name="mapasdevista_theme_options[bg_opacity]" value="<?php 
    echo htmlspecialchars($options['bg_opacity']);
    ?>
"/>
          <br/><br/>
          
          <label for="font_color"><strong><?php 
    _e("Font color", "mapasdevista");
    ?>
</strong></label><br/>
          <div id="font_color_box" class="colorpicker_box"></div>
          <input type="hidden" id="font_color_r" class="text" name="mapasdevista_theme_options[font_color][r]" value="<?php 
    echo htmlspecialchars($options['font_color']['r']);
    ?>
"/>
          <input type="hidden" id="font_color_g" class="text" name="mapasdevista_theme_options[font_color][g]" value="<?php 
    echo htmlspecialchars($options['font_color']['g']);
    ?>
"/>
          <input type="hidden" id="font_color_b" class="text" name="mapasdevista_theme_options[font_color][b]" value="<?php 
    echo htmlspecialchars($options['font_color']['b']);
    ?>
"/>
          <br/><br/>

          <!--
          <label for="font_color"><strong><?php 
    _e("Link color", "mapasdevista");
    ?>
</strong></label><br/>
          <div id="link_color_box" class="colorpicker_box"></div>
          <input type="hidden" id="link_color_r" class="text" name="mapasdevista_theme_options[link_color][r]" value="<?php 
    echo htmlspecialchars($options['link_color']['r']);
    ?>
"/>
          <input type="hidden" id="link_color_g" class="text" name="mapasdevista_theme_options[link_color][g]" value="<?php 
    echo htmlspecialchars($options['link_color']['g']);
    ?>
"/>
          <input type="hidden" id="link_color_b" class="text" name="mapasdevista_theme_options[link_color][b]" value="<?php 
    echo htmlspecialchars($options['link_color']['b']);
    ?>
"/>
          <br/><br/>
          -->


          
        </div>
      </div>
      
      <p class="textright clear prepend-top">
        <input type="submit" class="button-primary" value="<?php 
    _e('Save Changes');
    ?>
" />
      </p>
    </form>
  </div>
    
<?php 
}
<?php

$theme_options = wp_parse_args(get_option('mapasdevista_theme_options'), get_theme_default_options());
$opacity = (int) $theme_options['bg_opacity'];
if (!is_int($opacity)) {
    $opacity = 80;
}
$filtersOpacity = $opacity >= 5 ? $opacity - 5 : 0;
$opacity = $opacity / 100;
$filtersOpacity = $filtersOpacity / 100;
if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 7') || strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 8')) {
    $bgColor = 'rgb(' . $theme_options['bg_color']['r'] . ',' . $theme_options['bg_color']['g'] . ', ' . $theme_options['bg_color']['b'] . ')';
    $bgFiltersColor = 'rgb(' . $theme_options['bg_color']['r'] . ',' . $theme_options['bg_color']['g'] . ', ' . $theme_options['bg_color']['b'] . ')';
    $fontColor = 'rgb(' . $theme_options['font_color']['r'] . ',' . $theme_options['font_color']['g'] . ', ' . $theme_options['font_color']['b'] . ')';
    $themeColor = 'rgb(' . $theme_options['theme_color']['r'] . ',' . $theme_options['theme_color']['g'] . ', ' . $theme_options['theme_color']['b'] . ')';
} else {
    $bgColor = 'rgba(' . $theme_options['bg_color']['r'] . ',' . $theme_options['bg_color']['g'] . ', ' . $theme_options['bg_color']['b'] . ', ' . $opacity . ')';
    $bgFiltersColor = 'rgba(' . $theme_options['bg_color']['r'] . ',' . $theme_options['bg_color']['g'] . ', ' . $theme_options['bg_color']['b'] . ', ' . $filtersOpacity . ')';
    $fontColor = 'rgb(' . $theme_options['font_color']['r'] . ',' . $theme_options['font_color']['g'] . ', ' . $theme_options['font_color']['b'] . ')';
    $themeColor = 'rgb(' . $theme_options['theme_color']['r'] . ',' . $theme_options['theme_color']['g'] . ', ' . $theme_options['theme_color']['b'] . ')';
}
?>

body {padding: 0px !important; margin: 0px !important;}

/* Typography */
body, h1, h2, h3, h4, h5, h6 { color:<?php 
echo $fontColor;
?>
; }
a { color:<?php