aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-27 20:37:17 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-27 20:37:17 +0000
commit0ffda3e1b6c4bddee2ec45ea0bce793844b02bf6 (patch)
tree36b999e8558ebc6ae1f882de7684f7ac5d36bd79
parent4ec370d484881acd99e8b7c3ae5ecda954f8ee99 (diff)
downloadelgg-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
-rw-r--r--mod/profile/graphics/drag_handle.pngbin594 -> 0 bytes
-rw-r--r--mod/profile/graphics/twitter16px.pngbin724 -> 0 bytes
-rw-r--r--mod/profile/languages/en.php117
-rw-r--r--mod/profile/start.php35
-rw-r--r--mod/profile/views/default/profile/box.php26
-rw-r--r--mod/profile/views/default/profile/css.php39
-rw-r--r--mod/profile/views/default/profile/details.php12
-rw-r--r--mod/profile/views/default/profile/listing.php49
-rw-r--r--mod/profile/views/default/profile/menu/adminlinks.php28
-rw-r--r--mod/profile/views/default/profile/menu/friendlinks.php23
-rw-r--r--mod/profile/views/default/profile/menu/links.php9
-rwxr-xr-xmod/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.php13
-rw-r--r--mod/profile/views/default/profile/wrapper.php18
14 files changed, 43 insertions, 357 deletions
diff --git a/mod/profile/graphics/drag_handle.png b/mod/profile/graphics/drag_handle.png
deleted file mode 100644
index 2e9bc42be..000000000
--- a/mod/profile/graphics/drag_handle.png
+++ /dev/null
Binary files differ
diff --git a/mod/profile/graphics/twitter16px.png b/mod/profile/graphics/twitter16px.png
deleted file mode 100644
index de51c6953..000000000
--- a/mod/profile/graphics/twitter16px.png
+++ /dev/null
Binary files differ
diff --git a/mod/profile/languages/en.php b/mod/profile/languages/en.php
index 6017a590c..50f04bb33 100644
--- a/mod/profile/languages/en.php
+++ b/mod/profile/languages/en.php
@@ -4,121 +4,8 @@
*/
$english = array(
-
-/**
- * Profile
- */
-
- 'profile' => "Profile",
- 'profile:edit:default' => 'Profile fields',
- 'profile:preview' => 'Preview',
-
-/**
- * Profile menu items and titles
- */
-
- 'profile:yours' => "My profile",
- 'profile:user' => "%s's profile",
-
- 'profile:edit' => "Edit profile",
- 'profile:profilepictureinstructions' => "Your avatar is the image that's displayed on your profile page. <br /> You can change it as often as you'd like. (File formats accepted: GIF, JPG or PNG)",
- 'profile:icon' => "Avatar",
- 'profile:createicon' => "Create your avatar",
- 'profile:currentavatar' => "Current avatar",
- 'profile:createicon:header' => "Profile picture",
- 'profile:profilepicturecroppingtool' => "Avatar cropping tool",
- 'profile:createicon:instructions' => "Click and drag a square below to match how you want your avatar cropped. A preview will appear in the box on the right. When you are happy with the preview, click 'Create your avatar'. This cropped version will be used throughout the site as your avatar. ",
-
- 'profile:editdetails' => "Edit profile",
- 'profile:editicon' => "Edit avatar",
-
- 'profile:aboutme' => "About me",
- 'profile:description' => "About me",
- 'profile:briefdescription' => "Brief description",
- 'profile:location' => "Location",
- 'profile:skills' => "Skills",
- 'profile:interests' => "Interests",
- 'profile:contactemail' => "Contact email",
- 'profile:phone' => "Telephone",
- 'profile:mobile' => "Mobile phone",
- 'profile:website' => "Website",
-
- 'profile:banned' => 'This user account has been suspended.',
- 'profile:deleteduser' => 'Deleted user',
-
- 'profile:river:update' => "%s updated their profile",
- 'profile:river:iconupdate' => "%s updated their profile icon",
-
- 'profile:label' => "Profile label",
- 'profile:type' => "Profile type",
- 'profile:twitter' => "Twitter username",
- 'twitter:visit' => "Visit this Twitter account",
- 'profile:editdefault:fail' => 'Default profile could not be saved',
- 'profile:editdefault:success' => 'Item successfully added to default profile',
-
-
- 'profile:editdefault:delete:fail' => 'Removed default profile item field failed',
- 'profile:editdefault:delete:success' => 'Default profile item deleted!',
-
- 'profile:defaultprofile:reset' => 'Default system profile reset',
-
- 'profile:resetdefault' => 'Reset default profile',
- 'profile:explainchangefields' => 'You can replace the existing profile fields with your own using the form below. <br /><br />Give the new profile field a label, for example, \'Favorite team\', then select the field type (eg. text, url, tags), and click the \'Add\' button. To re-order the fields drag on the handle next to the field label. To edit a field label - click on the label\'s text to make it editable. <br />At any time you can revert back to the default profile set up, but you will loose any information already entered into custom fields on profile pages.',
-
-
-/**
- * Profile status messages
- */
-
- 'profile:saved' => "Your profile was successfully saved.",
- 'profile:icon:uploaded' => "Your profile picture was successfully uploaded.",
-
-/**
- * Profile comment wall
- **/
- 'profile:commentwall:add' => "Add to the wall",
- 'profile:commentwall' => "Comment Wall",
- 'profile:commentwall:posted' => "You successfully posted on the comment wall.",
- 'profile:commentwall:deleted' => "You successfully deleted the message.",
- 'profile:commentwall:blank' => "Sorry; you need to actually put something in the message area before we can save it.",
- 'profile:commentwall:notfound' => "Sorry; we could not find the specified item.",
- 'profile:commentwall:notdeleted' => "Sorry; we could not delete this message.",
- 'profile:commentwall:none' => "No comment wall posts found.",
- 'profile:commentwall:somethingwentwrong' => "Something went wrong when trying to save your message, make sure you actually wrote a message.",
- 'profile:commentwall:failure' => "An unexpected error occurred when adding your message. Please try again.",
-
-/**
- * Email messages commentwall
- */
-
- 'profile:comment:subject' => 'You have a new message on your comment wall!',
- 'profile:comment:body' => "You have a new message on your comment wall from %s. It reads:
-
-
-%s
-
-
-To view your message board comments, click here:
-
- %s
-
-To view %s's profile, click here:
-
- %s
-
-You cannot reply to this email.",
-
-/**
- * Profile error messages
- */
-
- 'profile:no_friends' => 'This person hasn\'t added any friends yet!',
- 'profile:no_groups' => 'This user has not joined any groups yet.',
- 'profile:noaccess' => "You do not have permission to edit this profile.",
- 'profile:notfound' => "Sorry, we could not find the specified profile.",
- 'profile:icon:notfound' => "Sorry, there was a problem uploading your profile picture.",
- 'profile:icon:noaccess' => 'You cannot change this profile icon',
- 'profile:field_too_long' => 'Cannot save your profile information because the "%s" section is too long.',
+ 'profile' => 'Profile',
+ 'profile:notfound' => 'Sorry. We could not find the requested profile.',
);
diff --git a/mod/profile/start.php b/mod/profile/start.php
index 017f91378..49f310882 100644
--- a/mod/profile/start.php
+++ b/mod/profile/start.php
@@ -8,8 +8,7 @@
elgg_register_event_handler('init', 'system', 'profile_init', 1);
/**
- * Profile init function; sets up the profile functions
- *
+ * Profile init function
*/
function profile_init() {
global $CONFIG;
@@ -33,12 +32,6 @@ function profile_init() {
elgg_extend_view('html_head/extend', 'profile/metatags');
elgg_extend_view('css/screen', 'profile/css');
-
- // Register actions
- elgg_register_action("profile/addcomment", $CONFIG->pluginspath . "profile/actions/addcomment.php");
- elgg_register_action("profile/deletecomment", $CONFIG->pluginspath . "profile/actions/deletecomment.php");
-
- elgg_register_event_handler('profileupdate', 'all', 'object_notifications');
// allow ECML in parts of the profile
elgg_register_plugin_hook_handler('get_views', 'ecml', 'profile_ecml_views_hook');
@@ -70,14 +63,14 @@ function profile_page_handler($page) {
}
if ($action == 'edit') {
- // use for the core profile edit page
+ // use the core profile edit page
require $CONFIG->path . 'pages/profile/edit.php';
return;
}
// main profile page
$params = array(
- 'box' => elgg_view('profile/box'),
+ 'box' => elgg_view('profile/wrapper'),
'num_columns' => 3,
);
$content = elgg_view_layout('widgets', $params);
@@ -87,28 +80,6 @@ function profile_page_handler($page) {
}
/**
- * Returns the html for a user profile.
- *
- * @param string $username The username of the profile to display
- * @param string $section Which section is currently selected.
- *
- * @todo - This should really use a plugin hook to get the list of plugin tabs
- *
- * @return mixed FALSE or html for the profile.
- */
-function profile_get_user_profile_html($user, $section = 'activity') {
- $body = elgg_view('profile/tab_navigation', array('section' => $section, 'entity' => $user));
- $view_options = array('entity' => $user);
-
- $content = elgg_view("profile/tabs/$section", $view_options);
-
- $body .= elgg_view('profile/content_wrapper', array('content' => $content));
-
- $body .= elgg_view('profile/sidebar', array('section' => $section));
- return $body;
-}
-
-/**
* Profile URL generator for $user->getUrl();
*
* @param ElggUser $user
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