From 62c69bb477ced2427a75e77c50e1bcad1f02e15a Mon Sep 17 00:00:00 2001 From: plegall Date: Thu, 9 Feb 2012 00:02:11 +0000 Subject: feature 2470 added: ability to create a new album "on the fly" on the "associate to album" action of the Batch Manager. The code was moved from the upload form and is now used by the upload form + Batch Manager. git-svn-id: http://piwigo.org/svn/trunk@13063 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/batch_manager_global.php | 1 + .../default/template/batch_manager_global.tpl | 4 +- .../default/template/include/add_album.inc.tpl | 102 +++++++++++++++++++++ .../themes/default/template/photos_add_direct.tpl | 99 +------------------- 4 files changed, 107 insertions(+), 99 deletions(-) create mode 100644 admin/themes/default/template/include/add_album.inc.tpl (limited to 'admin') diff --git a/admin/batch_manager_global.php b/admin/batch_manager_global.php index 7eb833898..a527330e7 100644 --- a/admin/batch_manager_global.php +++ b/admin/batch_manager_global.php @@ -528,6 +528,7 @@ SELECT id,name,uppercats,global_rank FROM '.CATEGORIES_TABLE.' ;'; 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 $selected_category = array(); diff --git a/admin/themes/default/template/batch_manager_global.tpl b/admin/themes/default/template/batch_manager_global.tpl index d278bb7f4..856633421 100644 --- a/admin/themes/default/template/batch_manager_global.tpl +++ b/admin/themes/default/template/batch_manager_global.tpl @@ -1,6 +1,7 @@ {include file='include/tag_selection.inc.tpl'} {include file='include/datepicker.inc.tpl'} {include file='include/colorbox.inc.tpl'} +{include file='include/add_album.inc.tpl'} {footer_script}{literal} pwg_initialization_datepicker("#date_creation_day", "#date_creation_month", "#date_creation_year", "#date_creation_linked_date", "#date_creation_action_set"); @@ -644,9 +645,10 @@ jQuery(window).load(function() {
- {html_options options=$associate_options } +
{'... or '|@translate}{'create a new album'|@translate}
diff --git a/admin/themes/default/template/include/add_album.inc.tpl b/admin/themes/default/template/include/add_album.inc.tpl new file mode 100644 index 000000000..82178ab11 --- /dev/null +++ b/admin/themes/default/template/include/add_album.inc.tpl @@ -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("