function actions() { if (!accesspress_is_menu_page($this->page_id)) { return; } if (isset($_REQUEST['action']) && 'create' == $_REQUEST['action']) { $this->create_link($_POST['create_link']); } elseif (isset($_REQUEST['action']) && 'edit' == $_REQUEST['action']) { $this->edit_link($_REQUEST['id'], $_POST['edit_link']); } elseif (isset($_REQUEST['action']) && 'delete' == $_REQUEST['action']) { $this->delete_link($_REQUEST['id']); } }
/** * Display notices on the save or reset of settings. * * @since 0.1.0 * * @return type */ public function notices() { if (!accesspress_is_menu_page($this->page_id)) { return; } $settings = get_option($this->settings_field); if (isset($settings['test-paypal'])) { unset($settings['test-paypal']); update_option($this->settings_field, $settings); $gateway = new MemberAccess_Paypal_Gateway(); $gateway->test(); if (is_wp_error($gateway->response)) { $message = $gateway->response->get_error_message(); } else { $message = __('Paypal Gateway test passed.', 'premise'); } echo '<div id="message" class="updated"><p><strong>' . $message . '</strong></p></div>'; } /** test the gateway by requesting info on a non-existent customer */ if (isset($settings['test-cc'])) { unset($settings['test-cc']); update_option($this->settings_field, $settings); $gateway = new MemberAccess_AuthorizeNet_Gateway(); $result = $gateway->test(); if (!$result && is_wp_error($gateway->response) && 'cc-error' == $gateway->response->get_error_code()) { $message = __('Authorize.Net Gateway test passed.', 'premise'); } elseif (is_wp_error($gateway->response)) { $message = $gateway->response->get_error_message(); } else { $message = __('Authorize.Net Gateway test failed.', 'premise'); } echo '<div id="message" class="updated"><p><strong>' . $message . '</strong></p></div>'; } return parent::notices(); }
/** * Add notices to the top of the page when certain actions take place. * * Add default notices via parent::notices() as well as a few custom ones. * * @since 1.5.0 * */ function notices() { /** Check to verify we're on the right page */ if (!accesspress_is_menu_page($this->page_id)) { return; } /** Show error if can't write to server */ if (!premise_make_stylesheet_path_writable()) { if (!is_multisite() || is_super_admin()) { $message = __('The %s folder does not exist or is not writeable. Please create it or <a href="http://codex.wordpress.org/Changing_File_Permissions">change file permissions</a> to 777.', 'premise'); } else { $message = __('The %s folder does not exist or is not writeable. Please contact your network administrator.', 'premise'); } $css_path = premise_get_stylesheet_location('path'); echo '<div id="message-unwritable" class="error"><p><strong>' . sprintf($message, _get_template_edit_filename($css_path, dirname($css_path))) . '</strong></p></div>'; } /** Genesis_Admin notices */ parent::notices(); }
public function notices() { global $Premise; if (!accesspress_is_menu_page($this->page_id)) { return; } $settings = get_option($this->settings_field); if (isset($settings['refresh-aweber'])) { unset($settings['refresh-aweber']); update_option($this->settings_field, $settings); $Premise->getAweberLists(true); $message = __('AWeber lists refreshed.', 'premise'); echo '<div id="message" class="updated"><p><strong>' . $message . '</strong></p></div>'; } return parent::notices(); }
/** * Display notices on the save or reset of settings. * * @since 0.1.0 * * @return type */ public function notices() { if (!accesspress_is_menu_page($this->page_id)) { return; } if (isset($_REQUEST['reset']) && 'true' == $_REQUEST['reset']) { echo '<div id="message" class="updated"><p><strong>' . $this->page_ops['reset_notice_text'] . '</strong></p></div>'; } elseif (isset($_REQUEST['settings-updated']) && $_REQUEST['settings-updated'] == 'true') { echo '<div id="message" class="updated"><p><strong>' . $this->page_ops['saved_notice_text'] . '</strong></p></div>'; } }