mirror of
https://github.com/monstra-cms/monstra.git
synced 2025-08-01 10:50:37 +02:00
Users Plugin: general js refactoring
This commit is contained in:
20
plugins/box/users/js/users.js
Normal file
20
plugins/box/users/js/users.js
Normal file
@@ -0,0 +1,20 @@
|
||||
if (typeof $.monstra == 'undefined') $.monstra = {};
|
||||
|
||||
$.monstra.users = {
|
||||
|
||||
init: function() {
|
||||
this.usersFrontendRegistration();
|
||||
},
|
||||
|
||||
usersFrontendRegistration: function() {
|
||||
$("[name=users_frontend_registration]").click(function() {
|
||||
$("[name=users_frontend]").submit();
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
$(document).ready(function(){
|
||||
$.monstra.users.init();
|
||||
});
|
@@ -9,29 +9,15 @@
|
||||
$user_login = '';
|
||||
}
|
||||
|
||||
// Add plugin navigation link
|
||||
Navigation::add(__('Users', 'users'), 'system', 'users', 2);
|
||||
|
||||
Action::add('admin_header', 'UsersAdmin::headers');
|
||||
// Add Plugin Javascript
|
||||
Javascript::add('plugins/box/users/js/users.js', 'backend');
|
||||
|
||||
|
||||
class UsersAdmin extends Backend {
|
||||
|
||||
|
||||
/**
|
||||
* Headers
|
||||
*/
|
||||
public static function headers() {
|
||||
echo ('
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$("[name=users_frontend_registration] , [name=users_frontend_authorization]").click(function() {
|
||||
$("[name=users_frontend]").submit();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Users admin
|
||||
*/
|
||||
|
Reference in New Issue
Block a user