diff options
Diffstat (limited to 'modules/g2_import')
-rw-r--r-- | modules/g2_import/helpers/g2_import.php | 16 | ||||
-rw-r--r-- | modules/g2_import/views/admin_g2_import.html.php | 8 |
2 files changed, 19 insertions, 5 deletions
diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php index 8c9b9eb9..f4551bc3 100644 --- a/modules/g2_import/helpers/g2_import.php +++ b/modules/g2_import/helpers/g2_import.php @@ -88,6 +88,15 @@ class g2_import_Core { return $versions["gallery"]; } + static function g2_module_active($module) { + static $plugin_list; + if (!$plugin_list) { + $plugin_list = g2(GalleryCoreApi::fetchPluginList("module")); + } + + return @$plugin_list[$module]["active"]; + } + static function stats() { GalleryCoreApi::requireOnce("modules/comment/classes/GalleryCommentHelper.class"); @@ -97,7 +106,12 @@ class g2_import_Core { $stats["albums"] = g2(GalleryCoreApi::fetchItemIdCount("GalleryAlbumItem")); $stats["photos"] = g2(GalleryCoreApi::fetchItemIdCount("GalleryPhotoItem")); $stats["movies"] = g2(GalleryCoreApi::fetchItemIdCount("GalleryMovieItem")); - list (, $stats["comments"]) = g2(GalleryCommentHelper::fetchAllComments($root_album_id, 1)); + + if (g2_import::g2_module_active("comment")) { + list (, $stats["comments"]) = g2(GalleryCommentHelper::fetchAllComments($root_album_id, 1)); + } else { + $stats["comments"] = 0; + } return $stats; } diff --git a/modules/g2_import/views/admin_g2_import.html.php b/modules/g2_import/views/admin_g2_import.html.php index 329a55a8..838e3a45 100644 --- a/modules/g2_import/views/admin_g2_import.html.php +++ b/modules/g2_import/views/admin_g2_import.html.php @@ -11,11 +11,11 @@ <? if (g2_import::is_initialized()): ?> <div id="gAdminG2Import"> <h1> <?= t("Import") ?> </h1> - <div class="gSuccess"> - <p> + <ul id="gMessage"> + <li class="gSuccess"> <?= t("Gallery version %version detected", array("version" => g2_import::version())) ?> - </p> - </div> + </li> + </ul> <div class="gInfo"> <p> |