aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-03-04 17:53:57 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-03-04 17:53:57 +0000
commit1852b00a819721c9d7399e7fa42321d582bb32af (patch)
treefe81c6f4fa440359091c0a737201c522f923a9db
parent88c3d54f0a6ceb0b539af4e922157b101b945542 (diff)
downloadelgg-1852b00a819721c9d7399e7fa42321d582bb32af.tar.gz
elgg-1852b00a819721c9d7399e7fa42321d582bb32af.tar.bz2
Pulled profile sidebar out into separate view.
Using one_column_with_sidebar layout for editing profile. git-svn-id: http://code.elgg.org/elgg/trunk@5285 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--mod/profile/profile_lib.php4
-rw-r--r--mod/profile/start.php7
-rwxr-xr-xmod/profile/views/default/profile/profile_contents/activity.php8
-rwxr-xr-xmod/profile/views/default/profile/profile_contents/details.php23
-rwxr-xr-xmod/profile/views/default/profile/profile_contents/friends.php6
-rw-r--r--mod/profile/views/default/profile/profile_contents/sidebar.php16
-rwxr-xr-xmod/profile/views/default/profile/profile_contents/twitter.php13
7 files changed, 38 insertions, 39 deletions
diff --git a/mod/profile/profile_lib.php b/mod/profile/profile_lib.php
index 176c6e4de..d92ad29b3 100644
--- a/mod/profile/profile_lib.php
+++ b/mod/profile/profile_lib.php
@@ -44,6 +44,7 @@ function profile_get_user_profile_html($user, $section = 'activity') {
break;
}
+ $body .= elgg_view('profile/profile_contents/sidebar');
return $body;
}
@@ -56,10 +57,11 @@ function profile_get_user_profile_html($user, $section = 'activity') {
*/
function profile_get_user_edit_content($user, $page) {
$section = (isset($page[2])) ? $page[2] : 'details';
+ $content = elgg_view('profile/profile_navigation', array('section' => $section, 'entity' => $user));
switch ($section) {
case 'icon':
- $content = elgg_view_title(elgg_echo('profile:edit'));
+ $content .= elgg_view_title(elgg_echo('profile:edit'));
$content .= elgg_view("profile/editicon", array('entity' => $user));
break;
default:
diff --git a/mod/profile/start.php b/mod/profile/start.php
index 2fef3f4d2..44a6d4e74 100644
--- a/mod/profile/start.php
+++ b/mod/profile/start.php
@@ -146,26 +146,29 @@ function profile_page_handler($page) {
switch ($action) {
case 'edit':
+ $layout = 'one_column_with_sidebar';
+
if (!$user || !$user->canEdit()) {
register_error(elgg_echo("profile:noaccess"));
forward();
}
$content = profile_get_user_edit_content($user, $page);
+ $content = elgg_view_layout($layout, 'asdf', $content);
break;
default:
+ $layout = 'one_column';
if (isset($page[1])) {
$section = $page[1];
} else {
$section = 'activity';
}
$content = profile_get_user_profile_html($user, $section);
+ $content = elgg_view_layout($layout, $content);
break;
}
- $content = elgg_view_layout('one_column', $content);
-
page_draw($title, $content);
return;
}
diff --git a/mod/profile/views/default/profile/profile_contents/activity.php b/mod/profile/views/default/profile/profile_contents/activity.php
index 62fc747e3..6cb2c3a7e 100755
--- a/mod/profile/views/default/profile/profile_contents/activity.php
+++ b/mod/profile/views/default/profile/profile_contents/activity.php
@@ -3,7 +3,7 @@
* Elgg user display (details)
* @uses $vars['entity'] The user entity
*/
-?>
+?>
<div id="profile_content">
<?php
if(is_plugin_enabled('thewire')) {
@@ -18,9 +18,3 @@
}
?>
</div>
-
-<div id="profile_sidebar">
-<?php
- echo elgg_view('profile/profile_ownerblock', array('smallicon' => true));
-?>
-</div>
diff --git a/mod/profile/views/default/profile/profile_contents/details.php b/mod/profile/views/default/profile/profile_contents/details.php
index c61379974..7c5e6a0a4 100755
--- a/mod/profile/views/default/profile/profile_contents/details.php
+++ b/mod/profile/views/default/profile/profile_contents/details.php
@@ -21,7 +21,7 @@
$value = $vars['entity']->$shortname;
if (!empty($value)) {
//This function controls the alternating class
- $even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even';
+ $even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even';
?>
<p class="<?php echo $even_odd; ?>">
<b><?php
@@ -37,27 +37,22 @@
}
}
?>
-<?php
+<?php
if (!get_plugin_setting('user_defined_fields', 'profile')) {
?>
-<?php
+<?php
if ($vars['entity']->isBanned()) {
echo "<div class='banned_user'>";
echo elgg_echo('profile:banned');
echo "</div>";
- }else{
- if($vars['entity']->description){
+ }else{
+ if($vars['entity']->description){
echo "<p class='aboutme_title'><b>" . elgg_echo("profile:aboutme") . "</b></p>";
- echo "<div class='aboutme_contents'>" .elgg_view('output/longtext', array('value' => $vars['entity']->description))."</div>";
+ echo "<div class='aboutme_contents'>" .elgg_view('output/longtext', array('value' => $vars['entity']->description))."</div>";
}
?>
<?php } ?>
- <?php
+ <?php
}
-
- echo "</div>";
- // profile sidebar
- echo "<div id='profile_sidebar'>";
- echo elgg_view('profile/profile_ownerblock');
- echo "</div>";
-?>
+
+ echo "</div>"; \ No newline at end of file
diff --git a/mod/profile/views/default/profile/profile_contents/friends.php b/mod/profile/views/default/profile/profile_contents/friends.php
index 4fa290a7f..a097f3830 100755
--- a/mod/profile/views/default/profile/profile_contents/friends.php
+++ b/mod/profile/views/default/profile/profile_contents/friends.php
@@ -12,10 +12,4 @@ if(!$friends)
<?php
echo $friends;
?>
-</div>
-
-<div id="profile_sidebar">
-<?php
- echo elgg_view('profile/profile_ownerblock', array('smallicon' => true));
-?>
</div> \ No newline at end of file
diff --git a/mod/profile/views/default/profile/profile_contents/sidebar.php b/mod/profile/views/default/profile/profile_contents/sidebar.php
new file mode 100644
index 000000000..49ca06484
--- /dev/null
+++ b/mod/profile/views/default/profile/profile_contents/sidebar.php
@@ -0,0 +1,16 @@
+<?php
+/**
+ * Elgg profile icon edit form
+ *
+ * @package ElggProfile
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.com/
+ */
+?>
+<div id="profile_sidebar">
+<?php
+ echo elgg_view('profile/profile_ownerblock', array('smallicon' => true));
+?>
+</div> \ No newline at end of file
diff --git a/mod/profile/views/default/profile/profile_contents/twitter.php b/mod/profile/views/default/profile/profile_contents/twitter.php
index 75b6d0467..f9b6f5d54 100755
--- a/mod/profile/views/default/profile/profile_contents/twitter.php
+++ b/mod/profile/views/default/profile/profile_contents/twitter.php
@@ -2,9 +2,9 @@
/**
* Elgg twitter view page
*/
-
+
$twitter_username = $vars['entity']->twitter;
-
+
// if the twitter username is empty, then do not show
if($twitter_username){
?>
@@ -14,11 +14,6 @@ if($twitter_username){
<script type="text/javascript" src="http://twitter.com/javascripts/blogger.js"></script>
<script type="text/javascript" src="http://twitter.com/statuses/user_timeline/<?php echo $twitter_username; ?>.json?callback=twitterCallback2&count=10"></script>
</div>
-<div id="profile_sidebar">
+
<?php
- echo elgg_view('profile/profile_ownerblock', array('smallicon' => true));
-?>
-</div>
-<?php
-}
-?> \ No newline at end of file
+} \ No newline at end of file