aboutsummaryrefslogtreecommitdiff
path: root/mod/embed/embed.php
diff options
context:
space:
mode:
authorpete <pete@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-03-16 12:09:44 +0000
committerpete <pete@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-03-16 12:09:44 +0000
commitd146923c93e58d604c44869238f406c714669826 (patch)
tree33adcb7184cd89ac4e85b48a2e2407a22a67e930 /mod/embed/embed.php
parent484de1047d5d095ea92937f867df7ad2526e564a (diff)
downloadelgg-d146923c93e58d604c44869238f406c714669826.tar.gz
elgg-d146923c93e58d604c44869238f406c714669826.tar.bz2
Updated Embed mod to new UI.
git-svn-id: http://code.elgg.org/elgg/trunk@5415 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/embed/embed.php')
-rw-r--r--mod/embed/embed.php67
1 files changed, 33 insertions, 34 deletions
diff --git a/mod/embed/embed.php b/mod/embed/embed.php
index 461bbdebb..358547491 100644
--- a/mod/embed/embed.php
+++ b/mod/embed/embed.php
@@ -1,38 +1,37 @@
<?php
+// This page can only be run from within the Elgg framework
+ if (!is_callable('elgg_view')) exit;
+
+// Get the name of the form field we need to inject into
+ $internalname = get_input('internalname');
+
+ if (!isloggedin()) exit;
+
+ global $SESSION;
+
+ $offset = (int) get_input('offset',0);
+ $simpletype = get_input('simpletype');
+ $entity_types = array('object' => array('file'));
- // This page can only be run from within the Elgg framework
- if (!is_callable('elgg_view')) exit;
-
- // Get the name of the form field we need to inject into
- $internalname = get_input('internalname');
-
- if (!isloggedin()) exit;
-
- global $SESSION;
-
- $offset = (int) get_input('offset',0);
- $simpletype = get_input('simpletype');
- $entity_types = array('object' => array('file'));
-
- if (empty($simpletype)) {
- $count = elgg_get_entities(array('type' => 'object', 'subtype' => 'file', 'owner_guid' => $SESSION['user']->guid, 'count' => TRUE));
- $entities = elgg_get_entities(array('type' => 'object', 'subtype' => 'file', 'owner_guid' => $SESSION['user']->guid, 'limit' => 6, 'offset' => $offset));
- } else {
- $count = elgg_get_entities_from_metadata(array('metadata_name' => 'simpletype', 'metadata_value' => $simpletype, 'types' => 'object', 'subtypes' => 'file', 'owner_guid' => $SESSION['user']->guid, 'limit' => 6, 'offset' => $offset, 'count' => TRUE));
- $entities = elgg_get_entities_from_metadata(array('metadata_name' => 'simpletype', 'metadata_value' => $simpletype, 'types' => 'object', 'subtypes' => 'file', 'owner_guid' => $SESSION['user']->guid, 'limit' => 6, 'offset' => $offset));
- }
-
- $types = get_tags(0,10,'simpletype','object','file',$SESSION['user']->guid);
-
- // Echo the embed view
- echo elgg_view('embed/media', array(
- 'entities' => $entities,
- 'internalname' => $internalname,
- 'offset' => $offset,
- 'count' => $count,
- 'simpletype' => $simpletype,
- 'limit' => 6,
- 'simpletypes' => $types,
- ));
+ if (empty($simpletype)) {
+ $count = elgg_get_entities(array('type' => 'object', 'subtype' => 'file', 'owner_guid' => $SESSION['user']->guid, 'count' => TRUE));
+ $entities = elgg_get_entities(array('type' => 'object', 'subtype' => 'file', 'owner_guid' => $SESSION['user']->guid, 'limit' => 6, 'offset' => $offset));
+ } else {
+ $count = elgg_get_entities_from_metadata(array('metadata_name' => 'simpletype', 'metadata_value' => $simpletype, 'types' => 'object', 'subtypes' => 'file', 'owner_guid' => $SESSION['user']->guid, 'limit' => 6, 'offset' => $offset, 'count' => TRUE));
+ $entities = elgg_get_entities_from_metadata(array('metadata_name' => 'simpletype', 'metadata_value' => $simpletype, 'types' => 'object', 'subtypes' => 'file', 'owner_guid' => $SESSION['user']->guid, 'limit' => 6, 'offset' => $offset));
+ }
+
+ $types = get_tags(0,10,'simpletype','object','file',$SESSION['user']->guid);
+
+// Echo the embed view
+ echo elgg_view('embed/media', array(
+ 'entities' => $entities,
+ 'internalname' => $internalname,
+ 'offset' => $offset,
+ 'count' => $count,
+ 'simpletype' => $simpletype,
+ 'limit' => 6,
+ 'simpletypes' => $types,
+ ));
?> \ No newline at end of file