function module_dropdown($name, $selected = null) { if (get_option('sugarpress_metadata') == null) { sugarpress_refresh_metadata(); } $modules = json_decode(get_option('sugarpress_metadata')); $html = "<select name='{$name}'>"; foreach ($modules as $key => $value) { $html .= "<option value='{$key}' " . ($selected == $key ? "selected" : "") . ">{$key}</option>"; } $html .= "</select>"; return $html; }
?> " 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>