Example #1
0
    /**
     * Coagulates the functions into a form on the front-end.
     *
     * @since 0.0.1
     * @access public
     */
    public function render_form()
    {
        ?>
        <div class="wrap">
            <?php 
        $this->form_title();
        ?>
            <div class="postbox ">
                <div class="inside">
	                <?php 
        $submit_value = DFP_Ads_Globals::post_var_exists('submit') ? DFP_Ads_Globals::get_post_var('submit') : '';
        switch ($submit_value) {
            // We're importing a CSV
            case 'Import CSV':
                $this->prepare_data($_FILES['DFP_Ads_Import']['tmp_name']['import_csv']);
                break;
            case 'Confirm Import':
                $this->import_data();
                $this->return_button('Return to Importer');
                break;
                // Display Import Form
            // Display Import Form
            default:
                $this->import_form();
        }
        ?>
                </div>
            </div>
        </div>
        <?php 
    }
Example #2
0
 /**
  * Verifies the nonce is correct.
  *
  * @since  0.3.1
  * @access private
  *
  * @return bool
  */
 private function verify_nonce()
 {
     if (DFP_Ads_Globals::post_var_exists($this->nonce) && wp_verify_nonce(DFP_Ads_Globals::get_post_var($this->nonce), basename(__FILE__))) {
         return true;
     } else {
         return false;
     }
 }