HybridAuth.utils.getMenu = function (actions, grid, selected) { var menu = []; var cls, icon, title, action; var has_delete = false; for (var i in actions) { if (!actions.hasOwnProperty(i)) { continue; } var a = actions[i]; if (!a['menu']) { if (a == '-') { menu.push('-'); } continue; } else if (menu.length > 0 && !has_delete && (/^remove/i.test(a['action']) || /^delete/i.test(a['action']))) { menu.push('-'); has_delete = true; } if (selected.length > 1) { if (!a['multiple']) { continue; } else if (typeof(a['multiple']) == 'string') { a['title'] = a['multiple']; } } icon = a['icon'] ? a['icon'] : ''; if (typeof(a['cls']) == 'object') { if (typeof(a['cls']['menu']) != 'undefined') { icon += ' ' + a['cls']['menu']; } } else { cls = a['cls'] ? a['cls'] : ''; } title = a['title'] ? a['title'] : a['title']; action = a['action'] ? grid[a['action']] : ''; menu.push({ handler: action, text: String.format( '{2}', cls, icon, title ), scope: grid }); } return menu; }; HybridAuth.utils.renderActions = function (value, props, row) { var res = []; var cls, icon, title, action, item; for (var i in row.data.actions) { if (!row.data.actions.hasOwnProperty(i)) { continue; } var a = row.data.actions[i]; if (!a['button']) { continue; } icon = a['icon'] ? a['icon'] : ''; if (typeof(a['cls']) == 'object') { if (typeof(a['cls']['button']) != 'undefined') { icon += ' ' + a['cls']['button']; } } else { cls = a['cls'] ? a['cls'] : ''; } action = a['action'] ? a['action'] : ''; title = a['title'] ? a['title'] : ''; item = String.format( '
  • ', cls, icon, action, title ); res.push(item); } return String.format( '', res.join('') ); };