Index: trunk/admin/batch_manager_global.php
===================================================================
--- trunk/admin/batch_manager_global.php	(revision 13052)
+++ trunk/admin/batch_manager_global.php	(revision 13063)
@@ -529,4 +529,5 @@
 ;';
 display_select_cat_wrapper($query, array(), 'associate_options', true);
+display_select_cat_wrapper($query, array(), 'category_parent_options');
 
 // in the filter box, which category to select by default
Index: trunk/admin/themes/default/template/batch_manager_global.tpl
===================================================================
--- trunk/admin/themes/default/template/batch_manager_global.tpl	(revision 13052)
+++ trunk/admin/themes/default/template/batch_manager_global.tpl	(revision 13063)
@@ -2,4 +2,5 @@
 {include file='include/datepicker.inc.tpl'}
 {include file='include/colorbox.inc.tpl'}
+{include file='include/add_album.inc.tpl'}
 
 {footer_script}{literal}
@@ -645,7 +646,8 @@
     <!-- associate -->
     <div id="action_associate" class="bulkAction">
-          <select style="width:400px" name="associate" size="1">
+          <select id="albumSelect" style="width:400px" name="associate" size="1">
             {html_options options=$associate_options }
          </select>
+<br>{'... or '|@translate}</span><a href="#" class="addAlbumOpen" title="{'create a new album'|@translate}">{'create a new album'|@translate}</a>
     </div>
 
Index: trunk/admin/themes/default/template/include/add_album.inc.tpl
===================================================================
--- trunk/admin/themes/default/template/include/add_album.inc.tpl	(revision 13063)
+++ trunk/admin/themes/default/template/include/add_album.inc.tpl	(revision 13063)
@@ -0,0 +1,102 @@
+{footer_script}{literal}
+jQuery(document).ready(function(){
+  function fillCategoryListbox(selectId, selectedValue) {
+    jQuery.getJSON(
+      "ws.php?format=json&method=pwg.categories.getList",
+      {
+        recursive: true,
+        fullname: true,
+        format: "json",
+      },
+      function(data) {
+        jQuery.each(
+          data.result.categories,
+          function(i,category) {
+            var selected = null;
+            if (category.id == selectedValue) {
+              selected = "selected";
+            }
+            
+            jQuery("<option/>")
+              .attr("value", category.id)
+              .attr("selected", selected)
+              .text(category.name)
+              .appendTo("#"+selectId)
+              ;
+          }
+        );
+      }
+    );
+  }
+
+  jQuery(".addAlbumOpen").colorbox({
+    inline:true,
+    href:"#addAlbumForm",
+    onComplete:function(){
+      jQuery("input[name=category_name]").focus();
+    }
+  });
+
+  jQuery("#addAlbumForm form").submit(function(){
+      jQuery("#categoryNameError").text("");
+
+      jQuery.ajax({
+        url: "ws.php?format=json&method=pwg.categories.add",
+        data: {
+          parent: jQuery("select[name=category_parent] option:selected").val(),
+          name: jQuery("input[name=category_name]").val(),
+        },
+        beforeSend: function() {
+          jQuery("#albumCreationLoading").show();
+        },
+        success:function(html) {
+          jQuery("#albumCreationLoading").hide();
+
+          var newAlbum = jQuery.parseJSON(html).result.id;
+          jQuery(".addAlbumOpen").colorbox.close();
+
+          jQuery("#albumSelect").find("option").remove();
+          fillCategoryListbox("albumSelect", newAlbum);
+
+          /* we refresh the album creation form, in case the user wants to create another album */
+          jQuery("#category_parent").find("option").remove();
+
+          jQuery("<option/>")
+            .attr("value", 0)
+            .text("------------")
+            .appendTo("#category_parent")
+          ;
+
+          fillCategoryListbox("category_parent", newAlbum);
+
+          jQuery("#addAlbumForm form input[name=category_name]").val('');
+
+          jQuery("#albumSelection").show();
+
+          return true;
+        },
+        error:function(XMLHttpRequest, textStatus, errorThrows) {
+            jQuery("#albumCreationLoading").hide();
+            jQuery("#categoryNameError").text(errorThrows).css("color", "red");
+        }
+      });
+
+      return false;
+  });
+});
+{/literal}{/footer_script}
+
+<div style="display:none">
+  <div id="addAlbumForm" style="text-align:left;padding:1em;">
+    <form>
+      {'Parent album'|@translate}<br>
+      <select id ="category_parent" name="category_parent">
+        <option value="0">------------</option>
+        {html_options options=$category_parent_options selected=$category_parent_options_selected}
+      </select>
+
+      <br><br>{'Album name'|@translate}<br><input name="category_name" type="text"> <span id="categoryNameError"></span>
+      <br><br><br><input type="submit" value="{'Create'|@translate}"> <span id="albumCreationLoading" style="display:none"><img src="themes/default/images/ajax-loader-small.gif"></span>
+    </form>
+  </div>
+</div>
Index: trunk/admin/themes/default/template/photos_add_direct.tpl
===================================================================
--- trunk/admin/themes/default/template/photos_add_direct.tpl	(revision 13052)
+++ trunk/admin/themes/default/template/photos_add_direct.tpl	(revision 13063)
@@ -8,4 +8,5 @@
 
 {include file='include/colorbox.inc.tpl'}
+{include file='include/add_album.inc.tpl'}
 
 {footer_script}{literal}
@@ -67,88 +68,4 @@
     return byteSize+suffix;
   }
-
-  function fillCategoryListbox(selectId, selectedValue) {
-    jQuery.getJSON(
-      "ws.php?format=json&method=pwg.categories.getList",
-      {
-        recursive: true,
-        fullname: true,
-        format: "json",
-      },
-      function(data) {
-        jQuery.each(
-          data.result.categories,
-          function(i,category) {
-            var selected = null;
-            if (category.id == selectedValue) {
-              selected = "selected";
-            }
-            
-            jQuery("<option/>")
-              .attr("value", category.id)
-              .attr("selected", selected)
-              .text(category.name)
-              .appendTo("#"+selectId)
-              ;
-          }
-        );
-      }
-    );
-  }
-
-  jQuery(".addAlbumOpen").colorbox({
-    inline:true,
-    href:"#addAlbumForm",
-    onComplete:function(){
-      jQuery("input[name=category_name]").focus();
-    }
-  });
-
-  jQuery("#addAlbumForm form").submit(function(){
-      jQuery("#categoryNameError").text("");
-
-      jQuery.ajax({
-        url: "ws.php?format=json&method=pwg.categories.add",
-        data: {
-          parent: jQuery("select[name=category_parent] option:selected").val(),
-          name: jQuery("input[name=category_name]").val(),
-        },
-        beforeSend: function() {
-          jQuery("#albumCreationLoading").show();
-        },
-        success:function(html) {
-          jQuery("#albumCreationLoading").hide();
-
-          var newAlbum = jQuery.parseJSON(html).result.id;
-          jQuery(".addAlbumOpen").colorbox.close();
-
-          jQuery("#albumSelect").find("option").remove();
-          fillCategoryListbox("albumSelect", newAlbum);
-
-          /* we refresh the album creation form, in case the user wants to create another album */
-          jQuery("#category_parent").find("option").remove();
-
-          jQuery("<option/>")
-            .attr("value", 0)
-            .text("------------")
-            .appendTo("#category_parent")
-          ;
-
-          fillCategoryListbox("category_parent", newAlbum);
-
-          jQuery("#addAlbumForm form input[name=category_name]").val('');
-
-          jQuery("#albumSelection").show();
-
-          return true;
-        },
-        error:function(XMLHttpRequest, textStatus, errorThrows) {
-            jQuery("#albumCreationLoading").hide();
-            jQuery("#categoryNameError").text(errorThrows).css("color", "red");
-        }
-      });
-
-      return false;
-  });
 
   jQuery("#hideErrors").click(function() {
@@ -352,18 +269,4 @@
 </div>
 
-<div style="display:none">
-  <div id="addAlbumForm" style="text-align:left;padding:1em;">
-    <form>
-      {'Parent album'|@translate}<br>
-      <select id ="category_parent" name="category_parent">
-        <option value="0">------------</option>
-        {html_options options=$category_parent_options selected=$category_parent_options_selected}
-      </select>
-
-      <br><br>{'Album name'|@translate}<br><input name="category_name" type="text"> <span id="categoryNameError"></span>
-      <br><br><br><input type="submit" value="{'Create'|@translate}"> <span id="albumCreationLoading" style="display:none"><img src="themes/default/images/ajax-loader-small.gif"></span>
-    </form>
-  </div>
-</div>
 
 <form id="uploadForm" enctype="multipart/form-data" method="post" action="{$form_action}" class="properties">
