aboutsummaryrefslogtreecommitdiff
path: root/views/default/core/settings
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-17 20:36:36 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-17 20:36:36 +0000
commitdb787a3ab93da0c2141d33f3058f9dc2f34d6f2a (patch)
treedca419a399cb00f45c227aed7a62993b089e0f27 /views/default/core/settings
parentc2add32bbf281d488deb26343cf059e3347fe525 (diff)
downloadelgg-db787a3ab93da0c2141d33f3058f9dc2f34d6f2a.tar.gz
elgg-db787a3ab93da0c2141d33f3058f9dc2f34d6f2a.tar.bz2
reorganized the settings views and updated the pages to use new layout
git-svn-id: http://code.elgg.org/elgg/trunk@7663 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/core/settings')
-rw-r--r--views/default/core/settings/account.php15
-rw-r--r--views/default/core/settings/account/default_access.php29
-rw-r--r--views/default/core/settings/account/email.php25
-rw-r--r--views/default/core/settings/account/language.php32
-rw-r--r--views/default/core/settings/account/name.php15
-rw-r--r--views/default/core/settings/account/notifications.php51
-rw-r--r--views/default/core/settings/account/password.php42
-rw-r--r--views/default/core/settings/statistics.php6
-rw-r--r--views/default/core/settings/statistics/numentities.php47
-rw-r--r--views/default/core/settings/statistics/online.php28
-rw-r--r--views/default/core/settings/tools.php25
-rw-r--r--views/default/core/settings/tools/plugin.php34
12 files changed, 349 insertions, 0 deletions
diff --git a/views/default/core/settings/account.php b/views/default/core/settings/account.php
new file mode 100644
index 000000000..86afb8ba1
--- /dev/null
+++ b/views/default/core/settings/account.php
@@ -0,0 +1,15 @@
+<?php
+/**
+ * Account settings form wrapper
+ *
+ * @package Elgg
+ * @subpackage Core
+ */
+
+$form_body = elgg_view("forms/account/settings");
+$form_body .= '<div class="divider"></div>';
+$form_body .= '<p>';
+$form_body .= elgg_view('input/submit', array('value' => elgg_echo('save')));
+$form_body .= '</p>';
+
+echo elgg_view('input/form', array('action' => "action/usersettings/save", 'body' => $form_body));
diff --git a/views/default/core/settings/account/default_access.php b/views/default/core/settings/account/default_access.php
new file mode 100644
index 000000000..e7c280198
--- /dev/null
+++ b/views/default/core/settings/account/default_access.php
@@ -0,0 +1,29 @@
+<?php
+/**
+ * Provide a way of setting your default access
+ *
+ * @package Elgg
+ * @subpackage Core
+ */
+if ($vars['config']->allow_user_default_access) {
+ $user = elgg_get_page_owner();
+
+ if ($user) {
+ if (false === ($default_access = $user->getPrivateSetting('elgg_default_access'))) {
+ $default_access = $vars['config']->default_access;
+ }
+?>
+<div class="user-settings access">
+ <h3><?php echo elgg_echo('default_access:settings'); ?></h3>
+ <p>
+ <?php echo elgg_echo('default_access:label'); ?>:
+ <?php
+
+ echo elgg_view('input/access',array('internalname' => 'default_access', 'value' => $default_access));
+
+ ?>
+ </p>
+</div>
+<?php
+ }
+} \ No newline at end of file
diff --git a/views/default/core/settings/account/email.php b/views/default/core/settings/account/email.php
new file mode 100644
index 000000000..396f8e79b
--- /dev/null
+++ b/views/default/core/settings/account/email.php
@@ -0,0 +1,25 @@
+<?php
+/**
+ * Provide a way of setting your email
+ *
+ * @package Elgg
+ * @subpackage Core
+ */
+
+$user = elgg_get_page_owner();
+
+if ($user) {
+?>
+<div class="user-settings email">
+<h3><?php echo elgg_echo('email:settings'); ?></h3>
+<p>
+ <?php echo elgg_echo('email:address:label'); ?>:
+ <?php
+
+ echo elgg_view('input/email',array('internalname' => 'email', 'value' => $user->email));
+
+ ?>
+</p>
+</div>
+<?php
+} \ No newline at end of file
diff --git a/views/default/core/settings/account/language.php b/views/default/core/settings/account/language.php
new file mode 100644
index 000000000..ada133791
--- /dev/null
+++ b/views/default/core/settings/account/language.php
@@ -0,0 +1,32 @@
+<?php
+/**
+ * Provide a way of setting your language prefs
+ *
+ * @package Elgg
+ * @subpackage Core
+ */
+
+global $CONFIG;
+$user = elgg_get_page_owner();
+
+if ($user) {
+?>
+<div class="user-settings language">
+<h3><?php echo elgg_echo('user:set:language'); ?></h3>
+<p>
+
+ <?php echo elgg_echo('user:language:label'); ?>: <?php
+
+ $value = $CONFIG->language;
+ if ($user->language) {
+ $value = $user->language;
+ }
+
+ echo elgg_view("input/pulldown", array('internalname' => 'language', 'value' => $value, 'options_values' => get_installed_translations()));
+
+ ?>
+
+</p>
+</div>
+<?php
+} \ No newline at end of file
diff --git a/views/default/core/settings/account/name.php b/views/default/core/settings/account/name.php
new file mode 100644
index 000000000..fad6c488f
--- /dev/null
+++ b/views/default/core/settings/account/name.php
@@ -0,0 +1,15 @@
+<?php
+/**
+ * Provide a way of setting your full name.
+ *
+ * @package Elgg
+ * @subpackage Core
+
+
+ */
+
+$user = elgg_get_page_owner();
+
+// all hidden, but necessary for properly updating user details
+echo elgg_view('input/hidden', array('internalname' => 'name', 'value' => $user->name));
+echo elgg_view('input/hidden', array('internalname' => 'guid', 'value' => $user->guid));
diff --git a/views/default/core/settings/account/notifications.php b/views/default/core/settings/account/notifications.php
new file mode 100644
index 000000000..afb142ebe
--- /dev/null
+++ b/views/default/core/settings/account/notifications.php
@@ -0,0 +1,51 @@
+<?php
+/**
+ * User settings for notifications.
+ *
+ * @package Elgg
+ * @subpackage Core
+ */
+
+global $NOTIFICATION_HANDLERS;
+$notification_settings = get_user_notification_settings(elgg_get_page_owner_guid());
+
+?>
+<div class="user-settings notifications">
+<h3><?php echo elgg_echo('notifications:usersettings'); ?></h3>
+
+<p><?php echo elgg_echo('notifications:methods'); ?>
+
+<table>
+<?php
+ // Loop through options
+ foreach ($NOTIFICATION_HANDLERS as $k => $v) {
+?>
+ <tr>
+ <td><?php echo elgg_echo($k); ?>: </td>
+
+ <td>
+<?php
+
+ if ($notification_settings->$k) {
+ $val = "yes";
+ } else {
+ $val = "no";
+ }
+
+ echo elgg_view('input/radio', array(
+ 'internalname' => "method[$k]",
+ 'value' => $val,
+ 'options' => array(
+ elgg_echo('option:yes') => 'yes',
+ elgg_echo('option:no') => 'no'
+ ),
+ ));
+
+?>
+ </td>
+ </tr>
+<?php
+ }
+?>
+</table>
+</div> \ No newline at end of file
diff --git a/views/default/core/settings/account/password.php b/views/default/core/settings/account/password.php
new file mode 100644
index 000000000..0bd7f38f8
--- /dev/null
+++ b/views/default/core/settings/account/password.php
@@ -0,0 +1,42 @@
+<?php
+/**
+ * Provide a way of setting your password
+ *
+ * @package Elgg
+ * @subpackage Core
+ */
+
+$user = elgg_get_page_owner();
+
+if ($user) {
+?>
+<div class="user-settings password">
+<h3><?php echo elgg_echo('user:set:password'); ?></h3>
+
+ <?php
+ // only make the admin user enter current password for changing his own password.
+ if (!isadminloggedin() || isadminloggedin() && $user->guid == get_loggedin_userid()) {
+ ?>
+ <p>
+ <?php echo elgg_echo('user:current_password:label'); ?>:
+ <?php
+ echo elgg_view('input/password', array('internalname' => 'current_password'));
+ ?>
+ </p>
+ <?php } ?>
+
+ <p>
+ <?php echo elgg_echo('user:password:label'); ?>:
+ <?php
+ echo elgg_view('input/password', array('internalname' => 'password'));
+ ?>
+ </p>
+
+ <p>
+ <?php echo elgg_echo('user:password2:label'); ?>: <?php
+ echo elgg_view('input/password', array('internalname' => 'password2'));
+ ?>
+ </p>
+</div>
+<?php
+} \ No newline at end of file
diff --git a/views/default/core/settings/statistics.php b/views/default/core/settings/statistics.php
new file mode 100644
index 000000000..1d7a5b052
--- /dev/null
+++ b/views/default/core/settings/statistics.php
@@ -0,0 +1,6 @@
+<?php
+/**
+ * User statitsics
+ *
+ * Blank view that can be extended
+ */
diff --git a/views/default/core/settings/statistics/numentities.php b/views/default/core/settings/statistics/numentities.php
new file mode 100644
index 000000000..10d2b7c68
--- /dev/null
+++ b/views/default/core/settings/statistics/numentities.php
@@ -0,0 +1,47 @@
+<?php
+/**
+ * Elgg statistics screen
+ *
+ * @package Elgg
+ * @subpackage Core
+ */
+
+// Get entity statistics
+$entity_stats = get_entity_statistics(get_loggedin_userid());
+
+if ($entity_stats) {
+?>
+<div class="user-settings statistics">
+ <h3><?php echo elgg_echo('usersettings:statistics:label:numentities'); ?></h3>
+ <table class="styled">
+ <?php
+ foreach ($entity_stats as $k => $entry) {
+ foreach ($entry as $a => $b) {
+
+ //This function controls the alternating class
+ $even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even';
+
+ if ($a == "__base__") {
+ $a = elgg_echo("item:{$k}");
+ if (empty($a)) {
+ $a = $k;
+ }
+ } else {
+ $a = elgg_echo("item:{$k}:{$a}");
+ if (empty($a)) {
+ $a = "$k $a";
+ }
+ }
+ echo <<< END
+ <tr class="{$even_odd}">
+ <td class="column-one"><b>{$a}:</b></td>
+ <td>{$b}</td>
+ </tr>
+END;
+ }
+ }
+ ?>
+ </table>
+</div>
+<?php
+} \ No newline at end of file
diff --git a/views/default/core/settings/statistics/online.php b/views/default/core/settings/statistics/online.php
new file mode 100644
index 000000000..dc24130cd
--- /dev/null
+++ b/views/default/core/settings/statistics/online.php
@@ -0,0 +1,28 @@
+<?php
+/**
+ * Elgg statistics screen showing online users.
+ *
+ * @package Elgg
+ * @subpackage Core
+ */
+
+$user = get_loggedin_user();
+
+$logged_in = 0;
+$log = get_system_log($user->guid, "login", "", 'user', '', 1);
+
+if ($log) {
+ $logged_in = $log[0]->time_created;
+}
+
+?>
+<div class="user-settings details">
+ <h3><?php echo elgg_echo('usersettings:statistics:yourdetails'); ?></h3>
+
+ <table class="styled">
+ <tr class="odd"><td class="column-one"><?php echo elgg_echo('usersettings:statistics:label:name'); ?></td><td><?php echo $user->name; ?></td></tr>
+ <tr class="even"><td class="column-one"><?php echo elgg_echo('usersettings:statistics:label:email'); ?></td><td><?php echo $user->email; ?></td></tr>
+ <tr class="odd"><td class="column-one"><?php echo elgg_echo('usersettings:statistics:label:membersince'); ?></td><td><?php echo date("r",$user->time_created); ?></td></tr>
+ <tr class="even"><td class="column-one"><?php echo elgg_echo('usersettings:statistics:label:lastlogin'); ?></td><td><?php echo date("r",$logged_in); ?></td></tr>
+ </table>
+</div> \ No newline at end of file
diff --git a/views/default/core/settings/tools.php b/views/default/core/settings/tools.php
new file mode 100644
index 000000000..8f5ee4af6
--- /dev/null
+++ b/views/default/core/settings/tools.php
@@ -0,0 +1,25 @@
+<?php
+/**
+ * Elgg plugin specific user settings.
+ *
+ * @package Elgg
+ * @subpackage Core
+ */
+
+// Description of what's going on
+echo "<div class='user-settings margin-top'>".elgg_view('output/longtext', array('value' => elgg_echo("usersettings:plugins:description")))."</div>";
+
+$limit = get_input('limit', 10);
+$offset = get_input('offset', 0);
+
+// Get the installed plugins
+$installed_plugins = $vars['installed_plugins'];
+$count = count($installed_plugins);
+
+// Display list of plugins
+$n = 0;
+foreach ($installed_plugins as $plugin => $data) {
+ if (is_plugin_enabled($plugin)) {
+ echo elgg_view("core/settings/tools/plugin", array('plugin' => $plugin, 'details' => $data));
+ }
+} \ No newline at end of file
diff --git a/views/default/core/settings/tools/plugin.php b/views/default/core/settings/tools/plugin.php
new file mode 100644
index 000000000..981d8d937
--- /dev/null
+++ b/views/default/core/settings/tools/plugin.php
@@ -0,0 +1,34 @@
+<?php
+/**
+ * Elgg plugin manifest class
+ *
+ * This file renders a plugin for the admin screen, including active/deactive, manifest details & display plugin
+ * settings.
+ *
+ * @package Elgg
+ * @subpackage Core
+ */
+
+
+$plugin = $vars['plugin'];
+$details = $vars['details'];
+
+$active = $details['active'];
+$manifest = $details['manifest'];
+
+$user_guid = $details['user_guid'];
+if ($user_guid) {
+ $user_guid = get_loggedin_userid();
+}
+
+if (elgg_view("usersettings/{$plugin}/edit")) {
+?>
+<div class="user-settings">
+ <h3><?php echo elgg_echo($plugin); ?></h3>
+
+ <div id="<?php echo $plugin; ?>_settings">
+ <?php echo elgg_view("object/plugin", array('plugin' => $plugin, 'entity' => find_plugin_usersettings($plugin, $user_guid), 'prefix' => 'user')) ?>
+ </div>
+</div>
+<?php
+} \ No newline at end of file