Changeset 13063
- Timestamp:
- Feb 9, 2012, 1:02:11 AM (13 years ago)
- Location:
- trunk/admin
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/batch_manager_global.php
r12930 r13063 529 529 ;'; 530 530 display_select_cat_wrapper($query, array(), 'associate_options', true); 531 display_select_cat_wrapper($query, array(), 'category_parent_options'); 531 532 532 533 // in the filter box, which category to select by default -
trunk/admin/themes/default/template/batch_manager_global.tpl
r12630 r13063 2 2 {include file='include/datepicker.inc.tpl'} 3 3 {include file='include/colorbox.inc.tpl'} 4 {include file='include/add_album.inc.tpl'} 4 5 5 6 {footer_script}{literal} … … 645 646 <!-- associate --> 646 647 <div id="action_associate" class="bulkAction"> 647 <select style="width:400px" name="associate" size="1">648 <select id="albumSelect" style="width:400px" name="associate" size="1"> 648 649 {html_options options=$associate_options } 649 650 </select> 651 <br>{'... or '|@translate}</span><a href="#" class="addAlbumOpen" title="{'create a new album'|@translate}">{'create a new album'|@translate}</a> 650 652 </div> 651 653 -
trunk/admin/themes/default/template/photos_add_direct.tpl
r13018 r13063 8 8 9 9 {include file='include/colorbox.inc.tpl'} 10 {include file='include/add_album.inc.tpl'} 10 11 11 12 {footer_script}{literal} … … 67 68 return byteSize+suffix; 68 69 } 69 70 function fillCategoryListbox(selectId, selectedValue) {71 jQuery.getJSON(72 "ws.php?format=json&method=pwg.categories.getList",73 {74 recursive: true,75 fullname: true,76 format: "json",77 },78 function(data) {79 jQuery.each(80 data.result.categories,81 function(i,category) {82 var selected = null;83 if (category.id == selectedValue) {84 selected = "selected";85 }86 87 jQuery("<option/>")88 .attr("value", category.id)89 .attr("selected", selected)90 .text(category.name)91 .appendTo("#"+selectId)92 ;93 }94 );95 }96 );97 }98 99 jQuery(".addAlbumOpen").colorbox({100 inline:true,101 href:"#addAlbumForm",102 onComplete:function(){103 jQuery("input[name=category_name]").focus();104 }105 });106 107 jQuery("#addAlbumForm form").submit(function(){108 jQuery("#categoryNameError").text("");109 110 jQuery.ajax({111 url: "ws.php?format=json&method=pwg.categories.add",112 data: {113 parent: jQuery("select[name=category_parent] option:selected").val(),114 name: jQuery("input[name=category_name]").val(),115 },116 beforeSend: function() {117 jQuery("#albumCreationLoading").show();118 },119 success:function(html) {120 jQuery("#albumCreationLoading").hide();121 122 var newAlbum = jQuery.parseJSON(html).result.id;123 jQuery(".addAlbumOpen").colorbox.close();124 125 jQuery("#albumSelect").find("option").remove();126 fillCategoryListbox("albumSelect", newAlbum);127 128 /* we refresh the album creation form, in case the user wants to create another album */129 jQuery("#category_parent").find("option").remove();130 131 jQuery("<option/>")132 .attr("value", 0)133 .text("------------")134 .appendTo("#category_parent")135 ;136 137 fillCategoryListbox("category_parent", newAlbum);138 139 jQuery("#addAlbumForm form input[name=category_name]").val('');140 141 jQuery("#albumSelection").show();142 143 return true;144 },145 error:function(XMLHttpRequest, textStatus, errorThrows) {146 jQuery("#albumCreationLoading").hide();147 jQuery("#categoryNameError").text(errorThrows).css("color", "red");148 }149 });150 151 return false;152 });153 70 154 71 jQuery("#hideErrors").click(function() { … … 352 269 </div> 353 270 354 <div style="display:none">355 <div id="addAlbumForm" style="text-align:left;padding:1em;">356 <form>357 {'Parent album'|@translate}<br>358 <select id ="category_parent" name="category_parent">359 <option value="0">------------</option>360 {html_options options=$category_parent_options selected=$category_parent_options_selected}361 </select>362 363 <br><br>{'Album name'|@translate}<br><input name="category_name" type="text"> <span id="categoryNameError"></span>364 <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>365 </form>366 </div>367 </div>368 271 369 272 <form id="uploadForm" enctype="multipart/form-data" method="post" action="{$form_action}" class="properties">
Note: See TracChangeset
for help on using the changeset viewer.