diff options
Diffstat (limited to 'views/default/page/elements')
-rw-r--r-- | views/default/page/elements/body.php | 8 | ||||
-rw-r--r-- | views/default/page/elements/comments.php | 42 | ||||
-rw-r--r-- | views/default/page/elements/comments_block.php | 45 | ||||
-rw-r--r-- | views/default/page/elements/foot.php | 11 | ||||
-rw-r--r-- | views/default/page/elements/footer.php | 12 | ||||
-rw-r--r-- | views/default/page/elements/head.php | 81 | ||||
-rw-r--r-- | views/default/page/elements/header.php | 10 | ||||
-rw-r--r-- | views/default/page/elements/header_logo.php | 8 | ||||
-rw-r--r-- | views/default/page/elements/messages.php | 6 | ||||
-rw-r--r-- | views/default/page/elements/owner_block.php | 31 | ||||
-rw-r--r-- | views/default/page/elements/shortcut_icon.php | 6 | ||||
-rw-r--r-- | views/default/page/elements/sidebar.php | 32 | ||||
-rw-r--r-- | views/default/page/elements/sidebar_alt.php | 12 | ||||
-rw-r--r-- | views/default/page/elements/tagcloud_block.php | 58 | ||||
-rw-r--r-- | views/default/page/elements/title.php | 14 | ||||
-rw-r--r-- | views/default/page/elements/topbar.php | 11 | ||||
-rw-r--r-- | views/default/page/elements/wrapper.php | 22 |
17 files changed, 379 insertions, 30 deletions
diff --git a/views/default/page/elements/body.php b/views/default/page/elements/body.php new file mode 100644 index 000000000..14c3978d3 --- /dev/null +++ b/views/default/page/elements/body.php @@ -0,0 +1,8 @@ +<?php +/** + * Elgg page body wrapper + * + * @uses $vars['body'] The HTML of the page body + */ + +echo elgg_extract('body', $vars, '');
\ No newline at end of file diff --git a/views/default/page/elements/comments.php b/views/default/page/elements/comments.php new file mode 100644 index 000000000..97cb9574e --- /dev/null +++ b/views/default/page/elements/comments.php @@ -0,0 +1,42 @@ +<?php +/** + * List comments with optional add form + * + * @uses $vars['entity'] ElggEntity + * @uses $vars['show_add_form'] Display add form or not + * @uses $vars['id'] Optional id for the div + * @uses $vars['class'] Optional additional class for the div + */ + +$show_add_form = elgg_extract('show_add_form', $vars, true); + +$id = ''; +if (isset($vars['id'])) { + $id = "id=\"{$vars['id']}\""; +} + +$class = 'elgg-comments'; +if (isset($vars['class'])) { + $class = "$class {$vars['class']}"; +} + +// work around for deprecation code in elgg_view() +unset($vars['internalid']); + +echo "<div $id class=\"$class\">"; + +$options = array( + 'guid' => $vars['entity']->getGUID(), + 'annotation_name' => 'generic_comment' +); +$html = elgg_list_annotations($options); +if ($html) { + echo '<h3>' . elgg_echo('comments') . '</h3>'; + echo $html; +} + +if ($show_add_form) { + echo elgg_view_form('comments/add', array(), $vars); +} + +echo '</div>'; diff --git a/views/default/page/elements/comments_block.php b/views/default/page/elements/comments_block.php new file mode 100644 index 000000000..d0f8ab809 --- /dev/null +++ b/views/default/page/elements/comments_block.php @@ -0,0 +1,45 @@ +<?php +/** + * Display the latest related comments + * + * Generally used in a sidebar. Does not work with groups currently. + * + * @uses $vars['subtypes'] Object subtype string or array of subtypes + * @uses $vars['owner_guid'] The owner of the content being commented on + * @uses $vars['limit'] The number of comments to display + */ + +$owner_guid = elgg_extract('owner_guid', $vars, ELGG_ENTITIES_ANY_VALUE); +if (!$owner_guid) { + $owner_guid = ELGG_ENTITIES_ANY_VALUE; +} + +$owner_entity = get_entity($owner_guid); +if ($owner_entity && elgg_instanceof($owner_entity, 'group')) { + // not supporting groups so return + return true; +} + +$options = array( + 'annotation_name' => 'generic_comment', + 'owner_guid' => $owner_guid, + 'reverse_order_by' => true, + 'limit' => elgg_extract('limit', $vars, 4), + 'type' => 'object', + 'subtypes' => elgg_extract('subtypes', $vars, ELGG_ENTITIES_ANY_VALUE), +); + +$title = elgg_echo('generic_comments:latest'); +$comments = elgg_get_annotations($options); +if ($comments) { + $body = elgg_view('page/components/list', array( + 'items' => $comments, + 'pagination' => false, + 'list_class' => 'elgg-latest-comments', + 'full_view' => false, + )); +} else { + $body = '<p>' . elgg_echo('generic_comment:none') . '</p>'; +} + +echo elgg_view_module('aside', $title, $body); diff --git a/views/default/page/elements/foot.php b/views/default/page/elements/foot.php new file mode 100644 index 000000000..a56b373b4 --- /dev/null +++ b/views/default/page/elements/foot.php @@ -0,0 +1,11 @@ +<?php + +echo elgg_view('footer/analytics'); + +$js = elgg_get_loaded_js('footer'); +foreach ($js as $script) { ?> + <script type="text/javascript" src="<?php echo $script; ?>"></script> +<?php +} + +?>
\ No newline at end of file diff --git a/views/default/page/elements/footer.php b/views/default/page/elements/footer.php index 2459545c0..ded2cea9a 100644 --- a/views/default/page/elements/footer.php +++ b/views/default/page/elements/footer.php @@ -9,4 +9,14 @@ */ echo elgg_view_menu('footer', array('sort_by' => 'priority', 'class' => 'elgg-menu-hz')); -?>
\ No newline at end of file + +$powered_url = elgg_get_site_url() . "_graphics/powered_by_elgg_badge_drk_bckgnd.gif"; + +echo '<div class="mts clearfloat float-alt">'; +echo elgg_view('output/url', array( + 'href' => 'http://elgg.org', + 'text' => "<img src=\"$powered_url\" alt=\"Powered by Elgg\" width=\"106\" height=\"15\" />", + 'class' => '', + 'is_trusted' => true, +)); +echo '</div>'; diff --git a/views/default/page/elements/head.php b/views/default/page/elements/head.php new file mode 100644 index 000000000..d4a95b4d0 --- /dev/null +++ b/views/default/page/elements/head.php @@ -0,0 +1,81 @@ +<?php +/** + * The standard HTML head + * + * @uses $vars['title'] The page title + */ + +// Set title +if (empty($vars['title'])) { + $title = elgg_get_config('sitename'); +} else { + $title = elgg_get_config('sitename') . ": " . $vars['title']; +} + +global $autofeed; +if (isset($autofeed) && $autofeed == true) { + $url = current_page_url(); + if (substr_count($url,'?')) { + $url .= "&view=rss"; + } else { + $url .= "?view=rss"; + } + $url = elgg_format_url($url); + $feedref = <<<END + + <link rel="alternate" type="application/rss+xml" title="RSS" href="{$url}" /> + +END; +} else { + $feedref = ""; +} + +$js = elgg_get_loaded_js('head'); +$css = elgg_get_loaded_css(); + +$version = get_version(); +$release = get_version(true); +?> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <meta name="ElggRelease" content="<?php echo $release; ?>" /> + <meta name="ElggVersion" content="<?php echo $version; ?>" /> + <title><?php echo $title; ?></title> + <?php echo elgg_view('page/elements/shortcut_icon', $vars); ?> + +<?php foreach ($css as $link) { ?> + <link rel="stylesheet" href="<?php echo $link; ?>" type="text/css" /> +<?php } ?> + +<?php + $ie_url = elgg_get_simplecache_url('css', 'ie'); + $ie7_url = elgg_get_simplecache_url('css', 'ie7'); + $ie6_url = elgg_get_simplecache_url('css', 'ie6'); +?> + <!--[if gt IE 7]> + <link rel="stylesheet" type="text/css" href="<?php echo $ie_url; ?>" /> + <![endif]--> + <!--[if IE 7]> + <link rel="stylesheet" type="text/css" href="<?php echo $ie7_url; ?>" /> + <![endif]--> + <!--[if IE 6]> + <link rel="stylesheet" type="text/css" href="<?php echo $ie6_url; ?>" /> + <![endif]--> + +<?php foreach ($js as $script) { ?> + <script type="text/javascript" src="<?php echo $script; ?>"></script> +<?php } ?> + +<script type="text/javascript"> +// <![CDATA[ + <?php echo elgg_view('js/initialize_elgg'); ?> +// ]]> +</script> + +<?php +echo $feedref; + +$metatags = elgg_view('metatags', $vars); +if ($metatags) { + elgg_deprecated_notice("The metatags view has been deprecated. Extend page/elements/head instead", 1.8); + echo $metatags; +} diff --git a/views/default/page/elements/header.php b/views/default/page/elements/header.php index ad3bfabce..1a1f5d211 100644 --- a/views/default/page/elements/header.php +++ b/views/default/page/elements/header.php @@ -11,12 +11,4 @@ echo elgg_view('page/elements/header_logo', $vars); echo elgg_view('core/account/login_dropdown'); // insert site-wide navigation -?> -<div id="social_menu"> -<?php -echo elgg_view_menu('site'); -?> -<div style="clear:both;"></div> -</div> -<?php echo elgg_view('page/elements/topbar', $vars); ?> -<div style="clear:both;"></div> +echo elgg_view_menu('site');
\ No newline at end of file diff --git a/views/default/page/elements/header_logo.php b/views/default/page/elements/header_logo.php index 373ce27f7..7fe721c40 100644 --- a/views/default/page/elements/header_logo.php +++ b/views/default/page/elements/header_logo.php @@ -6,16 +6,10 @@ $site = elgg_get_site_entity(); $site_name = $site->name; $site_url = elgg_get_site_url(); -$site_description = $site->description; ?> -<h1 style="float:left;margin-top:10px;"> +<h1> <a class="elgg-heading-site" href="<?php echo $site_url; ?>"> <?php echo $site_name; ?> </a> </h1> - - -<div style="clear:left;"></div> -<p style="float:left;margin-left:20px;"><?php echo $site_description; ?></p> - diff --git a/views/default/page/elements/messages.php b/views/default/page/elements/messages.php index 869ce2b5e..edd40d71e 100644 --- a/views/default/page/elements/messages.php +++ b/views/default/page/elements/messages.php @@ -8,7 +8,7 @@ * * @uses $vars['object'] The array of message registers */ -echo '<div style="width:990px;margin:0px auto;position:relative;">'; + echo '<ul class="elgg-system-messages">'; // hidden li so we validate @@ -18,10 +18,10 @@ if (isset($vars['object']) && is_array($vars['object']) && sizeof($vars['object' foreach ($vars['object'] as $type => $list ) { foreach ($list as $message) { echo "<li class=\"elgg-message elgg-state-$type\">"; - echo autop($message); + echo elgg_autop($message); echo '</li>'; } } } -echo '</ul></div>'; +echo '</ul>'; diff --git a/views/default/page/elements/owner_block.php b/views/default/page/elements/owner_block.php new file mode 100644 index 000000000..fc7f0f6d2 --- /dev/null +++ b/views/default/page/elements/owner_block.php @@ -0,0 +1,31 @@ +<?php +/** + * Elgg owner block + * Displays page ownership information + * + * @package Elgg + * @subpackage Core + * + */ + +elgg_push_context('owner_block'); + +// groups and other users get owner block +$owner = elgg_get_page_owner_entity(); +if ($owner instanceof ElggGroup || + ($owner instanceof ElggUser && $owner->getGUID() != elgg_get_logged_in_user_guid())) { + + $header = elgg_view_entity($owner, array('full_view' => false)); + + $body = elgg_view_menu('owner_block', array('entity' => $owner)); + + $body .= elgg_view('page/elements/owner_block/extend', $vars); + + echo elgg_view('page/components/module', array( + 'header' => $header, + 'body' => $body, + 'class' => 'elgg-owner-block', + )); +} + +elgg_pop_context();
\ No newline at end of file diff --git a/views/default/page/elements/shortcut_icon.php b/views/default/page/elements/shortcut_icon.php new file mode 100644 index 000000000..12fe9c1f8 --- /dev/null +++ b/views/default/page/elements/shortcut_icon.php @@ -0,0 +1,6 @@ +<?php +/** + * Displays the default shortcut icon + */ +?> +<link rel="SHORTCUT ICON" href="<?php echo elgg_get_site_url(); ?>_graphics/favicon.ico" />
\ No newline at end of file diff --git a/views/default/page/elements/sidebar.php b/views/default/page/elements/sidebar.php new file mode 100644 index 000000000..fe6bb450e --- /dev/null +++ b/views/default/page/elements/sidebar.php @@ -0,0 +1,32 @@ +<?php +/** + * Elgg sidebar contents + * + * @uses $vars['sidebar'] Optional content that is displayed at the bottom of sidebar + */ + +echo elgg_view_menu('extras', array( + 'sort_by' => 'priority', + 'class' => 'elgg-menu-hz', +)); + +echo elgg_view('page/elements/owner_block', $vars); + +echo elgg_view_menu('page', array('sort_by' => 'name')); + +// optional 'sidebar' parameter +if (isset($vars['sidebar'])) { + echo $vars['sidebar']; +} + +// @todo deprecated so remove in Elgg 2.0 +// optional second parameter of elgg_view_layout +if (isset($vars['area2'])) { + echo $vars['area2']; +} + +// @todo deprecated so remove in Elgg 2.0 +// optional third parameter of elgg_view_layout +if (isset($vars['area3'])) { + echo $vars['area3']; +}
\ No newline at end of file diff --git a/views/default/page/elements/sidebar_alt.php b/views/default/page/elements/sidebar_alt.php new file mode 100644 index 000000000..6d91ca58b --- /dev/null +++ b/views/default/page/elements/sidebar_alt.php @@ -0,0 +1,12 @@ +<?php +/** + * Elgg secondary sidebar contents + * + * You can override, extend, or pass content to it + * + * @uses $vars['sidebar_alt] HTML content for the alternate sidebar + */ + +$sidebar = elgg_extract('sidebar_alt', $vars, ''); + +echo $sidebar; diff --git a/views/default/page/elements/tagcloud_block.php b/views/default/page/elements/tagcloud_block.php new file mode 100644 index 000000000..258951c41 --- /dev/null +++ b/views/default/page/elements/tagcloud_block.php @@ -0,0 +1,58 @@ +<?php +/** + * Display content-based tags + * + * Generally used in a sidebar. Does not work with groups currently. + * + * @uses $vars['subtypes'] Object subtype string or array of subtypes + * @uses $vars['owner_guid'] The owner of the content being tagged + * @uses $vars['limit'] The maxinum number of tags to display + */ + +$owner_guid = elgg_extract('owner_guid', $vars, ELGG_ENTITIES_ANY_VALUE); +if (!$owner_guid) { + $owner_guid = ELGG_ENTITIES_ANY_VALUE; +} + +$owner_entity = get_entity($owner_guid); +if ($owner_entity && elgg_instanceof($owner_entity, 'group')) { + // not supporting groups so return + return true; +} + +$options = array( + 'type' => 'object', + 'subtype' => elgg_extract('subtypes', $vars, ELGG_ENTITIES_ANY_VALUE), + 'owner_guid' => $owner_guid, + 'threshold' => 0, + 'limit' => elgg_extract('limit', $vars, 50), + 'tag_name' => 'tags', +); + +$title = elgg_echo('tagcloud'); +if (is_array($options['subtype']) && count($options['subtype']) > 1) { + // we cannot provide links to tagged objects with multiple types + $tag_data = elgg_get_tags($options); + $cloud = elgg_view("output/tagcloud", array( + 'value' => $tag_data, + 'type' => $type, + )); +} else { + $cloud = elgg_view_tagcloud($options); +} +if (!$cloud) { + return true; +} + +// add a link to all site tags +$cloud .= '<p class="small">'; +$cloud .= elgg_view_icon('tag'); +$cloud .= elgg_view('output/url', array( + 'href' => 'tags', + 'text' => elgg_echo('tagcloud:allsitetags'), + 'is_trusted' => true, +)); +$cloud .= '</p>'; + + +echo elgg_view_module('aside', $title, $cloud); diff --git a/views/default/page/elements/title.php b/views/default/page/elements/title.php new file mode 100644 index 000000000..19f47f4e6 --- /dev/null +++ b/views/default/page/elements/title.php @@ -0,0 +1,14 @@ +<?php +/** + * Elgg title element + * + * @uses $vars['title'] The page title + * @uses $vars['class'] Optional class for heading + */ + +$class= ''; +if (isset($vars['class'])) { + $class = " class=\"{$vars['class']}\""; +} + +echo "<h2{$class}>{$vars['title']}</h2>"; diff --git a/views/default/page/elements/topbar.php b/views/default/page/elements/topbar.php index ef70a83cc..e4c6c86bb 100644 --- a/views/default/page/elements/topbar.php +++ b/views/default/page/elements/topbar.php @@ -5,16 +5,7 @@ */ // Elgg logo -?> -<div id="social_topbar"> - <div style="width:930px;margin:0px auto;"> - <?php if (elgg_is_logged_in()): - echo elgg_view_menu('topbar', array('sort_by' => 'priority', array('elgg-menu-hz'))); - endif ?> - </div> - <div style="clear:both;"></div> -</div> -<?php +echo elgg_view_menu('topbar', array('sort_by' => 'priority', array('elgg-menu-hz'))); // elgg tools menu // need to echo this empty view for backward compatibility. diff --git a/views/default/page/elements/wrapper.php b/views/default/page/elements/wrapper.php new file mode 100644 index 000000000..61828832d --- /dev/null +++ b/views/default/page/elements/wrapper.php @@ -0,0 +1,22 @@ +<?php +/** + * Deprecated content wrapper view from Elgg 1.5 through 1.7 + * + * @uses $vars['body'] The content to display inside content wrapper + * @uses $vars['subclass'] Additional css class + */ + +elgg_deprecated_notice("The 'page_elements/contentwrapper' has been deprecated", 1.8); +?> + +<div class="contentWrapper<?php + + if (isset($vars['subclass'])) { + echo ' ' . $vars['subclass']; + } + +?>"> +<?php + echo $vars['body']; +?> +</div> |