Beispiel #1
0
 public function handleSubmitOnInit()
 {
     WPLE()->logger->debug("handleSubmit()");
     if ($this->requestAction() == 'prepare_auction') {
         $listingsModel = new ListingsModel();
         $listings = $listingsModel->prepareListings($_REQUEST['post']);
         // redirect to listings page
         wp_redirect(get_admin_url() . 'admin.php?page=wplister');
         exit;
     }
     if ($this->requestAction() == 'reselect') {
         ListingsModel::reSelectListings($_REQUEST['auction']);
         // redirect to listings page
         wp_redirect(get_admin_url() . 'admin.php?page=wplister');
         exit;
     }
     if ($this->requestAction() == 'apply_listing_profile') {
         WPLE()->logger->info('apply_listing_profile');
         #WPLE()->logger->info( print_r( $_REQUEST, 1 ) );
         $profilesModel = new ProfilesModel();
         $profile = $profilesModel->getItem($_REQUEST['wpl_e2e_profile_to_apply']);
         $listingsModel = new ListingsModel();
         $items = $listingsModel->applyProfileToNewListings($profile);
         // remember selected profile
         self::updateOption('last_selected_profile', intval($_REQUEST['wpl_e2e_profile_to_apply']));
         // redirect to listings page
         if (@$_REQUEST['wpl_e2e_verify_after_profile'] == '1') {
             // verify new listings if asked to
             wp_redirect(get_admin_url() . 'admin.php?page=wplister&action=verifyPreparedItemsNow');
         } else {
             wp_redirect(get_admin_url() . 'admin.php?page=wplister');
         }
         exit;
     }
     // handle preview action
     if ($this->requestAction() == 'preview_auction') {
         $this->previewListing($_REQUEST['auction']);
         exit;
     }
 }