diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-12-27 20:37:17 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-12-27 20:37:17 +0000 |
commit | 0ffda3e1b6c4bddee2ec45ea0bce793844b02bf6 (patch) | |
tree | 36b999e8558ebc6ae1f882de7684f7ac5d36bd79 /mod/profile/views | |
parent | 4ec370d484881acd99e8b7c3ae5ecda954f8ee99 (diff) | |
download | elgg-0ffda3e1b6c4bddee2ec45ea0bce793844b02bf6.tar.gz elgg-0ffda3e1b6c4bddee2ec45ea0bce793844b02bf6.tar.bz2 |
more clean up of the basic profile plugin - reorged views and removed a lot of cruft
git-svn-id: http://code.elgg.org/elgg/trunk@7726 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/profile/views')
-rw-r--r-- | mod/profile/views/default/profile/box.php | 26 | ||||
-rw-r--r-- | mod/profile/views/default/profile/css.php | 39 | ||||
-rw-r--r-- | mod/profile/views/default/profile/details.php | 12 | ||||
-rw-r--r-- | mod/profile/views/default/profile/listing.php | 49 | ||||
-rw-r--r-- | mod/profile/views/default/profile/menu/adminlinks.php | 28 | ||||
-rw-r--r-- | mod/profile/views/default/profile/menu/friendlinks.php | 23 | ||||
-rw-r--r-- | mod/profile/views/default/profile/menu/links.php | 9 | ||||
-rwxr-xr-x | mod/profile/views/default/profile/owner_block.php (renamed from mod/profile/views/default/profile/ownerblock.php) | 31 | ||||
-rw-r--r-- | mod/profile/views/default/profile/sidebar.php | 13 | ||||
-rw-r--r-- | mod/profile/views/default/profile/wrapper.php | 18 |
10 files changed, 38 insertions, 210 deletions
diff --git a/mod/profile/views/default/profile/box.php b/mod/profile/views/default/profile/box.php deleted file mode 100644 index 77c408536..000000000 --- a/mod/profile/views/default/profile/box.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php -/** - * Profile info box - */ - -?> -<div class="profile elgg-col-2of3"> - <div class="elgg-inner clearfix"> -<?php - echo elgg_view('profile/sidebar', array('section' => 'details')); - echo elgg_view('profile/details', array('entity' => elgg_get_page_owner())); -?> - </div> -</div> - -<script type="text/javascript"> - $(document).ready(function() { - $('#elgg-widget-col-1').css('min-height', $('.profile').outerHeight(true)); - //$(selector).each(function() { - // if ($(this).height() > maxHeight) { - // maxHeight = $(this).height(); - // } - //}) - //$(selector).css('min-height', maxHeight); - }); -</script>
\ No newline at end of file diff --git a/mod/profile/views/default/profile/css.php b/mod/profile/views/default/profile/css.php index 1d1f1ccb1..f280db565 100644 --- a/mod/profile/views/default/profile/css.php +++ b/mod/profile/views/default/profile/css.php @@ -1,12 +1,12 @@ <?php /** - * Elgg Profile + * Elgg Profile CSS * * @package Profile */ ?> /* *************************************** - main layout blocks + Profile *************************************** */ .profile { float: left; @@ -18,23 +18,17 @@ -webkit-border-radius: 8px; -moz-border-radius: 8px; } -#profile-sidebar { - width:230px; - float:left; -} #profile-details { padding: 15px; } - -/* *************************************** - ownerblock in sidebar -*************************************** */ +/*** ownerblock ***/ #profile-owner-block { + width: 200px; + float: left; background-color: #eeeeee; padding: 15px; } -.owner_block_icon { - overflow: hidden; +#profile-owner-block .large { margin-bottom: 10px; } #profile-owner-block a.elgg-action-button { @@ -54,10 +48,6 @@ color: white; text-decoration: none; } - -/* *************************************** - admin menu in sidebar -*************************************** */ .profile-admin-menu { display: none; } @@ -82,10 +72,7 @@ .profile-admin-menu-wrapper a:hover { color: black; } - -/* *************************************** - full profile info panel -*************************************** */ +/*** profile details ***/ #profile-details .odd { background-color:#f4f4f4; -webkit-border-radius: 4px; @@ -110,10 +97,6 @@ #profile-details .aboutme_contents { padding:2px 0 0 3px; } - -/* *************************************** - banned user -*************************************** */ /* banned user full profile panel */ #profile_content .banned_user { border:2px solid red; @@ -121,11 +104,3 @@ -webkit-border-radius: 6px; -moz-border-radius: 6px; } -/* banned user in friends lists */ -.entity-listing-info p.entity-title.user.banned { - text-decoration: line-through; -} -.entity-listing-info p.entity-title.user.banned a { - color:red; -} - diff --git a/mod/profile/views/default/profile/details.php b/mod/profile/views/default/profile/details.php index c2f4cc01b..b81db30fd 100644 --- a/mod/profile/views/default/profile/details.php +++ b/mod/profile/views/default/profile/details.php @@ -4,14 +4,16 @@ * @uses $vars['entity'] The user entity */ +$user = elgg_get_page_owner(); + echo '<div id="profile-details" class="elgg-body pll">'; -echo "<h2>{$vars['entity']->name}</h2>"; +echo "<h2>{$user->name}</h2>"; $even_odd = null; if (is_array($vars['config']->profile) && sizeof($vars['config']->profile) > 0) { foreach($vars['config']->profile as $shortname => $valtype) { if ($shortname != "description") { - $value = $vars['entity']->$shortname; + $value = $user->$shortname; if (!empty($value)) { //This function controls the alternating class $even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even'; @@ -21,7 +23,7 @@ if (is_array($vars['config']->profile) && sizeof($vars['config']->profile) > 0) echo elgg_echo("profile:{$shortname}"); ?>: </b> <?php - echo elgg_view("output/{$valtype}", array('value' => $vars['entity']->$shortname)); + echo elgg_view("output/{$valtype}", array('value' => $user->$shortname)); ?> </p> <?php @@ -31,9 +33,9 @@ if (is_array($vars['config']->profile) && sizeof($vars['config']->profile) > 0) } if (!get_plugin_setting('user_defined_fields', 'profile')) { - if ($vars['entity']->isBanned()) { + if ($user->isBanned()) { echo "<div class='banned_user'>"; - echo elgg_echo('profile:banned'); + echo elgg_echo('banned'); echo "</div>"; } else { if ($vars['entity']->description) { diff --git a/mod/profile/views/default/profile/listing.php b/mod/profile/views/default/profile/listing.php deleted file mode 100644 index 489b1d50e..000000000 --- a/mod/profile/views/default/profile/listing.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php -/** - * Elgg user display (small) - * - * @package ElggProfile - * - * @uses $vars['entity'] The user entity - */ - -$icon = elgg_view( - "profile/icon", array( - 'entity' => $vars['entity'], - 'size' => 'tiny', - ) -); - -$banned = $vars['entity']->isBanned(); - -// Simple XFN -$rel_type = ""; -if (get_loggedin_userid() == $vars['entity']->guid) { - $rel_type = 'me'; -} elseif (check_entity_relationship(get_loggedin_userid(), 'friend', $vars['entity']->guid)) { - $rel_type = 'friend'; -} - -if ($rel_type) { - $rel = "rel=\"$rel_type\""; -} - -if (!$banned) { - $info .= "<p class='entity-title user'><a href=\"" . $vars['entity']->getUrl() . "\" $rel>" . $vars['entity']->name . "</a></p>"; - $location = $vars['entity']->location; - if (!empty($location)) { - $info .= "<p class='entity-subtext user'>" . elgg_echo("profile:location") . ": " . elgg_view("output/tags",array('value' => $vars['entity']->location)) . "</p>"; - } - //create a view that a status plugin could extend - in the default case, this is the wire - $info .= elgg_view("profile/status", array("entity" => $vars['entity'])); -}else{ - $info .= "<p class='entity-title user banned'>"; - if (isadminloggedin()) - $info .= "<a href=\"" . $vars['entity']->getUrl() . "\">"; - $info .= $vars['entity']->name; - if (isadminloggedin()) - $info .= "</a>"; - $info .= "</p>"; -} - -echo elgg_view_image_block($icon, $info); diff --git a/mod/profile/views/default/profile/menu/adminlinks.php b/mod/profile/views/default/profile/menu/adminlinks.php deleted file mode 100644 index 39807764a..000000000 --- a/mod/profile/views/default/profile/menu/adminlinks.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php -/** - * Profile admin context links - * - * @package ElggProfile - * - * @uses $vars['entity'] The user entity - */ - -if (isadminloggedin()){ - if (get_loggedin_userid()!=$vars['entity']->guid){ -?> - <a href="<?php echo elgg_get_site_url(); ?>pg/settings/user/<?php echo $vars['entity']->username; ?>/"><?php echo elgg_echo('profile:editdetails'); ?></a> -<?php - if (!$vars['entity']->isBanned()) { - echo elgg_view('output/confirmlink', array('text' => elgg_echo("ban"), 'href' => "action/admin/user/ban?guid={$vars['entity']->guid}")); - } else { - echo elgg_view('output/confirmlink', array('text' => elgg_echo("unban"), 'href' => "action/admin/user/unban?guid={$vars['entity']->guid}")); - } - echo elgg_view('output/confirmlink', array('text' => elgg_echo("delete"), 'href' => "action/admin/user/delete?guid={$vars['entity']->guid}")); - echo elgg_view('output/confirmlink', array('text' => elgg_echo("resetpassword"), 'href' => "action/admin/user/resetpassword?guid={$vars['entity']->guid}")); - if (!$vars['entity']->isAdmin()) { - echo elgg_view('output/confirmlink', array('text' => elgg_echo("makeadmin"), 'href' => "action/admin/user/makeadmin?guid={$vars['entity']->guid}")); - } else { - echo elgg_view('output/confirmlink', array('text' => elgg_echo("removeadmin"), 'href' => "action/admin/user/removeadmin?guid={$vars['entity']->guid}")); - } - } - } diff --git a/mod/profile/views/default/profile/menu/friendlinks.php b/mod/profile/views/default/profile/menu/friendlinks.php deleted file mode 100644 index ed13edb8b..000000000 --- a/mod/profile/views/default/profile/menu/friendlinks.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php -/** - * Elgg profile icon avatar menu: Add / Remove friend links - * - * @package ElggProfile - * - * @uses $vars['entity'] The user entity. If none specified, the current user is assumed. - */ -$ts = time(); -$token = generate_action_token($ts); -if ($vars['entity']->isFriend()) { - echo elgg_view('output/confirmlink', array( - 'href' => "action/friends/remove?friend={$vars['entity']->getGUID()}", - 'text' => elgg_echo('friend:remove'), - 'class' => 'remove_friend' - )); -} else { - echo elgg_view('output/confirmlink', array( - 'href' => "action/friends/add?friend={$vars['entity']->getGUID()}", - 'text' => elgg_echo('friend:add'), - 'class' => 'add_friend' - )); -}
\ No newline at end of file diff --git a/mod/profile/views/default/profile/menu/links.php b/mod/profile/views/default/profile/menu/links.php deleted file mode 100644 index 4233d7ec5..000000000 --- a/mod/profile/views/default/profile/menu/links.php +++ /dev/null @@ -1,9 +0,0 @@ -<?php -/** - * Elgg profile icon avatar menu: view for plugins to extend - * - * @package ElggProfile - * - * @uses $vars['entity'] The user entity. If none specified, the current user is assumed. - */ -?> diff --git a/mod/profile/views/default/profile/ownerblock.php b/mod/profile/views/default/profile/owner_block.php index ac0cb5b54..acff5c2d4 100755 --- a/mod/profile/views/default/profile/ownerblock.php +++ b/mod/profile/views/default/profile/owner_block.php @@ -1,34 +1,21 @@ <?php /** - * A simple owner block which houses info about the user whose 'stuff' you are looking at + * Profile owner block */ -// get the user who owns this profile -if ($vars['entity']) { - if ($vars['context'] == 'edit') { - $user = get_entity($vars['entity']->container_guid); - } else { - $user = get_entity($vars['entity']->guid); - } -} else { - $user = elgg_get_page_owner(); -} +$user = elgg_get_page_owner(); + if (!$user) { // no user so we quit view echo elgg_echo('viewfailure', array(__FILE__)); return TRUE; } -$more_info = ''; - -$location = elgg_view("output/tags", array('value' => $user->location)); - $icon = elgg_view("profile/icon", array( 'entity' => $user, 'size' => 'large', 'override' => 'true' )); -$icon_class = "large"; // grab the actions and admin menu items from user hover $menu = elgg_trigger_plugin_hook('register', "menu:user_hover", array('entity' => $user), array()); @@ -66,19 +53,13 @@ $content_menu = elgg_view_menu('owner_block', array( 'class' => 'profile-content-menu', )); -//contruct the display -$display = <<<EOT +echo <<<HTML <div id="profile-owner-block"> - <div class="owner_block_icon $icon_class"> - $icon - </div> - $more_info + $icon $profile_actions $content_menu $admin_links </div> -EOT; - -echo $display; +HTML; diff --git a/mod/profile/views/default/profile/sidebar.php b/mod/profile/views/default/profile/sidebar.php deleted file mode 100644 index d98964f5b..000000000 --- a/mod/profile/views/default/profile/sidebar.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php -/** - * Elgg profile icon edit form - * - * @package ElggProfile - */ -?> -<div id="profile-sidebar"> -<?php - $section = $vars['section']; - echo elgg_view('profile/ownerblock', array('section' => $section)); -?> -</div>
\ No newline at end of file diff --git a/mod/profile/views/default/profile/wrapper.php b/mod/profile/views/default/profile/wrapper.php new file mode 100644 index 000000000..88e1cd22f --- /dev/null +++ b/mod/profile/views/default/profile/wrapper.php @@ -0,0 +1,18 @@ +<?php +/** + * Profile info box + */ + +?> +<div class="profile elgg-col-2of3"> + <div class="elgg-inner clearfix"> + <?php echo elgg_view('profile/owner_block'); ?> + <?php echo elgg_view('profile/details'); ?> + </div> +</div> + +<script type="text/javascript"> + $(document).ready(function() { + $('#elgg-widget-col-1').css('min-height', $('.profile').outerHeight(true)); + }); +</script>
\ No newline at end of file |