diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-12-03 02:55:03 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-12-03 02:55:03 +0000 |
commit | ab10e3ac5a0b5bbc6cd08c7647a0123364db72f3 (patch) | |
tree | d115661a0501d359d9e91d9fa110c81723ee4f9b /views | |
parent | 6b7325c3138ea5a3f20f2d95dce05242b0cdb653 (diff) | |
download | elgg-ab10e3ac5a0b5bbc6cd08c7647a0123364db72f3.tar.gz elgg-ab10e3ac5a0b5bbc6cd08c7647a0123364db72f3.tar.bz2 |
preview of what the main content area looks like with a module approach
git-svn-id: http://code.elgg.org/elgg/trunk@7509 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views')
-rw-r--r-- | views/default/css/screen.php | 16 | ||||
-rw-r--r-- | views/default/layouts/module.php | 21 | ||||
-rw-r--r-- | views/default/page_elements/main_header.php | 27 | ||||
-rw-r--r-- | views/default/page_elements/main_module.php | 5 | ||||
-rw-r--r-- | views/default/page_elements/main_nav.php | 32 |
5 files changed, 91 insertions, 10 deletions
diff --git a/views/default/css/screen.php b/views/default/css/screen.php index acb2878fc..a8c825fdd 100644 --- a/views/default/css/screen.php +++ b/views/default/css/screen.php @@ -150,7 +150,7 @@ blockquote { GENERIC SELECTORS *************************************** */ h2 { - border-bottom:1px solid #CCCCCC; +/* border-bottom:1px solid #CCCCCC; */ padding-bottom:5px; } @@ -250,7 +250,7 @@ h2 { height:24px; z-index: 9000; } -.elgg-header { +.elgg-page > .elgg-header { x-overflow: hidden; position: relative; width: 100%; @@ -356,7 +356,19 @@ h2 { width: 730px; } +.elgg-module { +} +.elgg-module-heading { + float: left; + max-width: 530px; + margin-right: 10px; +} + +.elgg-maincontent-header { + border-bottom: 1px solid #CCCCCC; + padding-bottom: 3px; +} /* *************************************** ELGG TOPBAR diff --git a/views/default/layouts/module.php b/views/default/layouts/module.php index 8c74aae57..db940aedc 100644 --- a/views/default/layouts/module.php +++ b/views/default/layouts/module.php @@ -2,10 +2,11 @@ /** * Elgg module layout * - * @uses $vars['header'] HTML content of the header - * @uses $vars['body'] HTML content of the body - * @uses $vars['footer'] HTML content of the footer - * @uses $vars['class'] Optional additional class for module + * @uses $vars['header'] HTML content of the header + * @uses $vars['body'] HTML content of the body + * @uses $vars['footer'] HTML content of the footer + * @uses $vars['class'] Optional additional class for module + * @uses $vars['header_class'] Optional additional class for header */ $header = elgg_get_array_value('header', $vars, ''); @@ -18,8 +19,14 @@ if ($additional_class) { $class = "$class $additional_class"; } +$header_class = 'elgg-header'; +$additional_class = elgg_get_array_value('header_class', $vars, ''); +if ($additional_class) { + $header_class = "$header_class $additional_class"; +} + if ($header) { - $header = "<div class=\"elgg-header\">$header</div>"; + $header = "<div class=\"$header_class\">$header</div>"; } if ($footer) { @@ -30,9 +37,7 @@ echo <<<HTML <div class="$class"> <div class="elgg-inner"> $header - <div class="elgg-body"> - $body - </div> + <div class="elgg-body">$body</div> $footer </div> </div> diff --git a/views/default/page_elements/main_header.php b/views/default/page_elements/main_header.php new file mode 100644 index 000000000..438a6c432 --- /dev/null +++ b/views/default/page_elements/main_header.php @@ -0,0 +1,27 @@ +<?php +/** + * Header for main module + * + * @uses string $vars['type'] The section type. Should be the same as the page handler. Used for generating URLs. + */ + +$type = $vars['type']; +$username = get_loggedin_user()->username; + +$title = elgg_echo($type); + +$new_button = ''; +if (isloggedin()) { + $new_link = elgg_get_array_value('new_link', $vars, "pg/$type/$username/new"); + $params = array( + 'href' => $new_link = elgg_normalize_url($new_link), + 'text' => elgg_echo("$type:new"), + 'class' => 'action-button right', + ); + $new_button = elgg_view('output/url', $params); +} + +echo <<<HTML +<h2 class="elgg-module-heading">$title</h2> +$new_button +HTML; diff --git a/views/default/page_elements/main_module.php b/views/default/page_elements/main_module.php new file mode 100644 index 000000000..388a500fe --- /dev/null +++ b/views/default/page_elements/main_module.php @@ -0,0 +1,5 @@ +<?php + +$vars['class'] = 'elgg-module-maincontent'; +$vars['header_class'] = 'elgg-maincontent-header clearfix'; +echo elgg_view_layout('module', $vars);
\ No newline at end of file diff --git a/views/default/page_elements/main_nav.php b/views/default/page_elements/main_nav.php new file mode 100644 index 000000000..0c267b3f2 --- /dev/null +++ b/views/default/page_elements/main_nav.php @@ -0,0 +1,32 @@ +<?php + +// page handler type +$type = $vars['type']; + +$username = get_loggedin_user()->username; + +// so we know if the user is looking at their own, everyone's or all friends +$filter_context = $vars['context']; + +// generate a list of default tabs +$default_tabs = array( + 'all' => array( + 'title' => elgg_echo('all'), + 'url' => (isset($vars['all_link'])) ? $vars['all_link'] : "pg/$type/", + 'selected' => ($filter_context == 'everyone'), + ), + 'mine' => array( + 'title' => elgg_echo('mine'), + 'url' => (isset($vars['mine_link'])) ? $vars['mine_link'] : "pg/$type/$username", + 'selected' => ($filter_context == 'mine'), + ), + 'friend' => array( + 'title' => elgg_echo('friends'), + 'url' => (isset($vars['friend_link'])) ? $vars['friend_link'] : "pg/$type/$username/friends", + 'selected' => ($filter_context == 'friends'), + ), +); + +// determine if using default or overwritten tabs +$tabs = elgg_get_array_value('tabs', $vars, $default_tabs); +echo elgg_view('navigation/tabs', array('tabs' => $tabs));
\ No newline at end of file |