protected function init()
 {
     $transport = ucfirst($this->getRequest()->post('blog_import_transport', '', waRequest::TYPE_STRING_TRIM));
     $class = "blogImportPlugin{$transport}Transport";
     if ($transport && class_exists($class)) {
         $plugin_namespace = $this->getApp() . '_import';
         $namespace = $plugin_namespace . '_' . strtolower($transport);
         $this->plugin = wa()->getPlugin('import');
         if ($post = $this->getRequest()->post($plugin_namespace)) {
             $this->plugin->setup($post)->saveSettings();
         }
         $settings = $this->plugin->getSettings();
         $blog_model = new blogBlogModel();
         if ($settings['blog'] && ($blog = $blog_model->getById($settings['blog']))) {
             $settings['blog_status'] = $blog['status'];
         } else {
             throw new waException(_wp("Target blog not found"));
         }
         $author_has_rights = false;
         try {
             if ($settings['contact']) {
                 $author_has_rights = blogHelper::checkRights($settings['blog'], $settings['contact']);
             }
         } catch (waRightsException $ex) {
             //do nothing
         }
         if (!$author_has_rights) {
             throw new waException(_wp("Author not found or has insufficient rights"));
         }
         $this->data['transport'] = new $class($settings);
         $this->data['blog'] = $this->plugin->getSettingValue('blog');
         $this->transport =& $this->data['transport'];
         $this->transport->setup($this->getRequest()->post($namespace), array());
         $this->data['posts'] = $this->transport->getPosts();
         $this->data['current'] = 0;
         $this->data['count'] = count($this->data['posts']);
     } else {
         throw new waException(sprintf(_wp("Transport type %s not found"), $transport));
     }
 }