From d7adaddab7189bc493d22d96fec424aedca09b11 Mon Sep 17 00:00:00 2001 From: cash Date: Wed, 8 Dec 2010 01:19:38 +0000 Subject: reorganized the page views as discussed git-svn-id: http://code.elgg.org/elgg/trunk@7559 36083f99-b078-4883-b0ff-0f9b5a30f544 --- views/default/page/elements/body.php | 14 + views/default/page/elements/content.php | 14 + views/default/page/elements/content_header.php | 94 +++++++ .../page/elements/content_header_member.php | 24 ++ views/default/page/elements/footer.php | 21 ++ views/default/page/elements/header.php | 24 ++ views/default/page/elements/header_logo.php | 12 + views/default/page/elements/html_begin.php | 93 +++++++ views/default/page/elements/html_end.php | 11 + views/default/page/elements/messages.php | 28 ++ views/default/page/elements/topbar.php | 44 ++++ views/default/page/elements/topbar_logout.php | 14 + views/default/page/shells/admin.php | 29 +++ views/default/page/shells/default.php | 37 +++ views/default/page/shells/walled_garden.php | 281 +++++++++++++++++++++ 15 files changed, 740 insertions(+) create mode 100644 views/default/page/elements/body.php create mode 100644 views/default/page/elements/content.php create mode 100644 views/default/page/elements/content_header.php create mode 100644 views/default/page/elements/content_header_member.php create mode 100644 views/default/page/elements/footer.php create mode 100644 views/default/page/elements/header.php create mode 100644 views/default/page/elements/header_logo.php create mode 100644 views/default/page/elements/html_begin.php create mode 100644 views/default/page/elements/html_end.php create mode 100644 views/default/page/elements/messages.php create mode 100644 views/default/page/elements/topbar.php create mode 100644 views/default/page/elements/topbar_logout.php create mode 100644 views/default/page/shells/admin.php create mode 100644 views/default/page/shells/default.php create mode 100644 views/default/page/shells/walled_garden.php (limited to 'views/default/page') diff --git a/views/default/page/elements/body.php b/views/default/page/elements/body.php new file mode 100644 index 000000000..6f7691693 --- /dev/null +++ b/views/default/page/elements/body.php @@ -0,0 +1,14 @@ + + $body + +HTML; diff --git a/views/default/page/elements/content.php b/views/default/page/elements/content.php new file mode 100644 index 000000000..f82720c2f --- /dev/null +++ b/views/default/page/elements/content.php @@ -0,0 +1,14 @@ + + $body + +HTML; diff --git a/views/default/page/elements/content_header.php b/views/default/page/elements/content_header.php new file mode 100644 index 000000000..8809ad8b7 --- /dev/null +++ b/views/default/page/elements/content_header.php @@ -0,0 +1,94 @@ +username; + +if (!$page_owner) { + $page_owner = $logged_in_user; +} + +// so we know if the user is looking at their own, everyone's or all friends +$filter_context = $vars['context']; + +// get the object type +$type = $vars['type']; + +// create an empty string to start with +$new_button = ''; + +// generate a list of default tabs +$default_tabs = array( + 'all' => array( + 'title' => elgg_echo('all'), + 'url' => (isset($vars['all_link'])) ? $vars['all_link'] : "mod/$type/all.php", + '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 = (isset($vars['tabs'])) ? $vars['tabs'] : $default_tabs; +$tab_list = elgg_view('navigation/tabs', array('tabs' => $tabs)); + +$title = elgg_echo($type); +$title = '
' . elgg_view_title($title) . '
'; + +// must be logged in to see any action buttons +if (isloggedin()) { + // only show the new button when not on the add form. + // hide the tabs when on the add form. + if ($filter_context == 'action') { + $tab_list = ''; + } else { + // @todo remove the hard coded reference to the videolist plugin + if (elgg_get_context() == "videolist"){ + $video_link = elgg_get_site_url() . "pg/videolist/browse/$username/"; + $new_button = "" . elgg_echo('videolist:browsemenu') . ''; + } else { + $new_link = elgg_normalize_url((isset($vars['new_link'])) ? $vars['new_link'] : "pg/$type/$username/new"); + $new_button = "" . elgg_echo($type . ':new') . ''; + } + $new_button = "
$new_button
"; + } + + // also hide the tabs if in a group context (ie, listing groups) or + // when viewing tools belonging to a group + if (elgg_get_context() == 'groups' || $page_owner instanceof ElggGroup) { + $tab_list = ''; + } +} + +echo << + $title $new_button + +HTML; + +echo $tab_list; diff --git a/views/default/page/elements/content_header_member.php b/views/default/page/elements/content_header_member.php new file mode 100644 index 000000000..4cfee9258 --- /dev/null +++ b/views/default/page/elements/content_header_member.php @@ -0,0 +1,24 @@ +name; + +// get the object type +$type = $vars['type']; + +$title = elgg_echo($type); +$title = $name . "'s " . $type; +?> + +
+ ' . elgg_view_title($title) . '
'; ?> + + diff --git a/views/default/page/elements/footer.php b/views/default/page/elements/footer.php new file mode 100644 index 000000000..6c9cdc55e --- /dev/null +++ b/views/default/page/elements/footer.php @@ -0,0 +1,21 @@ + + + + diff --git a/views/default/page/elements/header.php b/views/default/page/elements/header.php new file mode 100644 index 000000000..148279b2e --- /dev/null +++ b/views/default/page/elements/header.php @@ -0,0 +1,24 @@ + +
+
+ +
+
diff --git a/views/default/page/elements/header_logo.php b/views/default/page/elements/header_logo.php new file mode 100644 index 000000000..6ae6a0fab --- /dev/null +++ b/views/default/page/elements/header_logo.php @@ -0,0 +1,12 @@ + + +

+ + sitename; ?> + +

diff --git a/views/default/page/elements/html_begin.php b/views/default/page/elements/html_begin.php new file mode 100644 index 000000000..23879dde8 --- /dev/null +++ b/views/default/page/elements/html_begin.php @@ -0,0 +1,93 @@ +sitename; +} else if (empty($vars['config']->sitename)) { + $title = $vars['title']; +} else { + $title = $vars['config']->sitename . ": " . $vars['title']; +} + +global $autofeed; +if (isset($autofeed) && $autofeed == true) { + $url = full_url(); + if (substr_count($url,'?')) { + $url .= "&view=rss"; + } else { + $url .= "?view=rss"; + } + $url = elgg_format_url($url); + $feedref = << + +END; +} else { + $feedref = ""; +} + +$js = elgg_get_js('head'); +$css = elgg_get_css(); + +// we won't trust server configuration but specify utf-8 +header('Content-type: text/html; charset=utf-8'); + +$version = get_version(); +$release = get_version(true); +?> + + + + + + + <?php echo $title; ?> + + + + + + + + + + + + + + diff --git a/views/default/page/elements/html_end.php b/views/default/page/elements/html_end.php new file mode 100644 index 000000000..0862934cf --- /dev/null +++ b/views/default/page/elements/html_end.php @@ -0,0 +1,11 @@ + + + diff --git a/views/default/page/elements/messages.php b/views/default/page/elements/messages.php new file mode 100644 index 000000000..f44d1204b --- /dev/null +++ b/views/default/page/elements/messages.php @@ -0,0 +1,28 @@ + 0) { + + echo ''; +} diff --git a/views/default/page/elements/topbar.php b/views/default/page/elements/topbar.php new file mode 100644 index 000000000..75df5fa93 --- /dev/null +++ b/views/default/page/elements/topbar.php @@ -0,0 +1,44 @@ +guid > 0)) { + echo '
'; + echo '
'; + + // Elgg logo + echo ''; + echo "\"Elgg"; + echo ''; + + // avatar + $user_link = $user->getURL(); + $user_image = $user->getIcon('topbar'); + echo "\"User"; + + // logout link + echo elgg_view('page/elements/topbar_logout', $vars); + + // elgg tools menu + // need to echo this empty view for backward compatibility. + echo elgg_view("navigation/topbar_tools"); + + // enable elgg topbar extending + echo elgg_view('elgg_topbar/extend', $vars); + + // user settings + $settings = elgg_echo('settings'); + echo "$settings"; + + // The administration link is for admin or site admin users only + if ($user->isAdmin()) { + $admin = elgg_echo("admin"); + echo "$admin"; + } + + echo '
'; + echo '
'; +} diff --git a/views/default/page/elements/topbar_logout.php b/views/default/page/elements/topbar_logout.php new file mode 100644 index 000000000..2d2ecf67c --- /dev/null +++ b/views/default/page/elements/topbar_logout.php @@ -0,0 +1,14 @@ +'; +echo elgg_view('output/url', array( + 'href' => "action/logout", + 'text' => elgg_echo('logout'), + 'is_action' => TRUE +)); +echo ''; diff --git a/views/default/page/shells/admin.php b/views/default/page/shells/admin.php new file mode 100644 index 000000000..c2581b23f --- /dev/null +++ b/views/default/page/shells/admin.php @@ -0,0 +1,29 @@ + $vars['sysmessages'])); +echo elgg_view('page/elements/content', $vars); +echo elgg_view('page/elements/html_end', $vars); \ No newline at end of file diff --git a/views/default/page/shells/default.php b/views/default/page/shells/default.php new file mode 100644 index 000000000..080bc7099 --- /dev/null +++ b/views/default/page/shells/default.php @@ -0,0 +1,37 @@ +'; +echo elgg_view('page/elements/messages', array('object' => $vars['sysmessages'])); +echo elgg_view('page/elements/topbar', $vars); +echo elgg_view('page/elements/header', $vars); +echo elgg_view('page/elements/body', $vars); +echo elgg_view('page/elements/footer', $vars); +echo ''; + +echo elgg_view('page/elements/html_end', $vars); diff --git a/views/default/page/shells/walled_garden.php b/views/default/page/shells/walled_garden.php new file mode 100644 index 000000000..4e64276c1 --- /dev/null +++ b/views/default/page/shells/walled_garden.php @@ -0,0 +1,281 @@ + + + + $vars['sysmessages'])); + +echo "
$view
"; +echo '
'; +echo "

Welcome to:
$title

"; +echo "
{$vars['body']}
"; +echo '
'; +echo '
'; +echo '
'; + +echo elgg_view('page/elements/html_end', $vars); -- cgit v1.2.3