diff options
Diffstat (limited to 'views/default/layout/shells')
-rw-r--r-- | views/default/layout/shells/administration.php | 36 | ||||
-rw-r--r-- | views/default/layout/shells/content.php | 53 | ||||
-rw-r--r-- | views/default/layout/shells/default.php | 18 | ||||
-rw-r--r-- | views/default/layout/shells/one_column.php | 16 | ||||
-rw-r--r-- | views/default/layout/shells/one_column_with_sidebar.php | 31 | ||||
-rw-r--r-- | views/default/layout/shells/one_sidebar.php | 31 | ||||
-rw-r--r-- | views/default/layout/shells/two_sidebar.php | 42 | ||||
-rw-r--r-- | views/default/layout/shells/widgets.php | 46 |
8 files changed, 273 insertions, 0 deletions
diff --git a/views/default/layout/shells/administration.php b/views/default/layout/shells/administration.php new file mode 100644 index 000000000..f7ed84935 --- /dev/null +++ b/views/default/layout/shells/administration.php @@ -0,0 +1,36 @@ +<?php +/** + * Elgg Admin Area Canvas + * + * @package Elgg + * @subpackage Core + * + * @uses $vars['content'] Content string + * @uses $vars['sidebar'] Optional sidebar content + */ +?> + +<div id="admin_header"> + <span class="network-title"><h2> + <a href="<?php echo elgg_get_site_url(); ?>"> + <?php echo $vars['config']->sitename; echo " ".elgg_echo('admin'); ?></a> + <a class="return_to_network" href="<?php echo elgg_get_site_url(); ?>"><< Return to network</a> + </h2></span> +</div> + +<div id="elgg-content" class="clearfix admin_area"> + + <div id="elgg-page-contents" class="clearfix"> + <?php + if (isset($vars['content'])) { + echo $vars['content']; + } + ?> + </div> + <div id="elgg-sidebar" class="clearfix"> + <?php + echo elgg_view('page_elements/sidebar', $vars); + ?> + </div> +</div> +<div id="admin_footer"></div>
\ No newline at end of file diff --git a/views/default/layout/shells/content.php b/views/default/layout/shells/content.php new file mode 100644 index 000000000..908197a39 --- /dev/null +++ b/views/default/layout/shells/content.php @@ -0,0 +1,53 @@ +<?php +/** + * Main content area layout + * + * @uses $vars['content'] HTML of main content area + * @uses $vars['sidebar'] HTML of the sidebar + * @uses $vars['header'] HTML of the content area header (override) + * @uses $vars['nav'] HTML of the content area nav (override) + * @uses $vars['footer'] HTML of the content area footer + * @uses $vars['filter'] HTML of the content area filter (override) + * @uses $vars['title'] Title text (override) + * @uses $vars['context'] Page context (override) + * @uses $vars['buttons'] Content header buttons (override) + * @uses $vars['filter_context'] Filter context: everyone, friends, mine + */ + +// give plugins an opportunity to add to content sidebars +$sidebar_content = elgg_get_array_value('sidebar', $vars, ''); +$params = $vars; +$params['content'] = $sidebar_content; +$sidebar = elgg_view('content/sidebar', $params); + +// navigation defaults to breadcrumbs +$nav = elgg_get_array_value('nav', $vars, elgg_view('navigation/breadcrumbs')); + +// allow page handlers to override the default header +if (isset($vars['header'])) { + $vars['header_override'] = $vars['header']; +} +$header = elgg_view('content/header', $vars); + +// allow page handlers to override the default filter +if (isset($vars['filter'])) { + $vars['filter_override'] = $vars['filter']; +} +$filter = elgg_view('content/filter', $vars); + +// the all important content +$content = elgg_get_array_value('content', $vars, ''); + +// optional footer for main content area +$footer_content = elgg_get_array_value('footer', $vars, ''); +$params = $vars; +$params['content'] = $footer_content; +$footer = elgg_view('content/footer', $params); + +$body = $nav . $header . $filter . $content . $footer; + +$params = array( + 'body' => $body, + 'sidebar' => $sidebar, +); +echo elgg_view_layout('one_sidebar', $params); diff --git a/views/default/layout/shells/default.php b/views/default/layout/shells/default.php new file mode 100644 index 000000000..60dc90b0d --- /dev/null +++ b/views/default/layout/shells/default.php @@ -0,0 +1,18 @@ +<?php +/** + * Elgg default layout + * + * @package Elgg + * @subpackage Core + * + * @uses $vars['content'] Content string + */ + +// @todo deprecated so remove in Elgg 2.0 +if (isset($vars['area1'])) { + echo $vars['area1']; +} + +if (isset($vars['content'])) { + echo $vars['content']; +} diff --git a/views/default/layout/shells/one_column.php b/views/default/layout/shells/one_column.php new file mode 100644 index 000000000..84a304e14 --- /dev/null +++ b/views/default/layout/shells/one_column.php @@ -0,0 +1,16 @@ +<?php +/** + * Elgg one-column layout + * + * @package Elgg + * @subpackage Core + * + * @uses $vars['content'] Content string + */ +?> +<div class="elgg-layout-one_column elgg-center elgg-width-classic clearfix"> + <div class="elgg-body"> + <?php echo $vars['content']; ?> + <?php echo $vars['area1']; ?> + </div> +</div>
\ No newline at end of file diff --git a/views/default/layout/shells/one_column_with_sidebar.php b/views/default/layout/shells/one_column_with_sidebar.php new file mode 100644 index 000000000..e408c6c1c --- /dev/null +++ b/views/default/layout/shells/one_column_with_sidebar.php @@ -0,0 +1,31 @@ +<?php +/** + * Elgg 1 column with sidebar layout + * + * @package Elgg + * @subpackage Core + * + * @uses $vars['content'] The content string for the main column + * @uses $vars['sidebar'] Optional content that is displayed in the sidebar + */ +?> + +<div class="elgg-layout-sidebar elgg-center elgg-width-classic clearfix"> + <div class="elgg-sidebar elgg-aside"> + <?php + echo elgg_view('page_elements/sidebar', $vars); + ?> + </div> + + <div class="elgg-main elgg-body"> + <?php + // @todo deprecated so remove in Elgg 2.0 + if (isset($vars['area1'])) { + echo $vars['area1']; + } + if (isset($vars['content'])) { + echo $vars['content']; + } + ?> + </div> +</div> diff --git a/views/default/layout/shells/one_sidebar.php b/views/default/layout/shells/one_sidebar.php new file mode 100644 index 000000000..d0bb3879f --- /dev/null +++ b/views/default/layout/shells/one_sidebar.php @@ -0,0 +1,31 @@ +<?php +/** + * Elgg main column with one sidebar layout + * + * @package Elgg + * @subpackage Core + * + * @uses $vars['body'] Content HTML for the main column + * @uses $vars['sidebar'] Optional content that is displayed in the sidebar + */ +?> + +<div class="elgg-layout-sidebar elgg-center elgg-width-classic clearfix"> + <div class="elgg-sidebar elgg-aside"> + <?php + echo elgg_view('page_elements/sidebar', $vars); + ?> + </div> + + <div class="elgg-main elgg-body"> + <?php + // @todo deprecated so remove in Elgg 2.0 + if (isset($vars['area1'])) { + echo $vars['area1']; + } + if (isset($vars['body'])) { + echo $vars['body']; + } + ?> + </div> +</div> diff --git a/views/default/layout/shells/two_sidebar.php b/views/default/layout/shells/two_sidebar.php new file mode 100644 index 000000000..26fb64920 --- /dev/null +++ b/views/default/layout/shells/two_sidebar.php @@ -0,0 +1,42 @@ +<?php +/** + * Elgg 2 sidebar layout + * + * @package Elgg + * @subpackage Core + * + * @uses $vars['content'] The content string for the main column + * @uses $vars['sidebar'] Optional content that is displayed in the sidebar + * @uses $vars['sidebar-alt'] Optional content that is displayed in the alternate sidebar + */ +?> + +<div class="elgg-layout-two-sidebar elgg-center elgg-width-classic clearfix"> + <div class="elgg-sidebar elgg-aside"> + <?php + echo elgg_view('page_elements/sidebar', $vars); + ?> + </div> + <div class="elgg-sidebar-alt elgg-aside"> + <?php + //$params = $vars; + //$params['sidebar'] = $vars['sidebar-alt']; + $params = array( + 'sidebar' => elgg_view('layout_elements/module', array('title' => 'Testing', 'body' => 'Hello, world!')) + ); + echo elgg_view('page_elements/sidebar', $params); + ?> + </div> + + <div class="elgg-main elgg-body"> + <?php + // @todo deprecated so remove in Elgg 2.0 + if (isset($vars['area1'])) { + echo $vars['area1']; + } + if (isset($vars['content'])) { + echo $vars['content']; + } + ?> + </div> +</div> diff --git a/views/default/layout/shells/widgets.php b/views/default/layout/shells/widgets.php new file mode 100644 index 000000000..130b2eaad --- /dev/null +++ b/views/default/layout/shells/widgets.php @@ -0,0 +1,46 @@ +<?php +/** + * Elgg widgets layout + * + * @uses $vars['box'] Optional display box at the top of layout + * @uses $vars['num_columns'] Number of widget columns for this layout + * @uses $vars['show_add_widgets'] Display the add widgets button and panel + */ + +$box = elgg_get_array_value('box', $vars, ''); +$num_columns = elgg_get_array_value('num_columns', $vars, 3); +$show_add_widgets = elgg_get_array_value('show_add_widgets', $vars, true); + +$owner = elgg_get_page_owner(); +$context = elgg_get_context(); +elgg_push_context('widgets'); + +$widgets = elgg_get_widgets($owner->guid, $context); + +if (elgg_can_edit_widget_layout($context)) { + if ($show_add_widgets) { + echo elgg_view('widgets/add-button'); + } + $params = array( + 'widgets' => $widgets, + 'context' => $context, + ); + echo elgg_view('widgets/add_panel', $params); +} + +echo $vars['box']; + +$widget_class = "widget-{$num_columns}-columns"; +for ($column_index = 1; $column_index <= $num_columns; $column_index++) { + $column_widgets = $widgets[$column_index]; + + echo "<div class=\"widget-column $widget_class\" id=\"widget-col-$column_index\">"; + if (is_array($column_widgets) && sizeof($column_widgets) > 0) { + foreach ($column_widgets as $widget) { + echo elgg_view_entity($widget); + } + } + echo '</div>'; +} + +elgg_pop_context();
\ No newline at end of file |