Exemplo n.º 1
0
 function user_dropdown($name, $selected = null)
 {
     if (get_option('sugarpress_users') == null) {
         sugarpress_refresh_users();
     }
     $users = json_decode(get_option('sugarpress_users'));
     //$users = get_option('sugarpress_users');
     //return $users;
     $html = "<select name='{$name}'>";
     foreach ($users as $user) {
         $html .= "<option value='{$user->id}' " . ($selected == $user->id ? "selected" : "") . ">" . $user->full_name . "</option>";
     }
     $html .= "</select>";
     return $html;
 }
Exemplo n.º 2
0
" style="float: left;margin-top: 15px; margin-right: 5px;"/><h2>SugarCRM Settings</h2>
<hr/>
<?php 
if (isset($_GET["settings-updated"])) {
    ?>
    <div id="message" class="updated">
        <p><strong><?php 
    _e('Settings saved.');
    ?>
</strong></p>
    </div>
    <?php 
}
if (isset($_POST["refresh_meta"])) {
    sugarpress_refresh_metadata();
    sugarpress_refresh_users();
    ?>
    <div id="message" class="updated">
        <p><strong>Metadata Refreshed</strong></p>
    </div>
    <?php 
}
?>
<p>Connection Status:
    <?php 
echo sugarpress_status() ? "<span style='font-weight:bold;color:green'>Connected</span>" : "<span style='font-weight:bold;color:red'>Not Connected</span>";
?>
    </p>
<hr/>
<p style="font-weight: bold">Use the settings below to connect WordPress to SugarCRM:</p>
<form method="post" action="options.php">