Changeset 25237 for trunk/admin
- Timestamp:
- Oct 30, 2013, 1:54:46 PM (11 years ago)
- Location:
- trunk/admin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/add_core_tabs.inc.php
r25084 r25237 61 61 case 'comments': 62 62 $sheets[''] = array('caption' => l10n('User comments'), 'url' => ''); 63 break; 64 65 case 'users': 66 $sheets[''] = array('caption' => '<span class="icon-users"> </span>'.l10n('User list'), 'url' => ''); 63 67 break; 64 68 -
trunk/admin/themes/default/template/user_list.tpl
r25198 r25237 9 9 var selectedMessage_all = "{'All %d photos are selected'|@translate}"; 10 10 var applyOnDetails_pattern = "{'on the %d selected users'|@translate}"; 11 var newUser_pattern = "✔ {'User %s added'|translate}"; 11 12 var missingConfirm = "{'You need to confirm deletion'|translate}"; 13 var missingUsername = "{'Please, enter a login'|translate}"; 12 14 13 15 var allUsers = [{$all_users}]; … … 17 19 {footer_script}{literal} 18 20 jQuery(document).ready(function() { 21 /** 22 * Add user 23 */ 24 jQuery("#addUser").click(function() { 25 jQuery("#addUserForm").toggle(); 26 jQuery("#showAddUser .infos").hide(); 27 jQuery("input[name=username]").focus(); 28 return false; 29 }); 30 31 jQuery("#addUserClose").click(function() { 32 jQuery("#addUserForm").hide(); 33 return false; 34 }); 35 36 jQuery("#addUserForm").submit(function() { 37 jQuery.ajax({ 38 url: "ws.php?format=json&method=pwg.users.add", 39 type:"POST", 40 data: jQuery(this).serialize(), 41 beforeSend: function() { 42 jQuery("#addUserForm .errors").hide(); 43 44 if (jQuery("input[name=username]").val() == "") { 45 jQuery("#addUserForm .errors").html('✘ '+missingUsername).show(); 46 return false; 47 } 48 49 jQuery("#addUserForm .loading").show(); 50 }, 51 success:function(data) { 52 oTable.fnDraw(); 53 jQuery("#addUserForm .loading").hide(); 54 55 var data = jQuery.parseJSON(data); 56 if (data.stat == 'ok') { 57 jQuery("#addUserForm input[type=text], #addUserForm input[type=password]").val(""); 58 59 var new_user = data.result.users[0]; 60 allUsers.push(parseInt(new_user.id)); 61 jQuery("#showAddUser .infos").html(sprintf(newUser_pattern, new_user.username)).show(); 62 checkSelection(); 63 64 jQuery("#addUserForm").hide(); 65 } 66 else { 67 jQuery("#addUserForm .errors").html('✘ '+data.message).show(); 68 } 69 }, 70 error:function(XMLHttpRequest, textStatus, errorThrows) { 71 jQuery("#addUserForm .loading").hide(); 72 } 73 }); 74 75 return false; 76 }); 77 78 /** 79 * Table with users 80 */ 81 19 82 /* first column must be prefixed with the open/close icon */ 20 83 var aoColumns = [ … … 265 328 table.dataTable {clear:right;padding-top:10px;} 266 329 .bulkAction {margin-top:10px;} 267 .actionButtons {margin-left:0;} 268 #applyActionBlock .infos {background-image:none; padding:2px 5px; margin:0;border-radius:5px;} 330 #addUserForm p {margin-left:0;} 331 #applyActionBlock .actionButtons {margin-left:0;} 332 span.infos, span.errors {background-image:none; padding:2px 5px; margin:0;border-radius:5px;} 269 333 </style> 270 334 {/literal} … … 274 338 </div> 275 339 276 <form style="display:none" class="filter" method="post" name="add_user" action="{$F_ADD_ACTION}"> 340 <p class="showCreateAlbum" id="showAddUser"> 341 <a href="#" id="addUser">{'Add a user'|translate}</a> 342 <span class="infos" style="display:none"></span> 343 </p> 344 345 <form id="addUserForm" style="display:none" method="post" name="add_user" action="{$F_ADD_ACTION}"> 277 346 <fieldset> 278 347 <legend>{'Add a user'|@translate}</legend> 279 <label>{'Username'|@translate} <input type="text" name="login" maxlength="50" size="20"></label> 280 {if $Double_Password} 281 <label>{'Password'|@translate} <input type="password" name="password"></label> 282 <label>{'Confirm Password'|@translate} <input type="password" name="password_conf" id="password_conf"></label> 283 {else} 284 <label>{'Password'|@translate} <input type="text" name="password"></label> 285 {/if} 286 <label>{'Email address'|@translate} <input type="text" name="email"></label> 287 <label>{'Send connection settings by email'|@translate} <input type="checkbox" name="send_password_by_mail" value="1" checked="checked"></label> 288 <label> <input class="submit" type="submit" name="submit_add" value="{'Submit'|@translate}"></label> 348 349 <p> 350 <strong>{'Username'|translate}</strong><br> 351 <input type="text" name="username" maxlength="50" size="20"> 352 </p> 353 354 <p> 355 <strong>{'Password'|translate}</strong><br> 356 <input type="{if $Double_Password}password{else}text{/if}" name="password"> 357 </p> 358 359 {if $Double_Password} 360 <p> 361 <strong>{'Confirm Password'|@translate}</strong><br> 362 <input type="password" name="password_confirm"> 363 </p> 364 {/if} 365 366 <p> 367 <strong>{'Email address'|@translate}</strong><br> 368 <input type="text" name="email"> 369 </p> 370 371 <p> 372 <label><input type="checkbox" name="send_password_by_mail"> <strong>{'Send connection settings by email'|@translate}</strong></label> 373 </p> 374 375 <p class="actionButtons"> 376 <input class="submit" name="submit_add" type="submit" value="{'Submit'|@translate}"> 377 <a href="#" id="addUserClose">{'Cancel'|@translate}</a> 378 <span class="loading" style="display:none"><img src="themes/default/images/ajax-loader-small.gif"></span> 379 <span class="errors" style="display:none"></span> 380 </p> 289 381 </fieldset> 290 382 </form> -
trunk/admin/user_list.php
r25194 r25237 25 25 * Add users and manage users list 26 26 */ 27 28 // +-----------------------------------------------------------------------+ 29 // | tabs | 30 // +-----------------------------------------------------------------------+ 31 32 include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php'); 33 34 $my_base_url = get_root_url().'admin.php?page='; 35 36 $tabsheet = new tabsheet(); 37 $tabsheet->set_id('users'); 38 $tabsheet->select('user_list'); 39 $tabsheet->assign(); 27 40 28 41 // +-----------------------------------------------------------------------+ … … 74 87 'users' => $users, 75 88 'all_users' => join(',', $user_ids), 89 'Double_Password' => $conf['double_password_type_in_admin'] 76 90 ) 77 91 );
Note: See TracChangeset
for help on using the changeset viewer.