Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/gallery/gallery3 into raw…
Browse files Browse the repository at this point in the history
…photo
  • Loading branch information
chadparry committed Apr 24, 2011
2 parents 809567f + c8f90e8 commit 26585fe
Show file tree
Hide file tree
Showing 71 changed files with 1,077 additions and 459 deletions.
2 changes: 1 addition & 1 deletion .build_number
Expand Up @@ -3,4 +3,4 @@
; process. You don't need to edit it. In fact..
;
; DO NOT EDIT THIS FILE BY HAND!
build_number=92
build_number=129
12 changes: 7 additions & 5 deletions installer/install.sql
Expand Up @@ -244,15 +244,15 @@ CREATE TABLE {modules} (
KEY `weight` (`weight`)
) AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
INSERT INTO {modules} VALUES (1,1,'gallery',47,1);
INSERT INTO {modules} VALUES (2,1,'user',3,2);
INSERT INTO {modules} VALUES (1,1,'gallery',49,1);
INSERT INTO {modules} VALUES (2,1,'user',4,2);
INSERT INTO {modules} VALUES (3,1,'comment',4,3);
INSERT INTO {modules} VALUES (4,1,'organize',4,4);
INSERT INTO {modules} VALUES (5,1,'info',2,5);
INSERT INTO {modules} VALUES (6,1,'rss',1,6);
INSERT INTO {modules} VALUES (7,1,'search',1,7);
INSERT INTO {modules} VALUES (8,1,'slideshow',2,8);
INSERT INTO {modules} VALUES (9,1,'tag',2,9);
INSERT INTO {modules} VALUES (9,1,'tag',3,9);
DROP TABLE IF EXISTS {outgoing_translations};
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
Expand Down Expand Up @@ -382,7 +382,7 @@ CREATE TABLE {vars} (
`value` text,
PRIMARY KEY (`id`),
UNIQUE KEY `module_name` (`module_name`,`name`)
) AUTO_INCREMENT=41 DEFAULT CHARSET=utf8;
) AUTO_INCREMENT=43 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
INSERT INTO {vars} VALUES (NULL,'gallery','active_site_theme','wind');
INSERT INTO {vars} VALUES (NULL,'gallery','active_admin_theme','admin_wind');
Expand Down Expand Up @@ -413,9 +413,10 @@ INSERT INTO {vars} VALUES (NULL,'gallery','email_line_length','70');
INSERT INTO {vars} VALUES (NULL,'gallery','email_header_separator','s:1:\"\n\";');
INSERT INTO {vars} VALUES (NULL,'gallery','show_user_profiles_to','registered_users');
INSERT INTO {vars} VALUES (NULL,'gallery','extra_binary_paths','/usr/local/bin:/opt/local/bin:/opt/bin');
INSERT INTO {vars} VALUES (NULL,'gallery','timezone',NULL);
INSERT INTO {vars} VALUES (NULL,'gallery','blocks_site_sidebar','a:4:{i:10;a:2:{i:0;s:7:\"gallery\";i:1;s:8:\"language\";}i:11;a:2:{i:0;s:4:\"info\";i:1;s:8:\"metadata\";}i:12;a:2:{i:0;s:3:\"rss\";i:1;s:9:\"rss_feeds\";}i:13;a:2:{i:0;s:3:\"tag\";i:1;s:3:\"tag\";}}');
INSERT INTO {vars} VALUES (NULL,'gallery','identity_provider','user');
INSERT INTO {vars} VALUES (NULL,'user','mininum_password_length','5');
INSERT INTO {vars} VALUES (NULL,'user','minimum_password_length','5');
INSERT INTO {vars} VALUES (NULL,'comment','spam_caught','0');
INSERT INTO {vars} VALUES (NULL,'comment','access_permissions','everybody');
INSERT INTO {vars} VALUES (NULL,'info','show_title','1');
Expand All @@ -424,3 +425,4 @@ INSERT INTO {vars} VALUES (NULL,'info','show_owner','1');
INSERT INTO {vars} VALUES (NULL,'info','show_name','1');
INSERT INTO {vars} VALUES (NULL,'info','show_captured','1');
INSERT INTO {vars} VALUES (NULL,'slideshow','max_scale','0');
INSERT INTO {vars} VALUES (NULL,'tag','tag_cloud_size','30');
Binary file modified lib/flowplayer.controls.swf
Binary file not shown.
216 changes: 152 additions & 64 deletions lib/flowplayer.js

Large diffs are not rendered by default.

Binary file modified lib/flowplayer.pseudostreaming.swf
Binary file not shown.
Binary file modified lib/flowplayer.swf
Binary file not shown.
2 changes: 1 addition & 1 deletion lib/jquery-ui.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions modules/akismet/module.info
@@ -1,3 +1,7 @@
name = "Akismet"
description = "Filter comments through the Akismet web service to detect and eliminate spam (http://akismet.com). You'll need a WordPress.com API key to use it."
version = 1
author_name = "Gallery Team"
author_url = "http://codex.gallery2.org/Gallery:Team"
info_url = "http://codex.gallery2.org/Gallery3:Modules:akismet"
discuss_url = "http://gallery.menalto.com/forum_module_akismet"
4 changes: 4 additions & 0 deletions modules/comment/module.info
@@ -1,3 +1,7 @@
name = "Comments"
description = "Allows users and guests to leave comments on photos and albums."
version = 4
author_name = "Gallery Team"
author_url = "http://codex.gallery2.org/Gallery:Team"
info_url = "http://codex.gallery2.org/Gallery3:Modules:comment"
discuss_url = "http://gallery.menalto.com/forum_module_comment"
4 changes: 4 additions & 0 deletions modules/digibug/module.info
@@ -1,3 +1,7 @@
name = "Digibug"
description = "Digibug Photo Printing Module"
version = 2
author_name = "Gallery Team"
author_url = "http://codex.gallery2.org/Gallery:Team"
info_url = "http://codex.gallery2.org/Gallery3:Modules:digibug"
discuss_url = "http://gallery.menalto.com/forum_module_digibug"
4 changes: 4 additions & 0 deletions modules/exif/module.info
@@ -1,3 +1,7 @@
name = "Exif Data"
description = "Extract Exif data and display it on photo pages."
version = 1
author_name = "Gallery Team"
author_url = "http://codex.gallery2.org/Gallery:Team"
info_url = "http://codex.gallery2.org/Gallery3:Modules:exif"
discuss_url = "http://gallery.menalto.com/forum_module_exif"
56 changes: 44 additions & 12 deletions modules/g2_import/controllers/admin_g2_import.php
Expand Up @@ -24,23 +24,42 @@ public function index() {
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");

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()) {
$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();
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 (g2_import::is_configured()) {
$view->content->form->configure_g2_import->embed_path->add_error("invalid", 1);
}
Expand Down Expand Up @@ -75,15 +94,28 @@ public function save() {
print $view;
}

public function autocomplete() {
$directories = array();
$path_prefix = Input::instance()->get("q");
foreach (glob("{$path_prefix}*") as $file) {
if (is_dir($file) && !is_link($file)) {
$directories[] = $file;
}
}

print implode("\n", $directories);
}

private function _get_import_form() {
$embed_path = module::get_var("g2_import", "embed_path", "");
$form = new Forge(
"admin/g2_import/save", "", "post", array("id" => "g-admin-configure-g2-import-form"));
$group = $form->group("configure_g2_import")->label(t("Configure Gallery 2 Import"));
$group->input("embed_path")->label(t("Filesystem path to your Gallery 2 embed.php file"))
->value(module::get_var("g2_import", "embed_path", ""));
->value($embed_path);
$group->embed_path->error_messages(
"invalid", t("The path you entered is not a Gallery 2 installation."));
$group->submit("")->value(t("Save"));
$group->submit("")->value($embed_path ? t("Change") : t("Continue"));
return $form;
}
}
21 changes: 20 additions & 1 deletion modules/g2_import/helpers/g2_import.php
Expand Up @@ -219,7 +219,7 @@ static function g2_module_active($module) {
* Return a set of statistics about the number of users, groups, albums, photos, movies and
* comments available for import from the Gallery 2 instance.
*/
static function stats() {
static function g2_stats() {
global $gallery;
$root_album_id = g2(GalleryCoreApi::getDefaultAlbumId());
$stats["users"] = g2(GalleryCoreApi::fetchUserCount());
Expand Down Expand Up @@ -247,6 +247,25 @@ static function stats() {
return $stats;
}

/**
* Return a set of statistics about the number of users, groups, albums, photos, movies and
* comments already imported into the Gallery 3 instance.
*/
static function g3_stats() {
$g3_stats = array(
"album" => 0, "comment" => 0, "item" => 0, "user" => 0, "group" => 0, "tag" => 0);
foreach (db::build()
->select("resource_type")
->select(array("C" => 'COUNT("*")'))
->from("g2_maps")
->where("resource_type", "IN", array("album", "comment", "item", "user", "group"))
->group_by("resource_type")
->execute() as $row) {
$g3_stats[$row->resource_type] = $row->C;
}
return $g3_stats;
}

/**
* Import a single group.
*/
Expand Down
2 changes: 1 addition & 1 deletion modules/g2_import/helpers/g2_import_task.php
Expand Up @@ -56,7 +56,7 @@ static function import($task) {
$mode = $task->get("mode");
$queue = $task->get("queue");
if (!isset($mode)) {
$stats = g2_import::stats();
$stats = g2_import::g2_stats();
$stats["items"] = $stats["photos"] + $stats["movies"];
unset($stats["photos"]);
unset($stats["movies"]);
Expand Down
4 changes: 4 additions & 0 deletions modules/g2_import/module.info
@@ -1,3 +1,7 @@
name = "Gallery2 Import"
description = "Import your Gallery 2 content into Gallery 3"
version = 2
author_name = "Gallery Team"
author_url = "http://codex.gallery2.org/Gallery:Team"
info_url = "http://codex.gallery2.org/Gallery3:Modules:g2_import"
discuss_url = "http://gallery.menalto.com/forum_module_g2_import"

0 comments on commit 26585fe

Please sign in to comment.