aboutsummaryrefslogtreecommitdiff
path: root/views/default/layout_elements/media.php
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-04 21:05:54 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-04 21:05:54 +0000
commit7433b07dac28a87a8d22bd0dd5fa78effe333255 (patch)
tree76040c3b6de7f82688d9025cf2af88f19dbd804e /views/default/layout_elements/media.php
parentb2c08a52541a12050ae12bac2dbc8e1f0563c2b0 (diff)
downloadelgg-7433b07dac28a87a8d22bd0dd5fa78effe333255.tar.gz
elgg-7433b07dac28a87a8d22bd0dd5fa78effe333255.tar.bz2
welcome to the new media view - it is being used in the new latest comments module
git-svn-id: http://code.elgg.org/elgg/trunk@7530 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/layout_elements/media.php')
-rw-r--r--views/default/layout_elements/media.php48
1 files changed, 48 insertions, 0 deletions
diff --git a/views/default/layout_elements/media.php b/views/default/layout_elements/media.php
new file mode 100644
index 000000000..8599d6c8a
--- /dev/null
+++ b/views/default/layout_elements/media.php
@@ -0,0 +1,48 @@
+<?php
+/**
+ * Elgg media element
+ *
+ * ---------------------------------------------------
+ * | | |
+ * | image | body |
+ * | block | block |
+ * | | |
+ * ---------------------------------------------------
+ *
+ * @uses $vars['body'] HTML content of the body block
+ * @uses $vars['img'] HTML content of the image block
+ * @uses $vars['class'] Optional additional class for media element
+ * @uses $vars['body_class'] Optional additional class for body block
+ * @uses $vars['img_class'] Optional additional class for image block
+ */
+
+$body = elgg_get_array_value('body', $vars, '');
+$image_block = elgg_get_array_value('img', $vars, '');
+
+$class = 'elgg-media';
+$additional_class = elgg_get_array_value('class', $vars, '');
+if ($additional_class) {
+ $class = "$class $additional_class";
+}
+
+$body_class = 'elgg-body';
+$additional_class = elgg_get_array_value('body_class', $vars, '');
+if ($additional_class) {
+ $body_class = "$body_class $additional_class";
+}
+$body = "<div class=\"$body_class\">$body</div>";
+
+$img_class = 'elgg-img';
+$additional_class = elgg_get_array_value('img_class', $vars, '');
+if ($additional_class) {
+ $img_class = "$img_class $additional_class";
+}
+if ($image_block) {
+ $image_block = "<div class=\"$img_class\">$image_block</div>";
+}
+
+echo <<<HTML
+<div class="$class clearfix">
+ $image_block$body
+</div>
+HTML;