예제 #1
0
 public function index()
 {
     g2_import::lower_error_reporting();
     if (g2_import::is_configured()) {
         g2_import::init();
     }
     if (class_exists("GalleryCoreApi")) {
         $g2_stats = g2_import::stats();
         $g2_sizes = g2_import::common_sizes();
     }
     $view = new Admin_View("admin.html");
     $view->page_title = t("Gallery 2 import");
     $view->content = new View("admin_g2_import.html");
     $view->content->form = $this->_get_import_form();
     $view->content->version = "";
     if (g2_import::is_initialized()) {
         $view->content->g2_stats = $g2_stats;
         $view->content->g2_sizes = $g2_sizes;
         $view->content->thumb_size = module::get_var("gallery", "thumb_size");
         $view->content->resize_size = module::get_var("gallery", "resize_size");
         $view->content->version = g2_import::version();
     } else {
         if (g2_import::is_configured()) {
             $view->content->form->configure_g2_import->embed_path->add_error("invalid", 1);
         }
     }
     g2_import::restore_error_reporting();
     print $view;
 }
예제 #2
0
 static function available_tasks()
 {
     if (g2_import::is_configured()) {
         g2_import::init();
         return array(Task_Definition::factory()->callback("g2_import_task::import")->name(t("Import from Gallery 2"))->description(t("Gallery %version detected", array("version" => g2_import::version())))->severity(log::SUCCESS));
     } else {
         return array();
     }
 }
예제 #3
0
 static function available_tasks()
 {
     $version = '';
     g2_import::lower_error_reporting();
     if (g2_import::is_configured()) {
         g2_import::init();
         // Guard from common case where the import has been
         // completed and the original files have been removed.
         if (class_exists("GalleryCoreApi")) {
             $version = g2_import::version();
         }
     }
     g2_import::restore_error_reporting();
     if (g2_import::is_initialized()) {
         return array(Task_Definition::factory()->callback("g2_import_task::import")->name(t("Import from Gallery 2"))->description(t("Gallery %version detected", array("version" => $version)))->severity(log::SUCCESS));
     }
     return array();
 }
예제 #4
0
 public function index()
 {
     g2_import::lower_error_reporting();
     if (g2_import::is_configured()) {
         g2_import::init();
     }
     $view = new Admin_View("admin.html");
     $view->page_title = t("Gallery 2 import");
     $view->content = new View("admin_g2_import.html");
     if (class_exists("GalleryCoreApi")) {
         $view->content->g2_stats = $g2_stats = g2_import::g2_stats();
         $view->content->g3_stats = $g3_stats = g2_import::g3_stats();
         $view->content->g2_sizes = g2_import::common_sizes();
         $view->content->g2_version = g2_import::version();
         // Don't count tags because we don't track them in g2_map
         $view->content->g2_resource_count = $g2_stats["users"] + $g2_stats["groups"] + $g2_stats["albums"] + $g2_stats["photos"] + $g2_stats["movies"] + $g2_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 (g2_import::is_initialized()) {
         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)));
             }
         }
         if (module::is_active("akismet")) {
             message::warning(t("The Akismet module may mark some or all of your imported comments as spam.  <a href=\"%url\">Deactivate</a> it to avoid that outcome.", array("url" => url::site("admin/modules"))));
         }
     } else {
         if (g2_import::is_configured()) {
             $view->content->form->configure_g2_import->embed_path->add_error("invalid", 1);
         }
     }
     g2_import::restore_error_reporting();
     print $view;
 }
예제 #5
0
  <?php 
echo $form;
?>

  <?php 
if (g2_import::is_initialized()) {
    ?>
  <div id="gAdminG2ImportDetails">
    <h2> <?php 
    echo t("Import");
    ?>
 </h2>
    <ul id="gMessage">
      <li class="gSuccess">
        <?php 
    echo t("Gallery version %version detected", array("version" => g2_import::version()));
    ?>
      </li>
      <?php 
    if ($g2_sizes["thumb"]["size"] && $thumb_size != $g2_sizes["thumb"]["size"]) {
        ?>
      <li class="gWarning">
        <?php 
        echo t("Your most common thumbnail size in Gallery 2 is %g2_pixels pixels, but your Gallery 3 thumbnail size is set to %g3_pixels pixels. <a href=\"%url\">Using the same value</a> will speed up your import.", array("g2_pixels" => $g2_sizes["thumb"]["size"], "g3_pixels" => $thumb_size, "url" => html::mark_clean(url::site("admin/theme_options"))));
        ?>
      </li>
      <?php 
    }
    ?>

      <?php