Skip to content

Commit 35f366d

Browse files
committed
upgrade for compatibility with widget_manager 5.1
1 parent 81b0244 commit 35f366d

File tree

5 files changed

+49
-128
lines changed

5 files changed

+49
-128
lines changed

CHANGES.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
x.x (mm/dd/yyyy):
44

5+
2.1 (09/11/2015):
6+
- upgrade for compatibility with widget_manager 5.1, elgg 1.10
7+
58
2.0 (09/11/2015):
69
- upgrade for elgg 1.9
710
- general code cleanup

manifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?xml version="1.0" encoding="UTF-8"?><plugin_manifest xmlns="http://www.elgg.org/plugin_manifest/1.8"> <name>Tabbed Profile</name> <author>Matt Beckett</author> <email>matt@mattbeckett.me</email> <version>2.0</version> <description>Users/Groups can have multiple profile pages for different contexts/viewers</description> <website>https://landing.athabascau.ca</website> <copyright>(C) Athabasca University</copyright> <license>GNU Public License version 2</license> <requires> <type>elgg_release</type> <version>1.9</version> </requires> <requires> <type>plugin</type> <name>widget_manager</name> </requires> <requires> <type>priority</type> <priority>after</priority> <plugin>widget_manager</plugin> </requires> <suggests> <type>plugin</type> <name>group_tools</name> </suggests> <screenshot> <description>Tabbed Profile</description> <path>screenshots/tabbed_profile1.png</path> </screenshot> <screenshot> <description>Adding a new tab</description> <path>screenshots/tabbed_profile2.png</path> </screenshot> <screenshot> <description>An iframe profile</description> <path>screenshots/tabbed_profile3.png</path> </screenshot> <screenshot> <description>Plugin settings</description> <path>screenshots/tabbed_profile4.png</path> </screenshot></plugin_manifest>
1+
<?xml version="1.0" encoding="UTF-8"?><plugin_manifest xmlns="http://www.elgg.org/plugin_manifest/1.8"> <name>Tabbed Profile</name> <author>Matt Beckett</author> <email>matt@mattbeckett.me</email> <version>2.1</version> <description>Users/Groups can have multiple profile pages for different contexts/viewers</description> <website>https://landing.athabascau.ca</website> <copyright>(C) Athabasca University</copyright> <license>GNU Public License version 2</license> <requires> <type>elgg_release</type> <version>1.10</version> </requires> <requires> <type>plugin</type> <name>widget_manager</name> <version>5.1</version> </requires> <requires> <type>priority</type> <priority>after</priority> <plugin>widget_manager</plugin> </requires> <suggests> <type>plugin</type> <name>group_tools</name> </suggests> <screenshot> <description>Tabbed Profile</description> <path>screenshots/tabbed_profile1.png</path> </screenshot> <screenshot> <description>Adding a new tab</description> <path>screenshots/tabbed_profile2.png</path> </screenshot> <screenshot> <description>An iframe profile</description> <path>screenshots/tabbed_profile3.png</path> </screenshot> <screenshot> <description>Plugin settings</description> <path>screenshots/tabbed_profile4.png</path> </screenshot></plugin_manifest>

views/default/groups/profile/layout.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
echo elgg_view('groups/profile/summary', $vars);
1414
}
1515

16-
if (group_gatekeeper(false)) {
16+
if (elgg_group_gatekeeper(false)) {
1717
echo elgg_view('groups/profile/widgets', $vars);
1818
} else {
1919
echo elgg_view('groups/profile/closed_membership', $vars);
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
2+
// overridden to fix https://github.com/ColdTrick/widget_manager/issues/62
3+
elgg.provide("elgg.widget_manager");
4+
5+
// add a custom case-insensitive Contains function for widget filter (jQuery > 1.3)
6+
jQuery.expr[':'].Contains = function(a,i,m){
7+
return jQuery(a).text().toUpperCase().indexOf(m[3].toUpperCase())>=0;
8+
};
9+
10+
elgg.widget_manager.widgets_search = function(q) {
11+
if (q === "") {
12+
$("#widget_manager_widgets_select .widget_manager_widgets_lightbox_wrapper").show();
13+
} else {
14+
$("#widget_manager_widgets_select .widget_manager_widgets_lightbox_wrapper").hide();
15+
$("#widget_manager_widgets_select .widget_manager_widgets_lightbox_wrapper:Contains('" + q + "')").show();
16+
}
17+
};
18+
19+
elgg.widget_manager.widget_add_init = function() {
20+
$(document).ajaxSuccess(function(e, xhr, settings) {
21+
if (settings.url == elgg.normalize_url('/action/widgets/add')) {
22+
// move new widget to a new position (after fixed widgets) if needed
23+
if ($(this).find('.elgg-widgets > .elgg-state-fixed').size() > 0) {
24+
$widget = $(this).find('.elgg-module-widget:first');
25+
$widget.insertAfter($(this).find('.elgg-state-fixed:last'));
26+
27+
// first item is the recently moved widget, because fixed widgets are not part of the sortable
28+
var index = $(this).find('.elgg-module-widget').index($widget);
29+
var guidString = $widget.attr('id');
30+
guidString = guidString.substr(guidString.indexOf('elgg-widget-') + "elgg-widget-".length);
31+
32+
elgg.action('widgets/move', {
33+
data: {
34+
widget_guid: guidString,
35+
column: 1,
36+
position: index
37+
}
38+
});
39+
}
40+
}
41+
});
42+
};
43+
44+
elgg.register_hook_handler('init', 'system', elgg.widget_manager.widget_add_init);

views/default/page/layouts/widgets/add_panel.php

Lines changed: 0 additions & 126 deletions
This file was deleted.

0 commit comments

Comments
 (0)