diff --git a/js/lightbox.js b/js/lightbox.js index 54453e8b2e115c1d921253a6044f5e0b0f157c32..fff661aab00add0049db44521191254134de7a96 100644 --- a/js/lightbox.js +++ b/js/lightbox.js @@ -772,7 +772,12 @@ var Lightbox = { var settings = Drupal.settings.lightbox2; var numberDisplay = null; if (Lightbox.imageArray.length > 1) { - numberDisplay = settings.image_count.replace(/\!current/, eval(Lightbox.activeImage + 1)).replace(/\!total/, Lightbox.imageArray.length); + if (!Lightbox.isLightframe) { + numberDisplay = settings.image_count.replace(/\!current/, eval(Lightbox.activeImage + 1)).replace(/\!total/, Lightbox.imageArray.length); + } + else { + numberDisplay = settings.page_count.replace(/\!current/, eval(Lightbox.activeImage + 1)).replace(/\!total/, Lightbox.imageArray.length); + } $('#numberDisplay').html(numberDisplay).css({zIndex: '10500'}).show(); } diff --git a/js/lightbox2.js b/js/lightbox2.js index ad6094227534703f8a5cbdc22f3b1c195f399904..6e9e09fbe7a98fdd6546e5611c687feabfe9b1bd 100644 --- a/js/lightbox2.js +++ b/js/lightbox2.js @@ -24,6 +24,7 @@ function lightbox2_lite_general_handler(event) { $("input[@name=lightbox2_force_show_nav]").attr("disabled", "disabled"); $("input[@name=lightbox2_disable_zoom]").attr("disabled", "disabled"); $("input[@name=lightbox2_image_count_str]").attr("disabled", "disabled"); + $("input[@name=lightbox2_page_count_str]").attr("disabled", "disabled"); $("select[@name=lightbox2_display_image_size]").attr("disabled", "disabled"); $("select[@name='lightbox2_trigger_image_size[]']").attr("disabled", "disabled"); $("input[@name=lightbox2_overlay_opacity]").attr("disabled", "disabled"); @@ -33,6 +34,7 @@ function lightbox2_lite_general_handler(event) { $("input[@name=lightbox2_force_show_nav]").removeAttr("disabled"); $("input[@name=lightbox2_disable_zoom]").removeAttr("disabled"); $("input[@name=lightbox2_image_count_str]").removeAttr("disabled"); + $("input[@name=lightbox2_page_count_str]").removeAttr("disabled"); $("select[@name=lightbox2_display_image_size]").removeAttr("disabled"); $("select[@name='lightbox2_trigger_image_size[]']").removeAttr("disabled"); $("input[@name=lightbox2_overlay_opacity]").removeAttr("disabled"); diff --git a/lightbox2.install b/lightbox2.install index 840f8760228e3aa5488b1b7a3d3e895550f36a1c..9d5384d35e6881d69483268b3a0d6c15617672dc 100644 --- a/lightbox2.install +++ b/lightbox2.install @@ -26,6 +26,7 @@ function lightbox2_uninstall() { variable_del('lightbox2_use_alt_layout'); variable_del('lightbox2_force_show_nav'); variable_del('lightbox2_image_count_str'); + variable_del('lightbox2_page_count_str'); variable_del('lightbox2_disable_zoom'); variable_del('lightbox2_disable_these_urls'); variable_del('lightbox2_imagefield_group_node_id'); diff --git a/lightbox2.module b/lightbox2.module index dbc70bea82bb49660b568b2ee853373e6b79389c..405f501a51ff057a1bed6ec491cffe36ec7050a2 100644 --- a/lightbox2.module +++ b/lightbox2.module @@ -229,6 +229,14 @@ function lightbox2_general_settings_form() { '#default_value' => variable_get('lightbox2_image_count_str', 'Image !current of !total'), ); + // Add text box for page count for grouping. + $form['lightbox2_page_count_str'] = array( + '#type' => 'textfield', + '#title' => t('Page Count Text'), + '#description' => t('This text is used to display the page count underneath HTML content displayed in the lightbox when using groups. Use !current as a placeholder for the number of the current page and !total for the total number of pages in the group. For example, "Page !current of !total".'), + '#default_value' => variable_get('lightbox2_page_count_str', 'Page !current of !total'), + ); + // Add checkbox for zoom image. $form['lightbox2_disable_zoom'] = array( '#type' => 'checkbox', @@ -772,6 +780,7 @@ function lightbox2_add_files() { 'node_link_text' => check_plain(t(variable_get('lightbox2_node_link_text', 'View Image Details'))), 'node_link_target' => variable_get('lightbox2_node_link_target', FALSE), 'image_count' => check_plain(t(variable_get('lightbox2_image_count_str', 'Image !current of !total'))), + 'page_count' => check_plain(t(variable_get('lightbox2_page_count_str', 'Page !current of !total'))), 'lite_press_x_close' => t('press !x to close', array('!x' => 'x')), // Automatic image handling settings. 'display_image_size' => variable_get('lightbox2_display_image_size', ''),