aboutsummaryrefslogtreecommitdiff
path: root/views/default/core
diff options
context:
space:
mode:
Diffstat (limited to 'views/default/core')
-rw-r--r--views/default/core/avatar/crop.php16
-rw-r--r--views/default/core/avatar/upload.php51
-rw-r--r--views/default/core/friends/collection.php64
-rw-r--r--views/default/core/friends/collections.php39
-rw-r--r--views/default/core/friends/collectiontabs.php62
-rw-r--r--views/default/core/friends/tablelist.php50
-rw-r--r--views/default/core/friends/tablelistcountupdate.php17
-rw-r--r--views/default/core/river/filter.php38
-rw-r--r--views/default/core/settings/account/email.php2
-rw-r--r--views/default/core/settings/account/name.php2
-rw-r--r--views/default/core/settings/account/password.php12
-rw-r--r--views/default/core/settings/statistics/numentities.php2
-rw-r--r--views/default/core/settings/statistics/online.php11
-rw-r--r--views/default/core/walled_garden/login.php25
-rw-r--r--views/default/core/walled_garden/lost_password.php13
-rw-r--r--views/default/core/walled_garden/register.php17
16 files changed, 387 insertions, 34 deletions
diff --git a/views/default/core/avatar/crop.php b/views/default/core/avatar/crop.php
new file mode 100644
index 000000000..1c59842c8
--- /dev/null
+++ b/views/default/core/avatar/crop.php
@@ -0,0 +1,16 @@
+<?php
+/**
+ * Avatar cropping view
+ *
+ * @uses vars['entity']
+ */
+
+?>
+<div id="avatar-croppingtool" class="mtl ptm">
+ <label><?php echo elgg_echo('avatar:crop:title'); ?></label>
+ <br />
+ <p>
+ <?php echo elgg_echo("avatar:create:instructions"); ?>
+ </p>
+ <?php echo elgg_view_form('avatar/crop', array(), $vars); ?>
+</div>
diff --git a/views/default/core/avatar/upload.php b/views/default/core/avatar/upload.php
new file mode 100644
index 000000000..6f9124192
--- /dev/null
+++ b/views/default/core/avatar/upload.php
@@ -0,0 +1,51 @@
+<?php
+/**
+ * Avatar upload view
+ *
+ * @uses $vars['entity']
+ */
+
+$user_avatar = elgg_view('output/img', array(
+ 'src' => $vars['entity']->getIconUrl('medium'),
+ 'alt' => elgg_echo('avatar'),
+));
+
+$current_label = elgg_echo('avatar:current');
+
+$remove_button = '';
+if ($vars['entity']->icontime) {
+ $remove_button = elgg_view('output/url', array(
+ 'text' => elgg_echo('remove'),
+ 'title' => elgg_echo('avatar:remove'),
+ 'href' => 'action/avatar/remove?guid=' . elgg_get_page_owner_guid(),
+ 'is_action' => true,
+ 'class' => 'elgg-button elgg-button-cancel mll',
+ ));
+}
+
+$form_params = array('enctype' => 'multipart/form-data');
+$upload_form = elgg_view_form('avatar/upload', $form_params, $vars);
+
+?>
+
+<p class="mtm">
+ <?php echo elgg_echo('avatar:upload:instructions'); ?>
+</p>
+
+<?php
+
+$image = <<<HTML
+<div id="current-user-avatar" class="mrl prl">
+ <label>$current_label</label><br />
+ $user_avatar
+</div>
+$remove_button
+HTML;
+
+$body = <<<HTML
+<div id="avatar-upload">
+ $upload_form
+</div>
+HTML;
+
+echo elgg_view_image_block($image, $upload_form);
diff --git a/views/default/core/friends/collection.php b/views/default/core/friends/collection.php
new file mode 100644
index 000000000..1a330af01
--- /dev/null
+++ b/views/default/core/friends/collection.php
@@ -0,0 +1,64 @@
+<?php
+/**
+ * View a friends collection
+ *
+ * @package Elgg
+ * @subpackage Core
+ *
+ * @uses $vars['collection'] The individual friends collection
+ */
+
+$coll = $vars['collection'];
+
+if (is_array($vars['collection']->members)) {
+ $count = sizeof($vars['collection']->members);
+} else {
+ $count = 0;
+}
+
+echo "<li><h2>";
+
+//as collections are private, check that the logged in user is the owner
+if ($coll->owner_guid == elgg_get_logged_in_user_guid()) {
+ echo "<div class=\"friends_collections_controls\">";
+ echo elgg_view('output/confirmlink', array(
+ 'href' => 'action/friends/collections/delete?collection=' . $coll->id,
+ 'class' => 'delete_collection',
+ 'text' => elgg_view_icon('delete'),
+ 'encode_text' => false,
+ ));
+ echo "</div>";
+}
+echo $coll->name;
+echo " (<span id=\"friends_membership_count{$vars['friendspicker']}\">{$count}</span>) </h2>";
+
+// individual collection panels
+$friends = $vars['collection']->entities;
+if ($friends) {
+ $content = elgg_view('core/friends/collectiontabs', array(
+ 'owner' => elgg_get_logged_in_user_entity(),
+ 'collection' => $vars['collection'],
+ 'friendspicker' => $vars['friendspicker'],
+ ));
+
+ echo elgg_view('input/friendspicker', array(
+ 'entities' => $friends,
+ 'value' => $vars['collection']->members,
+ 'content' => $content,
+ 'replacement' => '',
+ 'friendspicker' => $vars['friendspicker'],
+ ));
+?>
+<?php //@todo JS 1.8: no ?>
+ <script type="text/javascript">
+ $(function () {
+
+ $('#friends-picker_placeholder<?php echo $vars['friendspicker']; ?>').load(elgg.config.wwwroot + 'pages/friends/collections/pickercallback.php?username=<?php echo elgg_get_logged_in_user_entity()->username; ?>&type=list&collection=<?php echo $vars['collection']->id; ?>');
+
+ });
+ </script>
+ <?php
+}
+
+// close friends-picker div and the accordian list item
+echo "</li>";
diff --git a/views/default/core/friends/collections.php b/views/default/core/friends/collections.php
new file mode 100644
index 000000000..c6ee082c8
--- /dev/null
+++ b/views/default/core/friends/collections.php
@@ -0,0 +1,39 @@
+<?php
+/**
+ * Elgg friends collections
+ * Lists a user's friends collections
+ *
+ * @package Elgg
+ * @subpackage Core
+ *
+ * @uses $vars['collections'] The array of friends collections
+ */
+
+if (is_array($vars['collections']) && sizeof($vars['collections'])) {
+ echo "<ul id=\"friends_collections_accordian\">";
+
+ $friendspicker = 0;
+ foreach ($vars['collections'] as $collection) {
+ $friendspicker++;
+ echo elgg_view('core/friends/collection', array(
+ 'collection' => $collection,
+ 'friendspicker' => $friendspicker,
+ ));
+ }
+
+ echo "</ul>";
+
+} else {
+ echo elgg_echo("friends:nocollections");
+}
+
+?>
+<?php //@todo JS 1.8: no ?>
+<script>
+$(function(){
+ $('#friends_collections_accordian h2').click(function () {
+ $(this.parentNode).children("[class=friends-picker-main-wrapper]").slideToggle("fast");
+ //return false;
+ });
+});
+</script>
diff --git a/views/default/core/friends/collectiontabs.php b/views/default/core/friends/collectiontabs.php
new file mode 100644
index 000000000..bf12e0edb
--- /dev/null
+++ b/views/default/core/friends/collectiontabs.php
@@ -0,0 +1,62 @@
+<?php
+/**
+ * Elgg friends collections
+ * Lists a user's friends collections
+ *
+ * @package Elgg
+ * @subpackage Core
+ *
+ * @uses $vars['collections'] The array of friends collections
+ */
+
+$friendspicker = $vars['friendspicker'];
+
+$collectionid = $vars['collection']->id;
+$ownerid = $vars['owner']->getGUID();
+
+?>
+
+<ul class="elgg-tabs">
+ <li class="elgg-state-selected">
+ <a href="#" class="collectionmembers<?php echo $friendspicker; ?>">
+ <?php echo elgg_echo('friends:collections:members'); ?>
+ </a>
+ </li>
+ <li>
+ <a href="#" class="editmembers<?php echo $friendspicker; ?>">
+ <?php echo elgg_echo('friends:collections:edit'); ?>
+ </a>
+ </li>
+</ul>
+
+<?php //@todo JS 1.8: no ?>
+<script type="text/javascript">
+$(function () {
+
+ $('a.collectionmembers<?php echo $friendspicker; ?>').click(function () {
+ // load collection members pane
+ $('#friends-picker_placeholder<?php echo $friendspicker; ?>').load('<?php echo elgg_get_site_url(); ?>pages/friends/collections/pickercallback.php?username=<?php echo elgg_get_logged_in_user_entity()->username; ?>&type=list&collection=<?php echo $collectionid; ?>&friendspicker=<?php echo $friendspicker; ?>');
+
+ // remove selected state from previous tab
+ $(this).parent().parent().find("li.elgg-state-selected").removeClass("elgg-state-selected");
+ // add selected class to current tab
+ $(this).parent().addClass("elgg-state-selected");
+
+ return false;
+ });
+
+ $('a.editmembers<?php echo $friendspicker; ?>').click(function () {
+ // load friends picker pane
+ $('#friends-picker_placeholder<?php echo $friendspicker; ?>').load('<?php echo elgg_get_site_url(); ?>pages/friends/collections/pickercallback.php?username=<?php echo elgg_get_logged_in_user_entity()->username; ?>&type=picker&collection=<?php echo $collectionid; ?>&friendspicker=<?php echo $friendspicker; ?>');
+
+ // remove selected state from previous tab
+ $(this).parent().parent().find("li.elgg-state-selected").removeClass("elgg-state-selected");
+ // add selected class to current tab
+ $(this).parent().addClass("elgg-state-selected");
+
+ return false;
+ });
+
+
+});
+</script>
diff --git a/views/default/core/friends/tablelist.php b/views/default/core/friends/tablelist.php
new file mode 100644
index 000000000..339b9ab1b
--- /dev/null
+++ b/views/default/core/friends/tablelist.php
@@ -0,0 +1,50 @@
+<?php
+/**
+ * Elgg friends picker
+ * Lists the friends picker
+ *
+ * @package Elgg
+ * @subpackage Core
+ *
+ * @uses $vars['entities'] The array of ElggUser objects
+ */
+
+if (is_array($vars['entities'])) {
+
+?>
+
+<table cellspacing="0" id="friendspicker-members-table">
+ <tr>
+ <?php
+ $column = 0;
+ foreach($vars['entities'] as $entity) {
+ if (!($entity instanceof ElggEntity)) {
+ $entity = get_entity($entity);
+ }
+
+ if ($entity instanceof ElggEntity) {
+ ?>
+ <td style="width:25px;">
+ <div style="width: 25px;" class="mbl">
+ <?php echo elgg_view_entity_icon($entity, 'tiny'); ?>
+ </div>
+ </td>
+ <td style="width: 200px;" class="pas">
+ <?php echo $entity->name; ?>
+ </td>
+ <?php
+ $column++;
+ if ($column == 3) {
+ echo "</tr><tr>";
+ $column = 0;
+ }
+ }
+ }
+
+if ($column < 3 && $column != 0) echo "</tr>";
+ echo "</table>";
+}
+
+if (isset($vars['content'])) {
+ echo $vars['content'];
+} \ No newline at end of file
diff --git a/views/default/core/friends/tablelistcountupdate.php b/views/default/core/friends/tablelistcountupdate.php
new file mode 100644
index 000000000..7a0da1caa
--- /dev/null
+++ b/views/default/core/friends/tablelistcountupdate.php
@@ -0,0 +1,17 @@
+<?php
+/**
+ * Elgg friends picker count updater
+ * Updates the friends count on a collection
+ *
+ * @package Elgg
+ * @subpackage Core
+ *
+ * @uses $vars['count'] The count
+ * @uses $vars['friendspicker'] The friendspicker counter number
+ */
+
+?>
+<?php //@todo JS 1.8: no ?>
+<script language="text/javascript">
+ $("#friends_membership_count<?php echo $vars['friendspicker']; ?>").html("<?php echo $vars['count']; ?>");
+</script> \ No newline at end of file
diff --git a/views/default/core/river/filter.php b/views/default/core/river/filter.php
new file mode 100644
index 000000000..9b7fadaa8
--- /dev/null
+++ b/views/default/core/river/filter.php
@@ -0,0 +1,38 @@
+<?php
+/**
+ * Content filter for river
+ *
+ * @uses $vars[]
+ */
+
+// create selection array
+$options = array();
+$options['type=all'] = elgg_echo('river:select', array(elgg_echo('all')));
+$registered_entities = elgg_get_config('registered_entities');
+
+if (!empty($registered_entities)) {
+ foreach ($registered_entities as $type => $subtypes) {
+ // subtype will always be an array.
+ if (!count($subtypes)) {
+ $label = elgg_echo('river:select', array(elgg_echo("item:$type")));
+ $options["type=$type"] = $label;
+ } else {
+ foreach ($subtypes as $subtype) {
+ $label = elgg_echo('river:select', array(elgg_echo("item:$type:$subtype")));
+ $options["type=$type&subtype=$subtype"] = $label;
+ }
+ }
+ }
+}
+
+$params = array(
+ 'id' => 'elgg-river-selector',
+ 'options_values' => $options,
+);
+$selector = $vars['selector'];
+if ($selector) {
+ $params['value'] = $selector;
+}
+echo elgg_view('input/dropdown', $params);
+
+elgg_load_js('elgg.ui.river');
diff --git a/views/default/core/settings/account/email.php b/views/default/core/settings/account/email.php
index bb809958d..4bcdbb100 100644
--- a/views/default/core/settings/account/email.php
+++ b/views/default/core/settings/account/email.php
@@ -10,7 +10,7 @@ $user = elgg_get_page_owner_entity();
if ($user) {
$title = elgg_echo('email:settings');
- $content = elgg_echo('email:address:label') . ' :<br /> ';
+ $content = elgg_echo('email:address:label') . ': ';
$content .= elgg_view('input/email', array(
'name' => 'email',
'value' => $user->email,
diff --git a/views/default/core/settings/account/name.php b/views/default/core/settings/account/name.php
index af1b9a1a7..e356146a3 100644
--- a/views/default/core/settings/account/name.php
+++ b/views/default/core/settings/account/name.php
@@ -9,7 +9,7 @@
$user = elgg_get_page_owner_entity();
if ($user) {
$title = elgg_echo('user:name:label');
- $content = elgg_echo('name') . ' :<br />';
+ $content = elgg_echo('name') . ': ';
$content .= elgg_view('input/text', array(
'name' => 'name',
'value' => $user->name,
diff --git a/views/default/core/settings/account/password.php b/views/default/core/settings/account/password.php
index f17f605c1..4857034b2 100644
--- a/views/default/core/settings/account/password.php
+++ b/views/default/core/settings/account/password.php
@@ -14,17 +14,17 @@ if ($user) {
// only make the admin user enter current password for changing his own password.
$admin = '';
if (!elgg_is_admin_logged_in() || elgg_is_admin_logged_in() && $user->guid == elgg_get_logged_in_user_guid()) {
- $admin .= elgg_echo('user:current_password:label') . ' :<br />';
- $admin .= elgg_view('input/password', array('name' => 'current_password', 'placeholder' => '&#149;&#149;&#149;&#149;&#149;&#149;'));
+ $admin .= elgg_echo('user:current_password:label') . ': ';
+ $admin .= elgg_view('input/password', array('name' => 'current_password'));
$admin = "<p>$admin</p>";
}
- $password = elgg_echo('user:password:label') . ' :<br />';
- $password .= elgg_view('input/password', array('name' => 'password', 'placeholder' => '&#149;&#149;&#149;&#149;&#149;&#149;'));
+ $password = elgg_echo('user:password:label') . ': ';
+ $password .= elgg_view('input/password', array('name' => 'password'));
$password = "<p>$password</p>";
- $password2 = elgg_echo('user:password2:label') . ' :<br />';
- $password2 .= elgg_view('input/password', array('name' => 'password2', 'placeholder' => '&#149;&#149;&#149;&#149;&#149;&#149;'));
+ $password2 = elgg_echo('user:password2:label') . ': ';
+ $password2 .= elgg_view('input/password', array('name' => 'password2'));
$password2 = "<p>$password2</p>";
$content = $admin . $password . $password2;
diff --git a/views/default/core/settings/statistics/numentities.php b/views/default/core/settings/statistics/numentities.php
index ce1705a2e..3782fd8bc 100644
--- a/views/default/core/settings/statistics/numentities.php
+++ b/views/default/core/settings/statistics/numentities.php
@@ -7,7 +7,7 @@
*/
// Get entity statistics
-$entity_stats = get_entity_statistics(elgg_get_logged_in_user_guid());
+$entity_stats = get_entity_statistics(elgg_get_page_owner_guid());
if ($entity_stats) {
$rows = '';
diff --git a/views/default/core/settings/statistics/online.php b/views/default/core/settings/statistics/online.php
index ce7ff35fb..1385ff60f 100644
--- a/views/default/core/settings/statistics/online.php
+++ b/views/default/core/settings/statistics/online.php
@@ -6,14 +6,7 @@
* @subpackage Core
*/
-$user = elgg_get_logged_in_user_entity();
-
-$logged_in = 0;
-$log = get_system_log($user->guid, "login", "", 'user', '', 1);
-
-if ($log) {
- $logged_in = $log[0]->time_created;
-}
+$user = elgg_get_page_owner_entity();
$label_name = elgg_echo('usersettings:statistics:label:name');
$label_email = elgg_echo('usersettings:statistics:label:email');
@@ -21,7 +14,7 @@ $label_member_since = elgg_echo('usersettings:statistics:label:membersince');
$label_last_login = elgg_echo('usersettings:statistics:label:lastlogin');
$time_created = date("r", $user->time_created);
-$last_login = date("r", $logged_in);
+$last_login = date("r", $user->last_login);
$title = elgg_echo('usersettings:statistics:yourdetails');
diff --git a/views/default/core/walled_garden/login.php b/views/default/core/walled_garden/login.php
index 34126e411..42b79607d 100644
--- a/views/default/core/walled_garden/login.php
+++ b/views/default/core/walled_garden/login.php
@@ -4,13 +4,9 @@
*/
$title = elgg_get_site_entity()->name;
-
-/**
$welcome = elgg_echo('walled_garden:welcome');
- */
-$welcome .= $title;
+$welcome .= ': <br/>' . $title;
-
$menu = elgg_view_menu('walled_garden', array(
'sort_by' => 'priority',
'class' => 'elgg-menu-general elgg-menu-hz',
@@ -18,21 +14,18 @@ $menu = elgg_view_menu('walled_garden', array(
$login_box = elgg_view('core/account/login_box', array('module' => 'walledgarden-login'));
-$content = <<<HTML
-
+echo <<<HTML
<div class="elgg-col elgg-col-1of2">
<div class="elgg-inner">
- <h1 class="elgg-heading-walledgarden">$welcome</h1><br />
- A message you can edit in cool_theme/views/default/core/walled_garden/login.php :-).<br />
+ <h1 class="elgg-heading-walledgarden">
+ $welcome
+ </h1>
+ $menu
</div>
</div>
<div class="elgg-col elgg-col-1of2">
- <div class="elgg-inner">$login_box</div>
+ <div class="elgg-inner">
+ $login_box
+ </div>
</div>
HTML;
-
-echo elgg_view_module('walledgarden', '', $content, array(
- 'class' => 'elgg-walledgarden-double',
- 'header' => ' ',
- 'footer' => ' ',
-)); \ No newline at end of file
diff --git a/views/default/core/walled_garden/lost_password.php b/views/default/core/walled_garden/lost_password.php
new file mode 100644
index 000000000..82f8caf50
--- /dev/null
+++ b/views/default/core/walled_garden/lost_password.php
@@ -0,0 +1,13 @@
+<?php
+/**
+ * Walled garden lost password
+ */
+
+$title = elgg_echo('user:password:lost');
+$body = elgg_view_form('user/requestnewpassword');
+echo <<<HTML
+<div class="elgg-inner">
+ <h3>$title</h3>
+ $body
+</div>
+HTML;
diff --git a/views/default/core/walled_garden/register.php b/views/default/core/walled_garden/register.php
new file mode 100644
index 000000000..1ce2f8716
--- /dev/null
+++ b/views/default/core/walled_garden/register.php
@@ -0,0 +1,17 @@
+<?php
+/**
+ * Walled garden registration
+ */
+
+$title = elgg_echo('register');
+$body = elgg_view_form('register', array(), array(
+ 'friend_guid' => (int) get_input('friend_guid', 0),
+ 'invitecode' => get_input('invitecode'),
+));
+
+echo <<<__HTML
+<div class="elgg-inner">
+ <h2>$title</h2>
+ $body
+</div>
+__HTML;