public function index()
 {
     if (g1_import::is_configured()) {
         g1_import::init();
     }
     $view = new Admin_View('admin.html');
     $view->page_title = t('Gallery 1 import');
     $view->content = new View('admin_g1_import.html');
     if (is_dir(g1_import::$album_dir)) {
         $view->content->g1_stats = $g1_stats = g1_import::g1_stats();
         $view->content->g3_stats = $g3_stats = g1_import::g3_stats();
         $view->content->g1_sizes = g1_import::common_sizes();
         $view->content->g1_version = g1_import::version();
         // Don't count tags because we don't track them in g1_map
         $view->content->g1_resource_count = $g1_stats['users'] + $g1_stats['groups'] + $g1_stats['albums'] + $g1_stats['photos'] + $g1_stats['movies'] + $g1_stats['comments'];
         $view->content->g3_resource_count = $g3_stats['user'] + $g3_stats['group'] + $g3_stats['album'] + $g3_stats['item'] + $g3_stats['comment'] + $g3_stats['tag'];
     }
     $view->content->form = $this->_get_import_form();
     $view->content->version = '';
     $view->content->thumb_size = module::get_var('gallery', 'thumb_size');
     $view->content->resize_size = module::get_var('gallery', 'resize_size');
     if (g1_import::is_initialized()) {
         if (count(g1_import::$warn_utf8) > 0) {
             message::error(t('Your G1 contains %count folder(s) containing nonstandard characters that G3 doesn\'t work with: <pre>%names</pre>Please rename the above folders in G1 before trying to import your data.', array('count' => count(g1_import::$warn_utf8), 'names' => "\n\n  " . implode("\n  ", g1_import::$warn_utf8) . "\n\n")));
         }
         if ((bool) ini_get('eaccelerator.enable') || (bool) ini_get('xcache.cacher')) {
             message::warning(t('The eAccelerator and XCache PHP performance extensions are known to cause issues.  If you\'re using either of those and are having problems, please disable them while you do your import.  Add the following lines: <pre>%lines</pre> to gallery3/.htaccess and remove them when the import is done.', array('lines' => "\n\n  php_value eaccelerator.enable 0\n  php_value xcache.cacher off\n  php_value xcache.optimizer off\n\n")));
         }
         foreach (array('notification', 'search', 'exif') as $module_id) {
             if (module::is_active($module_id)) {
                 message::warning(t('<a href="%url">Deactivating</a> the <b>%module_id</b> module during your import will make it faster', array('url' => url::site('admin/modules'), 'module_id' => $module_id)));
             }
         }
     } else {
         if (g1_import::is_configured()) {
             $view->content->form->configure_g1_import->albums_path->add_error('invalid', 1);
         }
     }
     print $view;
 }