diff options
Diffstat (limited to 'views/default/core')
-rw-r--r-- | views/default/core/account/login_box.php | 15 | ||||
-rw-r--r-- | views/default/core/account/login_walled_garden.php | 100 | ||||
-rw-r--r-- | views/default/core/avatar/upload.php | 7 | ||||
-rw-r--r-- | views/default/core/friends/collection.php | 2 | ||||
-rw-r--r-- | views/default/core/settings/account/notifications.php | 2 | ||||
-rw-r--r-- | views/default/core/walled_garden/body.php | 11 | ||||
-rw-r--r-- | views/default/core/walled_garden/login.php | 37 | ||||
-rw-r--r-- | views/default/core/walled_garden/lost_password.php | 19 | ||||
-rw-r--r-- | views/default/core/walled_garden/register.php | 23 |
9 files changed, 102 insertions, 114 deletions
diff --git a/views/default/core/account/login_box.php b/views/default/core/account/login_box.php index 274172bdb..f39113653 100644 --- a/views/default/core/account/login_box.php +++ b/views/default/core/account/login_box.php @@ -4,8 +4,12 @@ * * @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); @@ -14,13 +18,4 @@ if (elgg_get_config('https_login')) { $title = elgg_echo('login'); $body = elgg_view_form('login', array('action' => "{$login_url}action/login")); -echo elgg_view_module('aside', $title, $body); - -?> - - -<script type="text/javascript"> - elgg.register_hook_handler('init', 'system', function() { - $('input[name=username]').focus(); - }); -</script> +echo elgg_view_module($module, $title, $body); diff --git a/views/default/core/account/login_walled_garden.php b/views/default/core/account/login_walled_garden.php deleted file mode 100644 index 1606b9592..000000000 --- a/views/default/core/account/login_walled_garden.php +++ /dev/null @@ -1,100 +0,0 @@ -<?php -/** - * Walled Garden Login Form - * - * @todo still requires clean up - */ - -$reg_url = elgg_normalize_url('register'); -$forgot_url = elgg_normalize_url('forgotpassword'); -$cancel_button = elgg_view('input/button', array( - 'value' => elgg_echo('cancel'), - 'class' => 'elgg-button-cancel mlm', -)); - -$form_body = elgg_view('forms/login'); -$form_body .= elgg_view('input/hidden', array( - 'name' => 'returntoreferer', - 'value' => 'true', -)); - -$login_url = elgg_get_site_url(); -if (elgg_get_config('https_login')) { - $login_url = str_replace("http:", "https:", elgg_get_site_url()); -} - -?> -<h2><?php echo elgg_echo('login'); ?></h2> -<?php -//@todo Forms 1.8: Convert to use elgg_view_form() -echo elgg_view('input/form', array( - 'body' => $form_body, - 'action' => "{$login_url}action/login", -)); - -if (elgg_get_config('allow_registration')) { - $title = elgg_echo('register'); - $body = elgg_view_form('register', array(), array( - 'friend_guid' => (int) get_input('friend_guid', 0), - 'invitecode' => get_input('invitecode'), - )); - - echo <<<__HTML -<div id="elgg-walledgarden-registration" class="hidden clearfix"> - <div class="elgg-hiddenform-body" class="clearfix"> - <h2>$title</h2> - $body - </div> - <div class="elgg-hiddenform-bottom"></div> -</div> -__HTML; -} - -$title = elgg_echo('user:password:lost'); -$body = elgg_view_form('user/requestnewpassword'); -echo <<<__HTML -<div id="elgg-walledgarden-lostpassword" class="hidden clearfix"> - <div class="elgg-hiddenform-body" class="clearfix"> - <h2>$title</h2> - $body - </div> - <div class="elgg-hiddenform-bottom"></div> -</div> -__HTML; - -//@todo JS 1.8: no -?> -<script type="text/javascript"> -$(document).ready(function() { - $('input.username').focus(); - - // add cancel button to inline forms - $('#elgg-walledgarden-registration').find('input.elgg-button-submit').after('<?php echo $cancel_button; ?>'); - $('#elgg-walledgarden-lostpassword').find('input.elgg-button-submit').after('<?php echo $cancel_button; ?>'); - - function elgg_slide_hiddenform(activateLink, parentElement, toggleElement) { - $(activateLink).closest(parentElement).find(toggleElement).fadeToggle('medium'); - } - - $('a[href="<?php echo $reg_url; ?>"]').click(function(e) { - e.preventDefault(); - elgg_slide_hiddenform(this, '#elgg-walledgarden-login', '#elgg-walledgarden-registration'); - $('input.name').focus(); - }); - - $('a[href="<?php echo $forgot_url; ?>"]').click(function(e) { - e.preventDefault(); - elgg_slide_hiddenform(this, '#elgg-walledgarden-login', '#elgg-walledgarden-lostpassword'); - $('input.lostusername').focus(); - }); - - $('input.elgg-button-cancel').click(function() { - if ($('#elgg-walledgarden-lostpassword').is(':visible')) { - $('a[href="<?php echo $forgot_url; ?>"]').click(); - } else if ($('#elgg-walledgarden-registration').is(':visible')) { - $('a[href="<?php echo $reg_url; ?>"]').click(); - } - return false; - }); -}); -</script> diff --git a/views/default/core/avatar/upload.php b/views/default/core/avatar/upload.php index 6887eab5c..4aa86373a 100644 --- a/views/default/core/avatar/upload.php +++ b/views/default/core/avatar/upload.php @@ -5,7 +5,10 @@ * @uses $vars['entity'] */ -$user_avatar = $vars['entity']->getIcon('medium'); +$user_avatar = elgg_view('output/img', array( + 'src' => $vars['entity']->getIconUrl('medium'), + 'alt' => elgg_echo('avatar'), +)); $current_label = elgg_echo('avatar:current'); @@ -23,7 +26,7 @@ $upload_form = elgg_view_form('avatar/upload', $form_params, $vars); $image = <<<HTML <div id="current-user-avatar" class="mrl prl"> <label>$current_label</label><br /> - <img src="$user_avatar" alt="avatar" /> + $user_avatar </div> HTML; diff --git a/views/default/core/friends/collection.php b/views/default/core/friends/collection.php index dac98bc5d..b7913da5f 100644 --- a/views/default/core/friends/collection.php +++ b/views/default/core/friends/collection.php @@ -25,7 +25,7 @@ if ($coll->owner_guid == elgg_get_logged_in_user_guid()) { 'href' => 'action/friends/collections/delete?collection=' . $coll->id, 'class' => 'delete_collection', 'text' => elgg_view_icon('delete'), - 'text_encode' => false, + 'encode_text' => false, )); echo "</div>"; } diff --git a/views/default/core/settings/account/notifications.php b/views/default/core/settings/account/notifications.php index ae5fe40bb..51292b2c9 100644 --- a/views/default/core/settings/account/notifications.php +++ b/views/default/core/settings/account/notifications.php @@ -24,7 +24,7 @@ $notification_settings = get_user_notification_settings(elgg_get_page_owner_guid foreach ($NOTIFICATION_HANDLERS as $k => $v) { ?> <tr> - <td><?php echo elgg_echo($k); ?>: </td> + <td><?php echo elgg_echo("notification:method:$k"); ?>: </td> <td> <?php diff --git a/views/default/core/walled_garden/body.php b/views/default/core/walled_garden/body.php new file mode 100644 index 000000000..67d8e0c37 --- /dev/null +++ b/views/default/core/walled_garden/body.php @@ -0,0 +1,11 @@ +<?php +/** + * Walled garden body + */ + +echo elgg_view('core/walled_garden/login'); +echo elgg_view('core/walled_garden/lost_password'); + +if (elgg_get_config('allow_registration')) { + echo elgg_view('core/walled_garden/register'); +} diff --git a/views/default/core/walled_garden/login.php b/views/default/core/walled_garden/login.php new file mode 100644 index 000000000..0a8b4a908 --- /dev/null +++ b/views/default/core/walled_garden/login.php @@ -0,0 +1,37 @@ +<?php +/** + * Walled garden login + */ + +$title = elgg_get_site_entity()->name; +$welcome = elgg_echo('walled_garden:welcome'); +$welcome .= ': <br/>' . $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> + $menu + </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' => ' ', +)); diff --git a/views/default/core/walled_garden/lost_password.php b/views/default/core/walled_garden/lost_password.php new file mode 100644 index 000000000..ce75b558b --- /dev/null +++ b/views/default/core/walled_garden/lost_password.php @@ -0,0 +1,19 @@ +<?php +/** + * Walled garden lost password + */ + +$title = elgg_echo('user:password:lost'); +$body = elgg_view_form('user/requestnewpassword'); +$lost = <<<HTML +<div class="elgg-inner"> + <h3>$title</h3> + $body +</div> +HTML; + +echo elgg_view_module('walledgarden', '', $lost, array( + 'class' => 'elgg-walledgarden-single elgg-walledgarden-password hidden', + 'header' => ' ', + 'footer' => ' ', +)); diff --git a/views/default/core/walled_garden/register.php b/views/default/core/walled_garden/register.php new file mode 100644 index 000000000..7f6aac99b --- /dev/null +++ b/views/default/core/walled_garden/register.php @@ -0,0 +1,23 @@ +<?php +/** + * Walled garden registration + */ + +$title = elgg_echo('register'); +$body = elgg_view_form('register', array(), array( + 'friend_guid' => (int) get_input('friend_guid', 0), + 'invitecode' => get_input('invitecode'), +)); + +$content = <<<__HTML +<div class="elgg-inner"> + <h2>$title</h2> + $body +</div> +__HTML; + +echo elgg_view_module('walledgarden', '', $content, array( + 'class' => 'elgg-walledgarden-single elgg-walledgarden-register hidden', + 'header' => ' ', + 'footer' => ' ', +));
\ No newline at end of file |