aboutsummaryrefslogtreecommitdiff
path: root/mod/embed/views
diff options
context:
space:
mode:
authorcash <cash.costello@gmail.com>2011-06-18 21:54:58 -0400
committercash <cash.costello@gmail.com>2011-06-18 21:54:58 -0400
commitaeb88b95d16ff1da7e2ce8fadde0eab1f4653d8b (patch)
tree54b47f12b8c7557ffb7ec2b14506217564664d3e /mod/embed/views
parentd462b57edfeab81bd90a5d0321ea3d1fcbbddff3 (diff)
downloadelgg-aeb88b95d16ff1da7e2ce8fadde0eab1f4653d8b.tar.gz
elgg-aeb88b95d16ff1da7e2ce8fadde0eab1f4653d8b.tar.bz2
rewrote pagination for embed file listing
Diffstat (limited to 'mod/embed/views')
-rw-r--r--mod/embed/views/default/embed/addcontentjs.php3
-rw-r--r--mod/embed/views/default/embed/embed.php8
-rw-r--r--mod/embed/views/default/js/embed/embed.php14
3 files changed, 23 insertions, 2 deletions
diff --git a/mod/embed/views/default/embed/addcontentjs.php b/mod/embed/views/default/embed/addcontentjs.php
index 18d2927fd..ffed211f5 100644
--- a/mod/embed/views/default/embed/addcontentjs.php
+++ b/mod/embed/views/default/embed/addcontentjs.php
@@ -3,4 +3,5 @@
* Blank for compatibility.
* @deprecated 1.8
*/
-?> \ No newline at end of file
+
+elgg_deprecated_notice("The view 'embed/addcontentjs' has been deprecated.", 1.8);
diff --git a/mod/embed/views/default/embed/embed.php b/mod/embed/views/default/embed/embed.php
index 9f0ac730f..77ce03699 100644
--- a/mod/embed/views/default/embed/embed.php
+++ b/mod/embed/views/default/embed/embed.php
@@ -21,7 +21,7 @@ if (!$sections) {
$content .= elgg_view('embed/tabs', $vars);
$offset = max(0, get_input('offset', 0));
- $limit = get_input('limit', 10);
+ $limit = get_input('limit', 5);
// build the items and layout.
if ($active_section == 'upload' || array_key_exists($active_section, $sections)) {
@@ -55,9 +55,15 @@ if (!$sections) {
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();
diff --git a/mod/embed/views/default/js/embed/embed.php b/mod/embed/views/default/js/embed/embed.php
index 78ad125ef..b709af05e 100644
--- a/mod/embed/views/default/js/embed/embed.php
+++ b/mod/embed/views/default/js/embed/embed.php
@@ -12,6 +12,9 @@ elgg.embed.init = function() {
var textAreaId = class.substr(class.indexOf('embed-control-') + "embed-control-".length);
elgg.embed.textAreaId = textAreaId;
});
+
+ // special pagination helper for lightbox
+ $('.embed-wrapper .elgg-pagination a').live('click', elgg.embed.pagination);
}
/**
@@ -36,4 +39,15 @@ elgg.embed.insert = function(event) {
event.preventDefault();
}
+/**
+ * Loads the next chunk of content within the lightbox
+ *
+ * @param {Object} event
+ * @return void
+ */
+elgg.embed.pagination = function(event) {
+ $('.embed-wrapper').parent().load($(this).attr('href'));
+ event.preventDefault();
+}
+
elgg.register_hook_handler('init', 'system', elgg.embed.init);