aboutsummaryrefslogtreecommitdiff
path: root/mod/profile/views/default
diff options
context:
space:
mode:
Diffstat (limited to 'mod/profile/views/default')
-rw-r--r--mod/profile/views/default/profile/menu.php33
-rw-r--r--mod/profile/views/default/profile/userdetails.php78
-rw-r--r--mod/profile/views/default/user/user.php65
3 files changed, 113 insertions, 63 deletions
diff --git a/mod/profile/views/default/profile/menu.php b/mod/profile/views/default/profile/menu.php
new file mode 100644
index 000000000..463301398
--- /dev/null
+++ b/mod/profile/views/default/profile/menu.php
@@ -0,0 +1,33 @@
+<?php
+
+ /**
+ * Elgg profile menu
+ *
+ * @package ElggProfile
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Ben Werdmuller <ben@curverider.co.uk>
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.com/
+ *
+ * @uses $vars['entity'] The user entity
+ */
+
+ if (isloggedin() && $vars['entity']->getGUID() != $vars['user']->getGUID()) {
+
+ if ($vars['entity']->isFriend()) {
+
+ echo "<p><a href=\"{$vars['url']}action/friends/remove?friend={$vars['entity']->getGUID()}\">" . elgg_echo("friend:remove") . "</a></p>";
+
+ } else {
+
+ echo "<p><a href=\"{$vars['url']}action/friends/add?friend={$vars['entity']->getGUID()}\">" . elgg_echo("friend:add") . "</a></p>";
+
+ }
+
+ echo "<p>&nbsp;</p>";
+
+ }
+
+?>
+ <p><a href="<?php echo $vars['url']; ?>pg/friends/<?php echo $vars['entity']->username ?>/"><?php echo sprintf(elgg_echo("friends:owned"),$vars['entity']->name) ?></a></p>
+ <p><a href="<?php echo $vars['url']; ?>pg/friendsof/<?php echo $vars['entity']->username ?>/"><?php echo sprintf(elgg_echo("friends:of:owned"),$vars['entity']->name) ?></a></p> \ No newline at end of file
diff --git a/mod/profile/views/default/profile/userdetails.php b/mod/profile/views/default/profile/userdetails.php
new file mode 100644
index 000000000..c405e78a9
--- /dev/null
+++ b/mod/profile/views/default/profile/userdetails.php
@@ -0,0 +1,78 @@
+<?php
+
+ /**
+ * Elgg user display (details)
+ *
+ * @package ElggProfile
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Ben Werdmuller <ben@curverider.co.uk>
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.com/
+ *
+ * @uses $vars['entity'] The user entity
+ */
+
+ if ($vars['full'] == true) {
+ $iconsize = "large";
+ } else {
+ $iconsize = "medium";
+ }
+ echo elgg_view(
+ "profile/icon", array(
+ 'entity' => $vars['entity'],
+ 'align' => "right",
+ 'size' => $iconsize,
+ )
+ );
+
+?>
+ <h2><a href="<?php echo $vars['entity']->getUrl(); ?>"><?php echo $vars['entity']->name; ?></a></h2>
+ <?php
+
+ if ($vars['full'] == true) {
+
+ ?>
+ <p><b><?php echo elgg_echo("profile:aboutme"); ?></b></p>
+ <p><?php echo nl2br($vars['entity']->description); ?></p>
+ <?php
+
+ 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;
+ if (!empty($value)) {
+
+ ?>
+
+ <p>
+ <b><?php
+
+ echo elgg_echo("profile:{$shortname}");
+
+ ?>: </b>
+ <?php
+
+ echo elgg_view("output/{$valtype}",array('value' => $vars['entity']->$shortname));
+
+ ?>
+
+ </p>
+
+ <?php
+ }
+ }
+ }
+
+ }
+
+ if ($vars['entity']->canEdit()) {
+
+ ?>
+ <p>
+ <a href="<?php echo $vars['url']; ?>mod/profile/edit.php"><?php echo elgg_echo("edit"); ?></a>
+ </p>
+ <?php
+
+ }
+
+ ?> \ No newline at end of file
diff --git a/mod/profile/views/default/user/user.php b/mod/profile/views/default/user/user.php
index 102932233..345a8aabb 100644
--- a/mod/profile/views/default/user/user.php
+++ b/mod/profile/views/default/user/user.php
@@ -12,67 +12,6 @@
* @uses $vars['entity'] The user entity
*/
- if ($vars['full'] == true) {
- $iconsize = "large";
- } else {
- $iconsize = "medium";
- }
- echo elgg_view(
- "profile/icon", array(
- 'entity' => $vars['entity'],
- 'align' => "right",
- 'size' => $iconsize,
- )
- );
-
-?>
- <h2><a href="<?php echo $vars['entity']->getUrl(); ?>"><?php echo $vars['entity']->name; ?></a></h2>
- <?php
-
- if ($vars['full'] == true) {
-
- ?>
- <p><b><?php echo elgg_echo("profile:aboutme"); ?></b></p>
- <p><?php echo nl2br($vars['entity']->description); ?></p>
- <?php
-
- 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;
- if (!empty($value)) {
-
- ?>
-
- <p>
- <b><?php
-
- echo elgg_echo("profile:{$shortname}");
-
- ?>: </b>
- <?php
-
- echo elgg_view("output/{$valtype}",array('value' => $vars['entity']->$shortname));
-
- ?>
-
- </p>
-
- <?php
- }
- }
- }
-
- }
-
- if ($vars['entity']->canEdit()) {
-
- ?>
- <p>
- <a href="<?php echo $vars['url']; ?>mod/profile/edit.php"><?php echo elgg_echo("edit"); ?></a>
- </p>
- <?php
-
- }
+ echo elgg_view_layout("one_column",elgg_view("profile/userdetails",$vars),elgg_view("profile/menu",$vars));
- ?> \ No newline at end of file
+?> \ No newline at end of file