Changeset 28494
- Timestamp:
- May 17, 2014, 2:11:47 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/picture_modify.php
r27896 r28494 43 43 WHERE representative_picture_id = '.$_GET['image_id'].' 44 44 ;'; 45 $represent_options_selected = array_from_query($query, 'id');45 $represent_options_selected = query2array($query, null, 'id'); 46 46 47 47 // +-----------------------------------------------------------------------+ … … 128 128 { 129 129 $data = array(); 130 $data {'id'}= $_GET['image_id'];131 $data {'name'}= $_POST['name'];132 $data {'author'}= $_POST['author'];130 $data['id'] = $_GET['image_id']; 131 $data['name'] = $_POST['name']; 132 $data['author'] = $_POST['author']; 133 133 $data['level'] = $_POST['level']; 134 134 135 135 if ($conf['allow_html_descriptions']) 136 136 { 137 $data {'comment'}= @$_POST['description'];137 $data['comment'] = @$_POST['description']; 138 138 } 139 139 else 140 140 { 141 $data {'comment'}= strip_tags(@$_POST['description']);141 $data['comment'] = strip_tags(@$_POST['description']); 142 142 } 143 143 144 144 if (!empty($_POST['date_creation_year'])) 145 145 { 146 $data {'date_creation'}=146 $data['date_creation'] = 147 147 $_POST['date_creation_year'] 148 148 .'-'.$_POST['date_creation_month'] … … 152 152 else 153 153 { 154 $data {'date_creation'}= null;154 $data['date_creation'] = null; 155 155 } 156 156 … … 470 470 WHERE image_id = '.$_GET['image_id'].' 471 471 ;'; 472 $associate_options_selected = array_from_query($query, 'id'); 473 474 $query = ' 475 SELECT id,name,uppercats,global_rank 476 FROM '.CATEGORIES_TABLE.' 477 ;'; 478 display_select_cat_wrapper($query, $associate_options_selected, 'associate_options'); 479 display_select_cat_wrapper($query, $represent_options_selected, 'represent_options'); 472 $associate_options_selected = query2array($query, null, 'id'); 473 474 $template->assign(compact('associate_options_selected', 'represent_options_selected')); 480 475 481 476 trigger_action('loc_end_picture_modify'); -
trunk/admin/themes/default/template/picture_modify.tpl
r25748 r28494 3 3 {include file='include/datepicker.inc.tpl'} 4 4 5 {combine_script id='jquery.chosen' load='footer' path='themes/default/js/plugins/chosen.jquery.min.js'} 6 {combine_css path="themes/default/js/plugins/chosen.css"} 7 8 {footer_script}{literal} 9 jQuery(document).ready(function() { 10 jQuery(".chzn-select").chosen(); 11 }); 12 {/literal}{/footer_script} 13 14 {combine_css path='themes/default/js/plugins/jquery.tokeninput.css'} 15 {combine_script id='jquery.tokeninput' load='async' require='jquery' path='themes/default/js/plugins/jquery.tokeninput.js'} 16 {footer_script require='jquery.tokeninput'} 17 jQuery(document).ready(function() {ldelim} 18 jQuery("#tags").tokenInput( 19 [{foreach from=$tags item=tag name=tags}{ldelim}"name":"{$tag.name|@escape:'javascript'}","id":"{$tag.id}"{rdelim}{if !$smarty.foreach.tags.last},{/if}{/foreach}], 20 {ldelim} 21 hintText: '{'Type in a search term'|@translate}', 22 noResultsText: '{'No results'|@translate}', 23 searchingText: '{'Searching...'|@translate}', 24 newText: ' ({'new'|@translate})', 25 animateDropdown: false, 26 preventDuplicates: true, 27 allowFreeTagging: true 5 {combine_script id='LocalStorageCache' load='footer' path='admin/themes/default/js/LocalStorageCache.js'} 6 7 {combine_script id='jquery.selectize' load='footer' path='themes/default/js/plugins/selectize.min.js'} 8 {combine_css id='jquery.selectize' path="themes/default/js/plugins/selectize.default.css"} 9 10 {footer_script} 11 (function(){ 12 {* <!-- CATEGORIES --> *} 13 var categoriesCache = new LocalStorageCache('categoriesAdminList', 60, function(callback) { 14 jQuery.getJSON('{$ROOT_URL}ws.php?format=json&method=pwg.categories.getAdminList', function(data) { 15 callback(data.result.categories); 16 }); 17 }); 18 19 jQuery('[data-selectize=categories]').selectize({ 20 valueField: 'id', 21 labelField: 'fullname', 22 searchField: ['fullname'], 23 plugins: ['remove_button'] 24 }); 25 26 categoriesCache.get(function(categories) { 27 var selects = jQuery('[data-selectize=categories]'); 28 29 jQuery.each(categories, function(i, category) { 30 selects.each(function() { 31 this.selectize.addOption(category); 32 }); 33 }); 34 35 selects.each(function() { 36 var that = this; 37 38 jQuery.each(jQuery(this).data('value'), function(i, id) { 39 that.selectize.addItem(id); 40 }); 41 }); 42 }); 43 44 {* <!-- TAGS --> *} 45 var tagsCache = new LocalStorageCache('tagsAdminList', 60, function(callback) { 46 jQuery.getJSON('{$ROOT_URL}ws.php?format=json&method=pwg.tags.getAdminList', function(data) { 47 var tags = data.result.tags; 48 49 for (var i=0, l=tags.length; i<l; i++) { 50 tags[i].id = '~~' + tags[i].id + '~~'; 28 51 } 29 ); 30 }); 31 {/footer_script} 32 33 {footer_script} 52 53 callback(tags); 54 }); 55 }); 56 57 jQuery('[data-selectize=tags]').selectize({ 58 valueField: 'id', 59 labelField: 'name', 60 searchField: ['name'], 61 plugins: ['remove_button'], 62 create: function(input, callback) { 63 tagsCache.clear(); 64 65 callback({ 66 id: input, 67 name: input 68 }); 69 } 70 }); 71 72 tagsCache.get(function(tags) { 73 var selects = jQuery('[data-selectize=tags]'); 74 75 jQuery.each(tags, function(i, tag) { 76 selects.each(function() { 77 this.selectize.addOption(tag); 78 }); 79 }); 80 81 selects.each(function() { 82 var that = this; 83 84 jQuery.each(jQuery(this).data('value'), function(i, tag) { 85 that.selectize.addItem(tag.id); 86 }); 87 }); 88 }); 89 90 {* <!-- DATEPICKER --> *} 34 91 pwg_initialization_datepicker("#date_creation_day", "#date_creation_month", "#date_creation_year", "#date_creation_linked_date", "#date_creation_action_set"); 92 }()); 35 93 {/footer_script} 36 94 … … 113 171 <strong>{'Linked albums'|@translate}</strong> 114 172 <br> 115 <select data-placeholder="Select albums..." class="chzn-select" multiple style="width:700px;" name="associate[]"> 116 {html_options options=$associate_options selected=$associate_options_selected} 117 </select> 173 <select data-selectize="categories" data-value="{$associate_options_selected|@json_encode|escape:html}" 174 name="associate[]" multiple style="width:600px;" ></select> 118 175 </p> 119 176 … … 121 178 <strong>{'Representation of albums'|@translate}</strong> 122 179 <br> 123 <select data-placeholder="Select albums..." class="chzn-select" multiple style="width:700px;" name="represent[]"> 124 {html_options options=$represent_options selected=$represent_options_selected} 125 </select> 180 <select data-selectize="categories" data-value="{$represent_options_selected|@json_encode|escape:html}" 181 name="represent[]" multiple style="width:600px;" ></select> 126 182 </p> 127 183 … … 129 185 <strong>{'Tags'|@translate}</strong> 130 186 <br> 131 <select id="tags" name="tags"> 132 {foreach from=$tag_selection item=tag} 133 <option value="{$tag.id}" class="selected">{$tag.name}</option> 134 {/foreach} 135 </select> 187 <select data-selectize="tags" data-value="{$tag_selection|@json_encode|escape:html}" 188 name="tags[]" multiple style="width:600px;" ></select> 136 189 </p> 137 190 -
trunk/include/ws_functions/pwg.categories.php
r26953 r28494 487 487 GROUP BY category_id 488 488 ;'; 489 $nb_images_of = simple_hash_from_query($query, 'category_id', 'counter');489 $nb_images_of = query2array($query, 'category_id', 'counter'); 490 490 491 491 $query = ' … … 506 506 $row['name'], 507 507 'ws_categories_getAdminList' 508 ) 509 ); 510 $row['fullname'] = strip_tags( 511 get_cat_display_name_cache( 512 $row['uppercats'], 513 null 508 514 ) 509 515 );
Note: See TracChangeset
for help on using the changeset viewer.