]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #4422 pulling in Ismayil's changes so that we use the module view for settings
authorCash Costello <cash.costello@gmail.com>
Sun, 17 Jun 2012 13:34:47 +0000 (09:34 -0400)
committerCash Costello <cash.costello@gmail.com>
Sun, 17 Jun 2012 13:34:47 +0000 (09:34 -0400)
languages/en.php
views/default/core/settings/account/default_access.php
views/default/core/settings/account/email.php
views/default/core/settings/account/language.php
views/default/core/settings/account/name.php
views/default/core/settings/account/notifications.php
views/default/core/settings/account/password.php
views/default/core/settings/statistics/numentities.php
views/default/core/settings/statistics/online.php

index ae874a550c44debcad87005ea4bc21c3f9251fd2..e9c333041bfd65a2dded76247cacaace4f1ada7c 100644 (file)
@@ -452,7 +452,7 @@ $english = array(
  * Notifications
  */
        'notifications:usersettings' => "Notification settings",
-       'notifications:methods' => "Please specify which methods you want to permit.",
+       'notifications:methods' => "Select your notification methods.",
        'notification:method:email' => 'Email',
 
        'notifications:usersettings:save:ok' => "Your notification settings were successfully saved.",
index e33211460e8f74911d79d2f2cc5d0e7695168c09..690f2714a1c4a59c8073a12894f8426ca76d8779 100644 (file)
@@ -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('name' => '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
+}
index fda83e795fa09c6755fb3f070f9161d56a7af176..4bcdbb100563a2ea838d1f65d8fff2e26c845042 100644 (file)
@@ -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('name' => '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);
+}
index 3a992966fe2c2d27289fc8dc557b3b0ba3185060..b360574228447bf64b5a99cd73d8a40b699f10dd 100644 (file)
@@ -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(
-                               'name' => 'language',
-                               'value' => $user->language,
-                               '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);
+}
index f719a84deccb9fbe86048ba4b8b95a028156342e..e356146a3b015b3acf94b7c2a9a7ce595de29fb5 100644 (file)
@@ -7,20 +7,15 @@
  */
 
 $user = elgg_get_page_owner_entity();
-?>
-<div class="elgg-module elgg-module-info">
-  <div class="elgg-head">
-               <h3><?php echo elgg_echo('user:name:label'); ?></h3>
-       </div>
-       <div class="elgg-body">
-               <p>
-                       <?php echo elgg_echo('name'); ?>:
-                       <?php
-                       echo elgg_view('input/text', array('name' => 'name', 'value' => $user->name));
-                       ?>
-               </p>
-       </div>
-</div>
-<?php
-// need the user's guid to make sure the correct user gets updated
-echo elgg_view('input/hidden', array('name' => 'guid', 'value' => $user->guid));
+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);
+
+       // need the user's guid to make sure the correct user gets updated
+       echo elgg_view('input/hidden', array('name' => 'guid', 'value' => $user->guid));
+}
index 51292b2c9ff6e7f5c96c32b9279214e5e06b6ea6..c212b388640b6cbefa99392e26c668f182e221db 100644 (file)
@@ -9,33 +9,20 @@
 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("notification:method:$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(
+
+       $radio = elgg_view('input/radio', array(
                'name' => "method[$k]",
                'value' => $val,
                'options' => array(
@@ -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);
index a80f3df6b73997184f1fe12a7619186e8bcf2422..4857034b248e3c4e737dba2676c38fb53fc451ac 100644 (file)
@@ -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 (!elgg_is_admin_logged_in() || elgg_is_admin_logged_in() && $user->guid == elgg_get_logged_in_user_guid()) {
-               ?>
-               <p>
-               <?php echo elgg_echo('user:current_password:label'); ?>:
-               <?php
-                       echo elgg_view('input/password', array('name' => '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('name' => '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('name' => '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);
+}
index 245fd67be7ff6f4aa8f7e2d93180b073bca9d724..ce1705a2e349ec35b565fed0b57438d1c9fe1c71 100644 (file)
 $entity_stats = get_entity_statistics(elgg_get_logged_in_user_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);
+}
index 65db42cb1aa3e8ba5a8d6bf08a847ac48c32428f..ce7ff35fb491524dcf58a464973fa8f358eecee9 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Elgg statistics screen showing online users.
+ * Statistics about this user.
  *
  * @package Elgg
  * @subpackage Core
@@ -15,17 +15,35 @@ if ($log) {
        $logged_in = $log[0]->time_created;
 }
 
-?>
-<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
+$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
+<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);