From 5041c6c48153453ed597206d08eeff37cf20e676 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sat, 15 Mar 2014 14:46:48 -0300 Subject: Squashed 'mod/cool_theme/' content from commit a26f7df git-subtree-dir: mod/cool_theme git-subtree-split: a26f7df43a266f7d1ff04847da330d15f6041e9b --- views/default/core/settings/account.php | 9 ++++ .../core/settings/account/default_access.php | 25 +++++++++++ views/default/core/settings/account/email.php | 19 +++++++++ views/default/core/settings/account/language.php | 20 +++++++++ views/default/core/settings/account/name.php | 21 ++++++++++ .../core/settings/account/notifications.php | 44 +++++++++++++++++++ views/default/core/settings/account/password.php | 33 +++++++++++++++ views/default/core/settings/statistics.php | 6 +++ .../core/settings/statistics/numentities.php | 44 +++++++++++++++++++ views/default/core/settings/statistics/online.php | 49 ++++++++++++++++++++++ views/default/core/settings/tools.php | 34 +++++++++++++++ 11 files changed, 304 insertions(+) create mode 100644 views/default/core/settings/account.php create mode 100644 views/default/core/settings/account/default_access.php create mode 100644 views/default/core/settings/account/email.php create mode 100644 views/default/core/settings/account/language.php create mode 100644 views/default/core/settings/account/name.php create mode 100644 views/default/core/settings/account/notifications.php create mode 100644 views/default/core/settings/account/password.php create mode 100644 views/default/core/settings/statistics.php create mode 100644 views/default/core/settings/statistics/numentities.php create mode 100644 views/default/core/settings/statistics/online.php create mode 100644 views/default/core/settings/tools.php (limited to 'views/default/core/settings') diff --git a/views/default/core/settings/account.php b/views/default/core/settings/account.php new file mode 100644 index 000000000..0c3792ece --- /dev/null +++ b/views/default/core/settings/account.php @@ -0,0 +1,9 @@ + 'elgg-form-alt')); \ No newline at end of file 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 @@ +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 @@ + '; + $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 @@ + '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 @@ +'; + $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 @@ + $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 = '' . elgg_echo("notification:method:$k") . ': '; + $cells .= "$radio"; + + $rows .= "$cells"; +} + + +$content = elgg_echo('notifications:methods'); +$content .= "$rows
"; + +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 @@ +guid == elgg_get_logged_in_user_guid()) { + $admin .= elgg_echo('user:current_password:label') . ' :
'; + $admin .= elgg_view('input/password', array('name' => 'current_password', 'placeholder' => '••••••')); + $admin = "

$admin

"; + } + + $password = elgg_echo('user:password:label') . ' :
'; + $password .= elgg_view('input/password', array('name' => 'password', 'placeholder' => '••••••')); + $password = "

$password

"; + + $password2 = elgg_echo('user:password2:label') . ' :
'; + $password2 .= elgg_view('input/password', array('name' => 'password2', 'placeholder' => '••••••')); + $password2 = "

$password2

"; + + $content = $admin . $password . $password2; + + echo elgg_view_module('info', $title, $content); +} 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 @@ + $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"; + } + } + $rows .= <<< END + + {$a}: + {$b} + +END; + } + } + + $title = elgg_echo('usersettings:statistics:label:numentities'); + $content = "$rows
"; + + echo elgg_view_module('info', $title, $content); +} diff --git a/views/default/core/settings/statistics/online.php b/views/default/core/settings/statistics/online.php new file mode 100644 index 000000000..ce7ff35fb --- /dev/null +++ b/views/default/core/settings/statistics/online.php @@ -0,0 +1,49 @@ +guid, "login", "", 'user', '', 1); + +if ($log) { + $logged_in = $log[0]->time_created; +} + +$label_name = elgg_echo('usersettings:statistics:label:name'); +$label_email = elgg_echo('usersettings:statistics:label:email'); +$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); + +$title = elgg_echo('usersettings:statistics:yourdetails'); + +$content = <<<__HTML + + + + + + + + + + + + + + + + + +
$label_name$user->name
$label_email$user->email
$label_member_since$time_created
$label_last_login$last_login
+__HTML; + +echo elgg_view_module('info', $title, $content); diff --git a/views/default/core/settings/tools.php b/views/default/core/settings/tools.php new file mode 100644 index 000000000..195db1d61 --- /dev/null +++ b/views/default/core/settings/tools.php @@ -0,0 +1,34 @@ + elgg_echo("usersettings:plugins:description"), + 'class' => 'user-settings mtn mbm', +)); + +// Get the installed plugins +$installed_plugins = $vars['installed_plugins']; +$count = count($installed_plugins); + + +// Display all plugins' usersettings forms +foreach ($installed_plugins as $plugin) { + $plugin_id = $plugin->getID(); + if ($plugin->isActive()) { + if (elgg_view_exists("usersettings/$plugin_id/edit") + || elgg_view_exists("plugins/$plugin_id/usersettings")) { + + $title = $plugin->getManifest()->getName(); + $body = elgg_view_form('plugins/usersettings/save', array(), array('entity' => $plugin)); + echo elgg_view_module('info', $title, $body); + } + } +} \ No newline at end of file -- cgit v1.2.3