aboutsummaryrefslogtreecommitdiff
path: root/mod
diff options
context:
space:
mode:
authorBrett Profitt <brett.profitt@gmail.com>2011-09-29 18:16:03 -0700
committerBrett Profitt <brett.profitt@gmail.com>2011-09-29 18:16:03 -0700
commitbfdb9bb8a87a29038ba1ae25355684ae19678fdd (patch)
treea074e2d6bfa19c17b284c3950b4555cf584eabe2 /mod
parent7be23080f34a8f92ca1f8d49c3aa0e6ce3472f4c (diff)
parenta458ae4e0f8e5b19884860fead6e5f901b95eca4 (diff)
downloadelgg-bfdb9bb8a87a29038ba1ae25355684ae19678fdd.tar.gz
elgg-bfdb9bb8a87a29038ba1ae25355684ae19678fdd.tar.bz2
Merge branch 'master' of github.com:brettp/Elgg
Diffstat (limited to 'mod')
-rw-r--r--mod/dashboard/languages/en.php14
-rw-r--r--mod/dashboard/start.php8
-rw-r--r--mod/dashboard/views/default/widgets/group_activity/content.php36
-rw-r--r--mod/dashboard/views/default/widgets/group_activity/edit.php45
-rw-r--r--mod/developers/languages/en.php7
-rw-r--r--mod/developers/start.php14
-rw-r--r--mod/developers/views/default/admin/develop_tools/inspect.php (renamed from mod/developers/views/default/admin/developers/inspect.php)0
-rw-r--r--mod/developers/views/default/admin/develop_tools/preview.php (renamed from mod/developers/views/default/admin/developers/preview.php)0
-rw-r--r--mod/developers/views/default/js/developers/developers.php1
-rw-r--r--mod/diagnostics/languages/en.php2
-rw-r--r--mod/diagnostics/start.php2
-rw-r--r--mod/diagnostics/views/default/admin/develop_utilities/diagnostics.php (renamed from mod/diagnostics/views/default/admin/utilities/diagnostics.php)0
-rw-r--r--mod/embed/languages/en.php2
-rw-r--r--mod/embed/manifest.xml4
-rw-r--r--mod/embed/start.php37
-rw-r--r--mod/embed/views/default/embed/css.php2
-rw-r--r--mod/embed/views/default/embed/embed.php59
-rw-r--r--mod/embed/views/default/embed/item/gallery.php54
-rw-r--r--mod/embed/views/default/embed/item/list.php63
-rw-r--r--mod/embed/views/default/embed/layouts/gallery.php10
-rw-r--r--mod/embed/views/default/embed/layouts/list.php10
-rw-r--r--mod/embed/views/default/embed/upload/content.php41
-rw-r--r--mod/embed/views/default/js/embed/embed.php4
-rw-r--r--mod/embed/views/default/js/embed/inline.php26
-rw-r--r--mod/externalpages/manifest.xml2
-rw-r--r--mod/file/languages/en.php2
-rw-r--r--mod/file/pages/file/search.php5
-rw-r--r--mod/file/start.php87
-rw-r--r--mod/file/views/default/embed/file/content.php61
-rw-r--r--mod/file/views/default/embed/file_upload/content.php15
-rw-r--r--mod/garbagecollector/views/default/plugins/garbagecollector/settings.php (renamed from mod/garbagecollector/views/default/settings/garbagecollector/edit.php)0
-rw-r--r--mod/groups/actions/groups/membership/join.php4
-rw-r--r--mod/groups/lib/groups.php6
-rw-r--r--mod/groups/views/default/groups/invitationrequests.php2
-rw-r--r--mod/groups/views/default/groups/membershiprequests.php2
-rw-r--r--mod/groups/views/default/plugins/groups/settings.php (renamed from mod/groups/views/default/settings/groups/edit.php)0
-rw-r--r--mod/groups/views/default/widgets/a_users_groups/content.php2
-rw-r--r--mod/likes/actions/likes/add.php13
-rw-r--r--mod/likes/languages/en.php23
-rw-r--r--mod/likes/start.php49
-rw-r--r--mod/likes/views/default/likes/count.php9
-rw-r--r--mod/likes/views/default/likes/css.php2
-rw-r--r--mod/likes/views/default/likes/js.php2
-rw-r--r--mod/logbrowser/languages/en.php2
-rw-r--r--mod/logbrowser/start.php4
-rw-r--r--mod/logbrowser/views/default/admin/administer_utilities/logbrowser.php (renamed from mod/logbrowser/views/default/admin/utilities/logbrowser.php)4
-rw-r--r--mod/logbrowser/views/default/forms/logbrowser/refine.php53
-rw-r--r--mod/logbrowser/views/default/logbrowser/form.php76
-rw-r--r--mod/logbrowser/views/default/logbrowser/refine.php35
-rw-r--r--mod/logrotate/languages/en.php2
-rw-r--r--mod/logrotate/start.php7
-rw-r--r--mod/logrotate/views/default/plugins/logrotate/settings.php (renamed from mod/logrotate/views/default/settings/logrotate/edit.php)17
-rw-r--r--mod/messageboard/views/default/messageboard/js.php2
-rw-r--r--mod/notifications/views/default/notifications/subscriptions/forminternals.php2
-rw-r--r--mod/pages/pages/pages/edit.php6
-rw-r--r--mod/profile/views/default/profile/js.php5
-rw-r--r--mod/profile/views/default/profile/owner_block.php2
-rw-r--r--mod/reportedcontent/languages/en.php2
-rw-r--r--mod/reportedcontent/start.php2
-rw-r--r--mod/reportedcontent/views/default/admin/administer_utilities/reportedcontent.php (renamed from mod/reportedcontent/views/default/admin/utilities/reportedcontent.php)0
-rw-r--r--mod/reportedcontent/views/default/object/reported_content.php2
-rw-r--r--mod/reportedcontent/views/default/reportedcontent/admin_css.php2
-rw-r--r--mod/search/search_hooks.php6
-rw-r--r--mod/search/views/default/search/css.php4
-rw-r--r--mod/twitter_api/views/default/plugins/twitter_api/settings.php (renamed from mod/twitter_api/views/default/settings/twitter_api/edit.php)6
-rw-r--r--mod/twitter_api/views/default/plugins/twitter_api/usersettings.php (renamed from mod/twitter_api/views/default/usersettings/twitter_api/edit.php)8
66 files changed, 491 insertions, 485 deletions
diff --git a/mod/dashboard/languages/en.php b/mod/dashboard/languages/en.php
new file mode 100644
index 000000000..e1378f2f1
--- /dev/null
+++ b/mod/dashboard/languages/en.php
@@ -0,0 +1,14 @@
+<?php
+/**
+ * User dashboard languages
+ */
+
+$english = array(
+ 'dashboard:widget:group:title' => 'Group activity',
+ 'dashboard:widget:group:desc' => 'View the activity in one of your groups',
+ 'dashboard:widget:group:select' => 'Select a group',
+ 'dashboard:widget:group:noactivity' => 'There is no activity in this group',
+ 'dashboard:widget:group:noselect' => 'Edit this widget to select a group',
+);
+
+add_translation("en", $english);
diff --git a/mod/dashboard/start.php b/mod/dashboard/start.php
index 69572bd32..5635ead57 100644
--- a/mod/dashboard/start.php
+++ b/mod/dashboard/start.php
@@ -18,6 +18,14 @@ function dashboard_init() {
'section' => 'alt',
));
+ elgg_register_widget_type(
+ 'group_activity',
+ elgg_echo('dashboard:widget:group:title'),
+ elgg_echo('dashboard:widget:group:desc'),
+ 'dashboard',
+ true
+ );
+
elgg_register_plugin_hook_handler('get_list', 'default_widgets', 'dashboard_default_widgets');
}
diff --git a/mod/dashboard/views/default/widgets/group_activity/content.php b/mod/dashboard/views/default/widgets/group_activity/content.php
new file mode 100644
index 000000000..60a9b352c
--- /dev/null
+++ b/mod/dashboard/views/default/widgets/group_activity/content.php
@@ -0,0 +1,36 @@
+<?php
+/**
+ * Group activity widget
+ */
+
+$num = (int) $vars['entity']->num_display;
+$guid = $vars['entity']->group_guid;
+
+$content = '';
+
+if ($guid) {
+ $title = get_entity($guid)->name;
+ $content = "<h3>$title</h3>";
+
+ elgg_push_context('widgets');
+ $db_prefix = elgg_get_config('dbprefix');
+ $activity = elgg_list_river(array(
+ 'limit' => $num,
+ 'pagination' => false,
+ 'joins' => array("JOIN {$db_prefix}entities e1 ON e1.guid = rv.object_guid"),
+ 'wheres' => array("(e1.container_guid = $guid)"),
+ ));
+ if (!$activity) {
+ $activity = '<p>' . elgg_echo('dashboard:widget:group:noactivity') . '</p>';
+ }
+ elgg_pop_context();
+
+ $content .= $activity;
+} else {
+ // no group selected yet
+ if ($vars['entity']->canEdit()) {
+ $content = '<p>' . elgg_echo('dashboard:widget:group:noselect') . '</p>';
+ }
+}
+
+echo $content;
diff --git a/mod/dashboard/views/default/widgets/group_activity/edit.php b/mod/dashboard/views/default/widgets/group_activity/edit.php
new file mode 100644
index 000000000..4e10f6ad4
--- /dev/null
+++ b/mod/dashboard/views/default/widgets/group_activity/edit.php
@@ -0,0 +1,45 @@
+<?php
+/**
+ * Group activity widget settings
+ */
+
+// once autocomplete is working use that
+$groups = elgg_get_logged_in_user_entity()->getGroups("", 0);
+$mygroups = array();
+if (!$vars['entity']->group_guid) {
+ $mygroups[0] = '';
+}
+foreach ($groups as $group) {
+ $mygroups[$group->guid] = $group->name;
+}
+$params = array(
+ 'name' => 'params[group_guid]',
+ 'value' => $vars['entity']->group_guid,
+ 'options_values' => $mygroups,
+);
+$group_dropdown = elgg_view('input/dropdown', $params);
+?>
+<div>
+ <?php echo elgg_echo('dashboard:widget:group:select'); ?>:
+ <?php echo $group_dropdown; ?>
+</div>
+<?php
+
+// set default value for number to display
+if (!isset($vars['entity']->num_display)) {
+ $vars['entity']->num_display = 8;
+}
+
+$params = array(
+ 'name' => 'params[num_display]',
+ 'value' => $vars['entity']->num_display,
+ 'options' => array(5, 8, 10, 12, 15, 20),
+);
+$num_dropdown = elgg_view('input/dropdown', $params);
+
+?>
+<div>
+ <?php echo elgg_echo('widget:numbertodisplay'); ?>:
+ <?php echo $num_dropdown; ?>
+</div>
+
diff --git a/mod/developers/languages/en.php b/mod/developers/languages/en.php
index 42df52134..a2682363c 100644
--- a/mod/developers/languages/en.php
+++ b/mod/developers/languages/en.php
@@ -6,10 +6,11 @@
$english = array(
// menu
+ 'admin:develop_tools' => 'Tools',
+ 'admin:develop_tools:preview' => 'Theming Sandbox',
+ 'admin:develop_tools:inspect' => 'Inspect',
'admin:developers' => 'Developers',
- 'admin:developers:settings' => 'Developer Settings',
- 'admin:developers:preview' => 'Theming Preview',
- 'admin:developers:inspect' => 'Inspect',
+ 'admin:developers:settings' => 'Settings',
// settings
'elgg_dev_tools:settings:explanation' => 'Control your development and debugging settings below. Some of these settings are also available on other admin pages.',
diff --git a/mod/developers/start.php b/mod/developers/start.php
index d9e1141e0..ab9a174a4 100644
--- a/mod/developers/start.php
+++ b/mod/developers/start.php
@@ -59,9 +59,17 @@ function developers_process_settings() {
function developers_setup_menu() {
if (elgg_in_context('admin')) {
- elgg_register_admin_menu_item('develop', 'settings', 'developers');
- elgg_register_admin_menu_item('develop', 'inspect', 'developers');
- elgg_register_admin_menu_item('develop', 'preview', 'developers');
+ elgg_register_admin_menu_item('develop', 'inspect', 'develop_tools');
+ elgg_register_admin_menu_item('develop', 'preview', 'develop_tools');
+
+ elgg_register_menu_item('page', array(
+ 'name' => 'dev_settings',
+ 'href' => 'admin/developers/settings',
+ 'text' => elgg_echo('settings'),
+ 'context' => 'admin',
+ 'priority' => 10,
+ 'section' => 'develop'
+ ));
}
}
diff --git a/mod/developers/views/default/admin/developers/inspect.php b/mod/developers/views/default/admin/develop_tools/inspect.php
index cfa3de2ea..cfa3de2ea 100644
--- a/mod/developers/views/default/admin/developers/inspect.php
+++ b/mod/developers/views/default/admin/develop_tools/inspect.php
diff --git a/mod/developers/views/default/admin/developers/preview.php b/mod/developers/views/default/admin/develop_tools/preview.php
index 920047d98..920047d98 100644
--- a/mod/developers/views/default/admin/developers/preview.php
+++ b/mod/developers/views/default/admin/develop_tools/preview.php
diff --git a/mod/developers/views/default/js/developers/developers.php b/mod/developers/views/default/js/developers/developers.php
index e6c249eb1..09e6ddd12 100644
--- a/mod/developers/views/default/js/developers/developers.php
+++ b/mod/developers/views/default/js/developers/developers.php
@@ -23,6 +23,7 @@ elgg.dev.inspectSubmit = function(event) {
$("#developers-ajax-loader").show();
$(this).ajaxSubmit({
+ dataType : 'json',
success : function(response) {
if (response) {
$("#developers-inspect-results").html(response.output);
diff --git a/mod/diagnostics/languages/en.php b/mod/diagnostics/languages/en.php
index 6d71945e3..c4e337b50 100644
--- a/mod/diagnostics/languages/en.php
+++ b/mod/diagnostics/languages/en.php
@@ -7,7 +7,7 @@
$english = array(
- 'admin:utilities:diagnostics' => 'System Diagnostics',
+ 'admin:develop_utilities:diagnostics' => 'System Diagnostics',
'diagnostics' => 'System diagnostics',
'diagnostics:report' => 'Diagnostics Report',
'diagnostics:unittester' => 'Unit Tests',
diff --git a/mod/diagnostics/start.php b/mod/diagnostics/start.php
index c55b10483..735e15042 100644
--- a/mod/diagnostics/start.php
+++ b/mod/diagnostics/start.php
@@ -16,7 +16,7 @@ function diagnostics_init() {
elgg_register_page_handler('diagnostics','diagnostics_page_handler');
// Add admin menu item
- elgg_register_admin_menu_item('develop', 'diagnostics', 'utilities');
+ elgg_register_admin_menu_item('develop', 'diagnostics', 'develop_utilities');
// Register some actions
$file = elgg_get_plugins_path() . "diagnostics/actions/download.php";
diff --git a/mod/diagnostics/views/default/admin/utilities/diagnostics.php b/mod/diagnostics/views/default/admin/develop_utilities/diagnostics.php
index 76f12b0ae..76f12b0ae 100644
--- a/mod/diagnostics/views/default/admin/utilities/diagnostics.php
+++ b/mod/diagnostics/views/default/admin/develop_utilities/diagnostics.php
diff --git a/mod/embed/languages/en.php b/mod/embed/languages/en.php
index f3a49e38b..287d34ca1 100644
--- a/mod/embed/languages/en.php
+++ b/mod/embed/languages/en.php
@@ -15,6 +15,8 @@ $english = array(
// messages
'embed:no_upload_content' => 'No upload content!',
'embed:no_section_content' => 'No items found.',
+
+ 'embed:no_sections' => 'No supported embed plugins found. Ask the site administrator to enabled a plugin with embed support.',
);
add_translation("en", $english); \ No newline at end of file
diff --git a/mod/embed/manifest.xml b/mod/embed/manifest.xml
index f61d27c23..02c012330 100644
--- a/mod/embed/manifest.xml
+++ b/mod/embed/manifest.xml
@@ -13,6 +13,10 @@
<type>elgg_version</type>
<version>2010030101</version>
</requires>
+ <requires>
+ <type>plugin</type>
+ <name>file</name>
+ </requires>
<activate_on_install>true</activate_on_install>
<admin_interface>advanced</admin_interface>
</plugin_manifest>
diff --git a/mod/embed/start.php b/mod/embed/start.php
index bdd832b4e..6c26163e9 100644
--- a/mod/embed/start.php
+++ b/mod/embed/start.php
@@ -74,13 +74,34 @@ function embed_page_handler($page) {
// listing
// item
// default to embed/listing | item if not found.
- // @todo trigger for all right now. If we categorize these later we can trigger
- // for certain categories.
- $sections = elgg_trigger_plugin_hook('embed_get_sections', 'all', NULL, array());
- $upload_sections = elgg_trigger_plugin_hook('embed_get_upload_sections', 'all', NULL, array());
-
- elgg_sort_3d_array_by_value($sections, 'name');
- elgg_sort_3d_array_by_value($upload_sections, 'name');
+
+ // @todo the menu system is good for registering and sorting, but not great for
+ // displaying tabs.
+ // Pulling in the menu manually and passing it through the embed/tabs view.
+ // We should work on making it easier to use tabs through the menu system, then fix
+ // this mess.
+ $menus = get_config('menus');
+ $menu = $menus['embed:sections'];
+
+ $sections = array();
+ $upload_sections = array();
+
+ foreach ($menu as $item) {
+ switch ($item->section) {
+ case 'upload':
+ $upload_sections[$item->getName()] = array(
+ 'name' => $item->getText(),
+ );
+ break;
+
+ default:
+ $sections[$item->getName()] = array(
+ 'name' => $item->getText(),
+ );
+ break;
+ }
+ }
+
$active_section = get_input('active_section', '');
$active_section = preg_replace('[\W]', '', $active_section);
$internal_id = get_input('internal_id', '');
@@ -97,4 +118,4 @@ function embed_page_handler($page) {
// exit because this is in a modal display.
exit;
-}
+} \ No newline at end of file
diff --git a/mod/embed/views/default/embed/css.php b/mod/embed/views/default/embed/css.php
index 150dc8733..03373da2b 100644
--- a/mod/embed/views/default/embed/css.php
+++ b/mod/embed/views/default/embed/css.php
@@ -8,7 +8,7 @@
.embed-wrapper {
width: 730px;
min-height: 400px;
- margin: 5px;
+ margin: 15px;
}
.embed-wrapper h2 {
color: #333333;
diff --git a/mod/embed/views/default/embed/embed.php b/mod/embed/views/default/embed/embed.php
index 2d8de1ca4..2bd329690 100644
--- a/mod/embed/views/default/embed/embed.php
+++ b/mod/embed/views/default/embed/embed.php
@@ -12,7 +12,6 @@
$sections = elgg_extract('sections', $vars, array());
$active_section = elgg_extract('active_section', $vars, array_shift(array_keys($sections)), false);
$upload_sections = elgg_extract('upload_sections', $vars, array());
-$internal_id = elgg_extract('internal_id', $vars);
if (!$sections) {
$content = elgg_echo('embed:no_sections');
@@ -23,57 +22,17 @@ if (!$sections) {
$offset = (int)max(0, get_input('offset', 0));
$limit = (int)get_input('limit', 5);
- // build the items and layout.
- if ($active_section == 'upload' || array_key_exists($active_section, $sections)) {
- $section_info = $sections[$active_section];
- $layout = isset($section_info['layout']) ? $section_info['layout'] : 'list';
-
- $params = array(
- 'offset' => $offset,
- 'limit' => $limit,
- 'section' => $active_section,
- 'upload_sections' => $upload_sections,
- 'internal_id' => $internal_id
- );
-
- // allow full override for this section
- // check for standard hook
- if ($section_content = elgg_view("embed/$active_section/content", $params)) {
- // handles its own pagination
- $content .= $section_content;
- } else {
- // see if anyone has any items to display for the active section
- $result = array('items' => array(), 'count' => 0);
- $embed_info = elgg_trigger_plugin_hook('embed_get_items', $active_section, $params, $result);
+ // find the view to display
+ // @todo make it so you don't have to manually create views for each page
+ $view = "embed/$active_section/content";
+
+ $section_content = elgg_view($view, $vars);
- // do we use default view or has someone defined "embed/$active_section/item/$layout"
- $view = "embed/$active_section/item/$layout";
- if (!elgg_view_exists($view)) {
- $view = "embed/item/$layout";
- }
-
- if (!isset($embed_info['items']) || !is_array($embed_info['items']) || !count($embed_info['items'])) {
- $content .= elgg_echo('embed:no_section_content');
- } else {
-
- elgg_push_context('widgets');
- $content .= elgg_view_entity_list($embed_info['items'], array(
- 'full_view' => false,
- 'count' => $embed_info['count'],
- 'pagination' => true,
- 'position' => 'before',
- 'offset' => $offset,
- 'limit' => $limit,
- ));
- elgg_pop_context();
-
- $js = elgg_view('js/embed/inline', array(
- 'items' => $embed_info['items'],
- ));
- }
- }
+ // build the items and layout.
+ if ($section_content) {
+ $content .= $section_content;
} else {
- $content .= elgg_echo('embed:invalid_section');
+ $content .= elgg_echo('embed:no_section_content');
}
}
diff --git a/mod/embed/views/default/embed/item/gallery.php b/mod/embed/views/default/embed/item/gallery.php
deleted file mode 100644
index daee8ee94..000000000
--- a/mod/embed/views/default/embed/item/gallery.php
+++ /dev/null
@@ -1,54 +0,0 @@
-<?php
-/**
- * Default item view for embed items in gallery display.
- *
- * Why don't we recycle the view/type/subtype views?
- * Because we need to have special JavaScript that fires when you click on
- * the icon / title.
- *
- * @todo Yes this is copy and pasted. Pete needs to theme. I'll DRY it up later.
- *
- * @uses object $vars['item'] The item to display
- * @return string A formatted item
- */
-
-$item = $vars['item'];
-$section = $vars['section'];
-$target = $vars['target'];
-$ecml_keyword = (isset($vars['ecml_enabled']) && isset($vars['ecml_keyword'])) ? $vars['ecml_keyword'] : NULL;
-$icon_size = $vars['icon_size'];
-
-// @todo add entity checking.
-
-// different entity types have different title attribute names.
-$title = isset($item->name) ? $item->name : $item->title;
-// don't let it be too long
-$title = elgg_get_excerpt($title);
-
-// @todo you can disable plugins that are required by other plugins
-// (embed requires ecml) so fallback to a hard-coded check to see if ecml is enabled.
-// #grumble
-if ($ecml_keyword) {
- $embed_code = "[$ecml_keyword guid={$item->getGUID()}]";
-} else {
- // fallback to inserting a hard link to the object with its icon
- $icon = "<img src=\"{$item->getIcon($icon_size)}\" />" . htmlentities($title, ENT_QUOTES, 'UTF-8');
-
- $embed_code = elgg_view('output/url', array(
- 'href' => $item->getURL(),
- 'title' => $title,
- 'text' => $title,
- 'encode_text' => FALSE
- ));
-}
-
-$icon = "<img src=\"{$item->getIcon($icon_size)}\" />";
-$info = htmlentities($title, ENT_QUOTES, 'UTF-8');
-
-$listing = elgg_view('entities/gallery_listing', array('icon' => $icon, 'info' => $info));
-
-// @todo JS 1.8: no
-echo "<div class=\"embed_data\" id=\"embed_{$item->getGUID()}\">$listing</div>";
-echo "<script type=\"text/javascript\">
- $('#embed_{$item->getGUID()}').data('embed_code', " . json_encode($embed_code) . ");
-</script>"; \ No newline at end of file
diff --git a/mod/embed/views/default/embed/item/list.php b/mod/embed/views/default/embed/item/list.php
deleted file mode 100644
index 89a2ffb63..000000000
--- a/mod/embed/views/default/embed/item/list.php
+++ /dev/null
@@ -1,63 +0,0 @@
-<?php
-/**
- * Default item view for embed items in list display.
- *
- * Why don't we recycle the view/type/subtype views?
- * Because we need to have special JavaScript that fires when you click on
- * the icon / title.
- *
- * @uses object $vars['item'] The item to display
- * @return string A formatted item
- */
-
-$item = $vars['item'];
-$section = $vars['section'];
-$target = $vars['target'];
-$ecml_keyword = (isset($vars['ecml_enabled']) && $vars['ecml_enabled'] && isset($vars['ecml_keyword'])) ? $vars['ecml_keyword'] : NULL;
-$icon_size = $vars['icon_size'];
-$owner = $item->getOwnerEntity();
-
-// @todo add entity checking.
-
-// different entity types have different title attribute names.
-$title = isset($item->name) ? $item->name : $item->title;
-// don't let it be too long
-$title = elgg_get_excerpt($title);
-
-$author_text = elgg_echo('byline', array($owner->name));
-$date = elgg_view_friendly_time($item->time_created);
-
-$subtitle = "$author_text $date";
-
-// @todo you can disable plugins that are required by other plugins
-// (embed requires ecml) so fallback to a hard-coded check to see if ecml is enabled.
-// #grumble
-if ($ecml_keyword) {
- $embed_code = "[$ecml_keyword guid={$item->getGUID()}]";
-} else {
- // fallback to inserting a hard link to the object with its icon
- $icon = "<img src=\"{$item->getIcon($icon_size)}\" />" . htmlentities($title, ENT_QUOTES, 'UTF-8');
-
- $embed_code = elgg_view('output/url', array(
- 'href' => $item->getURL(),
- 'title' => $title,
- 'text' => $icon,
- 'encode_text' => FALSE
- ));
-}
-
-$item_icon = elgg_view_entity_icon($item, $icon_size);
-
-$params = array(
- 'title' => $title,
- 'entity' => $item,
- 'subtitle' => $subtitle,
- 'tags' => FALSE,
-);
-$list_body = elgg_view('object/elements/summary', $params);
-
-// @todo JS 1.8: is this approach better than inline js?
-echo "<div class=\"embed_data\" id=\"embed_{$item->getGUID()}\">" . elgg_view_image_block($item_icon, $list_body) . '</div>';
-echo "<script type=\"text/javascript\">
- $('#embed_{$item->getGUID()}').data('embed_code', " . json_encode($embed_code) . ");
-</script>"; \ No newline at end of file
diff --git a/mod/embed/views/default/embed/layouts/gallery.php b/mod/embed/views/default/embed/layouts/gallery.php
deleted file mode 100644
index 70b6d33a5..000000000
--- a/mod/embed/views/default/embed/layouts/gallery.php
+++ /dev/null
@@ -1,10 +0,0 @@
-<?php
-/**
- * Embed - Gallery items
- *
- * @uses string $vars['content'] Pre-formatted content.
- *
- */
-$active_section = elgg_extract('section', $vars, array());
-
-echo "<div class='embed_modal_$active_section'>" . elgg_extract('content', $vars, '') . "</div>";
diff --git a/mod/embed/views/default/embed/layouts/list.php b/mod/embed/views/default/embed/layouts/list.php
deleted file mode 100644
index 5d62e572b..000000000
--- a/mod/embed/views/default/embed/layouts/list.php
+++ /dev/null
@@ -1,10 +0,0 @@
-<?php
-/**
- * Embed - List items
- *
- * @uses string $vars['content'] Pre-formatted content.
- *
- */
-$active_section = elgg_extract('section', $vars, array());
-
-echo "<div class='embed_modal_$active_section'>" . elgg_extract('content', $vars, '') . "</div>"; \ No newline at end of file
diff --git a/mod/embed/views/default/embed/upload/content.php b/mod/embed/views/default/embed/upload/content.php
deleted file mode 100644
index 8bedf5ad1..000000000
--- a/mod/embed/views/default/embed/upload/content.php
+++ /dev/null
@@ -1,41 +0,0 @@
-<?php
-/**
- * Special upload form
- */
-$upload_sections = elgg_extract('upload_sections', $vars, array());
-$active_section = get_input('active_upload_section', array_shift(array_keys($upload_sections)));
-$active_section = preg_replace('[\W]', '', $active_section);
-
-$options = array();
-
-if ($upload_sections) {
- foreach ($upload_sections as $id => $info) {
- $options[$id] = $info['name'];
- }
-
- $input = elgg_view('input/dropdown', array(
- 'name' => 'download_section',
- 'options_values' => $options,
- 'id' => 'embed_upload',
- 'value' => $active_section
- ));
-
- // hack this in for now as we clean up this mess
- $form_vars = array(
- 'enctype' => 'multipart/form-data',
- 'class' => 'elgg-form',
- );
- $upload_content = elgg_view_form('file/upload', $form_vars);
-/*
- if (!$upload_content = elgg_view($upload_sections[$active_section]['view'])) {
- $upload_content = elgg_echo('embed:no_upload_content');
- }
-*/
- echo "<div class='mbm'>" . elgg_echo('embed:upload_type') . "$input</div>";
- echo "<div class='embed-upload'>";
- echo $upload_content;
- echo "</div>";
-
-} else {
- echo elgg_echo('embed:no_upload_sections');
-}
diff --git a/mod/embed/views/default/js/embed/embed.php b/mod/embed/views/default/js/embed/embed.php
index ea92ba1fd..e9e08f9a0 100644
--- a/mod/embed/views/default/js/embed/embed.php
+++ b/mod/embed/views/default/js/embed/embed.php
@@ -1,9 +1,10 @@
+//<script>
elgg.provide('elgg.embed');
elgg.embed.init = function() {
// inserts the embed content into the textarea
- $(".embed-wrapper .elgg-item").live('click', elgg.embed.insert);
+ $(".embed_data").live('click', elgg.embed.insert);
// caches the current textarea id
$(".embed-control").live('click', function() {
@@ -30,7 +31,6 @@ elgg.embed.init = function() {
* @return void
*/
elgg.embed.insert = function(event) {
-
var textAreaId = elgg.embed.textAreaId;
var content = $(this).data('embed_code');
diff --git a/mod/embed/views/default/js/embed/inline.php b/mod/embed/views/default/js/embed/inline.php
deleted file mode 100644
index 0672a68f8..000000000
--- a/mod/embed/views/default/js/embed/inline.php
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
-/**
- * Inline embed JavaScript for attaching the insert data to list items
- *
- * @uses $vars['items']
- */
-
-foreach ($vars['items'] as $item) {
-
- // different entity types have different title attribute names.
- $title = isset($item->name) ? $item->name : $item->title;
- // don't let it be too long
- $title = elgg_get_excerpt($title);
-
- $icon = "<img src=\"{$item->getIcon($icon_size)}\" />" . htmlspecialchars($title, ENT_QUOTES, 'UTF-8', false);
-
- $embed_code = elgg_view('output/url', array(
- 'href' => $item->getURL(),
- 'title' => $title,
- 'text' => $icon,
- 'encode_text' => false,
- ));
- $embed_code = json_encode($embed_code);
-
- echo "$('#elgg-object-{$item->getGUID()}').data('embed_code', $embed_code);";
-} \ No newline at end of file
diff --git a/mod/externalpages/manifest.xml b/mod/externalpages/manifest.xml
index 453cef259..32528585d 100644
--- a/mod/externalpages/manifest.xml
+++ b/mod/externalpages/manifest.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<plugin_manifest xmlns="http://www.elgg.org/plugin_manifest/1.8">
- <name>External Pages</name>
+ <name>Site Pages</name>
<author>Core developers</author>
<version>1.8</version>
<category>bundled</category>
diff --git a/mod/file/languages/en.php b/mod/file/languages/en.php
index 72b198d54..aa30084a9 100644
--- a/mod/file/languages/en.php
+++ b/mod/file/languages/en.php
@@ -75,6 +75,8 @@ $english = array(
'item:object:file' => 'Files',
+ 'file:newupload' => 'A new file has been uploaded',
+
/**
* Embed media
**/
diff --git a/mod/file/pages/file/search.php b/mod/file/pages/file/search.php
index 3e85d45db..402a28933 100644
--- a/mod/file/pages/file/search.php
+++ b/mod/file/pages/file/search.php
@@ -6,6 +6,11 @@
*/
$page_owner_guid = get_input('page_owner', null);
+
+if ($page_owner_guid !== null) {
+ $page_owner_guid = sanitise_int($page_owner_guid);
+}
+
if ($page_owner_guid) {
elgg_set_page_owner_guid($page_owner_guid);
}
diff --git a/mod/file/start.php b/mod/file/start.php
index b94dc309a..749d7a519 100644
--- a/mod/file/start.php
+++ b/mod/file/start.php
@@ -57,11 +57,23 @@ function file_init() {
// temporary - see #2010
elgg_register_action("file/download", "$action_path/download.php");
-
// embed support
- elgg_register_plugin_hook_handler('embed_get_sections', 'all', 'file_embed_get_sections');
- elgg_register_plugin_hook_handler('embed_get_items', 'file', 'file_embed_get_items');
- elgg_register_plugin_hook_handler('embed_get_upload_sections', 'all', 'file_embed_get_upload_sections');
+ $item = ElggMenuItem::factory(array(
+ 'name' => 'file',
+ 'text' => elgg_echo('file'),
+ 'href' => '#',
+ 'section' => 'select'
+ ));
+ elgg_register_menu_item('embed:sections', $item);
+
+ $item = ElggMenuItem::factory(array(
+ 'name' => 'file_upload',
+ 'text' => elgg_echo('file:upload'),
+ 'href' => '#',
+ 'section' => 'upload'
+ ));
+
+ elgg_register_menu_item('embed:sections', $item);
}
/**
@@ -332,69 +344,4 @@ function file_icon_url_override($hook, $type, $returnvalue, $params) {
$url = elgg_trigger_plugin_hook('file:icon:url', 'override', $params, $url);
return $url;
}
-}
-
-/**
- * Register file as an embed type.
- *
- * @param unknown_type $hook
- * @param unknown_type $type
- * @param unknown_type $value
- * @param unknown_type $params
- */
-function file_embed_get_sections($hook, $type, $value, $params) {
- $value['file'] = array(
- 'name' => elgg_echo('file'),
- 'layout' => 'list',
- 'icon_size' => 'small',
- );
-
- return $value;
-}
-
-/**
- * Return a list of files for embedding
- *
- * @param unknown_type $hook
- * @param unknown_type $type
- * @param unknown_type $value
- * @param unknown_type $params
- */
-function file_embed_get_items($hook, $type, $value, $params) {
- $options = array(
- 'owner_guid' => elgg_get_logged_in_user_guid(),
- 'type_subtype_pair' => array('object' => 'file'),
- 'count' => TRUE
- );
-
- if ($count = elgg_get_entities($options)) {
- $value['count'] += $count;
-
- unset($options['count']);
- $options['offset'] = $params['offset'];
- $options['limit'] = $params['limit'];
-
- $items = elgg_get_entities($options);
-
- $value['items'] = array_merge($items, $value['items']);
- }
-
- return $value;
-}
-
-/**
- * Register file as an embed type.
- *
- * @param unknown_type $hook
- * @param unknown_type $type
- * @param unknown_type $value
- * @param unknown_type $params
- */
-function file_embed_get_upload_sections($hook, $type, $value, $params) {
- $value['file'] = array(
- 'name' => elgg_echo('file'),
- 'view' => 'file/embed_upload'
- );
-
- return $value;
-}
+} \ No newline at end of file
diff --git a/mod/file/views/default/embed/file/content.php b/mod/file/views/default/embed/file/content.php
new file mode 100644
index 000000000..eadcd1a6d
--- /dev/null
+++ b/mod/file/views/default/embed/file/content.php
@@ -0,0 +1,61 @@
+<?php
+/**
+ * List files available for upload
+ */
+
+$active_section = elgg_extract('active_section', $vars);
+
+$options = array(
+ 'owner_guid' => elgg_get_logged_in_user_guid(),
+ 'type_subtype_pair' => array('object' => 'file'),
+ 'count' => true
+);
+
+$count = elgg_get_entities($options);
+
+if ($count) {
+ echo "<div class='embed_modal_$active_section'>";
+
+ unset($options['count']);
+ $items = elgg_get_entities($options);
+
+ foreach ($items as $item) {
+
+ // different entity types have different title attribute names.
+ $title = isset($item->name) ? $item->name : $item->title;
+ // don't let it be too long
+ $title = elgg_get_excerpt($title);
+
+ $author_text = elgg_echo('byline', array($owner->name));
+ $date = elgg_view_friendly_time($item->time_created);
+
+ $subtitle = "$author_text $date";
+
+ $icon = "<img src=\"{$item->getIconURL($icon_size)}\" />";
+
+ $embed_code = elgg_view('output/url', array(
+ 'href' => $item->getURL(),
+ 'title' => $title,
+ 'text' => $icon,
+ 'encode_text' => FALSE
+ ));
+
+ $item_icon = elgg_view_entity_icon($item, $icon_size);
+
+ $params = array(
+ 'title' => $title,
+ 'entity' => $item,
+ 'subtitle' => $subtitle,
+ 'tags' => FALSE,
+ );
+ $list_body = elgg_view('object/elements/summary', $params);
+
+ // @todo JS 1.8: is this approach better than inline js?
+ echo "<div class=\"embed_data\" id=\"embed_{$item->getGUID()}\">" . elgg_view_image_block($item_icon, $list_body) . '</div>';
+ echo "<script type=\"text/javascript\">
+ $('#embed_{$item->getGUID()}').data('embed_code', " . json_encode($embed_code) . ");
+ </script>";
+ }
+
+ echo '</div>';
+} \ No newline at end of file
diff --git a/mod/file/views/default/embed/file_upload/content.php b/mod/file/views/default/embed/file_upload/content.php
new file mode 100644
index 000000000..13c18f745
--- /dev/null
+++ b/mod/file/views/default/embed/file_upload/content.php
@@ -0,0 +1,15 @@
+<?php
+/**
+ * Upload a file through the embed interface
+ */
+
+$form_vars = array(
+ 'enctype' => 'multipart/form-data',
+ 'class' => 'elgg-form',
+);
+$upload_content = elgg_view_form('file/upload', $form_vars);
+
+echo "<div class='mbm'>" . elgg_echo('embed:upload_type') . "$input</div>";
+echo "<div class='embed-upload'>";
+echo $upload_content;
+echo "</div>"; \ No newline at end of file
diff --git a/mod/garbagecollector/views/default/settings/garbagecollector/edit.php b/mod/garbagecollector/views/default/plugins/garbagecollector/settings.php
index 3ade780f9..3ade780f9 100644
--- a/mod/garbagecollector/views/default/settings/garbagecollector/edit.php
+++ b/mod/garbagecollector/views/default/plugins/garbagecollector/settings.php
diff --git a/mod/groups/actions/groups/membership/join.php b/mod/groups/actions/groups/membership/join.php
index 210e285a5..b4f4e280c 100644
--- a/mod/groups/actions/groups/membership/join.php
+++ b/mod/groups/actions/groups/membership/join.php
@@ -10,6 +10,8 @@
* @package ElggGroups
*/
+global $CONFIG;
+
$user_guid = get_input('user_guid', elgg_get_logged_in_user_guid());
$group_guid = get_input('group_guid');
@@ -45,7 +47,7 @@ if (($user instanceof ElggUser) && ($group instanceof ElggGroup)) {
add_entity_relationship($user->guid, 'membership_request', $group->guid);
// Notify group owner
- $url = "{$CONFIG->url}mod/groups/membershipreq.php?group_guid={$group->guid}";
+ $url = "{$CONFIG->url}groups/requests/$group->guid";
$subject = elgg_echo('groups:request:subject', array(
$user->name,
$group->name,
diff --git a/mod/groups/lib/groups.php b/mod/groups/lib/groups.php
index 12a22deb4..86e6f018e 100644
--- a/mod/groups/lib/groups.php
+++ b/mod/groups/lib/groups.php
@@ -17,7 +17,7 @@ function groups_handle_all_page() {
$selected_tab = get_input('filter', 'newest');
switch ($selected_tab) {
- case 'pop':
+ case 'popular':
$content = elgg_list_entities_from_relationship_count(array(
'type' => 'group',
'relationship' => 'member',
@@ -25,7 +25,7 @@ function groups_handle_all_page() {
'full_view' => false,
));
break;
- case 'active':
+ case 'discussion':
$content = elgg_list_entities(array(
'type' => 'object',
'subtype' => 'groupforumtopic',
@@ -198,7 +198,7 @@ function groups_handle_invitations_page() {
elgg_push_breadcrumb($title);
// @todo temporary workaround for exts #287.
- $invitations = groups_get_invited_groups($user->getGUID());
+ $invitations = groups_get_invited_groups(elgg_get_logged_in_user_guid());
$content = elgg_view('groups/invitationrequests', array('invitations' => $invitations));
$params = array(
diff --git a/mod/groups/views/default/groups/invitationrequests.php b/mod/groups/views/default/groups/invitationrequests.php
index 788788324..9c2df8b9c 100644
--- a/mod/groups/views/default/groups/invitationrequests.php
+++ b/mod/groups/views/default/groups/invitationrequests.php
@@ -10,7 +10,7 @@ if (!empty($vars['invitations']) && is_array($vars['invitations'])) {
echo '<ul class="elgg-list">';
foreach ($vars['invitations'] as $group) {
if ($group instanceof ElggGroup) {
- $icon = elgg_view_entity_icon($group, 'tiny', array('override' => 'true'));
+ $icon = elgg_view_entity_icon($group, 'tiny', array('hover' => 'true'));
$group_title = elgg_view('output/url', array(
'href' => $group->getURL(),
diff --git a/mod/groups/views/default/groups/membershiprequests.php b/mod/groups/views/default/groups/membershiprequests.php
index 4d1c78c8c..7f33b83e0 100644
--- a/mod/groups/views/default/groups/membershiprequests.php
+++ b/mod/groups/views/default/groups/membershiprequests.php
@@ -11,7 +11,7 @@ if (!empty($vars['requests']) && is_array($vars['requests'])) {
echo '<ul class="elgg-list">';
foreach ($vars['requests'] as $user) {
if ($user instanceof ElggUser) {
- $icon = elgg_view_entity_icon($user, 'tiny', array('override' => 'true'));
+ $icon = elgg_view_entity_icon($user, 'tiny', array('hover' => 'true'));
$user_title = elgg_view('output/url', array(
'href' => $user->getURL(),
diff --git a/mod/groups/views/default/settings/groups/edit.php b/mod/groups/views/default/plugins/groups/settings.php
index 7197dcb37..7197dcb37 100644
--- a/mod/groups/views/default/settings/groups/edit.php
+++ b/mod/groups/views/default/plugins/groups/settings.php
diff --git a/mod/groups/views/default/widgets/a_users_groups/content.php b/mod/groups/views/default/widgets/a_users_groups/content.php
index 81d355442..114fd7565 100644
--- a/mod/groups/views/default/widgets/a_users_groups/content.php
+++ b/mod/groups/views/default/widgets/a_users_groups/content.php
@@ -21,7 +21,7 @@ $content = elgg_list_entities_from_relationship($options);
echo $content;
if ($content) {
- $url = "group/member/" . elgg_get_page_owner_entity()->username;
+ $url = "groups/member/" . elgg_get_page_owner_entity()->username;
$more_link = elgg_view('output/url', array(
'href' => $url,
'text' => elgg_echo('groups:more'),
diff --git a/mod/likes/actions/likes/add.php b/mod/likes/actions/likes/add.php
index b76c1bea9..a6a8d6c45 100644
--- a/mod/likes/actions/likes/add.php
+++ b/mod/likes/actions/likes/add.php
@@ -41,18 +41,7 @@ if (!$annotation) {
// notify if poster wasn't owner
if ($entity->owner_guid != $user->guid) {
- notify_user($entity->owner_guid,
- $user->guid,
- elgg_echo('likes:email:subject'),
- elgg_echo('likes:email:body', array(
- $user->name,
- $entity->title,
- //$comment_text,
- $entity->getURL(),
- $user->name,
- $user->getURL()
- ))
- );
+ likes_notify_user($entity->getOwnerEntity(), $user, $entity);
}
system_message(elgg_echo("likes:likes"));
diff --git a/mod/likes/languages/en.php b/mod/likes/languages/en.php
index aad2a7f24..29b379506 100644
--- a/mod/likes/languages/en.php
+++ b/mod/likes/languages/en.php
@@ -17,9 +17,28 @@ $english = array(
'likes:userlikedthis' => '%s like',
'likes:userslikedthis' => '%s likes',
'likes:river:annotate' => 'likes',
- 'likes:email:body' => '%s liked %s',
- 'likes:email:subject' => 'A user liked one of your objects',
+
'river:likes' => 'likes %s %s',
+
+ // notifications. yikes.
+ 'likes:notifications:subject' => '%s likes your post "%s"',
+ 'likes:notifications:body' =>
+'Hi %1$s,
+
+%2$s likes your post "%3$s" on %4$s!
+
+See your original post here:
+
+%5$s
+
+or view %2$s\'s profile here:
+
+%6$s
+
+Thanks,
+%4$s
+',
+
);
add_translation('en', $english);
diff --git a/mod/likes/start.php b/mod/likes/start.php
index d45fb96b3..76b48a369 100644
--- a/mod/likes/start.php
+++ b/mod/likes/start.php
@@ -109,3 +109,52 @@ function likes_count($entity) {
return $entity->countAnnotations('likes');
}
}
+
+/**
+ * Notify $user that $liker liked his $entity.
+ *
+ * @param type $user
+ * @param type $liker
+ * @param type $entity
+ */
+function likes_notify_user(ElggUser $user, ElggUser $liker, ElggEntity $entity) {
+
+ if (!$user instanceof ElggUser) {
+ return false;
+ }
+
+ if (!$liker instanceof ElggUser) {
+ return false;
+ }
+
+ if (!$entity instanceof ElggEntity) {
+ return false;
+ }
+
+ $title_str = $entity->title;
+ if (!$title_str) {
+ $title_str = elgg_get_excerpt($entity->description);
+ }
+
+ $site = get_config('site');
+
+ $subject = elgg_echo('likes:notifications:subject', array(
+ $liker->name,
+ $title_str
+ ));
+
+ $body = elgg_echo('likes:notifications:body', array(
+ $user->name,
+ $liker->name,
+ $title_str,
+ $site->name,
+ $entity->getURL(),
+ $liker->getURL()
+ ));
+
+ notify_user($user->guid,
+ $liker->guid,
+ $subject,
+ $body
+ );
+} \ No newline at end of file
diff --git a/mod/likes/views/default/likes/count.php b/mod/likes/views/default/likes/count.php
index bdc50bcd1..071a069bd 100644
--- a/mod/likes/views/default/likes/count.php
+++ b/mod/likes/views/default/likes/count.php
@@ -24,8 +24,13 @@ if ($num_of_likes) {
'href' => "#likes-$guid"
);
$list = elgg_view('output/url', $params);
- $list .= "<div class='elgg-module elgg-module-popup elgg-likes-list hidden clearfix' id='likes-$guid'>";
- $list .= elgg_list_annotations(array('guid' => $guid, 'annotation_name' => 'likes', 'limit' => 99));
+ $list .= "<div class='elgg-module elgg-module-popup elgg-likes hidden clearfix' id='likes-$guid'>";
+ $list .= elgg_list_annotations(array(
+ 'guid' => $guid,
+ 'annotation_name' => 'likes',
+ 'limit' => 99,
+ 'list_class' => 'elgg-list-likes'
+ ));
$list .= "</div>";
echo $list;
}
diff --git a/mod/likes/views/default/likes/css.php b/mod/likes/views/default/likes/css.php
index fabf54e46..1ec07b366 100644
--- a/mod/likes/views/default/likes/css.php
+++ b/mod/likes/views/default/likes/css.php
@@ -7,7 +7,7 @@
/* ***************************************
Likes
*************************************** */
-.elgg-likes-list {
+.elgg-likes {
width: 345px;
position: absolute;
}
diff --git a/mod/likes/views/default/likes/js.php b/mod/likes/views/default/likes/js.php
index b7e000539..f701ebedf 100644
--- a/mod/likes/views/default/likes/js.php
+++ b/mod/likes/views/default/likes/js.php
@@ -15,7 +15,7 @@
* @return {Object}
*/
elgg.ui.likesPopupHandler = function(hook, type, params, options) {
- if (params.target.hasClass('elgg-likes-list')) {
+ if (params.target.hasClass('elgg-likes')) {
options.my = 'right bottom';
options.at = 'left top';
return options;
diff --git a/mod/logbrowser/languages/en.php b/mod/logbrowser/languages/en.php
index 90689a1b0..3b6ead272 100644
--- a/mod/logbrowser/languages/en.php
+++ b/mod/logbrowser/languages/en.php
@@ -6,7 +6,7 @@
*/
$english = array(
- 'admin:utilities:logbrowser' => 'Log browser',
+ 'admin:administer_utilities:logbrowser' => 'Log browser',
'logbrowser' => 'Log browser',
'logbrowser:browse' => 'Browse system log',
'logbrowser:search' => 'Refine results',
diff --git a/mod/logbrowser/start.php b/mod/logbrowser/start.php
index eedc9d8ad..3bffe800a 100644
--- a/mod/logbrowser/start.php
+++ b/mod/logbrowser/start.php
@@ -14,7 +14,7 @@ function logbrowser_init() {
elgg_register_plugin_hook_handler('register', 'menu:user_hover', 'logbrowser_user_hover_menu');
- elgg_register_admin_menu_item('administer', 'logbrowser', 'utilities');
+ elgg_register_admin_menu_item('administer', 'logbrowser', 'administer_utilities');
}
/**
@@ -23,7 +23,7 @@ function logbrowser_init() {
function logbrowser_user_hover_menu($hook, $type, $return, $params) {
$user = $params['entity'];
- $url = "admin/overview/logbrowser?user_guid={$user->guid}";
+ $url = "admin/utilities/logbrowser?user_guid={$user->guid}";
$item = new ElggMenuItem('logbrowser', elgg_echo('logbrowser:explore'), $url);
$item->setSection('admin');
$return[] = $item;
diff --git a/mod/logbrowser/views/default/admin/utilities/logbrowser.php b/mod/logbrowser/views/default/admin/administer_utilities/logbrowser.php
index dadc6cda3..2be1f33dc 100644
--- a/mod/logbrowser/views/default/admin/utilities/logbrowser.php
+++ b/mod/logbrowser/views/default/admin/administer_utilities/logbrowser.php
@@ -34,7 +34,7 @@ if ($timeupper) {
$timeupper = strtotime($timeupper);
}
-$form = elgg_view('logbrowser/form', array(
+$refine = elgg_view('logbrowser/refine', array(
'user_guid' => $user,
'timeupper' => $timeupper,
'timelower' => $timelower,
@@ -54,7 +54,7 @@ $nav = elgg_view('navigation/pagination',array(
// display admin body
$body = <<<__HTML
-$form
+$refine
$nav
$table
$nav
diff --git a/mod/logbrowser/views/default/forms/logbrowser/refine.php b/mod/logbrowser/views/default/forms/logbrowser/refine.php
new file mode 100644
index 000000000..ff3f48b03
--- /dev/null
+++ b/mod/logbrowser/views/default/forms/logbrowser/refine.php
@@ -0,0 +1,53 @@
+<?php
+/**
+ * Form body for refining the log browser search.
+ * Look for a particular person or in a time window.
+ *
+ * @uses $vars['user_guid']
+ * @uses $vars['timelower']
+ * @uses $vars['timeupper']
+ */
+
+if (isset($vars['timelower'])) {
+ $lowerval = date('r',$vars['timelower']);
+} else {
+ $lowerval = "";
+}
+if (isset($vars['timeupper'])) {
+ $upperval = date('r',$vars['timeupper']);
+} else {
+ $upperval = "";
+}
+if (isset($vars['user_guid'])) {
+ if ($user = get_entity($vars['user_guid'])) {
+ $userval = $user->username;
+ }
+} else {
+ $userval = "";
+}
+
+
+$form = "<div>" . elgg_echo('logbrowser:user');
+$form .= elgg_view('input/text', array(
+ 'name' => 'search_username',
+ 'value' => $userval,
+)) . "</div>";
+
+$form .= "<div>" . elgg_echo('logbrowser:starttime');
+$form .= elgg_view('input/text', array(
+ 'name' => 'timelower',
+ 'value' => $lowerval,
+)) . "</div>";
+
+$form .= "<div>" . elgg_echo('logbrowser:endtime');
+$form .= elgg_view('input/text', array(
+ 'name' => 'timeupper',
+ 'value' => $upperval,
+)) . "</div>";
+$form .= '<div class="elgg-foot">';
+$form .= elgg_view('input/submit', array(
+ 'value' => elgg_echo('search'),
+));
+$form .= '</div>';
+
+echo $form;
diff --git a/mod/logbrowser/views/default/logbrowser/form.php b/mod/logbrowser/views/default/logbrowser/form.php
deleted file mode 100644
index d5cf9f6b8..000000000
--- a/mod/logbrowser/views/default/logbrowser/form.php
+++ /dev/null
@@ -1,76 +0,0 @@
-<?php
-/**
- * Log browser search form
- *
- * @package ElggLogBrowser
- */
-?>
-
-<div id="logbrowser-search-area">
-<?php
-
- if ($vars['timelower']) {
- $lowerval = date('r',$vars['timelower']);
- } else {
- $lowerval = "";
- }
- if ($vars['timeupper']) {
- $upperval = date('r',$vars['timeupper']);
- } else {
- $upperval = "";
- }
- if ($vars['user_guid']) {
- if ($user = get_entity($vars['user_guid']))
- $userval = $user->username;
- } else {
- $userval = "";
- }
-
-
- $form = "<p>" . elgg_echo('logbrowser:user');
- $form .= elgg_view('input/text', array(
- 'name' => 'search_username',
- 'value' => $userval,
- )) . "</p>";
-
- $form .= "<p>" . elgg_echo('logbrowser:starttime');
- $form .= elgg_view('input/text', array(
- 'name' => 'timelower',
- 'value' => $lowerval,
- )) . "</p>";
-
- $form .= "<p>" . elgg_echo('logbrowser:endtime');
- $form .= elgg_view('input/text', array(
- 'name' => 'timeupper',
- 'value' => $upperval,
- )) . "</p>";
- $form .= elgg_view('input/submit', array(
- 'value' => elgg_echo('search'),
- ));
-
- //@todo Forms 1.8: Convert to use elgg_view_form()
- $wrappedform = elgg_view('input/form', array(
- 'body' => $form,
- 'method' => 'get',
- 'action' => "admin/overview/logbrowser",
- 'disable_security' => true,
- ));
-
- $toggle_link = elgg_view('output/url', array(
- 'href' => '#log-browser-search-form',
- 'text' => elgg_echo('logbrowser:search'),
- 'rel' => 'toggle',
- ));
-?>
- <p>
- <?php echo $toggle_link; ?>
- </p>
- <div id="log-browser-search-form" class="elgg-module elgg-module-inline hidden">
- <div class="elgg-head">
- <h3><?php echo elgg_echo('logbrowser:search'); ?></h3>
- </div>
- <div class="elgg-body">
- <?php echo $wrappedform; ?>
- </div>
- </div>
-</div> \ No newline at end of file
diff --git a/mod/logbrowser/views/default/logbrowser/refine.php b/mod/logbrowser/views/default/logbrowser/refine.php
new file mode 100644
index 000000000..27cb6042f
--- /dev/null
+++ b/mod/logbrowser/views/default/logbrowser/refine.php
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Log browser search form
+ *
+ * @package ElggLogBrowser
+ */
+
+$form_vars = array(
+ 'method' => 'get',
+ 'action' => 'admin/administer_utilities/logbrowser',
+ 'disable_security' => true,
+);
+$form = elgg_view_form('logbrowser/refine', $form_vars, $vars);
+
+$toggle_link = elgg_view('output/url', array(
+ 'href' => '#log-browser-search-form',
+ 'text' => elgg_echo('logbrowser:search'),
+ 'rel' => 'toggle',
+));
+
+?>
+
+<div id="logbrowser-search-area" class="mbm">
+ <div>
+ <?php echo $toggle_link; ?>
+ </div>
+ <div id="log-browser-search-form" class="elgg-module elgg-module-inline hidden">
+ <div class="elgg-head">
+ <h3><?php echo elgg_echo('logbrowser:search'); ?></h3>
+ </div>
+ <div class="elgg-body">
+ <?php echo $form; ?>
+ </div>
+ </div>
+</div> \ No newline at end of file
diff --git a/mod/logrotate/languages/en.php b/mod/logrotate/languages/en.php
index c3cf2d8ad..27731d732 100644
--- a/mod/logrotate/languages/en.php
+++ b/mod/logrotate/languages/en.php
@@ -15,7 +15,7 @@ $english = array(
'logrotate:logrotated' => "Log rotated\n",
'logrotate:lognotrotated' => "Error rotating log\n",
- 'logrotate:date' => 'Delete archived logs older than a',
+ 'logrotate:delete' => 'Delete archived logs older than a',
'logrotate:week' => 'week',
'logrotate:month' => 'month',
diff --git a/mod/logrotate/start.php b/mod/logrotate/start.php
index c05506d83..28f14ad14 100644
--- a/mod/logrotate/start.php
+++ b/mod/logrotate/start.php
@@ -9,7 +9,7 @@ elgg_register_event_handler('init', 'system', 'logrotate_init');
function logrotate_init() {
$period = elgg_get_plugin_setting('period', 'logrotate');
- $time = elgg_get_plugin_setting('time', 'logrotate');
+ $delete = elgg_get_plugin_setting('delete', 'logrotate');
switch ($period) {
case 'weekly':
case 'monthly' :
@@ -22,7 +22,7 @@ function logrotate_init() {
// Register cron hook for archival of logs
elgg_register_plugin_hook_handler('cron', $period, 'logrotate_archive_cron');
// Register cron hook for deletion of selected archived logs
- elgg_register_plugin_hook_handler('cron', $time, 'logrotate_delete_cron');
+ elgg_register_plugin_hook_handler('cron', $delete, 'logrotate_delete_cron');
}
/**
@@ -64,7 +64,7 @@ function logrotate_delete_cron($hook, $entity_type, $returnvalue, $params) {
$day = 86400;
$offset = 0;
- $period = elgg_get_plugin_setting('time', 'logrotate');
+ $period = elgg_get_plugin_setting('delete', 'logrotate');
switch ($period) {
case 'weekly':
$offset = $day * 7;
@@ -90,7 +90,6 @@ function logrotate_delete_cron($hook, $entity_type, $returnvalue, $params) {
*
* @param int $time_of_delete An offset in seconds from now to delete (useful for log deletion)
*/
-
function log_browser_delete_log($time_of_delete) {
global $CONFIG;
diff --git a/mod/logrotate/views/default/settings/logrotate/edit.php b/mod/logrotate/views/default/plugins/logrotate/settings.php
index 64c7bf743..d9c4032fe 100644
--- a/mod/logrotate/views/default/settings/logrotate/edit.php
+++ b/mod/logrotate/views/default/plugins/logrotate/settings.php
@@ -16,9 +16,9 @@ if (!$time) {
}
?>
<div>
- <?php echo elgg_echo('logrotate:period'); ?>
-
<?php
+
+ echo elgg_echo('logrotate:period') . ' ';
echo elgg_view('input/dropdown', array(
'name' => 'params[period]',
'options_values' => array(
@@ -29,14 +29,13 @@ if (!$time) {
'value' => $period
));
?>
-
- <?php echo elgg_echo('</div><div>'); ?>
-
- <?php echo elgg_echo('logrotate:date'); ?>
-
+</div>
+<div>
<?php
- echo elgg_view('input/pulldown', array(
- 'name' => 'params[time]',
+
+ echo elgg_echo('logrotate:delete') . ' ';
+ echo elgg_view('input/dropdown', array(
+ 'name' => 'params[delete]',
'options_values' => array(
'weekly' => elgg_echo('logrotate:week'),
'monthly' => elgg_echo('logrotate:month'),
diff --git a/mod/messageboard/views/default/messageboard/js.php b/mod/messageboard/views/default/messageboard/js.php
index 5d89fcd69..e5495409a 100644
--- a/mod/messageboard/views/default/messageboard/js.php
+++ b/mod/messageboard/views/default/messageboard/js.php
@@ -23,7 +23,7 @@ elgg.messageboard.submit = function(e) {
data: data,
success: function(json) {
// the action always returns the full ul and li wrapped annotation.
- var ul = form.next('ul.elgg-annotation-list');
+ var ul = form.next('ul.elgg-list-annotation');
if (ul.length < 1) {
form.parent().append(json.output);
diff --git a/mod/notifications/views/default/notifications/subscriptions/forminternals.php b/mod/notifications/views/default/notifications/subscriptions/forminternals.php
index 106eadc54..a7fbec2fd 100644
--- a/mod/notifications/views/default/notifications/subscriptions/forminternals.php
+++ b/mod/notifications/views/default/notifications/subscriptions/forminternals.php
@@ -234,7 +234,7 @@ END;
<td class="namefield">
<a href="<?php echo $friend->getURL(); ?>">
<?php
- echo elgg_view_entity_icon($friend, 'tiny', array('override' => true));
+ echo elgg_view_entity_icon($friend, 'tiny', array('hover' => false));
?>
</a>
<p class="namefieldlink">
diff --git a/mod/pages/pages/pages/edit.php b/mod/pages/pages/pages/edit.php
index e6c2ea015..6f54d72bf 100644
--- a/mod/pages/pages/pages/edit.php
+++ b/mod/pages/pages/pages/edit.php
@@ -7,15 +7,15 @@
gatekeeper();
-$page_guid = get_input('guid');
+$page_guid = (int)get_input('guid');
$page = get_entity($page_guid);
if (!$page) {
-
+
}
$container = $page->getContainerEntity();
if (!$container) {
-
+
}
elgg_set_page_owner_guid($container->getGUID());
diff --git a/mod/profile/views/default/profile/js.php b/mod/profile/views/default/profile/js.php
index edf68543c..16dec59df 100644
--- a/mod/profile/views/default/profile/js.php
+++ b/mod/profile/views/default/profile/js.php
@@ -1,3 +1,6 @@
elgg.register_hook_handler('init', 'system', function() {
- $('#elgg-widget-col-1').css('min-height', $('.profile').outerHeight(true) + 1);
+ // only do this on the profile page's widget canvas.
+ if ($('.profile').length) {
+ $('#elgg-widget-col-1').css('min-height', $('.profile').outerHeight(true) + 1);
+ }
}); \ No newline at end of file
diff --git a/mod/profile/views/default/profile/owner_block.php b/mod/profile/views/default/profile/owner_block.php
index 5a65a3a26..05cb41a14 100644
--- a/mod/profile/views/default/profile/owner_block.php
+++ b/mod/profile/views/default/profile/owner_block.php
@@ -11,7 +11,7 @@ if (!$user) {
return TRUE;
}
-$icon = elgg_view_entity_icon($user, 'large', array('override' => 'true'));
+$icon = elgg_view_entity_icon($user, 'large', array('hover' => 'true'));
// grab the actions and admin menu items from user hover
$menu = elgg_trigger_plugin_hook('register', "menu:user_hover", array('entity' => $user), array());
diff --git a/mod/reportedcontent/languages/en.php b/mod/reportedcontent/languages/en.php
index c047644e3..c2e197879 100644
--- a/mod/reportedcontent/languages/en.php
+++ b/mod/reportedcontent/languages/en.php
@@ -8,7 +8,7 @@
$english = array(
'item:object:reported_content' => 'Reported items',
- 'admin:utilities:reportedcontent' => 'Reported content',
+ 'admin:administer_utilities:reportedcontent' => 'Reported content',
'reportedcontent' => 'Reported content',
'reportedcontent:this' => 'Report this',
'reportedcontent:this:tooltip' => 'Report this page to an administrator',
diff --git a/mod/reportedcontent/start.php b/mod/reportedcontent/start.php
index 87b4b3c7b..66a1248d9 100644
--- a/mod/reportedcontent/start.php
+++ b/mod/reportedcontent/start.php
@@ -39,7 +39,7 @@ function reportedcontent_init() {
// Add admin menu item
// @todo Might want to move this to a 'feedback' section. something other than utils
- elgg_register_admin_menu_item('administer', 'reportedcontent', 'utilities');
+ elgg_register_admin_menu_item('administer', 'reportedcontent', 'administer_utilities');
elgg_register_widget_type(
'reportedcontent',
diff --git a/mod/reportedcontent/views/default/admin/utilities/reportedcontent.php b/mod/reportedcontent/views/default/admin/administer_utilities/reportedcontent.php
index 32f108312..32f108312 100644
--- a/mod/reportedcontent/views/default/admin/utilities/reportedcontent.php
+++ b/mod/reportedcontent/views/default/admin/administer_utilities/reportedcontent.php
diff --git a/mod/reportedcontent/views/default/object/reported_content.php b/mod/reportedcontent/views/default/object/reported_content.php
index 6bcbf6e5d..b0176c11f 100644
--- a/mod/reportedcontent/views/default/object/reported_content.php
+++ b/mod/reportedcontent/views/default/object/reported_content.php
@@ -29,7 +29,7 @@ if ($report->state == 'archived') {
'href' => $archive_url,
'text' => elgg_echo('reportedcontent:archive'),
'is_action' => true,
- 'class' => 'elgg-button elgg-button-action',
+ 'class' => 'elgg-button elgg-button-action mrm',
);
echo elgg_view('output/url', $params);
}
diff --git a/mod/reportedcontent/views/default/reportedcontent/admin_css.php b/mod/reportedcontent/views/default/reportedcontent/admin_css.php
index 2eba964a1..1ed240f3b 100644
--- a/mod/reportedcontent/views/default/reportedcontent/admin_css.php
+++ b/mod/reportedcontent/views/default/reportedcontent/admin_css.php
@@ -28,7 +28,7 @@
}
.reported-content .controls {
float: right;
- margin: 0 0 0 10px;
+ margin: 5px 0 0 10px;
}
.report-details {
background-color: white;
diff --git a/mod/search/search_hooks.php b/mod/search/search_hooks.php
index 428d6f700..b302272fb 100644
--- a/mod/search/search_hooks.php
+++ b/mod/search/search_hooks.php
@@ -202,6 +202,10 @@ function search_tags_hook($hook, $type, $value, $params) {
$search_tag_names = $valid_tag_names;
}
+ if (!$search_tag_names) {
+ return array('entities' => array(), 'count' => $count);
+ }
+
// don't use elgg_get_entities_from_metadata() here because of
// performance issues. since we don't care what matches at this point
// use an IN clause to grab everything that matches at once and sort
@@ -337,7 +341,7 @@ function search_comments_hook($hook, $type, $value, $params) {
$container_and = '';
if ($params['container_guid'] && $params['container_guid'] !== ELGG_ENTITIES_ANY_VALUE) {
- $container_and = 'AND e.container_guid = ' . sanitise_string($params['container_guid']);
+ $container_and = 'AND e.container_guid = ' . sanitise_int($params['container_guid']);
}
$e_access = get_access_sql_suffix('e');
diff --git a/mod/search/views/default/search/css.php b/mod/search/views/default/search/css.php
index 601536c81..0b8f34b60 100644
--- a/mod/search/views/default/search/css.php
+++ b/mod/search/views/default/search/css.php
@@ -30,11 +30,11 @@ Search plugin
font-size: 12px;
font-weight: bold;
padding: 2px 4px 2px 26px;
- background: transparent url(<?php echo elgg_get_site_url(); ?>_graphics/elgg_sprites.png) no-repeat 2px -718px;
+ background: transparent url(<?php echo elgg_get_site_url(); ?>_graphics/elgg_sprites.png) no-repeat 2px -934px;
}
.elgg-search input[type=text]:focus, .elgg-search input[type=text]:active {
background-color: white;
- background-position: 2px -700px;
+ background-position: 2px -916px;
border: 1px solid white;
color: #0054A7;
}
diff --git a/mod/twitter_api/views/default/settings/twitter_api/edit.php b/mod/twitter_api/views/default/plugins/twitter_api/settings.php
index 4e52a5c9d..0b9afd4cf 100644
--- a/mod/twitter_api/views/default/settings/twitter_api/edit.php
+++ b/mod/twitter_api/views/default/plugins/twitter_api/settings.php
@@ -9,14 +9,14 @@ $consumer_key_string = elgg_echo('twitter_api:consumer_key');
$consumer_key_view = elgg_view('input/text', array(
'name' => 'params[consumer_key]',
'value' => $vars['entity']->consumer_key,
- 'class' => 'text_input',
+ 'class' => 'elgg-input-thin',
));
$consumer_secret_string = elgg_echo('twitter_api:consumer_secret');
$consumer_secret_view = elgg_view('input/text', array(
'name' => 'params[consumer_secret]',
'value' => $vars['entity']->consumer_secret,
- 'class' => 'text_input twitter-secret',
+ 'class' => 'elgg-input-thin',
));
$sign_on_with_twitter_string = elgg_echo('twitter_api:login');
@@ -40,7 +40,7 @@ $new_users_with_twitter_view = elgg_view('input/dropdown', array(
));
$settings = <<<__HTML
-<div class="elgg-instructs mtm"><p>$instructions</p></div>
+<div class="elgg-content-thin mtm"><p>$instructions</p></div>
<div><label>$consumer_key_string</label><br /> $consumer_key_view</div>
<div><label>$consumer_secret_string</label><br /> $consumer_secret_view</div>
<div>$sign_on_with_twitter_string $sign_on_with_twitter_view</div>
diff --git a/mod/twitter_api/views/default/usersettings/twitter_api/edit.php b/mod/twitter_api/views/default/plugins/twitter_api/usersettings.php
index acb8d9af5..65d04b883 100644
--- a/mod/twitter_api/views/default/usersettings/twitter_api/edit.php
+++ b/mod/twitter_api/views/default/plugins/twitter_api/usersettings.php
@@ -5,9 +5,9 @@
$user = elgg_get_logged_in_user_entity();
$user_guid = $user->getGUID();
-$twitter_name = get_plugin_usersetting('twitter_name', $user_guid, 'twitter_api');
-$access_key = get_plugin_usersetting('access_key', $user_guid, 'twitter_api');
-$access_secret = get_plugin_usersetting('access_secret', $user_guid, 'twitter_api');
+$twitter_name = elgg_get_plugin_user_setting('twitter_name', $user_guid, 'twitter_api');
+$access_key = elgg_get_plugin_user_setting('access_key', $user_guid, 'twitter_api');
+$access_secret = elgg_get_plugin_user_setting('access_secret', $user_guid, 'twitter_api');
$site_name = elgg_get_site_entity()->name;
echo '<div>' . elgg_echo('twitter_api:usersettings:description', array($site_name)) . '</div>';
@@ -21,7 +21,7 @@ if (!$access_key || !$access_secret) {
// let them disassociate their account.
if ($user->email) {
$url = elgg_get_site_url() . "twitter_api/revoke";
- echo '<div class="twitter_anywhere">' . elgg_echo('twitter_api:usersettings:authorized', array($site_name, $twitter_name)) . '</div>';
+ echo '<div>' . elgg_echo('twitter_api:usersettings:authorized', array($site_name, $twitter_name)) . '</div>';
echo '<div>' . sprintf(elgg_echo('twitter_api:usersettings:revoke'), $url) . '</div>';
} else {
echo elgg_echo('twitter_api:usersettings:cannot_revoke', array(elgg_normalize_url('twitter_api/interstitial')));