diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-12-24 05:16:04 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-12-24 05:16:04 +0000 |
commit | 54dac8c96380082136b38532707c7b1e031549e8 (patch) | |
tree | 8b18fe197739f37835b6b45029f6e6bb83579ae8 /views | |
parent | b9dba608b5e72f55754ef1abd17753a31f4bcc07 (diff) | |
download | elgg-54dac8c96380082136b38532707c7b1e031549e8.tar.gz elgg-54dac8c96380082136b38532707c7b1e031549e8.tar.bz2 |
creating standard list body for plugins
git-svn-id: http://code.elgg.org/elgg/trunk@7717 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views')
-rw-r--r-- | views/default/css/elements/core.php | 29 | ||||
-rw-r--r-- | views/default/layout/objects/list/body.php | 51 |
2 files changed, 77 insertions, 3 deletions
diff --git a/views/default/css/elements/core.php b/views/default/css/elements/core.php index 29fdd598b..6f4e46f66 100644 --- a/views/default/css/elements/core.php +++ b/views/default/css/elements/core.php @@ -210,11 +210,34 @@ h2 { margin: 5px 0; clear: both; } - -.elgg-list li { +.elgg-list > li { border-bottom: 1px dotted #CCCCCC; } - +.elgg-list-metadata { + float: right; + margin-left: 15px; + font-size: 90%; +} +.elgg-list-metadata li { + float: left; + margin-left: 15px; +} +.elgg-list-metadata, .elgg-list-metadata a { + color: #aaaaaa; +} +.elgg-list-subtitle { + color: #666666; + font-size: 85%; + line-height: 1.2em; + font-style: italic; + margin-bottom: 5px; +} +.elgg-tags { + margin-bottom: 5px; +} +.elgg-list-content { + margin: 10px 5px; +} .elgg-center { margin: 0 auto; } diff --git a/views/default/layout/objects/list/body.php b/views/default/layout/objects/list/body.php new file mode 100644 index 000000000..9bef21da9 --- /dev/null +++ b/views/default/layout/objects/list/body.php @@ -0,0 +1,51 @@ +<?php +/** + * List body + * + * Sample output + * <ul elgg-list-metadata><li>Public</li><li>Like this</li></ul> + * <h3><a href="">Title</a></h3> + * <p class="elgg-list-subtitle">Posted 3 hours ago by George</p> + * <p class="elgg-tags"><a href="">one</a>, <a href="">two</a></p> + * <div class="elgg-list-content">Excerpt text</div> + * + * @uses $vars['entity'] ElggEntity + * @uses $vars['title'] Title link (optional) + * @uses $vars['metadata'] HTML for entity metadata and actions (optional) + * @uses $vars['subtitle'] HTML for the subtitle (optional) + * @uses $vars['tags'] HTML for the tags (optional) + * @uses $vars['content'] HTML for the entity content (optional) + */ + +$entity = $vars['entity']; + +$title_link = elgg_get_array_value('title', $vars, ''); +if (!$title_link) { + $params = array( + 'text' => $entity->title, + 'href' => $entity->getURL(), + ); + $title_link = elgg_view('output/url', $params); +} + +$metadata = elgg_get_array_value('metadata', $vars, ''); +$subtitle = elgg_get_array_value('subtitle', $vars, ''); +$content = elgg_get_array_value('content', $vars, ''); + +$tags = elgg_get_array_value('tags', $vars, ''); +if (!$tags) { + $tag_text = elgg_view('output/tags', array('tags' => $entity->tags)); + if ($tag_text) { + $tags = '<p class="elgg-tags">' . $tag_text . '</p>'; + } +} + +if ($metadata) { + echo $metadata; +} +echo "<h3>$title_link</h3>"; +echo "<p class=\"elgg-list-subtitle\">$subtitle</p>"; +echo $tags; +if ($content) { + echo "<div class=\"elgg-list-content\">$content</div>"; +} |