_dispatch(); } private function _dispatch() { $pending_upgrades = awpcp()->manual_upgrades->get_pending_tasks(); $tasks = array(); foreach ( $pending_upgrades as $action => $data ) { $tasks[] = array('name' => $data['name'], 'action' => $action); } $messages = array( 'introduction' => _x( 'Before you can use AWPCP again we need to upgrade your database. This operation may take a few minutes, depending on the amount of information stored. Please press the Upgrade button shown below to start the process.', 'awpcp upgrade', 'another-wordpress-classifieds-plugin' ), 'success' => sprintf( _x( 'Congratulations. AWPCP has been successfully upgraded. You can now access all features. Click here to Continue.', 'awpcp upgrade', 'another-wordpress-classifieds-plugin' ), add_query_arg( 'page', 'awpcp.php' ) ), 'button' => _x( 'Upgrade', 'awpcp upgrade', 'another-wordpress-classifieds-plugin' ), ); $tasks = new AWPCP_AsynchronousTasksComponent( $tasks, $messages ); return $this->render( 'content', $tasks->render() ); } }