diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2014-03-15 14:46:48 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2014-03-15 14:46:48 -0300 |
commit | 5041c6c48153453ed597206d08eeff37cf20e676 (patch) | |
tree | b25f495baf01202485f05b5245625f28558c6135 /views/default/core/settings/account | |
download | elgg-5041c6c48153453ed597206d08eeff37cf20e676.tar.gz elgg-5041c6c48153453ed597206d08eeff37cf20e676.tar.bz2 |
Squashed 'mod/cool_theme/' content from commit a26f7df
git-subtree-dir: mod/cool_theme
git-subtree-split: a26f7df43a266f7d1ff04847da330d15f6041e9b
Diffstat (limited to 'views/default/core/settings/account')
-rw-r--r-- | views/default/core/settings/account/default_access.php | 25 | ||||
-rw-r--r-- | views/default/core/settings/account/email.php | 19 | ||||
-rw-r--r-- | views/default/core/settings/account/language.php | 20 | ||||
-rw-r--r-- | views/default/core/settings/account/name.php | 21 | ||||
-rw-r--r-- | views/default/core/settings/account/notifications.php | 44 | ||||
-rw-r--r-- | views/default/core/settings/account/password.php | 33 |
6 files changed, 162 insertions, 0 deletions
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..690f2714a --- /dev/null +++ b/views/default/core/settings/account/default_access.php @@ -0,0 +1,25 @@ +<?php +/** + * Provide a way of setting your default access + * + * @package Elgg + * @subpackage Core + */ +if (elgg_get_config('allow_user_default_access')) { + $user = elgg_get_page_owner_entity(); + + if ($user) { + if (false === ($default_access = $user->getPrivateSetting('elgg_default_access'))) { + $default_access = elgg_get_config('default_access'); + } + + $title = elgg_echo('default_access:settings'); + $content = elgg_echo('default_access:label') . ': '; + $content .= elgg_view('input/access', array( + 'name' => 'default_access', + 'value' => $default_access, + )); + + echo elgg_view_module('info', $title, $content); + } +} diff --git a/views/default/core/settings/account/email.php b/views/default/core/settings/account/email.php new file mode 100644 index 000000000..bb809958d --- /dev/null +++ b/views/default/core/settings/account/email.php @@ -0,0 +1,19 @@ +<?php +/** + * Provide a way of setting your email + * + * @package Elgg + * @subpackage Core + */ + +$user = elgg_get_page_owner_entity(); + +if ($user) { + $title = elgg_echo('email:settings'); + $content = elgg_echo('email:address:label') . ' :<br /> '; + $content .= elgg_view('input/email', array( + 'name' => 'email', + 'value' => $user->email, + )); + echo elgg_view_module('info', $title, $content); +} diff --git a/views/default/core/settings/account/language.php b/views/default/core/settings/account/language.php new file mode 100644 index 000000000..b36057422 --- /dev/null +++ b/views/default/core/settings/account/language.php @@ -0,0 +1,20 @@ +<?php +/** + * Provide a way of setting your language prefs + * + * @package Elgg + * @subpackage Core + */ + +$user = elgg_get_page_owner_entity(); + +if ($user) { + $title = elgg_echo('user:set:language'); + $content = elgg_echo('user:language:label') . ': '; + $content .= elgg_view("input/dropdown", array( + 'name' => 'language', + 'value' => $user->language, + 'options_values' => get_installed_translations() + )); + echo elgg_view_module('info', $title, $content); +} diff --git a/views/default/core/settings/account/name.php b/views/default/core/settings/account/name.php new file mode 100644 index 000000000..af1b9a1a7 --- /dev/null +++ b/views/default/core/settings/account/name.php @@ -0,0 +1,21 @@ +<?php +/** + * Provide a way of setting your full name. + * + * @package Elgg + * @subpackage Core + */ + +$user = elgg_get_page_owner_entity(); +if ($user) { + $title = elgg_echo('user:name:label'); + $content = elgg_echo('name') . ' :<br />'; + $content .= elgg_view('input/text', array( + 'name' => 'name', + 'value' => $user->name, + )); + echo elgg_view_module('info', $title, $content); + + // need the user's guid to make sure the correct user gets updated + echo elgg_view('input/hidden', array('name' => '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..c212b3886 --- /dev/null +++ b/views/default/core/settings/account/notifications.php @@ -0,0 +1,44 @@ +<?php +/** + * User settings for notifications. + * + * @package Elgg + * @subpackage Core + */ + +global $NOTIFICATION_HANDLERS; +$notification_settings = get_user_notification_settings(elgg_get_page_owner_guid()); + +$title = elgg_echo('notifications:usersettings'); + +$rows = ''; + +// Loop through options +foreach ($NOTIFICATION_HANDLERS as $k => $v) { + + if ($notification_settings->$k) { + $val = "yes"; + } else { + $val = "no"; + } + + $radio = elgg_view('input/radio', array( + 'name' => "method[$k]", + 'value' => $val, + 'options' => array( + elgg_echo('option:yes') => 'yes', + elgg_echo('option:no') => 'no' + ), + )); + + $cells = '<td class="prm pbl">' . elgg_echo("notification:method:$k") . ': </td>'; + $cells .= "<td>$radio</td>"; + + $rows .= "<tr>$cells</tr>"; +} + + +$content = elgg_echo('notifications:methods'); +$content .= "<table>$rows</table>"; + +echo elgg_view_module('info', $title, $content); diff --git a/views/default/core/settings/account/password.php b/views/default/core/settings/account/password.php new file mode 100644 index 000000000..f17f605c1 --- /dev/null +++ b/views/default/core/settings/account/password.php @@ -0,0 +1,33 @@ +<?php + +/** + * Provide a way of setting your password + * + * @package Elgg + * @subpackage Core + */ +$user = elgg_get_page_owner_entity(); + +if ($user) { + $title = elgg_echo('user:set:password'); + + // 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' => '••••••')); + $admin = "<p>$admin</p>"; + } + + $password = elgg_echo('user:password:label') . ' :<br />'; + $password .= elgg_view('input/password', array('name' => 'password', 'placeholder' => '••••••')); + $password = "<p>$password</p>"; + + $password2 = elgg_echo('user:password2:label') . ' :<br />'; + $password2 .= elgg_view('input/password', array('name' => 'password2', 'placeholder' => '••••••')); + $password2 = "<p>$password2</p>"; + + $content = $admin . $password . $password2; + + echo elgg_view_module('info', $title, $content); +} |