diff options
Diffstat (limited to 'views/default/core/settings')
| -rw-r--r-- | views/default/core/settings/account.php | 8 | ||||
| -rw-r--r-- | views/default/core/settings/account/default_access.php | 24 | ||||
| -rw-r--r-- | views/default/core/settings/account/email.php | 24 | ||||
| -rw-r--r-- | views/default/core/settings/account/language.php | 29 | ||||
| -rw-r--r-- | views/default/core/settings/account/name.php | 16 | ||||
| -rw-r--r-- | views/default/core/settings/account/notifications.php | 47 | ||||
| -rw-r--r-- | views/default/core/settings/account/password.php | 54 | ||||
| -rw-r--r-- | views/default/core/settings/statistics/numentities.php | 65 | ||||
| -rw-r--r-- | views/default/core/settings/statistics/online.php | 53 | ||||
| -rw-r--r-- | views/default/core/settings/tools.php | 31 | ||||
| -rw-r--r-- | views/default/core/settings/tools/plugin.php | 42 |
11 files changed, 157 insertions, 236 deletions
diff --git a/views/default/core/settings/account.php b/views/default/core/settings/account.php index 86afb8ba1..0c3792ece 100644 --- a/views/default/core/settings/account.php +++ b/views/default/core/settings/account.php @@ -6,10 +6,4 @@ * @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)); +echo elgg_view_form('usersettings/save', array('class' => '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 index 67a0a4137..690f2714a 100644 --- a/views/default/core/settings/account/default_access.php +++ b/views/default/core/settings/account/default_access.php @@ -12,22 +12,14 @@ if (elgg_get_config('allow_user_default_access')) { if (false === ($default_access = $user->getPrivateSetting('elgg_default_access'))) { $default_access = elgg_get_config('default_access'); } -?> -<div class="elgg-module elgg-module-info"> - <div class="elgg-head"> - <h3><?php echo elgg_echo('default_access:settings'); ?></h3> - </div> - <div class="elgg-body"> - <p> - <?php echo elgg_echo('default_access:label'); ?>: - <?php - echo elgg_view('input/access', array('internalname' => 'default_access', 'value' => $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, + )); - ?> - </p> - </div> -</div> -<?php + echo elgg_view_module('info', $title, $content); } -}
\ No newline at end of file +} diff --git a/views/default/core/settings/account/email.php b/views/default/core/settings/account/email.php index 3782d39a8..4bcdbb100 100644 --- a/views/default/core/settings/account/email.php +++ b/views/default/core/settings/account/email.php @@ -9,19 +9,11 @@ $user = elgg_get_page_owner_entity(); if ($user) { -?> -<div class="elgg-module elgg-module-info"> - <div class="elgg-head"> - <h3><?php echo elgg_echo('email:settings'); ?></h3> - </div> - <div class="elgg-body"> - <p> - <?php echo elgg_echo('email:address:label'); ?>: - <?php - echo elgg_view('input/email',array('internalname' => 'email', 'value' => $user->email)); - ?> - </p> - </div> -</div> -<?php -}
\ No newline at end of file + $title = elgg_echo('email:settings'); + $content = elgg_echo('email:address:label') . ': '; + $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 index c8fef3a46..b36057422 100644 --- a/views/default/core/settings/account/language.php +++ b/views/default/core/settings/account/language.php @@ -9,23 +9,12 @@ $user = elgg_get_page_owner_entity(); if ($user) { -?> -<div class="elgg-module elgg-module-info"> - <div class="elgg-head"> - <h3><?php echo elgg_echo('user:set:language'); ?></h3> - </div> - <div class="elgg-body"> - <p> - <?php echo elgg_echo('user:language:label'); ?>: - <?php - echo elgg_view("input/dropdown", array( - 'internalname' => 'language', - 'value' => $value, - 'options_values' => get_installed_translations() - )); - ?> - </p> - </div> -</div> -<?php -}
\ No newline at end of file + $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 index 22f950925..e356146a3 100644 --- a/views/default/core/settings/account/name.php +++ b/views/default/core/settings/account/name.php @@ -4,12 +4,18 @@ * * @package Elgg * @subpackage Core - - */ $user = elgg_get_page_owner_entity(); +if ($user) { + $title = elgg_echo('user:name:label'); + $content = elgg_echo('name') . ': '; + $content .= elgg_view('input/text', array( + 'name' => 'name', + 'value' => $user->name, + )); + echo elgg_view_module('info', $title, $content); -// 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)); + // 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 index decf000ea..c212b3886 100644 --- a/views/default/core/settings/account/notifications.php +++ b/views/default/core/settings/account/notifications.php @@ -9,34 +9,21 @@ global $NOTIFICATION_HANDLERS; $notification_settings = get_user_notification_settings(elgg_get_page_owner_guid()); -?> -<div class="elgg-module elgg-module-info"> - <div class="elgg-head"> - <h3><?php echo elgg_echo('notifications:usersettings'); ?></h3> - </div> - <div class="elgg-body"> +$title = elgg_echo('notifications:usersettings'); -<p><?php echo elgg_echo('notifications:methods'); ?> +$rows = ''; -<table> -<?php - // Loop through options - foreach ($NOTIFICATION_HANDLERS as $k => $v) { -?> - <tr> - <td><?php echo elgg_echo($k); ?>: </td> - - <td> -<?php +// Loop through options +foreach ($NOTIFICATION_HANDLERS as $k => $v) { if ($notification_settings->$k) { $val = "yes"; } else { $val = "no"; } - - echo elgg_view('input/radio', array( - 'internalname' => "method[$k]", + + $radio = elgg_view('input/radio', array( + 'name' => "method[$k]", 'value' => $val, 'options' => array( elgg_echo('option:yes') => 'yes', @@ -44,12 +31,14 @@ $notification_settings = get_user_notification_settings(elgg_get_page_owner_guid ), )); -?> - </td> - </tr> -<?php - } -?> -</table> - </div> -</div>
\ No newline at end of file + $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 index 0ee215f9c..4857034b2 100644 --- a/views/default/core/settings/account/password.php +++ b/views/default/core/settings/account/password.php @@ -1,45 +1,33 @@ <?php + /** * Provide a way of setting your password * * @package Elgg * @subpackage Core */ - $user = elgg_get_page_owner_entity(); if ($user) { -?> -<div class="elgg-module elgg-module-info"> - <div class="elgg-head"> - <h3><?php echo elgg_echo('user:set:password'); ?></h3> - </div> - <div class="elgg-body"> - <?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 } ?> + $title = elgg_echo('user:set:password'); - <p> - <?php echo elgg_echo('user:password:label'); ?>: - <?php - echo elgg_view('input/password', array('internalname' => 'password')); - ?> - </p> + // 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') . ': '; + $admin .= elgg_view('input/password', array('name' => 'current_password')); + $admin = "<p>$admin</p>"; + } - <p> - <?php echo elgg_echo('user:password2:label'); ?>: <?php - echo elgg_view('input/password', array('internalname' => 'password2')); - ?> - </p> - </div> -</div> -<?php -}
\ No newline at end of file + $password = elgg_echo('user:password:label') . ': '; + $password .= elgg_view('input/password', array('name' => 'password')); + $password = "<p>$password</p>"; + + $password2 = elgg_echo('user:password2:label') . ': '; + $password2 .= elgg_view('input/password', array('name' => 'password2')); + $password2 = "<p>$password2</p>"; + + $content = $admin . $password . $password2; + + echo elgg_view_module('info', $title, $content); +} diff --git a/views/default/core/settings/statistics/numentities.php b/views/default/core/settings/statistics/numentities.php index 388af0af6..3782fd8bc 100644 --- a/views/default/core/settings/statistics/numentities.php +++ b/views/default/core/settings/statistics/numentities.php @@ -7,45 +7,38 @@ */ // Get entity statistics -$entity_stats = get_entity_statistics(get_loggedin_userid()); +$entity_stats = get_entity_statistics(elgg_get_page_owner_guid()); if ($entity_stats) { -?> -<div class="elgg-module elgg-module-info"> - <div class="elgg-head"> - <h3><?php echo elgg_echo('usersettings:statistics:label:numentities'); ?></h3> - </div> - <div class="elgg-body"> - <table class="elgg-table-alt"> - <?php - foreach ($entity_stats as $k => $entry) { - foreach ($entry as $a => $b) { + $rows = ''; + foreach ($entity_stats as $k => $entry) { + foreach ($entry as $a => $b) { - //This function controls the alternating class - $even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even'; + // 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; + 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"; } } - ?> - </table> - </div> -</div> -<?php -}
\ No newline at end of file + $rows .= <<< END + <tr class="{$even_odd}"> + <td class="column-one"><b>{$a}:</b></td> + <td>{$b}</td> + </tr> +END; + } + } + + $title = elgg_echo('usersettings:statistics:label:numentities'); + $content = "<table class=\"elgg-table-alt\">$rows</table>"; + + 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 index df477d871..1385ff60f 100644 --- a/views/default/core/settings/statistics/online.php +++ b/views/default/core/settings/statistics/online.php @@ -1,31 +1,42 @@ <?php /** - * Elgg statistics screen showing online users. + * Statistics about this user. * * @package Elgg * @subpackage Core */ -$user = get_loggedin_user(); +$user = elgg_get_page_owner_entity(); -$logged_in = 0; -$log = get_system_log($user->guid, "login", "", 'user', '', 1); +$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'); -if ($log) { - $logged_in = $log[0]->time_created; -} +$time_created = date("r", $user->time_created); +$last_login = date("r", $user->last_login); -?> -<div class="elgg-module elgg-module-info"> - <div class="elgg-head"> - <h3><?php echo elgg_echo('usersettings:statistics:yourdetails'); ?></h3> - </div> - <div class="elgg-body"> - <table class="elgg-table-alt"> - <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> -</div>
\ No newline at end of file +$title = elgg_echo('usersettings:statistics:yourdetails'); + +$content = <<<__HTML +<table class="elgg-table-alt"> + <tr class="odd"> + <td class="column-one">$label_name</td> + <td>$user->name</td> + </tr> + <tr class="even"> + <td class="column-one">$label_email</td> + <td>$user->email</td> + </tr> + <tr class="odd"> + <td class="column-one">$label_member_since</td> + <td>$time_created</td> + </tr> + <tr class="even"> + <td class="column-one">$label_last_login</td> + <td>$last_login</td> + </tr> +</table> +__HTML; + +echo elgg_view_module('info', $title, $content); diff --git a/views/default/core/settings/tools.php b/views/default/core/settings/tools.php index 8f5ee4af6..195db1d61 100644 --- a/views/default/core/settings/tools.php +++ b/views/default/core/settings/tools.php @@ -2,24 +2,33 @@ /** * Elgg plugin specific user settings. * - * @package Elgg - * @subpackage Core + * @uses array $vars['installed_plugins'] An array of plugins as returned by elgg_get_plugins() + * + * @package Elgg.Core + * @subpackage Plugins.Settings */ // 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); +echo elgg_view('output/longtext', array( + 'value' => elgg_echo("usersettings:plugins:description"), + 'class' => 'user-settings mtn mbm', +)); // 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)); + +// 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 diff --git a/views/default/core/settings/tools/plugin.php b/views/default/core/settings/tools/plugin.php deleted file mode 100644 index 50cc55b50..000000000 --- a/views/default/core/settings/tools/plugin.php +++ /dev/null @@ -1,42 +0,0 @@ -<?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="elgg-module elgg-module-info"> - <div class="elgg-head"> - <h3><?php echo elgg_echo($plugin); ?></h3> - </div> - <div class="elgg-body"> - <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> -</div> -<?php -}
\ No newline at end of file |
