function output() { echo '<div class="wrap" id="' . $this->key . '">'; echo '<h2>' . dfrapi_setting_pages($this->page) . ' — Datafeedr API</h2>'; if ($errors = $this->api_errors()) { echo dfrapi_html_output_api_error($errors); } else { echo '<form method="post" action="options.php">'; wp_nonce_field('update-options'); settings_fields($this->page); do_settings_sections($this->page); submit_button(); echo '</form>'; } echo '<div id="dfr_unload_message" style="display:none">' . __('You have unsaved changes', DFRAPI_DOMAIN) . '</div>'; echo '</div>'; }
function list_merchants($network_id) { $merchants = dfrapi_api_get_all_merchants($network_id); if (array_key_exists('dfrapi_api_error', $merchants)) { return dfrapi_html_output_api_error($merchants); } $html = ' <div style="display:none;" class="merchants" id="merchants_for_nid_' . $network_id . '"> <div class="merchant_actions"> <span class="filter_action"> ' . __('Search', DFRAPI_DOMAIN) . ': <input type="text"> <a class="reset_search button" title="' . __('Clear search', DFRAPI_DOMAIN) . '">×</a> </span> <span class="sep">|</span> <span class="hide_action"> <a style="display:none" class="hide_empty_merchants button">' . __('Hide Empty Merchants', DFRAPI_DOMAIN) . '</a> <a class="show_empty_merchants button">' . __('Show Empty Merchants', DFRAPI_DOMAIN) . '</a> </span> </div> '; $left = $right = ''; foreach ($merchants as $merchant) { $selected = in_array($merchant['_id'], $this->options['ids']); $row = $this->format_merchant($merchant, $selected); if ($selected) { $right .= $row; } else { $left .= $row; } } // foreach ( $merchants as $merchant ) $html .= ' <div class="dfrapi_panes"> <div class="dfrapi_pane_left"> <div class="dfrapi_pane_title"> <span>' . __('Available Merchants', DFRAPI_DOMAIN) . '</span> <a class="add_all button">' . __('Add All', DFRAPI_DOMAIN) . '</a> </span> </div> <div class="dfrapi_pane_content"> ' . $left . ' </div> </div> <div class="dfrapi_pane_right"> <div class="dfrapi_pane_title"> <span>' . __('Selected Merchants', DFRAPI_DOMAIN) . '</span> <a class="remove_all button">' . __('Remove All', DFRAPI_DOMAIN) . '</a> </div> <div class="dfrapi_pane_content"> ' . $right . ' </div> </div> </div> '; $html .= "</div>"; return $html; }