Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- <!--
- $(document).ready(function () {
- var settings = JSON.parse('{PLUGIN-SETTINGS}' || null);
- var handler = function (json) {
- /* response handler here */
- console.log(json);
- }
- function register_plugin(collector) {
- var plugin = {
- "name": collector['name'],
- "collector": collector,
- "handler": handler,
- "load": (check_option('{OPTIONS}', 'sync') ? 'sync' : 'async')
- }
- register_handler(plugin);
- register_event('get-users', export_get_users, '{PLUGIN-NAME}.{ID}');
- }
- function dbinit() {
- var collector = {
- "name": "{PLUGIN-NAME}.{ID}",
- "path": "{PLUGIN-DIR}",
- "folder": "{FOLDER}",
- "page": "{PAGE}"
- }
- register_plugin(collector);
- console.log('Loaded');
- if (!check_option('{OPTIONS}', 'sync'))
- $.post('{AJAX}dbinit.php', collector, handler, 'html');
- }
- dbinit();
- function export_get_users() {
- var users = [{
- "id": 1,
- "photo": "/link",
- "name": "John",
- "surename":"Smith",
- "position":"Administrator"
- }, {
- "id": 2,
- "photo": "/link",
- "name": "Ban",
- "surename": "Smith",
- "position": "Administrator"
- }];
- return users;
- }
- });
- -->
- </script>
- <div class="{PLUGIN-NAME}-{ID}" data-plugin-name="{PLUGIN-NAME}.{ID}"></div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement