aboutsummaryrefslogtreecommitdiff
path: root/mod
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
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')
-rw-r--r--mod/embed/embed.php67
-rw-r--r--mod/embed/images/button_spacer.gifbin43 -> 0 bytes
-rw-r--r--mod/embed/images/loading.gifbin4421 -> 0 bytes
-rw-r--r--mod/embed/images/media_modal.pngbin131886 -> 0 bytes
-rw-r--r--mod/embed/start.php83
-rw-r--r--mod/embed/views/default/embed/css.php162
-rw-r--r--mod/embed/views/default/embed/js.php10
-rw-r--r--mod/embed/views/default/embed/link.php2
-rw-r--r--mod/embed/views/default/embed/media.php6
-rw-r--r--mod/embed/views/default/embed/pagination.php5
-rw-r--r--mod/embed/views/default/embed/simpletype.php64
-rw-r--r--mod/embed/views/default/embed/tabs.php5
-rw-r--r--mod/embed/views/default/embed/upload.php147
-rw-r--r--mod/embed/views/default/group/default/embed.php4
-rw-r--r--mod/embed/views/default/object/default/embed.php4
-rw-r--r--mod/embed/views/default/object/file/embed.php1
-rw-r--r--mod/embed/views/default/object/file/embedlist.php14
-rw-r--r--mod/embed/views/default/site/default/embed.php8
-rw-r--r--mod/embed/views/default/user/default/embed.php8
19 files changed, 266 insertions, 324 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
diff --git a/mod/embed/images/button_spacer.gif b/mod/embed/images/button_spacer.gif
deleted file mode 100644
index 5bfd67a2d..000000000
--- a/mod/embed/images/button_spacer.gif
+++ /dev/null
Binary files differ
diff --git a/mod/embed/images/loading.gif b/mod/embed/images/loading.gif
deleted file mode 100644
index 5a9af96d2..000000000
--- a/mod/embed/images/loading.gif
+++ /dev/null
Binary files differ
diff --git a/mod/embed/images/media_modal.png b/mod/embed/images/media_modal.png
deleted file mode 100644
index 9d206901a..000000000
--- a/mod/embed/images/media_modal.png
+++ /dev/null
Binary files differ
diff --git a/mod/embed/start.php b/mod/embed/start.php
index b14767381..d6bdcc0c9 100644
--- a/mod/embed/start.php
+++ b/mod/embed/start.php
@@ -1,50 +1,49 @@
<?php
+/**
+ * Elgg media embed plugin
+ *
+ * @package ElggEmbed
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd <info@elgg.com>
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.com/
+ */
- /**
- * Elgg media embed plugin
- *
- * @package ElggEmbed
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Curverider Ltd <info@elgg.com>
- * @copyright Curverider Ltd 2008-2010
- * @link http://elgg.com/
- */
-
- /**
- * Init function
- *
- */
- function embed_init() {
-
- // Extend useful views with stuff we need for our embed modal
- elgg_extend_view('css','embed/css');
- elgg_extend_view('js/initialise_elgg','embed/js');
- elgg_extend_view('metatags','embed/metatags');
- elgg_extend_view('input/longtext','embed/link',10);
-
- // Page handler for the modal media embed
- register_page_handler('embed','embed_page_handler');
-
- }
+/**
+ * Init function
+ *
+ */
+ function embed_init() {
- /**
- * Runs the 'embed' script
- *
- */
- function embed_page_handler($page) {
-
- switch($page[0]) {
- case 'upload': require_once(dirname(__FILE__) . '/upload.php');
- exit;
- break;
- default: require_once(dirname(__FILE__) . '/embed.php');
- exit;
- break;
- }
+ // Extend useful views with stuff we need for our embed modal
+ elgg_extend_view('css','embed/css');
+ elgg_extend_view('js/initialise_elgg','embed/js');
+ elgg_extend_view('metatags','embed/metatags');
+ elgg_extend_view('input/longtext','embed/link',10);
+ // Page handler for the modal media embed
+ register_page_handler('embed','embed_page_handler');
+
+ }
+
+/**
+ * Runs the 'embed' script
+ *
+ */
+ function embed_page_handler($page) {
+
+ switch($page[0]) {
+ case 'upload': require_once(dirname(__FILE__) . '/upload.php');
+ exit;
+ break;
+ default: require_once(dirname(__FILE__) . '/embed.php');
+ exit;
+ break;
}
+
+ }
- // Register the init action
- register_elgg_event_handler('init','system','embed_init',10);
+// Register the init action
+ register_elgg_event_handler('init','system','embed_init',10);
?>
diff --git a/mod/embed/views/default/embed/css.php b/mod/embed/views/default/embed/css.php
index 31d474a61..1b4f3ca80 100644
--- a/mod/embed/views/default/embed/css.php
+++ b/mod/embed/views/default/embed/css.php
@@ -1,15 +1,13 @@
<?php
-
- /**
- * Elgg embed CSS - standard across all themes
- *
- * @package embed
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Curverider <info@elgg.com>
- * @copyright Curverider Ltd 2008-2010
- * @link http://elgg.org/
- */
-
+/**
+ * Elgg embed CSS - standard across all themes
+ *
+ * @package embed
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider <info@elgg.com>
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.org/
+ */
?>
#facebox {
@@ -24,7 +22,7 @@
}
#facebox .body {
padding: 10px;
- background: white;
+ background-color: white;
width: 730px;
-webkit-border-radius: 12px;
-moz-border-radius: 12px;
@@ -49,10 +47,6 @@
#facebox .footer img.close_image:hover {
background: url(<?php echo $vars['url']; ?>mod/embed/images/close_button.gif) no-repeat left -31px;
}
-#facebox .footer a {
- -moz-outline: none;
- outline: none;
-}
#facebox_overlay {
position: fixed;
top: 0px;
@@ -67,14 +61,49 @@
background-color: #000000;
z-index: 9999;
}
-
* html #facebox_overlay { /* ie6 hack */
position: absolute;
height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px');
}
+/* entity listing overrides */
+#media_upload,
+#media_embed {
+ margin:0 5px 10px 5px;
+ padding:10px;
+ border:2px solid #dedede;
+ -webkit-border-radius: 8px;
+ -moz-border-radius: 8px;
+ background: #dedede;
+}
+#media_embed .entity_listing {
+ margin:0;
+ padding:0;
+ background-color: white;
+}
+#media_embed .entity_listing_info {
+ width:610px;
+}
+#media_upload .input_textarea {
+ height:100px;
+ width:682px;
+}
+#media_embed .embed_instructions {
+ margin:10px 0 5px 0;
+}
+a.embed_media {
+ margin:0;
+ float:right;
+ display:block;
+ text-align: right;
+ font-weight: normal;
+}
+label a.embed_media {
+ font-size:0.8em;
+}
+
-/* EMBED MEDIA TABS */
+/* modal tabs */
#embed_media_tabs {
margin:10px 0 0 10px;
padding:0;
@@ -90,15 +119,15 @@
}
#embed_media_tabs ul li a {
font-weight: bold;
- font-size:1.35em;
+ font-size:1.2em;
text-align: center;
text-decoration: none;
color:#b6b6b6;
background: white;
display: block;
- padding: 0 10px 0 10px;
+ padding: 3px 10px 0 10px;
margin:0 10px 0 10px;
- height:25px;
+ height:20px;
width:auto;
border-top:2px solid #dedede;
border-left:2px solid #dedede;
@@ -108,9 +137,6 @@
-webkit-border-top-left-radius: 8px;
-webkit-border-top-right-radius: 8px;
}
-/* IE6 fix */
-* html #embed_media_tabs ul li a { display: inline; }
-
#embed_media_tabs ul li a:hover {
background:#b6b6b6;
color:white;
@@ -129,94 +155,40 @@
background: #dedede;
color:#666666;
position: relative;
- /* top: 2px; - only needed if selected tab needs to sit over a border */
-}
-
-#mediaUpload,
-#mediaEmbed {
- margin:0 5px 10px 5px;
- padding:10px;
- border:2px solid #dedede;
- -webkit-border-radius: 8px;
- -moz-border-radius: 8px;
- background: #dedede;
-}
-#mediaEmbed .search_listing {
- margin:0 0 5px 0;
- background: white;
}
+/* IE6 fix */
+* html #embed_media_tabs ul li a { display: inline; }
-h1.mediaModalTitle {
- /* color:#0054A7; */
- font-size:1.35em;
- line-height:1.2em;
- margin:0 0 0 8px;
- padding:5px;
-}
-#mediaEmbed .pagination,
-#mediaUpload .pagination {
+/* Pagination (override core elgg css defaults) */
+#media_embed .pagination,
+#media_upload .pagination {
float:right;
padding:5px;
- background:white;
+ background-color:white;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
}
-#mediaUpload label {
- font-size:120%;
-}
-#mediaEmbed p.embedInstructions {
- margin:10px 0 5px 0;
-}
-a.embed_media {
- margin:0;
- float:right;
- display:block;
- text-align: right;
- font-size:1.0em;
- font-weight: normal;
-}
-label a.embed_media {
- font-size:0.8em;
-}
-
-
-
-
-/* ***************************************
- PAGINATION
-*************************************** */
-#mediaEmbed .pagination .pagination_number {
+#media_embed .pagination .pagination_number {
border:1px solid #999999;
color:#666666;
}
-#mediaEmbed .pagination .pagination_number:hover {
- background:#aaaaaa;
+#media_embed .pagination .pagination_number:hover {
+ background-color:#aaaaaa;
color:black;
}
-
-#mediaEmbed .pagination .pagination_previous,
-#mediaEmbed .pagination .pagination_next {
+#media_embed .pagination .pagination_previous,
+#media_embed .pagination .pagination_next {
border:1px solid #999999;
color:#666666;
}
-#mediaEmbed .pagination .pagination_previous:hover,
-#mediaEmbed .pagination .pagination_next:hover {
- background:#aaaaaa;
+#media_embed .pagination .pagination_previous:hover,
+#media_embed .pagination .pagination_next:hover {
+ background-color:#aaaaaa;
color:black;
}
-#mediaEmbed .pagination .pagination_currentpage {
- background:#666666;
+#media_embed .pagination .pagination_currentpage {
+ background-color:#666666;
border:1px solid #666666;
color:white;
-}
-
-
-
-
-
-
-
-
-
-
+} \ No newline at end of file
diff --git a/mod/embed/views/default/embed/js.php b/mod/embed/views/default/embed/js.php
index fa809ce23..71120e68f 100644
--- a/mod/embed/views/default/embed/js.php
+++ b/mod/embed/views/default/embed/js.php
@@ -89,16 +89,16 @@
settings: {
opacity : 0.7,
overlay : true,
- loadingImage : '<?php echo $vars['url']; ?>mod/embed/images/loading.gif',
- closeImage : '<?php echo $vars['url']; ?>mod/embed/images/button_spacer.gif',
+ loadingImage : '<?php echo $vars['url']; ?>_graphics/ajax_loader_bw.gif',
+ closeImage : '<?php echo $vars['url']; ?>_graphics/spacer.gif',
imageTypes : [ 'png', 'jpg', 'jpeg', 'gif' ],
faceboxHtml : '\
- <div id="facebox" style="display:none;"> \
+ <div id="facebox" class="hidden"> \
<div class="popup"> \
<div class="body"> \
<div class="footer"> \
<a href="#" class="close"> \
- <img src="<?php echo $vars['url']; ?>mod/embed/images/button_spacer.gif" title="close" class="close_image" width="22" height="22" border="0" /> \
+ <img src="<?php echo $vars['url']; ?>_graphics/spacer.gif" title="close" class="close_image" width="22" height="22" border="0" /> \
</a> \
</div> \
<div class="content"> \
@@ -140,7 +140,7 @@
$('#facebox .body').children().fadeIn('slow');
$('#facebox').css('left', $(window).width() / 2 - ($('#facebox').width() / 2));
$(document).trigger('reveal.facebox').trigger('afterReveal.facebox');
- }, 1000);
+ }, 100);
//$('#facebox .loading').remove()
//$('#facebox .body').children().fadeIn('slow')
diff --git a/mod/embed/views/default/embed/link.php b/mod/embed/views/default/embed/link.php
index f8db0bd85..0dd77ac99 100644
--- a/mod/embed/views/default/embed/link.php
+++ b/mod/embed/views/default/embed/link.php
@@ -1 +1 @@
-<a class="embed_media" href="<?php echo $vars['url'] . 'pg/embed/media'; ?>?internalname=<?php echo $vars['internalname']; ?>" rel="facebox"><?php echo elgg_echo('media:insert'); ?></a><br /> \ No newline at end of file
+<a class="embed_media small link" href="<?php echo $vars['url'] . 'pg/embed/media'; ?>?internalname=<?php echo $vars['internalname']; ?>" rel="facebox"><?php echo elgg_echo('media:insert'); ?></a><br /> \ No newline at end of file
diff --git a/mod/embed/views/default/embed/media.php b/mod/embed/views/default/embed/media.php
index 48bf65fdf..25e63ce7d 100644
--- a/mod/embed/views/default/embed/media.php
+++ b/mod/embed/views/default/embed/media.php
@@ -1,9 +1,9 @@
-<h1 class="mediaModalTitle">Embed / Upload Media</h1>
+<h2 class="media_modal_title">Embed / Upload Media</h2>
<?php
echo elgg_view('embed/tabs',array('tab' => 'media', 'internalname' => $vars['internalname']));
?>
- <div id='mediaEmbed'>
+ <div id="media_embed">
<?php
echo elgg_view('embed/pagination',array(
'offset' => $vars['offset'],
@@ -22,7 +22,7 @@
$entities = $vars['entities'];
if (is_array($entities) && !empty($entities)) {
- echo "<p class=\"embedInstructions\">" . elgg_echo('embed:instructions') . "</p>";
+ echo "<p class='embed_instructions'>" . elgg_echo('embed:instructions') . "</p>";
foreach($entities as $entity) {
if ($entity instanceof ElggEntity) {
diff --git a/mod/embed/views/default/embed/pagination.php b/mod/embed/views/default/embed/pagination.php
index d087fc12c..b5a741fcd 100644
--- a/mod/embed/views/default/embed/pagination.php
+++ b/mod/embed/views/default/embed/pagination.php
@@ -92,7 +92,7 @@
if (($i - $prev) > 1) {
- echo "<span class=\"pagination_more\">...</span>";
+ echo "<span class='pagination_more'>...</span>";
}
@@ -102,7 +102,7 @@
if ($curoffset != $offset) {
echo " <a onclick=\"javascript:$('.popup .content').load('{$counturl}'); return false\" href=\"#\" class=\"pagination_number\">{$i}</a> ";
} else {
- echo "<span class=\"pagination_currentpage\"> {$i} </span>";
+ echo "<span class='pagination_currentpage'> {$i} </span>";
}
$prev = $i;
@@ -124,7 +124,6 @@
}
?>
-<br class="clearfloat" />
</div>
<?php
} // end of pagination check if statement
diff --git a/mod/embed/views/default/embed/simpletype.php b/mod/embed/views/default/embed/simpletype.php
index f92678f52..790284fd8 100644
--- a/mod/embed/views/default/embed/simpletype.php
+++ b/mod/embed/views/default/embed/simpletype.php
@@ -1,39 +1,35 @@
- <select name="simpletype" id="embed_simpletype_select">
-
+<select name="simpletype" id="embed_simpletype_select">
<?php
- $all = new stdClass;
- $all->tag = "all";
- $vars['simpletypes'][] = $all;
- $vars['simpletypes'] = array_reverse($vars['simpletypes']);
+ $all = new stdClass;
+ $all->tag = "all";
+ $vars['simpletypes'][] = $all;
+ $vars['simpletypes'] = array_reverse($vars['simpletypes']);
- if (isset($vars['simpletypes']) && is_array($vars['simpletypes']))
- foreach($vars['simpletypes'] as $type) {
-
- if ($vars['simpletype'] == $type->tag || (empty($vars['simpletype']) && $type->tag == 'all')) {
- $selected = 'selected = "selected"';
- } else $selected = '';
- $tag = $type->tag;
- if ($tag != "all") {
- $label = elgg_echo("file:type:" . $tag);
- } else {
- $tag = '';
- $label = elgg_echo('all');
- }
-
-?>
- <option <?php echo $selected; ?> value="<?php echo $tag; ?>"><?php echo $label; ?></option>
-<?php
-
+ if (isset($vars['simpletypes']) && is_array($vars['simpletypes']))
+ foreach($vars['simpletypes'] as $type) {
+
+ if ($vars['simpletype'] == $type->tag || (empty($vars['simpletype']) && $type->tag == 'all')) {
+ $selected = 'selected = "selected"';
+ } else $selected = '';
+ $tag = $type->tag;
+ if ($tag != "all") {
+ $label = elgg_echo("file:type:" . $tag);
+ } else {
+ $tag = '';
+ $label = elgg_echo('all');
}
-
+
+?>
+ <option <?php echo $selected; ?> value="<?php echo $tag; ?>"><?php echo $label; ?></option>
+<?php
+ }
?>
-
- </select>
- <script type="text/javascript">
- $('#embed_simpletype_select').change(function(){
- var simpletype = $('#embed_simpletype_select').val();
- var url = '<?php echo $vars['url']; ?>pg/embed/media?simpletype=' + simpletype + '&internalname=<?php echo $vars['internalname']; ?>';
- $('.popup .content').load(url);
- });
- </script>
+</select>
+<script type="text/javascript">
+ $('#embed_simpletype_select').change(function(){
+ var simpletype = $('#embed_simpletype_select').val();
+ var url = '<?php echo $vars['url']; ?>pg/embed/media?simpletype=' + simpletype + '&internalname=<?php echo $vars['internalname']; ?>';
+ $('.popup .content').load(url);
+ });
+</script>
diff --git a/mod/embed/views/default/embed/tabs.php b/mod/embed/views/default/embed/tabs.php
index 8b2f5bde4..a83bc9b55 100644
--- a/mod/embed/views/default/embed/tabs.php
+++ b/mod/embed/views/default/embed/tabs.php
@@ -10,7 +10,7 @@
?>
-<div id="embed_media_tabs">
+<div id="embed_media_tabs" class="clearfloat">
<ul>
<li>
<a href="#" <?php echo $embedselected; ?> onclick="javascript:$('.popup .content').load('<?php echo $vars['url'] . 'pg/embed/media'; ?>?internalname=<?php echo $vars['internalname']; ?>'); return false"><?php echo elgg_echo('embed:media'); ?></a>
@@ -19,5 +19,4 @@
<a href="#" <?php echo $uploadselected; ?> onclick="javascript:$('.popup .content').load('<?php echo $vars['url'] . 'pg/embed/upload'; ?>?internalname=<?php echo $vars['internalname']; ?>'); return false"><?php echo elgg_echo('upload:media'); ?></a>
</li>
</ul>
-</div>
-<div class="clearfloat"></div> \ No newline at end of file
+</div> \ No newline at end of file
diff --git a/mod/embed/views/default/embed/upload.php b/mod/embed/views/default/embed/upload.php
index fbdcbfd8c..d995b4b2b 100644
--- a/mod/embed/views/default/embed/upload.php
+++ b/mod/embed/views/default/embed/upload.php
@@ -1,88 +1,85 @@
-<h1 class="mediaModalTitle">Embed / Upload Media</h1>
+<h2 class="media_modal_title">Embed / Upload Media</h2>
<?php
- echo elgg_view('embed/tabs',array('tab' => 'upload', 'internalname'=>get_input('internalname')));
+echo elgg_view('embed/tabs',array('tab' => 'upload', 'internalname'=>get_input('internalname')));
- if (!elgg_view_exists('file/upload')) {
- echo "<p>" . elgg_echo('embed:file:required') . "</p>";
- } else {
- $action = 'file/upload';
-
+if (!elgg_view_exists('file/upload')) {
+ echo "<p>" . elgg_echo('embed:file:required') . "</p>";
+} else {
+ $action = 'file/upload';
+
?>
- <form id="mediaUpload" action="<?php echo $vars['url']; ?>action/file/upload" method="post" enctype="multipart/form-data">
- <p>
- <label for="upload"><?php echo elgg_echo("file:file"); ?><br />
+<form id="media_upload" action="<?php echo $vars['url']; ?>action/file/upload" method="post" enctype="multipart/form-data">
+ <p>
+ <label for="upload"><?php echo elgg_echo("file:file"); ?><br />
+ <?php
+ echo elgg_view('input/securitytoken');
+ echo elgg_view("input/file",array('internalname' => 'upload', 'js' => 'id="upload"'));
+
+ ?>
+ </label></p>
+ <p>
+ <label><?php echo elgg_echo("title"); ?><br />
<?php
- echo elgg_view('input/securitytoken');
- echo elgg_view("input/file",array('internalname' => 'upload', 'js' => 'id="upload"'));
-
- ?>
- </label></p>
- <p>
- <label><?php echo elgg_echo("title"); ?><br />
- <?php
- echo elgg_view("input/text", array(
- "internalname" => "title",
- "value" => $title,
- ));
-
- ?>
- </label>
- </p>
- <p>
- <label for="filedescription"><?php echo elgg_echo("description"); ?><br />
- <textarea class="input_textarea" name="description" id="filedescription"></textarea>
- </label></p>
+ echo elgg_view("input/text", array(
+ "internalname" => "title",
+ "value" => $title,
+ ));
- <p>
- <label><?php echo elgg_echo("tags"); ?><br />
- <?php
- echo elgg_view("input/tags", array(
- "internalname" => "tags",
- "value" => $tags,
- ));
-
- ?>
- </label>
- </p>
- <p>
- <label>
- <?php echo elgg_echo('access'); ?><br />
- <?php echo elgg_view('input/access', array('internalname' => 'access_id','value' => ACCESS_DEFAULT)); ?>
- </label>
- </p>
+ ?>
+ </label>
+ </p>
+ <p>
+ <label for="filedescription"><?php echo elgg_echo("description"); ?><br />
+ <textarea class="input_textarea" name="description" id="filedescription"></textarea>
+ </label></p>
- <p>
- <?php
+ <p>
+ <label><?php echo elgg_echo("tags"); ?><br />
+ <?php
+ echo elgg_view("input/tags", array(
+ "internalname" => "tags",
+ "value" => $tags,
+ ));
- if (isset($vars['container_guid']))
- echo "<input type=\"hidden\" name=\"container_guid\" value=\"{$vars['container_guid']}\" />";
- if (isset($vars['entity']))
- echo "<input type=\"hidden\" name=\"file_guid\" value=\"{$vars['entity']->getGUID()}\" />";
-
- ?>
- <input type="submit" value="<?php echo elgg_echo("save"); ?>" />
- </p>
- </form>
- <script type="text/javascript">
- // wait for the DOM to be loaded
- //$(document).ready(function() {
- // bind 'myForm' and provide a simple callback function
- $('#mediaUpload').submit(function() {
- var options = {
- success: function() {
- $('.popup .content').load('<?php echo $vars['url'] . 'pg/embed/media'; ?>?internalname=<?php echo $vars['internalname']; ?>');
- }
- };
- $(this).ajaxSubmit(options);
- return false;
- });
- //});
- </script>
+ ?>
+ </label>
+ </p>
+ <p>
+ <label>
+ <?php echo elgg_echo('access'); ?><br />
+ <?php echo elgg_view('input/access', array('internalname' => 'access_id','value' => ACCESS_DEFAULT)); ?>
+ </label>
+ </p>
-<?php
+ <p>
+ <?php
+
+ if (isset($vars['container_guid']))
+ echo "<input type=\"hidden\" name=\"container_guid\" value=\"{$vars['container_guid']}\" />";
+ if (isset($vars['entity']))
+ echo "<input type=\"hidden\" name=\"file_guid\" value=\"{$vars['entity']->getGUID()}\" />";
- }
+ ?>
+ <input type="submit" value="<?php echo elgg_echo("save"); ?>" />
+ </p>
+</form>
+<script type="text/javascript">
+ // bind 'myForm' and provide a simple callback function
+ $('#media_upload').submit(function() {
+ var options = {
+ success: function() {
+ $('.popup .content').load('<?php echo $vars['url'] . 'pg/embed/media'; ?>?internalname=<?php echo $vars['internalname']; ?>');
+ }
+ };
+ $(this).ajaxSubmit(options);
+ return false;
+ });
+</script>
+
+<?php
+}
+
?>
diff --git a/mod/embed/views/default/group/default/embed.php b/mod/embed/views/default/group/default/embed.php
index c5bf905a0..34a0d0c61 100644
--- a/mod/embed/views/default/group/default/embed.php
+++ b/mod/embed/views/default/group/default/embed.php
@@ -1,9 +1,5 @@
<?php
-
if ($vars['entity'] instanceof ElggGroup) {
-
echo '<a href="'. $vars['entity']->getURL() .'">' . $vars['entity']->title . '</a>';
-
}
-
?> \ No newline at end of file
diff --git a/mod/embed/views/default/object/default/embed.php b/mod/embed/views/default/object/default/embed.php
index c97dbd48a..6f698a157 100644
--- a/mod/embed/views/default/object/default/embed.php
+++ b/mod/embed/views/default/object/default/embed.php
@@ -1,9 +1,5 @@
<?php
-
if ($vars['entity'] instanceof ElggObject) {
-
echo '<a href="'. $vars['entity']->getURL() .'">' . $vars['entity']->title . '</a>';
-
}
-
?> \ No newline at end of file
diff --git a/mod/embed/views/default/object/file/embed.php b/mod/embed/views/default/object/file/embed.php
index 01f3904ac..b93c46e5e 100644
--- a/mod/embed/views/default/object/file/embed.php
+++ b/mod/embed/views/default/object/file/embed.php
@@ -1,5 +1,4 @@
<?php
-
$mime = $vars['entity']->mimetype;
if (elgg_view_exists('file/specialcontent/' . $mime)) {
diff --git a/mod/embed/views/default/object/file/embedlist.php b/mod/embed/views/default/object/file/embedlist.php
index 71e84f265..345e69b4b 100644
--- a/mod/embed/views/default/object/file/embedlist.php
+++ b/mod/embed/views/default/object/file/embedlist.php
@@ -1,19 +1,17 @@
<?php
-
$file = $vars['entity'];
$friendlytime = friendly_time($vars['entity']->time_created);
- $info = "<p> <a href=\"{$file->getURL()}\">{$file->title}</a></p>";
- $info .= "<p class=\"owner_timestamp\">{$friendlytime}";
+ $info = "<p class='entity_title'> <a href=\"{$file->getURL()}\">{$file->title}</a></p>";
+ $info .= "<p class='entity_subtext'>{$friendlytime}";
$icon = "<a href=\"{$file->getURL()}\">" . elgg_view("file/icon", array("mimetype" => $file->mimetype, 'thumbnail' => $file->thumbnail, 'file_guid' => $file->guid, 'size' => 'small')) . "</a>";
-
?>
-<div id="embedFile<?php echo $file->guid; ?>">
- <div class="search_listing">
- <div class="search_listing_icon">
+<div id="embed_entity_<?php echo $file->guid; ?>">
+ <div class="entity_listing clearfloat">
+ <div class="entity_listing_icon">
<?php echo $icon; ?>
</div>
- <div class="search_listing_info">
+ <div class="entity_listing_info">
<?php echo $info; ?>
</div>
</div>
diff --git a/mod/embed/views/default/site/default/embed.php b/mod/embed/views/default/site/default/embed.php
index 2d0c52214..2e8920a9a 100644
--- a/mod/embed/views/default/site/default/embed.php
+++ b/mod/embed/views/default/site/default/embed.php
@@ -1,9 +1,5 @@
<?php
-
- if ($vars['entity'] instanceof ElggSite) {
-
- echo '<a href="'. $vars['entity']->getURL() .'">' . $vars['entity']->name . '</a>';
-
+ if ($vars['entity'] instanceof ElggSite) {
+ echo '<a href="'. $vars['entity']->getURL() .'">' . $vars['entity']->name . '</a>';
}
-
?> \ No newline at end of file
diff --git a/mod/embed/views/default/user/default/embed.php b/mod/embed/views/default/user/default/embed.php
index 1c3dae072..df538c94c 100644
--- a/mod/embed/views/default/user/default/embed.php
+++ b/mod/embed/views/default/user/default/embed.php
@@ -1,9 +1,5 @@
<?php
-
- if ($vars['entity'] instanceof ElggUser) {
-
- echo '<a href="'. $vars['entity']->getURL() .'">' . $vars['entity']->name . '</a>';
-
+ if ($vars['entity'] instanceof ElggUser) {
+ echo '<a href="'. $vars['entity']->getURL() .'">' . $vars['entity']->name . '</a>';
}
-
?> \ No newline at end of file