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 | |
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')
-rw-r--r-- | views/default/core/account/login_box.php | 21 | ||||
-rw-r--r-- | views/default/core/account/login_dropdown.php | 27 | ||||
-rw-r--r-- | views/default/core/settings/account.php | 9 | ||||
-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 | ||||
-rw-r--r-- | views/default/core/settings/statistics.php | 6 | ||||
-rw-r--r-- | views/default/core/settings/statistics/numentities.php | 44 | ||||
-rw-r--r-- | views/default/core/settings/statistics/online.php | 49 | ||||
-rw-r--r-- | views/default/core/settings/tools.php | 34 | ||||
-rw-r--r-- | views/default/core/walled_garden/login.php | 38 |
14 files changed, 390 insertions, 0 deletions
diff --git a/views/default/core/account/login_box.php b/views/default/core/account/login_box.php new file mode 100644 index 000000000..f39113653 --- /dev/null +++ b/views/default/core/account/login_box.php @@ -0,0 +1,21 @@ +<?php +/** + * Elgg login box + * + * @package Elgg + * @subpackage Core + * + * @uses $vars['module'] The module name. Default: aside + */ + +$module = elgg_extract('module', $vars, 'aside'); + +$login_url = elgg_get_site_url(); +if (elgg_get_config('https_login')) { + $login_url = str_replace("http:", "https:", $login_url); +} + +$title = elgg_echo('login'); +$body = elgg_view_form('login', array('action' => "{$login_url}action/login")); + +echo elgg_view_module($module, $title, $body); diff --git a/views/default/core/account/login_dropdown.php b/views/default/core/account/login_dropdown.php new file mode 100644 index 000000000..e90cbf106 --- /dev/null +++ b/views/default/core/account/login_dropdown.php @@ -0,0 +1,27 @@ +<?php +/** + * Elgg drop-down login form + */ + +if (elgg_is_logged_in()) { + return true; +} + +$login_url = elgg_get_site_url(); +if (elgg_get_config('https_login')) { + $login_url = str_replace("http:", "https:", elgg_get_site_url()); +} + +$body = elgg_view_form('login', array('action' => "{$login_url}action/login"), array('returntoreferer' => TRUE)); +?> +<div id="login-dropdown"> + <?php + echo elgg_view('output/url', array( + 'href' => 'login#login-dropdown-box', + 'rel' => 'popup', + 'class' => 'elgg-button elgg-button-dropdown', + 'text' => elgg_echo('login'), + )); + echo elgg_view_module('dropdown', '', $body, array('id' => 'login-dropdown-box')); + ?> +</div> 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 @@ +<?php +/** + * Account settings form wrapper + * + * @package Elgg + * @subpackage Core + */ + +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 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); +} 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..ce1705a2e --- /dev/null +++ b/views/default/core/settings/statistics/numentities.php @@ -0,0 +1,44 @@ +<?php +/** + * Elgg statistics screen + * + * @package Elgg + * @subpackage Core + */ + +// Get entity statistics +$entity_stats = get_entity_statistics(elgg_get_logged_in_user_guid()); + +if ($entity_stats) { + $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'; + + 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 + <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 new file mode 100644 index 000000000..ce7ff35fb --- /dev/null +++ b/views/default/core/settings/statistics/online.php @@ -0,0 +1,49 @@ +<?php +/** + * Statistics about this user. + * + * @package Elgg + * @subpackage Core + */ + +$user = elgg_get_logged_in_user_entity(); + +$logged_in = 0; +$log = get_system_log($user->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 +<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 new file mode 100644 index 000000000..195db1d61 --- /dev/null +++ b/views/default/core/settings/tools.php @@ -0,0 +1,34 @@ +<?php +/** + * Elgg plugin specific user settings. + * + * @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 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 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/walled_garden/login.php b/views/default/core/walled_garden/login.php new file mode 100644 index 000000000..34126e411 --- /dev/null +++ b/views/default/core/walled_garden/login.php @@ -0,0 +1,38 @@ +<?php +/** + * Walled garden login + */ + +$title = elgg_get_site_entity()->name; + +/** +$welcome = elgg_echo('walled_garden:welcome'); + */ +$welcome .= $title; + + +$menu = elgg_view_menu('walled_garden', array( + 'sort_by' => 'priority', + 'class' => 'elgg-menu-general elgg-menu-hz', +)); + +$login_box = elgg_view('core/account/login_box', array('module' => 'walledgarden-login')); + +$content = <<<HTML + +<div class="elgg-col elgg-col-1of2"> + <div class="elgg-inner"> + <h1 class="elgg-heading-walledgarden">$welcome</h1><br /> + A message you can edit in cool_theme/views/default/core/walled_garden/login.php :-).<br /> + </div> +</div> +<div class="elgg-col elgg-col-1of2"> + <div class="elgg-inner">$login_box</div> +</div> +HTML; + +echo elgg_view_module('walledgarden', '', $content, array( + 'class' => 'elgg-walledgarden-double', + 'header' => ' ', + 'footer' => ' ', +));
\ No newline at end of file |