]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Pulled profile sidebar out into separate view.
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 4 Mar 2010 17:53:57 +0000 (17:53 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 4 Mar 2010 17:53:57 +0000 (17:53 +0000)
Using one_column_with_sidebar layout for editing profile.

git-svn-id: http://code.elgg.org/elgg/trunk@5285 36083f99-b078-4883-b0ff-0f9b5a30f544

mod/profile/profile_lib.php
mod/profile/start.php
mod/profile/views/default/profile/profile_contents/activity.php
mod/profile/views/default/profile/profile_contents/details.php
mod/profile/views/default/profile/profile_contents/friends.php
mod/profile/views/default/profile/profile_contents/sidebar.php [new file with mode: 0644]
mod/profile/views/default/profile/profile_contents/twitter.php

index 176c6e4de24d9abc9ea0c89ef25c8ac493e8f6ea..d92ad29b3ea3ec0fd0c32b8898d2eb063969fea0 100644 (file)
@@ -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:
index 2fef3f4d21b6fd7d082656b44231458f8b1c4303..44a6d4e745b4e720d3005d0ac03640cf9516cee0 100644 (file)
@@ -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;
 }
index 62fc747e3a805794125351821f88ec4983486621..6cb2c3a7ecfb0488af1859480693400a35c91d3c 100755 (executable)
@@ -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>
index c613799745bcbea880c39488bbfac89ed378a8c6..7c5e6a0a4f85df55d47d8123c73d0df853522542 100755 (executable)
@@ -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
                        }
        }
 ?>
-<?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
index 4fa290a7fb6c1b61789c0b36f59502ac09c840d1..a097f3830e7e20f2681b8c4bb60b5f331d8a6410 100755 (executable)
@@ -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 (file)
index 0000000..49ca064
--- /dev/null
@@ -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
index 75b6d0467d81ad011677d78d3545d8d555fccfaa..f9b6f5d5451bafd1a8a75f85b95a669748737e5b 100755 (executable)
@@ -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