diff options
author | Sem <sembrestels@riseup.net> | 2011-11-18 07:32:27 +0100 |
---|---|---|
committer | Sem <sembrestels@riseup.net> | 2011-11-18 07:32:27 +0100 |
commit | e53d410129701ea1c9d19529afa493f11b5f5b70 (patch) | |
tree | d9963b24bf8932654b4a47e36602c75975e50dba /views | |
parent | 377da25d2965c64941f83baae119fc970ec60982 (diff) | |
parent | 08a962c98e2923724f8013d6eaae89101243752a (diff) | |
download | elgg-e53d410129701ea1c9d19529afa493f11b5f5b70.tar.gz elgg-e53d410129701ea1c9d19529afa493f11b5f5b70.tar.bz2 |
Merge github.com:Elgg/Elgg
Conflicts:
engine/lib/input.php
Diffstat (limited to 'views')
166 files changed, 1614 insertions, 1440 deletions
diff --git a/views/default/admin/appearance/default_widgets.php b/views/default/admin/appearance/default_widgets.php index 4416dc8f6..1bf5791ac 100644 --- a/views/default/admin/appearance/default_widgets.php +++ b/views/default/admin/appearance/default_widgets.php @@ -17,6 +17,7 @@ if ($object) { 'text' => elgg_echo('upgrade'), 'href' => 'action/widgets/upgrade', 'is_action' => true, + 'is_trusted' => true, 'class' => 'elgg_button elgg-button-submit', 'title' => 'Upgrade your default widgets to work on Elgg 1.8', )); diff --git a/views/default/admin/appearance/menu_items.php b/views/default/admin/appearance/menu_items.php index 4e35e032f..1d5c95cf9 100644 --- a/views/default/admin/appearance/menu_items.php +++ b/views/default/admin/appearance/menu_items.php @@ -7,4 +7,4 @@ */ -echo elgg_view_form('admin/menu/save'); +echo elgg_view_form('admin/menu/save', array('class' => 'elgg-form-settings')); diff --git a/views/default/admin/appearance/profile_fields.php b/views/default/admin/appearance/profile_fields.php index 7077687cc..91d14b874 100644 --- a/views/default/admin/appearance/profile_fields.php +++ b/views/default/admin/appearance/profile_fields.php @@ -3,16 +3,14 @@ * Admin area: edit default profile fields */ -$add = elgg_view_form('profile/fields/add', array(), array()); +$add = elgg_view_form('profile/fields/add', array('class' => 'elgg-form-settings'), array()); $list = elgg_view('admin/appearance/profile_fields/list'); $reset = elgg_view_form('profile/fields/reset', array(), array()); $body = <<<__HTML $add $list -<div class="default_profile_reset"> - $reset -</div> +$reset __HTML; echo $body; diff --git a/views/default/admin/appearance/profile_fields/list.php b/views/default/admin/appearance/profile_fields/list.php index 542ab1b6f..b9440a95d 100644 --- a/views/default/admin/appearance/profile_fields/list.php +++ b/views/default/admin/appearance/profile_fields/list.php @@ -9,22 +9,24 @@ $n = 0; $loaded_defaults = array(); $items = array(); -if ($fieldlist = elgg_get_config('profile_custom_fields')) { +$fieldlist = elgg_get_config('profile_custom_fields'); +if ($fieldlist) { $fieldlistarray = explode(',', $fieldlist); foreach ($fieldlistarray as $listitem) { - if ($translation = elgg_get_config("admin_defined_profile_{$listitem}")) { + $translation = elgg_get_config("admin_defined_profile_$listitem"); + $type = elgg_get_config("admin_defined_profile_type_$listitem"); + if ($translation && $type) { $item = new stdClass; $item->translation = $translation; $item->shortname = $listitem; - $item->name = "admin_defined_profile_{$listitem}"; - $item->type = elgg_get_config("admin_defined_profile_type_{$listitem}"); + $item->name = "admin_defined_profile_$listitem"; + $item->type = elgg_echo("profile:field:$type"); $items[] = $item; } } } ?> -<div id="list"> - <ul id="sortable_profile_fields"> +<ul id="elgg-profile-fields" class="mvm"> <?php $save = elgg_echo('save'); @@ -36,8 +38,9 @@ foreach ($items as $item) { //$even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even'; $url = elgg_view('output/url', array( 'href' => "action/profile/fields/delete?id={$item->shortname}", - 'is_action' => TRUE, 'text' => elgg_view_icon('delete-alt'), + 'is_action' => true, + 'is_trusted' => true, )); $type = elgg_echo($item->type); echo <<<HTML @@ -49,8 +52,4 @@ HTML; } ?> - </ul> -</div> -<div id="tempList"></div> - -<input name="sortableListOrder" type="hidden" id="sortableListOrder" value="<?php echo $fieldlist; ?>" />
\ No newline at end of file +</ul>
\ No newline at end of file diff --git a/views/default/admin/header.php b/views/default/admin/header.php index 3919c017e..331190a88 100644 --- a/views/default/admin/header.php +++ b/views/default/admin/header.php @@ -7,10 +7,12 @@ $admin_title = elgg_get_site_entity()->name . ' ' . elgg_echo('admin'); $view_site = elgg_view('output/url', array( 'href' => elgg_get_site_url(), 'text' => elgg_echo('admin:view_site'), + 'is_trusted' => true, )); $logout = elgg_view('output/url', array( 'href' => 'action/logout', 'text' => elgg_echo('logout'), + 'is_trusted' => true, )); ?> <h1 class="elgg-heading-site"> diff --git a/views/default/admin/plugin_settings.php b/views/default/admin/plugin_settings.php index c75492270..1c6e9e206 100644 --- a/views/default/admin/plugin_settings.php +++ b/views/default/admin/plugin_settings.php @@ -19,7 +19,7 @@ $settings = false; if (elgg_view_exists("settings/$plugin_id/edit") || elgg_view_exists("plugins/$plugin_id/settings")) { $title = $plugin->getManifest()->getName(); - $params = array('id' => "$plugin_id-settings"); + $params = array('id' => "$plugin_id-settings", 'class' => 'elgg-form-settings'); $body = elgg_view_form("plugins/settings/save", $params, $vars); echo elgg_view_module('info', $title, $body); diff --git a/views/default/admin/plugins.php b/views/default/admin/plugins.php index cd0b83c00..c3e7e3ab0 100644 --- a/views/default/admin/plugins.php +++ b/views/default/admin/plugins.php @@ -22,7 +22,8 @@ foreach ($installed_plugins as $id => $plugin) { if (!$plugin->isValid()) { if ($plugin->isActive()) { // force disable and warn - register_error(elgg_echo('ElggPlugin:InvalidAndDeactivated', array($plugin->getId()))); + elgg_add_admin_notice('invalid_and_deactivated_' . $plugin->getID(), + elgg_echo('ElggPlugin:InvalidAndDeactivated', array($plugin->getId()))); $plugin->deactivate(); } continue; @@ -45,6 +46,11 @@ foreach ($installed_plugins as $id => $plugin) { unset($installed_plugins[$id]); } break; + case 'nonbundled': + if (in_array('bundled', $plugin_categories)) { + unset($installed_plugins[$id]); + } + break; default: if (!in_array($show_category, $plugin_categories)) { unset($installed_plugins[$id]); @@ -55,7 +61,13 @@ foreach ($installed_plugins as $id => $plugin) { if (isset($plugin_categories)) { foreach ($plugin_categories as $category) { if (!array_key_exists($category, $categories)) { - $categories[$category] = elgg_echo("admin:plugins:category:$category"); + // if localization string not defined, fall back to original category string + $cat_raw_string = "admin:plugins:category:$category"; + $cat_display_string = elgg_echo($cat_raw_string); + if ($cat_display_string == $cat_raw_string) { + $cat_display_string = ucwords($category); + } + $categories[$category] = $cat_display_string; } } } @@ -82,7 +94,7 @@ switch ($sort) { case 'alpha': $plugin_list = array(); foreach ($installed_plugins as $plugin) { - $plugin_list[$plugin->getManifest()->getName()] = $plugin; + $plugin_list[$plugin->getFriendlyName()] = $plugin; } ksort($plugin_list); break; @@ -96,10 +108,16 @@ switch ($sort) { asort($categories); +// we want bundled/nonbundled pulled to be at the top of the list +unset($categories['bundled']); +unset($categories['nonbundled']); + $common_categories = array( 'all' => elgg_echo('admin:plugins:category:all'), 'active' => elgg_echo('admin:plugins:category:active'), 'inactive' => elgg_echo('admin:plugins:category:inactive'), + 'bundled' => elgg_echo('admin:plugins:category:bundled'), + 'nonbundled' => elgg_echo('admin:plugins:category:nonbundled'), ); $categories = array_merge($common_categories, $categories); diff --git a/views/default/admin/settings/advanced.php b/views/default/admin/settings/advanced.php index 12e4303e7..a262740f2 100644 --- a/views/default/admin/settings/advanced.php +++ b/views/default/admin/settings/advanced.php @@ -6,4 +6,4 @@ * @subpackage Core */ -echo elgg_view_form('admin/site/update_advanced'); +echo elgg_view_form('admin/site/update_advanced', array('class' => 'elgg-form-settings')); diff --git a/views/default/admin/settings/basic.php b/views/default/admin/settings/basic.php index 3b8f4f183..9334ba81b 100644 --- a/views/default/admin/settings/basic.php +++ b/views/default/admin/settings/basic.php @@ -6,4 +6,4 @@ * @subpackage Core */ -echo elgg_view_form('admin/site/update_basic'); +echo elgg_view_form('admin/site/update_basic', array('class' => 'elgg-form-settings')); diff --git a/views/default/annotation/default.php b/views/default/annotation/default.php index 0e626ad9a..5d29a53e2 100644 --- a/views/default/annotation/default.php +++ b/views/default/annotation/default.php @@ -19,7 +19,7 @@ $owner_link = "<a href=\"{$owner->getURL()}\">$owner->name</a>"; $menu = elgg_view_menu('annotation', array( 'annotation' => $annotation, 'sort_by' => 'priority', - 'class' => 'elgg-menu-hz right', + 'class' => 'elgg-menu-hz float-alt', )); $text = elgg_view("output/longtext", array("value" => $annotation->value)); diff --git a/views/default/annotation/generic_comment.php b/views/default/annotation/generic_comment.php index a4fbf904e..9891510e0 100644 --- a/views/default/annotation/generic_comment.php +++ b/views/default/annotation/generic_comment.php @@ -2,8 +2,8 @@ /** * Elgg generic comment view * - * @uses $vars['annotation'] ElggAnnotation object - * @uses $vars['full_view'] Display fill view or brief view + * @uses $vars['annotation'] ElggAnnotation object + * @uses $vars['full_view'] Display fill view or brief view */ if (!isset($vars['annotation'])) { @@ -32,7 +32,7 @@ if ($full_view) { $menu = elgg_view_menu('annotation', array( 'annotation' => $comment, 'sort_by' => 'priority', - 'class' => 'elgg-menu-hz right', + 'class' => 'elgg-menu-hz float-alt', )); $comment_text = elgg_view("output/longtext", array("value" => $comment->value)); 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 diff --git a/views/default/css/admin.php b/views/default/css/admin.php index 8993ec66d..c02d43512 100644 --- a/views/default/css/admin.php +++ b/views/default/css/admin.php @@ -38,26 +38,26 @@ html, body { margin-bottom: 1px; } img { - border-width:0; - border-color:transparent; + border-width: 0; + border-color: transparent; } :focus { - outline:0 none; + outline: 0 none; } ol, ul { list-style: none; } em, i { - font-style:italic; + font-style: italic; } ins { - text-decoration:none; + text-decoration: none; } del { text-decoration:line-through; } strong, b { - font-weight:bold; + font-weight: bold; } table { border-collapse: collapse; @@ -79,7 +79,6 @@ blockquote, q { /* *************************************** BASICS *************************************** */ - body { background-color: #eee; font-size: 80%; @@ -116,15 +115,8 @@ p { margin-bottom: 15px; } -.elgg-output dt { font-weight: bold } -.elgg-output dd { margin: 0 0 1em 2em } - -table.mceLayout { - width:100% !important; -} - .clearfloat { - clear:both; + clear: both; } /* Clearfix! */ @@ -149,21 +141,6 @@ table.mceLayout { font-size: xx-large; content: " x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x "; } -.hidden { - display:none; -} -.centered { - margin:0 auto; -} -.center { - text-align: center; -} -.float { - float: left; -} -.float-alt { - float: right; -} /* *************************************** PAGE WRAPPER @@ -211,7 +188,7 @@ table.mceLayout { .elgg-menu-user li { display: inline; } -.elgg-menu-user li:after{ +.elgg-menu-user li:after { content: "|"; display: inline-block; font-weight: normal; @@ -222,6 +199,9 @@ table.mceLayout { content: ""; } +/* *************************************** + MESSAGES +*************************************** */ .elgg-page-messages { padding: 20px 0 0; width: 500px; @@ -248,13 +228,40 @@ table.mceLayout { border-color: #c6d880; } +.elgg-admin-notices { + padding-bottom: 15px; +} +.elgg-admin-notices p { + background-color: #BDE5F8; + color: black; + border: 1px solid blue; + font-weight: bold; + padding: 3px 0px 3px 10px; + + -webkit-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45); + -moz-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45); + box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45); + + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.elgg-admin-notices a.elgg-admin-notice { + float: right; + text-decoration: none; +} + +.elgg-admin-notices a { + text-decoration: underline; +} + /* *************************************** BODY *************************************** */ .elgg-page-body { padding: 20px 0; } -.elgg-main { +.elgg-main { background-color: #fff; border: 1px solid #ccc; padding: 20px; @@ -313,6 +320,9 @@ table.mceLayout { .elgg-module-main > .elgg-head { margin-bottom: 5px; } +.elgg-module-info > .elgg-head { + margin-bottom: 10px; +} .elgg-module-inline { margin: 20px 0; } @@ -384,31 +394,27 @@ table.mceLayout { float: right; margin-left: 5px; } - .elgg-item { margin: 3px; } -.elgg-menu-metadata { - float: right; - margin-left: 15px; - font-size: 90%; -} -.elgg-menu-metadata > li { - float: left; - margin-left: 15px; +.elgg-list-simple li { + margin-bottom: 5px; } -.elgg-menu-metadata, .elgg-menu-metadata a { - color: #aaa; +.elgg-list-distinct { + border-top: 1px dotted #CCCCCC; + margin: 5px 0; + clear: both; } -.elgg-simple-list li { - margin-bottom: 5px; +.elgg-list-distinct > li { + border-bottom: 1px dotted #CCCCCC; } + /* *************************************** FORMS AND INPUT *************************************** */ label { font-weight: bold; - color:#333333; + color: #333333; font-size: 110%; } fieldset > div { @@ -421,7 +427,7 @@ input { font: 120% Arial, Helvetica, sans-serif; padding: 5px; border: 1px solid #ccc; - color:#666; + color: #666; -webkit-border-radius: 5px; -moz-border-radius: 5px; @@ -432,50 +438,79 @@ input { .elgg-input-tags, .elgg-input-url, .elgg-input-plaintext { - width:98%; + width: 98%; } textarea { height: 100px; } -input[type="submit"], .elgg-button-submit, .elgg-button-action, .elgg-button-cancel { +.elgg-input-thin { + width: 400px; +} +.elgg-input-natural { + width: auto; +} + +.elgg-button { font-size: 14px; font-weight: bold; - color: white; text-decoration: none; - background-color: #333; - border-color: #333; - + -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; - display: inline-block; width: auto; padding: 2px 4px; - margin: 10px 5px 10px 0; cursor: pointer; outline: none; } -input[type="submit"]:hover, .elgg-button-submit:hover, .elgg-button-action:hover { +a.elgg-button { + padding: 3px 6px; +} + +.elgg-button + .elgg-button { + margin-left: 5px; +} + +.elgg-button-submit, +.elgg-button-action { + color: white; + border: 1px solid #333; + background-color: #333; + text-shadow: 1px 1px 0px black; +} +.elgg-button-submit:hover, +.elgg-button-action:hover { color: white; background-color: #000; text-decoration: none; } -.elgg-button-submit, .elgg-button-action, .elgg-button-cancel { - padding: 4px 8px; +.elgg-button-submit.elgg-state-disabled, +.elgg-button-action.elgg-state-disabled { + color: #999; + cursor: default; } + .elgg-button-cancel { color: #333; background-color: #999; + border: 1px solid #999; } .elgg-button-cancel:hover { color: #222; background-color: #666; text-decoration: none; } -.elgg-button-action.elgg-state-disabled { - background-color: #aaa; + +.elgg-form-useradd input[type=text], +.elgg-form-useradd input[type=password] { + width: 300px; +} + +.elgg-form-settings { + max-width: 800px; } + /* ************************************** DATE PICKER *************************************** */ @@ -546,6 +581,7 @@ input[type="submit"]:hover, .elgg-button-submit:hover, .elgg-button-action:hover color: #333; background: #ddd; } + /* *************************************** PAGINATION *************************************** */ @@ -571,14 +607,13 @@ input[type="submit"]:hover, .elgg-button-submit:hover, .elgg-button-action:hover color: white; text-decoration: none; } - -.elgg-pagination .elgg-state-disabled { +.elgg-pagination .elgg-state-disabled span { color: #CCC; border-color: #CCC; } -.elgg-pagination .elgg-state-selected { - color: #555; - border-color: #555; +.elgg-pagination .elgg-state-selected span { + color: #000; + border-color: #ccc; } /* *************************************** @@ -636,7 +671,6 @@ input[type="submit"]:hover, .elgg-button-submit:hover, .elgg-button-action:hover -moz-border-radius: 5px; border-radius: 5px; } - .elgg-admin-sidebar-menu a:hover { text-decoration: none; background: black; @@ -646,12 +680,10 @@ input[type="submit"]:hover, .elgg-button-submit:hover, .elgg-button-action:hover .elgg-admin-sidebar-menu li.elgg-state-selected > a { background-color: #BBB; } - .elgg-admin-sidebar-menu .elgg-menu-closed:before { content: "\25B8"; padding-right: 4px; } - .elgg-admin-sidebar-menu .elgg-menu-opened:before { content: "\25BE"; padding-right: 4px; @@ -676,7 +708,6 @@ input[type="submit"]:hover, .elgg-button-submit:hover, .elgg-button-action:hover .elgg-menu-title { float: right; } - .elgg-menu-title > li { display: inline-block; margin-left: 4px; @@ -685,12 +716,13 @@ input[type="submit"]:hover, .elgg-button-submit:hover, .elgg-button-action:hover /* *************************************** FOOTER MENU *************************************** */ -.elgg-menu-footer {color:gray} - +.elgg-menu-footer { + color: gray; +} .elgg-menu-footer li { float: left; } -.elgg-menu-footer li:after{ +.elgg-menu-footer li:after { content: "\007C"; display: inline-block; padding: 0 4px 0 4px; @@ -701,6 +733,20 @@ input[type="submit"]:hover, .elgg-button-submit:hover, .elgg-button-action:hover } /* *************************************** + GENERAL MENU +*************************************** */ +.elgg-menu-general > li, +.elgg-menu-general > li > a { + display: inline-block; + color: #999; +} + +.elgg-menu-general > li:after { + content: "\007C"; + padding: 0 4px; +} + +/* *************************************** HOVER MENU *************************************** */ .elgg-menu-hover { @@ -744,19 +790,48 @@ input[type="submit"]:hover, .elgg-button-submit:hover, .elgg-button-action:hover } /* *************************************** + ENTITY MENU +*************************************** */ +<?php // height depends on line height/font size ?> +.elgg-menu-entity, elgg-menu-annotation { + float: right; + margin-left: 15px; + font-size: 90%; + color: #666; + line-height: 16px; + height: 16px; +} +.elgg-menu-entity > li, .elgg-menu-annotation > li { + margin-left: 15px; +} +.elgg-menu-entity > li > a, .elgg-menu-annotation > li > a { + color: #aaa; +} +<?php // need to override .elgg-menu-hz ?> +.elgg-menu-entity > li > a, .elgg-menu-annotation > li > a { + display: block; +} +.elgg-menu-entity > li > span, .elgg-menu-annotation > li > span { + vertical-align: baseline; +} + +/* *************************************** MORE MENUS *************************************** */ /* Horizontal menus w/ separator support */ .elgg-menu-hz > li, .elgg-menu-hz > li:after, .elgg-menu-hz > li > a { - display:inline-block; - vertical-align:middle; + display: inline-block; + vertical-align: middle; } /* Allow inline image blocks in horizontal menus */ .elgg-menu-hz .elgg-body:after { content: '.'; } +.elgg-menu > li:last-child::after { + display: none; +} .elgg-menu-admin-footer a { color: #eee; } @@ -766,6 +841,19 @@ input[type="submit"]:hover, .elgg-button-submit:hover, .elgg-button-action:hover .elgg-menu-longtext { float: right; } +.elgg-menu-metadata { + list-style-type: none; + float: right; + margin-left: 15px; + font-size: 90%; +} +.elgg-menu-metadata > li { + float: left; + margin-left: 15px; +} +.elgg-menu-metadata, .elgg-menu-metadata a { + color: #aaa; +} /* *************************************** WIDGETS @@ -926,81 +1014,6 @@ a.elgg-widget-collapsed:before { width: 83.33%; } - -.elgg-subtext { - color: #666; - font-size: 85%; - line-height: 1.2em; - font-style: italic; - margin-bottom: 5px; -} - -.elgg-longtext-control { - margin-left: 14px; - font-size: 80%; - cursor: pointer; -} - -/* *************************************** - Spacing (from OOCSS) -*************************************** */ -.pan{padding:0} -.pas{padding:5px} -.pam{padding:10px} -.pal{padding:20px} -.ptn{padding-top:0} -.pts{padding-top:5px} -.ptm{padding-top:10px} -.ptl{padding-top:20px} -.prn{padding-right:0} -.prs{padding-right:5px} -.prm{padding-right:10px} -.prl{padding-right:20px} -.pbn{padding-bottom:0} -.pbs{padding-bottom:5px} -.pbm{padding-bottom:10px} -.pbl{padding-bottom:20px} -.pln{padding-left:0} -.pls{padding-left:5px} -.plm{padding-left:10px} -.pll{padding-left:20px} -.phn{padding-left:0;padding-right:0} -.phs{padding-left:5px;padding-right:5px} -.phm{padding-left:10px;padding-right:10px} -.phl{padding-left:20px;padding-right:20px} -.pvn{padding-top:0;padding-bottom:0} -.pvs{padding-top:5px;padding-bottom:5px} -.pvm{padding-top:10px;padding-bottom:10px} -.pvl{padding-top:20px;padding-bottom:20px} -.man{margin:0} -.mas{margin:5px} -.mam{margin:10px} -.mal{margin:20px} -.mtn{margin-top:0} -.mts{margin-top:5px} -.mtm{margin-top:10px} -.mtl{margin-top:20px} -.mrn{margin-right:0} -.mrs{margin-right:5px} -.mrm{margin-right:10px} -.mrl{margin-right:20px} -.mbn{margin-bottom:0} -.mbs{margin-bottom:5px} -.mbm{margin-bottom:10px} -.mbl{margin-bottom:20px} -.mln{margin-left:0} -.mls{margin-left:5px} -.mlm{margin-left:10px} -.mll{margin-left:20px} -.mhn{margin-left:0;margin-right:0} -.mhs{margin-left:5px;margin-right:5px} -.mhm{margin-left:10px;margin-right:10px} -.mhl{margin-left:20px;margin-right:20px} -.mvn{margin-top:0;margin-bottom:0} -.mvs{margin-top:5px;margin-bottom:5px} -.mvm{margin-top:10px;margin-bottom:10px} -.mvl{margin-top:20px;margin-bottom:20px} - /* *************************************** ICONS *************************************** */ @@ -1049,6 +1062,7 @@ a.elgg-widget-collapsed:before { *************************************** */ .elgg-avatar { position: relative; + display: inline-block; } .elgg-avatar > a > img { display: block; @@ -1156,94 +1170,32 @@ a.elgg-widget-collapsed:before { height: 200px; } - -.elgg-menu-metadata { - list-style-type: none; - float: right; - margin-left: 15px; - font-size: 90%; -} -.elgg-menu-metadata > li { - float: left; - margin-left: 15px; -} - -.right {float:right} -.elgg-toggle {cursor:pointer} - -<?php //@todo elgg-drag-handle instead? ?> -.elgg-state-draggable .elgg-head { - cursor: move; -} - /* *************************************** - ADMIN MISC -*************************************** */ - -.elgg-instructs { - max-width: 600px; -} - -.manifest_file { - background-color:#eee; - - -webkit-border-radius: 8px; - -moz-border-radius: 8px; - border-radius: 8px; - - padding:5px 10px; - margin:4px 0; -} - - -.plugin_controls { - padding: 3px 3px 3px 0; - font-weight: bold; - float: left; - width: 150px; -} -form.admin_plugins_simpleview .elgg-button-submit { - margin-right:20px; -} -.plugin_info { - margin: 3px; - padding-left: 150px; - display: block; -} -.plugin_metadata { - display:block; - color:#999; -} -.plugin_name input[type="checkbox"] { - margin-right: 10px; -} -ul.admin_plugins { - margin-bottom: 0; - padding-left: 0; - list-style: none; -} + PLUGINS +**************************************** */ .elgg-plugin { - border:1px solid #999; - margin:0 0 5px; - padding:0 7px 4px 10px; + border: 1px solid #999; + margin: 0 0 5px; + padding: 0 7px 4px 10px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; } - +.elgg-plugin.elgg-state-draggable > .elgg-image-block .elgg-head { + cursor: move; +} .elgg-plugin p { - margin:0; - padding:0; + margin: 0; } .elgg-plugin h3 { - color:black; + color: black; padding-bottom: 10px; } -.plugin_settings { +.elgg-plugin-settings { font-weight: normal; + font-size: 0.9em; } - .elgg-plugin-screenshot { display: inline; } @@ -1263,64 +1215,43 @@ ul.admin_plugins { border-radius: 8px; } .elgg-plugin-screenshot-lightbox h2 { - color:black; + color: black; } - .elgg-plugin.elgg-state-active { background: white; } .elgg-plugin.elgg-state-inactive { background: #dedede; } - -.elgg-state-error { +.elgg-plugin .elgg-state-error { background: #fbe3e4; color: #8a1f11; border-color: #fbc2c4; font-weight: bold; } -.elgg-state-warning { +.elgg-plugin .elgg-state-warning { background: #fbedb5; color: #000000; border-color: #fbe58b; font-weight: bold; } +.elgg-plugin-more { + background-color: #eee; -.admin_notices { - padding-bottom: 15px; -} -.admin_notices p { - background-color:#BDE5F8; - color: black; - border: 1px solid blue; - font-weight: bold; - padding: 3px 0px 3px 10px; - - -webkit-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45); - -moz-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45); - box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45); - - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; -} - -.admin_notices a { - float: right; -} + -webkit-border-radius: 8px; + -moz-border-radius: 8px; + border-radius: 8px; -.add-user form { - width:300px; + padding: 5px 10px; + margin: 4px 0; } /**************************************** - Markdown Text + MARKDOWN ****************************************/ - .elgg-markdown { margin: 15px; } - .elgg-markdown h1, .elgg-markdown h2, .elgg-markdown h3, @@ -1330,17 +1261,159 @@ ul.admin_plugins { margin: 1em 0 1em -15px; color: #333; } - .elgg-markdown ol { list-style: decimal; padding-left: 2em; } - .elgg-markdown ul { list-style: disc; padding-left: 2em; } - .elgg-markdown p { margin: 15px 0; -}
\ No newline at end of file +} + +/* *************************************** + MISC +*************************************** */ +.elgg-content-thin { + max-width: 600px; +} + +.elgg-subtext { + color: #666; + font-size: 85%; + line-height: 1.2em; + font-style: italic; + margin-bottom: 5px; +} + +.elgg-longtext-control { + margin-left: 14px; + font-size: 80%; + cursor: pointer; +} + +table.mceLayout { + width:100% !important; +} + +.elgg-output dt { + font-weight: bold; +} +.elgg-output dd { + margin: 0 0 1em 2em; +} + +/* *************************************** + HELPERS +*************************************** */ +.hidden { + display: none; +} +.centered { + margin: 0 auto; +} +.center { + text-align: center; +} +.float { + float: left; +} +.float-alt { + float: right; +} +.elgg-toggle { + cursor: pointer; +} +.elgg-discover .elgg-discoverable { + display: none; +} +.elgg-discover:hover .elgg-discoverable { + display: block; +} +.elgg-transition:hover { + opacity: .7; +} + +/* *************************************** + BORDERS AND SEPARATORS +*************************************** */ +.elgg-border-plain { + border: 1px solid #eeeeee; +} +.elgg-border-transition { + border: 1px solid #eeeeee; +} +.elgg-divide-top { + border-top: 1px solid #CCCCCC; +} +.elgg-divide-bottom { + border-bottom: 1px solid #CCCCCC; +} +.elgg-divide-left { + border-left: 1px solid #CCCCCC; +} +.elgg-divide-right { + border-right: 1px solid #CCCCCC; +} + +/* *************************************** + SPACING (from OOCSS) +*************************************** */ +.pan{padding:0} +.pas{padding:5px} +.pam{padding:10px} +.pal{padding:20px} +.ptn{padding-top:0} +.pts{padding-top:5px} +.ptm{padding-top:10px} +.ptl{padding-top:20px} +.prn{padding-right:0} +.prs{padding-right:5px} +.prm{padding-right:10px} +.prl{padding-right:20px} +.pbn{padding-bottom:0} +.pbs{padding-bottom:5px} +.pbm{padding-bottom:10px} +.pbl{padding-bottom:20px} +.pln{padding-left:0} +.pls{padding-left:5px} +.plm{padding-left:10px} +.pll{padding-left:20px} +.phn{padding-left:0;padding-right:0} +.phs{padding-left:5px;padding-right:5px} +.phm{padding-left:10px;padding-right:10px} +.phl{padding-left:20px;padding-right:20px} +.pvn{padding-top:0;padding-bottom:0} +.pvs{padding-top:5px;padding-bottom:5px} +.pvm{padding-top:10px;padding-bottom:10px} +.pvl{padding-top:20px;padding-bottom:20px} +.man{margin:0} +.mas{margin:5px} +.mam{margin:10px} +.mal{margin:20px} +.mtn{margin-top:0} +.mts{margin-top:5px} +.mtm{margin-top:10px} +.mtl{margin-top:20px} +.mrn{margin-right:0} +.mrs{margin-right:5px} +.mrm{margin-right:10px} +.mrl{margin-right:20px} +.mbn{margin-bottom:0} +.mbs{margin-bottom:5px} +.mbm{margin-bottom:10px} +.mbl{margin-bottom:20px} +.mln{margin-left:0} +.mls{margin-left:5px} +.mlm{margin-left:10px} +.mll{margin-left:20px} +.mhn{margin-left:0;margin-right:0} +.mhs{margin-left:5px;margin-right:5px} +.mhm{margin-left:10px;margin-right:10px} +.mhl{margin-left:20px;margin-right:20px} +.mvn{margin-top:0;margin-bottom:0} +.mvs{margin-top:5px;margin-bottom:5px} +.mvm{margin-top:10px;margin-bottom:10px} +.mvl{margin-top:20px;margin-bottom:20px} diff --git a/views/default/css/elements/components.php b/views/default/css/elements/components.php index 4a09ca74e..f675ab7cb 100644 --- a/views/default/css/elements/components.php +++ b/views/default/css/elements/components.php @@ -146,10 +146,10 @@ /* *************************************** River *************************************** */ -.elgg-river { +.elgg-list-river { border-top: 1px solid #CCC; } -.elgg-river > li { +.elgg-list-river > li { border-bottom: 1px solid #CCC; } .elgg-river-item { diff --git a/views/default/css/elements/core.php b/views/default/css/elements/core.php index af4a1882a..ace6048bb 100644 --- a/views/default/css/elements/core.php +++ b/views/default/css/elements/core.php @@ -68,8 +68,9 @@ /* Enabled nesting of dropdown/flyout menus */ .elgg-menu > li { position: relative; } -/* Separators should only come between list items */ -.elgg-menu > li:last-child:after { display: none } +.elgg-menu > li:last-child::after { + display: none; +} /* Maximize click target */ .elgg-menu > li > a { display: block } @@ -98,8 +99,4 @@ position: relative; display: inline-block; - - /* Inline-block: IE 6, 7 */ - zoom: 1; - *display: inline; } diff --git a/views/default/css/elements/forms.php b/views/default/css/elements/forms.php index 1fced0196..e358c86e7 100644 --- a/views/default/css/elements/forms.php +++ b/views/default/css/elements/forms.php @@ -72,14 +72,13 @@ input[type="radio"] { width:auto; } .elgg-input-checkboxes.elgg-horizontal li, -.elgg-input-radio.elgg-horizontal li { +.elgg-input-radios.elgg-horizontal li { display: inline; padding-right: 10px; } -.elgg-form-account input[type="text"], -.elgg-form-account input[type="password"] { - width: 300px; +.elgg-form-login, .elgg-form-account { + max-width: 450px; } /* *************************************** @@ -235,36 +234,78 @@ input[type="radio"] { } /* *************************************** - USER PICKER + AUTOCOMPLETE *************************************** */ +<?php //autocomplete will expand to fullscreen without max-width ?> +.ui-autocomplete { + position: absolute; + cursor: default; +} +.elgg-autocomplete-item .elgg-body { + max-width: 600px; +} +.ui-autocomplete { + background-color: white; + border: 1px solid #ccc; + overflow: hidden; + + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; +} +.ui-autocomplete .ui-menu-item { + padding: 0px 4px; + + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; +} +.ui-autocomplete .ui-menu-item:hover { + background-color: #eee; +} +.ui-autocomplete a:hover { + text-decoration: none; + color: #4690D6; +} -.user-picker .user-picker-entry { - clear:both; - height:25px; - padding:5px; - margin-top:5px; - border-bottom:1px solid #cccccc; +/* *************************************** + USER PICKER +*************************************** */ +.elgg-user-picker-list li:first-child { + border-top: 1px dotted #ccc; + margin-top: 5px; } -.user-picker-entry .elgg-button-delete { - margin-right:10px; +.elgg-user-picker-list > li { + border-bottom: 1px dotted #ccc; } + /* *************************************** DATE PICKER **************************************** */ .ui-datepicker { + display: none; + margin-top: 3px; + width: 208px; background-color: white; border: 1px solid #0054A7; -webkit-border-radius: 6px; -moz-border-radius: 6px; border-radius: 6px; + overflow: hidden; + -webkit-box-shadow: 4px 4px 4px rgba(0, 0, 0, 0.5); -moz-box-shadow: 4px 4px 4px rgba(0, 0, 0, 0.5); box-shadow: 4px 4px 4px rgba(0, 0, 0, 0.5); - overflow: hidden; +} +.ui-datepicker-inline { + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; } .ui-datepicker-header { + position: relative; background: #4690D6; color: white; padding: 2px 0; diff --git a/views/default/css/elements/helpers.php b/views/default/css/elements/helpers.php index e6f59260d..e9a9e0a30 100644 --- a/views/default/css/elements/helpers.php +++ b/views/default/css/elements/helpers.php @@ -33,27 +33,10 @@ float: right; } -.right { - float: right; -} - -.left { - float: left; -} - .link { cursor: pointer; } -<?php @todo // do we need something like large and small? ?> -.large { - font-size: 120%; -} - -.small { - font-size: 80%; -} - .elgg-discover .elgg-discoverable { display: none; } diff --git a/views/default/css/elements/icons.php b/views/default/css/elements/icons.php index 1bc056072..f7c789e33 100644 --- a/views/default/css/elements/icons.php +++ b/views/default/css/elements/icons.php @@ -27,215 +27,254 @@ .elgg-icon-arrow-two-head { background-position: 0 -36px; } -.elgg-icon-calendar { +.elgg-icon-attention:hover { background-position: 0 -54px; } -.elgg-icon-checkmark:hover { +.elgg-icon-attention { background-position: 0 -72px; } -.elgg-icon-checkmark { +.elgg-icon-calendar { background-position: 0 -90px; } -.elgg-icon-clip:hover { +.elgg-icon-cell-phone { background-position: 0 -108px; } -.elgg-icon-clip { +.elgg-icon-checkmark:hover { background-position: 0 -126px; } -.elgg-icon-cursor-drag-arrow { +.elgg-icon-checkmark { background-position: 0 -144px; } -.elgg-icon-delete-alt:hover { +.elgg-icon-clip:hover { background-position: 0 -162px; } -.elgg-icon-delete-alt { +.elgg-icon-clip { background-position: 0 -180px; } -.elgg-icon-delete:hover { +.elgg-icon-cursor-drag-arrow { background-position: 0 -198px; } -.elgg-icon-delete { +.elgg-icon-delete-alt:hover { background-position: 0 -216px; } -.elgg-icon-download:hover { +.elgg-icon-delete-alt { background-position: 0 -234px; } -.elgg-icon-download { +.elgg-icon-delete:hover { background-position: 0 -252px; } -.elgg-icon-facebook { +.elgg-icon-delete { background-position: 0 -270px; } -.elgg-icon-home:hover { +.elgg-icon-download:hover { background-position: 0 -288px; } -.elgg-icon-home { +.elgg-icon-download { background-position: 0 -306px; } -.elgg-icon-hover-menu:hover { +.elgg-icon-eye { background-position: 0 -324px; } -.elgg-icon-hover-menu { +.elgg-icon-facebook { background-position: 0 -342px; } -.elgg-icon-link:hover { +.elgg-icon-grid:hover { background-position: 0 -360px; } -.elgg-icon-link { +.elgg-icon-grid { background-position: 0 -378px; } -.elgg-icon-mail-alt:hover { +.elgg-icon-home:hover { background-position: 0 -396px; } -.elgg-icon-mail-alt { +.elgg-icon-home { background-position: 0 -414px; } -.elgg-icon-mail:hover { +.elgg-icon-hover-menu:hover { background-position: 0 -432px; } -.elgg-icon-mail { +.elgg-icon-hover-menu { background-position: 0 -450px; } -.elgg-icon-print-alt { +.elgg-icon-info:hover { background-position: 0 -468px; } -.elgg-icon-print { +.elgg-icon-info { background-position: 0 -486px; } -.elgg-icon-push-pin-alt { +.elgg-icon-link:hover { background-position: 0 -504px; } -.elgg-icon-push-pin { +.elgg-icon-link { background-position: 0 -522px; } -.elgg-icon-redo { +.elgg-icon-list { background-position: 0 -540px; } -.elgg-icon-refresh:hover { +.elgg-icon-lock-closed { background-position: 0 -558px; } -.elgg-icon-refresh { +.elgg-icon-lock-open { background-position: 0 -576px; } -.elgg-icon-round-arrow-left { +.elgg-icon-mail-alt:hover { background-position: 0 -594px; } -.elgg-icon-round-arrow-right { +.elgg-icon-mail-alt { background-position: 0 -612px; } -.elgg-icon-round-checkmark { +.elgg-icon-mail:hover { background-position: 0 -630px; } -.elgg-icon-round-minus { +.elgg-icon-mail { background-position: 0 -648px; } -.elgg-icon-round-plus { +.elgg-icon-photo { background-position: 0 -666px; } -.elgg-icon-rss { +.elgg-icon-print-alt { background-position: 0 -684px; } -.elgg-icon-search-focus { +.elgg-icon-print { background-position: 0 -702px; } -.elgg-icon-search { +.elgg-icon-push-pin-alt { background-position: 0 -720px; } -.elgg-icon-settings-alt:hover { +.elgg-icon-push-pin { background-position: 0 -738px; } -.elgg-icon-settings-alt { +.elgg-icon-redo { background-position: 0 -756px; } -.elgg-icon-settings { +.elgg-icon-refresh:hover { background-position: 0 -774px; } -.elgg-icon-share:hover { +.elgg-icon-refresh { background-position: 0 -792px; } -.elgg-icon-share { +.elgg-icon-round-arrow-left { background-position: 0 -810px; } -.elgg-icon-shop-cart:hover { +.elgg-icon-round-arrow-right { background-position: 0 -828px; } -.elgg-icon-shop-cart { +.elgg-icon-round-checkmark { background-position: 0 -846px; } -.elgg-icon-speech-bubble-alt:hover { +.elgg-icon-round-minus { background-position: 0 -864px; } -.elgg-icon-speech-bubble-alt { +.elgg-icon-round-plus { background-position: 0 -882px; } -.elgg-icon-speech-bubble:hover { +.elgg-icon-rss { background-position: 0 -900px; } -.elgg-icon-speech-bubble { +.elgg-icon-search-focus { background-position: 0 -918px; } -.elgg-icon-star-alt { +.elgg-icon-search { background-position: 0 -936px; } -.elgg-icon-star-empty:hover { +.elgg-icon-settings-alt:hover { background-position: 0 -954px; } -.elgg-icon-star-empty { +.elgg-icon-settings-alt { background-position: 0 -972px; } -.elgg-icon-star:hover { +.elgg-icon-settings { background-position: 0 -990px; } -.elgg-icon-star { +.elgg-icon-share:hover { background-position: 0 -1008px; } -.elgg-icon-tag:hover { +.elgg-icon-share { background-position: 0 -1026px; } -.elgg-icon-tag { +.elgg-icon-shop-cart:hover { background-position: 0 -1044px; } -.elgg-icon-thumbs-down-alt:hover { +.elgg-icon-shop-cart { background-position: 0 -1062px; } -.elgg-icon-thumbs-down:hover, -.elgg-icon-thumbs-down-alt { +.elgg-icon-speech-bubble-alt:hover { background-position: 0 -1080px; } -.elgg-icon-thumbs-down { +.elgg-icon-speech-bubble-alt { background-position: 0 -1098px; } -.elgg-icon-thumbs-up-alt:hover { +.elgg-icon-speech-bubble:hover { background-position: 0 -1116px; } -.elgg-icon-thumbs-up:hover, -.elgg-icon-thumbs-up-alt { +.elgg-icon-speech-bubble { background-position: 0 -1134px; } -.elgg-icon-thumbs-up { +.elgg-icon-star-alt { background-position: 0 -1152px; } -.elgg-icon-trash { +.elgg-icon-star-empty:hover { background-position: 0 -1170px; } -.elgg-icon-twitter { +.elgg-icon-star-empty { background-position: 0 -1188px; } -.elgg-icon-undo { +.elgg-icon-star:hover { background-position: 0 -1206px; } -.elgg-icon-user { +.elgg-icon-star { background-position: 0 -1224px; } -.elgg-icon-user:hover { +.elgg-icon-tag:hover { background-position: 0 -1242px; } -.elgg-icon-users:hover { +.elgg-icon-tag { background-position: 0 -1260px; } -.elgg-icon-users { +.elgg-icon-thumbs-down-alt:hover { background-position: 0 -1278px; } +.elgg-icon-thumbs-down:hover, +.elgg-icon-thumbs-down-alt { + background-position: 0 -1296px; +} +.elgg-icon-thumbs-down { + background-position: 0 -1314px; +} +.elgg-icon-thumbs-up-alt:hover { + background-position: 0 -1332px; +} +.elgg-icon-thumbs-up:hover, +.elgg-icon-thumbs-up-alt { + background-position: 0 -1350px; +} +.elgg-icon-thumbs-up { + background-position: 0 -1368px; +} +.elgg-icon-trash { + background-position: 0 -1386px; +} +.elgg-icon-twitter { + background-position: 0 -1404px; +} +.elgg-icon-undo { + background-position: 0 -1422px; +} +.elgg-icon-user:hover { + background-position: 0 -1440px; +} +.elgg-icon-user { + background-position: 0 -1458px; +} +.elgg-icon-users:hover { + background-position: 0 -1476px; +} +.elgg-icon-users { + background-position: 0 -1494px; +} +.elgg-icon-video { + background-position: 0 -1512px; +} .elgg-avatar > .elgg-icon-hover-menu { @@ -258,6 +297,7 @@ *************************************** */ .elgg-avatar { position: relative; + display: inline-block; } .elgg-avatar > a > img { display: block; diff --git a/views/default/css/elements/misc.php b/views/default/css/elements/misc.php index ebac2b91f..d9622d34a 100644 --- a/views/default/css/elements/misc.php +++ b/views/default/css/elements/misc.php @@ -18,7 +18,7 @@ #avatar-croppingtool { border-top: 1px solid #ccc; } -#user-avatar { +#user-avatar-cropper { float: left; } #user-avatar-preview { diff --git a/views/default/css/elements/navigation.php b/views/default/css/elements/navigation.php index b5388715e..bf1046dda 100644 --- a/views/default/css/elements/navigation.php +++ b/views/default/css/elements/navigation.php @@ -98,7 +98,7 @@ .elgg-breadcrumbs > li { display: inline-block; } -.elgg-breadcrumbs > li:after{ +.elgg-breadcrumbs > li:after { content: "\003E"; padding: 0 4px; font-weight: normal; @@ -178,7 +178,6 @@ text-decoration: none; } - .elgg-menu-site-default { position: absolute; bottom: 0; @@ -191,62 +190,68 @@ margin-right: 1px; } -.elgg-menu-site-default > li > a {color: white} +.elgg-menu-site-default > li > a { + color: white; +} +.elgg-menu-site > li > ul { + display: none; + background-color: white; +} + +.elgg-menu-site > li:hover > ul { + display: block; +} .elgg-menu-site-default > .elgg-state-selected > a, .elgg-menu-site-default > li:hover > a { background: white; color: #555; - + -webkit-box-shadow: 2px -1px 1px rgba(0, 0, 0, 0.25); -moz-box-shadow: 2px -1px 1px rgba(0, 0, 0, 0.25); box-shadow: 2px -1px 1px rgba(0, 0, 0, 0.25); - + -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; } .elgg-menu-site-more { - display: none; position: relative; left: -1px; width: 100%; - z-index: 1; min-width: 150px; border: 1px solid #999; border-top: 0; - + -webkit-border-radius: 0 0 4px 4px; -moz-border-radius: 0 0 4px 4px; border-radius: 0 0 4px 4px; - + -webkit-box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.25); -moz-box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.25); box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.25); } -li:hover > .elgg-menu-site-more { - display: block; -} - .elgg-menu-site-more > li > a { - background: white; + background-color: white; color: #555; - + -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; - + -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; } + .elgg-menu-site-more > li > a:hover { background: #4690D6; color: white; } + .elgg-menu-site-more > li:last-child > a, .elgg-menu-site-more > li:last-child > a:hover { -webkit-border-radius: 0 0 4px 4px; @@ -402,12 +407,12 @@ li:hover > .elgg-menu-site-more { } /* *************************************** - FOOTER + SITE FOOTER *************************************** */ .elgg-menu-footer > li, .elgg-menu-footer > li > a { display: inline-block; - color:#999; + color: #999; } .elgg-menu-footer > li:after { @@ -424,6 +429,20 @@ li:hover > .elgg-menu-site-more { } /* *************************************** + GENERAL MENU +*************************************** */ +.elgg-menu-general > li, +.elgg-menu-general > li > a { + display: inline-block; + color: #999; +} + +.elgg-menu-general > li:after { + content: "\007C"; + padding: 0 4px; +} + +/* *************************************** ENTITY AND ANNOTATION *************************************** */ <?php // height depends on line height/font size ?> diff --git a/views/default/css/ie.php b/views/default/css/ie.php index cb4ede0ae..4bddd4d55 100644 --- a/views/default/css/ie.php +++ b/views/default/css/ie.php @@ -1,118 +1,8 @@ /** - * elgg_layout css for Internet Explorer > ie6 - * @uses $vars['wwwroot'] The site URL -*/ -* {zoom: 1;} /* trigger hasLayout in IE */ + * CSS for IE8 and above + */ -/* tools drop-down menu */ -#elgg-header {z-index:1;} -.navigation li a:hover ul {display:block; position:absolute; top:21px; left:0;} -.navigation li a:hover ul li a {display:block;} -.navigation li.navigation-more ul li a {width:150px;background-color: #dedede;} - -.clearfix { display: block; } -.hidden.clearfix { display: none; } -#elgg-page-contents {overflow: hidden;} /* remove horizontal scroll on riverdash */ -#breadcrumbs {top:-2px; margin-bottom: 5px;} - -/* entity list views */ -.entity-metadata {max-width: 300px;} -.entity-edit {float:right;} -.access_level {float:left;} -.elgg-image-block .entity-metadata { - min-width:400px; - text-align: right; -} - -/* profile */ -.elgg-tabs.profile .profile_name {margin-left: -260px;} -#profile_content .river_comment_form.hidden .input-text { width:510px; } - -/* notifications */ -.friends-picker-navigation {margin:0;padding:0;} -.friends-picker-container h3 {margin:0;padding:0;line-height: 1em;} - -/* private messages */ -#elgg-topbar-contents a.privatemessages.new span { - display:block; - padding:1px; - position:relative; - text-align:center; - float:left; - top:-1px; - right:auto; -} -#elgg-topbar-contents a.privatemessages.new {padding:0 0 0 20px;} -#elgg-topbar-contents a.privatemessages:hover {background-position:left 2px;} -#elgg-topbar-contents a.privatemessages.new:hover {background-position: left 2px;} - -/* riverdashboard mod rules */ -#riverdashboard_updates {clear:both;} -#riverdashboard_updates a.update_link {margin:0 0 9px 0;} -.riverdashboard_filtermenu {margin:10px 0 0 0;} -.river_comment_form.hidden .input-text { - width:530px; - float:left; -} -.river_link_divider { - width:10px; - text-align: center; -} - -/* shared access */ -.shared_access_collection h2.shared_access_name {margin-top:-15px;} - -/* dropdown login */ -*:first-child+html #login-dropdown #signin-button { - line-height:10px; -} -*:first-child+html #login-dropdown #signin-button a.signin span { - background-position:-150px -54px; -} -*:first-child+html #login-dropdown #signin-button a.signin.menu-open span { - background-position:-150px -74px; -} - -/* Gallery */ -.elgg-gallery-fluid > li { - float: left; - margin: 2px; -} - - -/* navigation */ -.elgg-breadcrumbs > li { - display: inline; -} - -.elgg-breadcrumbs > li > a { - display: inline; - padding-right: 4px; - margin-right: 4px; - border-right: 1px solid #bababa; -} - -.elgg-menu-title > li { - display: block; -} - -.elgg-menu-title > li > a { +/* ie8 does not like shrink wrapping this div with inline-block */ +.elgg-avatar { display: block; } - -.elgg-menu-footer > li > a { - display: inline; -} - -.elgg-menu-river > li { - display: inline; -} - -li:hover > .elgg-menu-site-more { - display: none; -} - -/* admin */ -.elgg-menu-footer li { - display: inline; -}
\ No newline at end of file diff --git a/views/default/css/ie6.php b/views/default/css/ie6.php index f8ed208f6..cf49d33f2 100644 --- a/views/default/css/ie6.php +++ b/views/default/css/ie6.php @@ -1,15 +1,11 @@ /** - * elgg_layout css for Internet Explorer6 - * @uses $vars['wwwroot'] The site URL -*/ + * CSS for IE6 + */ * {zoom: 1;} /* trigger hasLayout in IE */ /* main nav drop-down */ #elgg-header {z-index:1;} -.navigation li a:hover ul {display:block; position:absolute; top:21px; left:0;} -.navigation li a:hover ul li a {display:block;} -.navigation li.navigation-more ul li a {width:150px;background-color: #dedede;} /* @todo check this one */ .elgg-button-delete a { background-position-y: 2px; } diff --git a/views/default/css/ie7.php b/views/default/css/ie7.php new file mode 100644 index 000000000..db0125b4b --- /dev/null +++ b/views/default/css/ie7.php @@ -0,0 +1,65 @@ +/** + * CSS for IE7 + */ + +/* trigger hasLayout in IE */ +* { + zoom: 1; +} + +/* site menu drop-down z-index fix for IE7 */ +.elgg-page-header { + z-index: 1; +} + +/* inline-block fixes */ +.elgg-gallery > li, +.elgg-button, +.elgg-icon, +.elgg-menu-hz > li, +.elgg-menu-hz > li:after, +.elgg-menu-hz > li > a, +.elgg-menu-hz > li > span, +.elgg-breadcrumbs > li, +.elgg-menu-footer > li > a, +.elgg-menu-footer li, +.elgg-menu-general > li > a, +.elgg-menu-general li { + display: inline; +} + +/* IE7 does not support :after */ +.elgg-breadcrumbs > li > a { + display: inline; + padding-right: 4px; + margin-right: 4px; + border-right: 1px solid #bababa; +} +.elgg-menu-footer li, +.elgg-menu-user li, +.elgg-menu-general li { + padding-left: 4px; + padding-right: 4px; +} + +/* longtext menu would not display horizontally without this */ +.elgg-menu-longtext { + width: 100%; +} +.elgg-menu-longtext li { + width: 100px; + float: right; +} + +.elgg-avatar { + display: inline; +} + +.elgg-body-walledgarden .elgg-col-1of2 { + width: 255px; +} + +.elgg-module-walledgarden > .elgg-head, +.elgg-module-walledgarden > .elgg-foot { + width: 530px; +}
\ No newline at end of file diff --git a/views/default/css/lightbox.php b/views/default/css/lightbox.php index 55e6ec604..7d5917cc3 100644 --- a/views/default/css/lightbox.php +++ b/views/default/css/lightbox.php @@ -1,4 +1,4 @@ -<? +<?php /** * Fancybox lightbox CSS. * @@ -8,7 +8,7 @@ * @subpackage UI */ -$jquery_path = elgg_get_site_url() . '/vendors/jquery/'; +$jquery_path = elgg_get_site_url() . 'vendors/jquery/'; ?> /* diff --git a/views/default/css/walled_garden.php b/views/default/css/walled_garden.php index 75bf0f29e..ea2543587 100644 --- a/views/default/css/walled_garden.php +++ b/views/default/css/walled_garden.php @@ -6,32 +6,65 @@ $url = elgg_get_site_url(); ?> -#elgg-walledgarden { +.elgg-body-walledgarden { margin: 100px auto 0 auto; - width: 563px; - min-height: 230px; - background: url(<?php echo $url; ?>_graphics/walled_garden_background_top.gif) no-repeat left top; - padding: 0; position: relative; + width: 530px; +} +.elgg-module-walledgarden { + position: absolute; + top: 0; + left: 0; +} +.elgg-module-walledgarden > .elgg-head { + height: 17px; +} +.elgg-module-walledgarden > .elgg-body { + padding: 0 10px; +} +.elgg-module-walledgarden > .elgg-foot { + height: 17px; +} +.elgg-walledgarden-double > .elgg-head { + background: url(<?php echo $url; ?>_graphics/walled_garden/two_column_top.png) no-repeat left top; +} +.elgg-walledgarden-double > .elgg-body { + background: url(<?php echo $url; ?>_graphics/walled_garden/two_column_middle.png) repeat-y left top; +} +.elgg-walledgarden-double > .elgg-foot { + background: url(<?php echo $url; ?>_graphics/walled_garden/two_column_bottom.png) no-repeat left top; +} +.elgg-walledgarden-single > .elgg-head { + background: url(<?php echo $url; ?>_graphics/walled_garden/one_column_top.png) no-repeat left top; +} +.elgg-walledgarden-single > .elgg-body { + background: url(<?php echo $url; ?>_graphics/walled_garden/one_column_middle.png) repeat-y left top; +} +.elgg-walledgarden-single > .elgg-foot { + background: url(<?php echo $url; ?>_graphics/walled_garden/one_column_bottom.png) no-repeat left top; } -#elgg-walledgarden-bottom { - margin:0 auto; - background: url(<?php echo $url; ?>_graphics/walled_garden_background_bottom.gif) no-repeat left bottom; - width:563px; - height:54px; +.elgg-col > .elgg-inner { + margin: 0 0 0 5px; +} +.elgg-col:first-child > .elgg-inner { + margin: 0 5px 0 0; +} +.elgg-col > .elgg-inner { + padding: 0 8px; } -#elgg-walledgarden-intro { - width: 230px; - float: left; - margin: 35px 15px 15px 35px; +.elgg-walledgarden-single > .elgg-body > .elgg-inner { + padding: 0 8px; } -#elgg-walledgarden-login { - width: 230px; - float: left; - margin: 30px 15px 45px 19px; +.elgg-module-walledgarden-login { + margin: 0; +} +.elgg-body-walledgarden h3 { + font-size: 1.5em; + line-height: 1.1em; + padding-bottom: 5px; } .elgg-heading-walledgarden { @@ -39,27 +72,3 @@ $url = elgg_get_site_url(); margin-top: 60px; line-height: 1.1em; } - -#elgg-walledgarden-lostpassword, -#elgg-walledgarden-registration { - position: absolute; - right: 0; - top: 0; - width: 563px; - background-color: white; - padding: 0; - background: url(<?php echo $url; ?>_graphics/walled_garden_backgroundfull_top.gif) no-repeat left top; - height: auto; -} - -.elgg-hiddenform-body { - padding: 30px 40px 0 40px; - height: auto; -} -.elgg-hiddenform-bottom { - margin: 0 auto; - background: url(<?php echo $url; ?>_graphics/walled_garden_backgroundfull_bottom.gif) no-repeat left bottom; - width: 563px; - height: 54px; - position: relative; -} diff --git a/views/default/forms/account/settings.php b/views/default/forms/account/settings.php index 824b2280b..3967207ce 100644 --- a/views/default/forms/account/settings.php +++ b/views/default/forms/account/settings.php @@ -5,4 +5,6 @@ * This form is extended by Elgg with the views in core/settings/account. * Plugins can additionally extend it and then register for the * 'usersettings:save', 'user' plugin hook. + * + * This view is included by "forms/usersettings/save" */ diff --git a/views/default/forms/admin/menu/save.php b/views/default/forms/admin/menu/save.php index 92a0784df..1a67ffcc4 100644 --- a/views/default/forms/admin/menu/save.php +++ b/views/default/forms/admin/menu/save.php @@ -64,7 +64,7 @@ $custom_items = elgg_get_config('site_custom_menu_items'); $name_str = elgg_echo('name'); $url_str = elgg_echo('admin:plugins:label:website'); -echo '<ul class="elgg-simple-list">'; +echo '<ul class="elgg-list elgg-list-simple">'; if (is_array($custom_items)) { foreach ($custom_items as $title => $url) { diff --git a/views/default/forms/admin/plugins/change_state.php b/views/default/forms/admin/plugins/change_state.php index ba5d873e7..730c8ff32 100644 --- a/views/default/forms/admin/plugins/change_state.php +++ b/views/default/forms/admin/plugins/change_state.php @@ -9,6 +9,7 @@ $guids = elgg_extract('guids', $vars, array()); $guids = implode(',', $guids); +echo '<div>'; echo elgg_view('input/hidden', array( 'name' => 'guids', 'value' => $guids, @@ -16,5 +17,6 @@ echo elgg_view('input/hidden', array( echo elgg_view('input/submit', array( 'value' => elgg_echo("admin:plugins:{$vars['action']}_all"), - 'class' => 'elgg-button elgg-button-action' + 'class' => 'elgg-button elgg-button-action mrm' )); +echo '</div>'; diff --git a/views/default/forms/admin/plugins/filter.php b/views/default/forms/admin/plugins/filter.php index d00906e6a..fd1b618bc 100644 --- a/views/default/forms/admin/plugins/filter.php +++ b/views/default/forms/admin/plugins/filter.php @@ -7,6 +7,7 @@ * @uses $vvars['sort'] */ +echo '<div>'; echo elgg_view('input/dropdown', array( 'name' => 'category', 'options_values' => $vars['category_options'], @@ -22,3 +23,4 @@ echo elgg_view('input/submit', array( 'value' => elgg_echo('filter'), 'class' => 'elgg-button elgg-button-action', )); +echo '</div>'; diff --git a/views/default/forms/admin/plugins/sort.php b/views/default/forms/admin/plugins/sort.php index 284e085e6..7f2246bad 100644 --- a/views/default/forms/admin/plugins/sort.php +++ b/views/default/forms/admin/plugins/sort.php @@ -7,6 +7,7 @@ * @uses $vars['category'] */ +echo '<div class="mtm">'; echo elgg_view('input/dropdown', array( 'name' => 'sort', 'options_values' => $vars['sort_options'], @@ -22,3 +23,4 @@ echo elgg_view('input/submit', array( 'value' => elgg_echo('sort'), 'class' => 'elgg-button elgg-button-action' )); +echo '</div>'; diff --git a/views/default/forms/admin/site/update_advanced.php b/views/default/forms/admin/site/update_advanced.php index fa253967c..e12764092 100644 --- a/views/default/forms/admin/site/update_advanced.php +++ b/views/default/forms/admin/site/update_advanced.php @@ -17,26 +17,26 @@ foreach (array('wwwroot', 'path', 'dataroot') as $field) { } $form_body .= "<div>" . elgg_echo('admin:site:access:warning') . "<br />"; -$form_body .= elgg_echo('installation:sitepermissions'); +$form_body .= "<label>" . elgg_echo('installation:sitepermissions') . "</label>"; $form_body .= elgg_view('input/access', array( 'name' => 'default_access', 'value' => elgg_get_config('default_access'), )) . "</div>"; $form_body .= "<div>" . elgg_echo('installation:allow_user_default_access:description') . "<br />"; $form_body .= elgg_view("input/checkboxes", array( - 'options' => array(elgg_echo('installation:allow_user_default_access:label')), + 'options' => array(elgg_echo('installation:allow_user_default_access:label') => elgg_echo('installation:allow_user_default_access:label')), 'name' => 'allow_user_default_access', 'value' => (elgg_get_config('allow_user_default_access') ? elgg_echo('installation:allow_user_default_access:label') : ""), )) . "</div>"; $form_body .= "<div>" . elgg_echo('installation:simplecache:description') . "<br />"; $form_body .= elgg_view("input/checkboxes", array( - 'options' => array(elgg_echo('installation:simplecache:label')), + 'options' => array(elgg_echo('installation:simplecache:label') => elgg_echo('installation:simplecache:label')), 'name' => 'simplecache_enabled', 'value' => (elgg_get_config('simplecache_enabled') ? elgg_echo('installation:simplecache:label') : ""), )) . "</div>"; $form_body .= "<div>" . elgg_echo('installation:viewpathcache:description') . "<br />"; $form_body .= elgg_view("input/checkboxes", array( - 'options' => array(elgg_echo('installation:viewpathcache:label')), + 'options' => array(elgg_echo('installation:viewpathcache:label') => elgg_echo('installation:viewpathcache:label')), 'name' => 'viewpath_cache_enabled', 'value' => (elgg_get_config('viewpath_cache_enabled') ? elgg_echo('installation:viewpathcache:label') : ""), )) . "</div>"; @@ -52,7 +52,7 @@ $form_body .= '</div>'; // control new user registration $options = array( - 'options' => array(elgg_echo('installation:registration:label')), + 'options' => array(elgg_echo('installation:registration:label') => elgg_echo('installation:registration:label')), 'name' => 'allow_registration', 'value' => elgg_get_config('allow_registration') ? elgg_echo('installation:registration:label') : '', ); @@ -62,7 +62,7 @@ $form_body .= '<br />' .elgg_view('input/checkboxes', $options) . '</div>'; // control walled garden $walled_garden = elgg_get_config(walled_garden); $options = array( - 'options' => array(elgg_echo('installation:walled_garden:label')), + 'options' => array(elgg_echo('installation:walled_garden:label') => elgg_echo('installation:walled_garden:label')), 'name' => 'walled_garden', 'value' => $walled_garden ? elgg_echo('installation:walled_garden:label') : '', ); @@ -71,7 +71,7 @@ $form_body .= '<br />' . elgg_view('input/checkboxes', $options) . '</div>'; $form_body .= "<div>" . elgg_echo('installation:httpslogin') . "<br />"; $form_body .= elgg_view("input/checkboxes", array( - 'options' => array(elgg_echo('installation:httpslogin:label')), + 'options' => array(elgg_echo('installation:httpslogin:label') => elgg_echo('installation:httpslogin:label')), 'name' => 'https_login', 'value' => (elgg_get_config('https_login') ? elgg_echo('installation:httpslogin:label') : "") )) . "</div>"; @@ -83,7 +83,7 @@ if ($disable_api) { $on = (disable_api ? "" : elgg_echo('installation:disableapi:label')); } $form_body .= elgg_view("input/checkboxes", array( - 'options' => array(elgg_echo('installation:disableapi:label')), + 'options' => array(elgg_echo('installation:disableapi:label') => elgg_echo('installation:disableapi:label')), 'name' => 'api', 'value' => $on, )); diff --git a/views/default/forms/avatar/crop.php b/views/default/forms/avatar/crop.php index dc5e3d77f..3e798cb27 100644 --- a/views/default/forms/avatar/crop.php +++ b/views/default/forms/avatar/crop.php @@ -5,11 +5,27 @@ * @uses $vars['entity'] */ -$master_image = $vars['entity']->getIcon('master'); +elgg_load_js('jquery.imgareaselect'); +elgg_load_js('elgg.avatar_cropper'); +elgg_load_css('jquery.imgareaselect'); + +$master_img = elgg_view('output/img', array( + 'src' => $vars['entity']->getIconUrl('master'), + 'alt' => elgg_echo('avatar'), + 'class' => 'mrl', + 'id' => 'user-avatar-cropper', +)); + +$preview_img = elgg_view('output/img', array( + 'src' => $vars['entity']->getIconUrl('master'), + 'alt' => elgg_echo('avatar'), +)); ?> <div class="clearfix"> - <img id="user-avatar" class="mrl" src="<?php echo $master_image; ?>" alt="<?php echo elgg_echo('avatar'); ?>" /> + <?php echo $master_img; ?> + <div id="user-avatar-preview-title"><label><?php echo elgg_echo('avatar:preview'); ?></label></div> + <div id="user-avatar-preview"><?php echo $preview_img; ?></div> </div> <div class="elgg-foot"> <?php @@ -24,46 +40,3 @@ echo elgg_view('input/submit', array('value' => elgg_echo('avatar:create'))); ?> </div> -<!-- grab the required js for icon cropping --> -<script type="text/javascript" src="<?php echo elgg_get_site_url(); ?>vendors/jquery/jquery.imgareaselect-0.9.8/scripts/jquery.imgareaselect.min.js"></script> -<link rel="stylesheet" type="text/css" href="<?php echo elgg_get_site_url(); ?>vendors/jquery/jquery.imgareaselect-0.9.8/css/imgareaselect-deprecated.css" media="screen" /> -<?php //@todo JS 1.8: no ?> -<script type="text/javascript"> - - // display a preview of the users cropped section - function preview(img, selection) { - // catch for the first click on the image - if (selection.width == 0 || selection.height == 0) { - return; - } - - var origWidth = $("#user-avatar").width(); //get the width of the users master photo - var origHeight = $("#user-avatar").height(); //get the height of the users master photo - var scaleX = 100 / selection.width; - var scaleY = 100 / selection.height; - $('#user-avatar-preview > img').css({ - width: Math.round(scaleX * origWidth) + 'px', - height: Math.round(scaleY * origHeight) + 'px', - marginLeft: '-' + Math.round(scaleX * selection.x1) + 'px', - marginTop: '-' + Math.round(scaleY * selection.y1) + 'px' - }); - } - - function selectChange(img, selection) { - // populate the form with the correct coordinates once a user has cropped their image - $('input[name=x1]').val(selection.x1); - $('input[name=x2]').val(selection.x2); - $('input[name=y1]').val(selection.y1); - $('input[name=y2]').val(selection.y2); - } - - $(document).ready(function() { - $('<div id="user-avatar-preview"><img src="<?php echo $master_image; ?>" /></div>').insertAfter($('#user-avatar')); - $('<div id="user-avatar-preview-title"><label><?php echo elgg_echo('avatar:preview'); ?></label></div>').insertBefore($('#user-avatar-preview')); - - // this produces the coordinates - $('#user-avatar').imgAreaSelect({ selectionOpacity: 0, onSelectEnd: selectChange }); - // show the preview - $('#user-avatar').imgAreaSelect({ aspectRatio: '1:1', onSelectChange: preview }); - }); -</script> diff --git a/views/default/forms/login.php b/views/default/forms/login.php index 5cfdcd4c6..6f6cc9906 100644 --- a/views/default/forms/login.php +++ b/views/default/forms/login.php @@ -9,7 +9,11 @@ <div> <label><?php echo elgg_echo('loginusername'); ?></label> - <?php echo elgg_view('input/text', array('name' => 'username')); ?> + <?php echo elgg_view('input/text', array( + 'name' => 'username', + 'class' => 'elgg-autofocus', + )); + ?> </div> <div> <label><?php echo elgg_echo('password'); ?></label> @@ -18,28 +22,28 @@ <?php echo elgg_view('login/extend'); ?> -<div> - <?php echo elgg_view('input/submit', array('value' => elgg_echo('login'))); ?> - - <label class="right mtm"> +<div class="elgg-foot"> + <label class="mtm float-alt"> <input type="checkbox" name="persistent" value="true" /> <?php echo elgg_echo('user:persistent'); ?> </label> + <?php echo elgg_view('input/submit', array('value' => elgg_echo('login'))); ?> + <?php - if ($vars['returntoreferer']) { + if (isset($vars['returntoreferer'])) { echo elgg_view('input/hidden', array('name' => 'returntoreferer', 'value' => 'true')); } ?> -</div> -<ul class="elgg-menu elgg-menu-footer"> -<?php - if (elgg_get_config('allow_registration')) { - echo '<li><a class="registration_link" href="' . elgg_get_site_url() . 'register">' . elgg_echo('register') . '</a></li>'; - } -?> - <li><a class="forgotten_password_link" href="<?php echo elgg_get_site_url(); ?>forgotpassword"> - <?php echo elgg_echo('user:password:lost'); ?> - </a></li> -</ul>
\ No newline at end of file + <ul class="elgg-menu elgg-menu-general mtm"> + <?php + if (elgg_get_config('allow_registration')) { + echo '<li><a class="registration_link" href="' . elgg_get_site_url() . 'register">' . elgg_echo('register') . '</a></li>'; + } + ?> + <li><a class="forgot_link" href="<?php echo elgg_get_site_url(); ?>forgotpassword"> + <?php echo elgg_echo('user:password:lost'); ?> + </a></li> + </ul> +</div> diff --git a/views/default/forms/plugins/settings/save.php b/views/default/forms/plugins/settings/save.php index c3d8f231f..dc7b2fef7 100644 --- a/views/default/forms/plugins/settings/save.php +++ b/views/default/forms/plugins/settings/save.php @@ -1,6 +1,6 @@ <?php /** - * Used to show plugin user settings. + * Used to show plugin settings for both users and admins. * * @package Elgg.Core * @subpackage Plugins diff --git a/views/default/forms/plugins/usersettings/save.php b/views/default/forms/plugins/usersettings/save.php index bf243ae6b..ced88f818 100644 --- a/views/default/forms/plugins/usersettings/save.php +++ b/views/default/forms/plugins/usersettings/save.php @@ -1,4 +1,13 @@ <?php +/** + * Plugin user settings + * + * Calls the plugin admin settings form body with type set to 'user' + * + * @package Elgg.Core + * @subpackage Plugins + */ + $vars['type'] = 'user'; // Can't use elgg_view_form() because it overrides the $vars['action'] parameter diff --git a/views/default/forms/profile/fields/add.php b/views/default/forms/profile/fields/add.php index 7961037e6..1ea9c57a9 100644 --- a/views/default/forms/profile/fields/add.php +++ b/views/default/forms/profile/fields/add.php @@ -1,8 +1,6 @@ <?php /** - * Elgg profile index - * - * @package ElggProfile + * Add a new field to the set of custom profile fields */ $label_text = elgg_echo('profile:label'); @@ -10,19 +8,21 @@ $type_text = elgg_echo('profile:type'); $label_control = elgg_view('input/text', array('name' => 'label')); $type_control = elgg_view('input/dropdown', array('name' => 'type', 'options_values' => array( - 'text' => elgg_echo('text'), - 'longtext' => elgg_echo('longtext'), - 'tags' => elgg_echo('tags'), - 'url' => elgg_echo('url'), - 'email' => elgg_echo('email') + 'text' => elgg_echo('profile:field:text'), + 'longtext' => elgg_echo('profile:field:longtext'), + 'tags' => elgg_echo('profile:field:tags'), + 'url' => elgg_echo('profile:field:url'), + 'email' => elgg_echo('profile:field:email'), + 'location' => elgg_echo('profile:field:location'), + 'date' => elgg_echo('profile:field:date'), ))); $submit_control = elgg_view('input/submit', array('name' => elgg_echo('add'), 'value' => elgg_echo('add'))); $formbody = <<< END - <p>$label_text: $label_control - $type_text: $type_control - $submit_control</p> + <div>$label_text: $label_control</div> + <div class="elgg-foot">$type_text: $type_control + $submit_control</div> END; echo autop(elgg_echo('profile:explainchangefields')); diff --git a/views/default/forms/profile/fields/reset.php b/views/default/forms/profile/fields/reset.php index 4e0f51dc6..c0bb1b7f4 100644 --- a/views/default/forms/profile/fields/reset.php +++ b/views/default/forms/profile/fields/reset.php @@ -3,8 +3,10 @@ * Reset profile fields form */ +echo '<div class="elgg-foot">'; $params = array( 'value' => elgg_echo('profile:resetdefault'), 'class' => 'elgg-button-cancel', ); echo elgg_view('input/submit', $params); +echo '</div>'; diff --git a/views/default/forms/register.php b/views/default/forms/register.php index 4e0a521ab..411152205 100644 --- a/views/default/forms/register.php +++ b/views/default/forms/register.php @@ -23,6 +23,7 @@ if (elgg_is_sticky_form('register')) { echo elgg_view('input/text', array( 'name' => 'name', 'value' => $name, + 'class' => 'elgg-autofocus', )); ?> </div> @@ -70,12 +71,8 @@ echo elgg_view('register/extend'); // Add captcha hook echo elgg_view('input/captcha'); +echo '<div class="elgg-foot">'; echo elgg_view('input/hidden', array('name' => 'friend_guid', 'value' => $vars['friend_guid'])); echo elgg_view('input/hidden', array('name' => 'invitecode', 'value' => $vars['invitecode'])); echo elgg_view('input/submit', array('name' => 'submit', 'value' => elgg_echo('register'))); -?> -<script type="text/javascript"> - $(function() { - $('input[name=name]').focus(); - }); -</script>
\ No newline at end of file +echo '</div>'; diff --git a/views/default/forms/user/requestnewpassword.php b/views/default/forms/user/requestnewpassword.php index 22357e728..8a5a18734 100644 --- a/views/default/forms/user/requestnewpassword.php +++ b/views/default/forms/user/requestnewpassword.php @@ -12,15 +12,13 @@ </div> <div> <label><?php echo elgg_echo('username'); ?></label><br /> - <?php echo elgg_view('input/text', array('name' => 'username')); ?> + <?php echo elgg_view('input/text', array( + 'name' => 'username', + 'class' => 'elgg-autofocus', + )); + ?> </div> <?php echo elgg_view('input/captcha'); ?> <div class="elgg-foot"> <?php echo elgg_view('input/submit', array('value' => elgg_echo('request'))); ?> </div> -<?php //@todo JS 1.8: no ?> -<script type="text/javascript"> - $(document).ready(function() { - $('input[name=username]').focus(); - }); -</script>
\ No newline at end of file diff --git a/views/default/forms/useradd.php b/views/default/forms/useradd.php index 66f8846e2..4f337e4e4 100644 --- a/views/default/forms/useradd.php +++ b/views/default/forms/useradd.php @@ -17,10 +17,6 @@ if (elgg_is_sticky_form('useradd')) { } } -$admin_option = false; -if ((elgg_get_logged_in_user_entity()->isAdmin()) && ($vars['show_admin'])) { - $admin_option = true; -} ?> <div> <label><?php echo elgg_echo('name');?></label><br /> @@ -67,18 +63,15 @@ if ((elgg_get_logged_in_user_entity()->isAdmin()) && ($vars['show_admin'])) { )); ?> </div> - +<div> <?php -if ($admin_option) { - echo "<div>"; echo elgg_view('input/checkboxes', array( 'name' => "admin", 'options' => array(elgg_echo('admin_option') => 1), 'value' => $admin, )); - echo "</div>"; -} ?> +</div> <div class="elgg-foot"> <?php echo elgg_view('input/submit', array('value' => elgg_echo('register'))); ?> diff --git a/views/default/forms/usersettings/save.php b/views/default/forms/usersettings/save.php index ea53f2571..71323083f 100644 --- a/views/default/forms/usersettings/save.php +++ b/views/default/forms/usersettings/save.php @@ -1,5 +1,11 @@ <?php -$form_body = elgg_view("forms/account/settings"); +/** + * User account settings. + * + * Plugins should extend "forms/account/settings" to add to the settings. + */ + +$form_body = elgg_view("forms/account/settings", $vars); $form_body .= '<div class="elgg-foot">'; $form_body .= elgg_view('input/submit', array('value' => elgg_echo('save'))); diff --git a/views/default/forms/widgets/save.php b/views/default/forms/widgets/save.php index 4ba911cb5..6959b2a82 100644 --- a/views/default/forms/widgets/save.php +++ b/views/default/forms/widgets/save.php @@ -14,7 +14,7 @@ $custom_form_section = elgg_view($edit_view, array('entity' => $widget)); $access = ''; if ($show_access) { - $access = elgg_view('input/access', array( + $access = elgg_echo('access') . ': ' . elgg_view('input/access', array( 'name' => 'params[access_id]', 'value' => $widget->access_id, )); @@ -38,4 +38,4 @@ $body = <<<___END </div> ___END; -echo $body;
\ No newline at end of file +echo $body; diff --git a/views/default/icon/default.php b/views/default/icon/default.php index c5749ba04..22c20b3a7 100644 --- a/views/default/icon/default.php +++ b/views/default/icon/default.php @@ -5,9 +5,11 @@ * @package Elgg * @subpackage Core * - * @uses $vars['entity'] The entity the icon represents - uses getIconURL() method - * @uses $vars['size'] topbar, tiny, small, medium (default), large, master - * @uses $vars['href'] Optional override for link + * @uses $vars['entity'] The entity the icon represents - uses getIconURL() method + * @uses $vars['size'] topbar, tiny, small, medium (default), large, master + * @uses $vars['href'] Optional override for link + * @uses $vars['img_class'] Optional CSS class added to img + * @uses $vars['link_class'] Optional CSS class for the link */ $entity = $vars['entity']; @@ -18,25 +20,38 @@ if (!in_array($vars['size'], $sizes)) { $vars['size'] = "medium"; } +$class = elgg_extract('img_class', $vars, ''); + if (isset($entity->name)) { $title = $entity->name; } else { $title = $entity->title; } +$title = htmlspecialchars($title, ENT_QUOTES, 'UTF-8', false); $url = $entity->getURL(); if (isset($vars['href'])) { $url = $vars['href']; } -$img_src = $entity->getIconURL($vars['size']); -$img = "<img src=\"$img_src\" alt=\"$title\" />"; +$img = elgg_view('output/img', array( + 'src' => $entity->getIconURL($vars['size']), + 'alt' => $title, + 'class' => $class, +)); if ($url) { - echo elgg_view('output/url', array( + $params = array( 'href' => $url, 'text' => $img, - )); + 'is_trusted' => true, + ); + $class = elgg_extract('link_class', $vars, ''); + if ($class) { + $params['class'] = $class; + } + + echo elgg_view('output/url', $params); } else { echo $img; } diff --git a/views/default/icon/user/default.php b/views/default/icon/user/default.php index 6f5c6e2da..c0b0e7483 100644 --- a/views/default/icon/user/default.php +++ b/views/default/icon/user/default.php @@ -5,10 +5,14 @@ * Rounded avatar corners - CSS3 method * uses avatar as background image so we can clip it with border-radius in supported browsers * - * @uses $vars['entity'] The user entity. If none specified, the current user is assumed. - * @uses $vars['size'] The size - tiny, small, medium or large. (medium) - * @uses $vars['hover'] Display the hover menu? (true) - * @uses $vars['class'] Optional class added to the .elgg-avatar div + * @uses $vars['entity'] The user entity. If none specified, the current user is assumed. + * @uses $vars['size'] The size - tiny, small, medium or large. (medium) + * @uses $vars['use_hover'] Display the hover menu? (true) + * @uses $vars['use_link'] Wrap a link around image? (true) + * @uses $vars['class'] Optional class added to the .elgg-avatar div + * @uses $vars['img_class'] Optional CSS class added to img + * @uses $vars['link_class'] Optional CSS class for the link + * @uses $vars['href'] Optional override of the link href */ $user = elgg_extract('entity', $vars, elgg_get_logged_in_user_entity()); @@ -22,11 +26,13 @@ if (isset($vars['class'])) { $class = "$class {$vars['class']}"; } +$use_link = elgg_extract('use_link', $vars, true); + if (!($user instanceof ElggUser)) { return true; } -$name = htmlspecialchars($user->name, ENT_QUOTES, 'UTF-8'); +$name = htmlspecialchars($user->name, ENT_QUOTES, 'UTF-8', false); $username = $user->username; $icontime = $user->icontime; @@ -35,15 +41,37 @@ if (!$icontime) { } $js = elgg_extract('js', $vars, ''); +if ($js) { + elgg_deprecated_notice("Passing 'js' to icon views is deprecated.", 1.8, 5); +} -$hover = elgg_extract('hover', $vars, true); +$img_class = ''; +if (isset($vars['img_class'])) { + $img_class = $vars['img_class']; +} + +$use_hover = elgg_extract('use_hover', $vars, true); +if (isset($vars['override'])) { + elgg_deprecated_notice("Use 'use_hover' rather than 'override' with user avatars", 1.8, 5); + $use_hover = false; +} +if (isset($vars['hover'])) { + // only 1.8.0 was released with 'hover' as the key + $use_hover = $vars['hover']; +} $spacer_url = elgg_get_site_url() . '_graphics/spacer.gif'; -$icon_url = $user->getIconURL($size); -$icon = "<img src=\"$spacer_url\" alt=\"$name\" title=\"$name\" $js style=\"background: url($icon_url) no-repeat;\" />"; +$icon_url = elgg_format_url($user->getIconURL($size)); +$icon = elgg_view('output/img', array( + 'src' => $spacer_url, + 'alt' => $name, + 'title' => $name, + 'class' => $img_class, + 'style' => "background: url($icon_url) no-repeat;", +)); -$show_menu = $hover && (elgg_is_admin_logged_in() || !$user->isBanned()); +$show_menu = $use_hover && (elgg_is_admin_logged_in() || !$user->isBanned()); ?> <div class="<?php echo $class; ?>"> @@ -59,9 +87,17 @@ if ($show_menu) { echo elgg_view_menu('user_hover', $params); } -echo elgg_view('output/url', array( - 'href' => $user->getURL(), - 'text' => $icon, -)); +if ($use_link) { + $class = elgg_extract('link_class', $vars, ''); + $url = elgg_extract('href', $vars, $user->getURL()); + echo elgg_view('output/url', array( + 'href' => $url, + 'text' => $icon, + 'is_trusted' => true, + 'class' => $class, + )); +} else { + echo "<a>$icon</a>"; +} ?> </div> diff --git a/views/default/input/autocomplete.php b/views/default/input/autocomplete.php index 421541e24..e58eb1ae8 100644 --- a/views/default/input/autocomplete.php +++ b/views/default/input/autocomplete.php @@ -8,7 +8,7 @@ * @todo This currently only works for ONE AUTOCOMPLETE TEXT FIELD on a page. * * @uses $vars['value'] Current value for the text input - * @uses $vars['match_on'] Array | str What to match on. all|array(groups|users|friends|subtype) + * @uses $vars['match_on'] Array | str What to match on. all|array(groups|users|friends) * @uses $vars['match_owner'] Bool. Match only entities that are owned by logged in user. * @uses $vars['class'] Additional CSS class */ @@ -26,15 +26,19 @@ $defaults = array( $vars = array_merge($defaults, $vars); -$ac_url_params = http_build_query(array( - 'match_on' => $vars['match_on'], - 'match_owner' => $vars['match_owner'], -)); - -unset($vars['match_on']); -unset($vars['match_owner']); +$params = array(); +if (isset($vars['match_on'])) { + $params['match_on'] = $vars['match_on']; + unset($vars['match_on']); +} +if (isset($vars['match_owner'])) { + $params['match_owner'] = $vars['match_owner']; + unset($vars['match_owner']); +} +$ac_url_params = http_build_query($params); elgg_load_js('elgg.autocomplete'); +elgg_load_js('jquery.ui.autocomplete.html'); ?> diff --git a/views/default/input/button.php b/views/default/input/button.php index c21989919..9957fdc54 100644 --- a/views/default/input/button.php +++ b/views/default/input/button.php @@ -33,7 +33,7 @@ switch ($vars['type']) { } // blank src if trying to access an offsite image. @todo why? -if (strpos($vars['src'], elgg_get_site_url()) === false) { +if (isset($vars['src']) && strpos($vars['src'], elgg_get_site_url()) === false) { $vars['src'] = ""; } ?> diff --git a/views/default/input/checkboxes.php b/views/default/input/checkboxes.php index 985858b85..db4b06949 100644 --- a/views/default/input/checkboxes.php +++ b/views/default/input/checkboxes.php @@ -49,7 +49,6 @@ $id = ''; if (isset($vars['id'])) { $id = "id=\"{$vars['id']}\""; unset($vars['id']); - unset($vars['internalid']); } if (is_array($vars['value'])) { diff --git a/views/default/input/date.php b/views/default/input/date.php index ceeb2105c..828ce5520 100644 --- a/views/default/input/date.php +++ b/views/default/input/date.php @@ -49,7 +49,7 @@ if ($timestamp) { // convert timestamps to text for display if (is_numeric($vars['value'])) { - $vars['value'] = gmdate('Y/m/d', $vars['value']); + $vars['value'] = gmdate('Y-m-d', $vars['value']); } $attributes = elgg_format_attributes($vars); diff --git a/views/default/input/dropdown.php b/views/default/input/dropdown.php index 4673a9301..9f07874f1 100644 --- a/views/default/input/dropdown.php +++ b/views/default/input/dropdown.php @@ -11,7 +11,7 @@ * @uses $vars['value'] The current value, if any * @uses $vars['options'] An array of strings representing the options for the dropdown field * @uses $vars['options_values'] An associative array of "value" => "option" - * where "value" is an internal name and "option" is + * where "value" is the name and "option" is * the value displayed on the button. Replaces * $vars['options'] when defined. * @uses $vars['class'] Additional CSS class diff --git a/views/default/input/friendspicker.php b/views/default/input/friendspicker.php index 1a60e0d88..b41449fbf 100644 --- a/views/default/input/friendspicker.php +++ b/views/default/input/friendspicker.php @@ -187,7 +187,7 @@ if (!isset($vars['replacement'])) { } //echo "<p>" . $user->name . "</p>"; - $label = elgg_view_entity_icon($friend, 'tiny', array('override' => true)); + $label = elgg_view_entity_icon($friend, 'tiny', array('use_hover' => false)); $options[$label] = $friend->getGUID(); if ($vars['highlight'] == 'all' diff --git a/views/default/input/radio.php b/views/default/input/radio.php index a8b278efd..ef860a773 100644 --- a/views/default/input/radio.php +++ b/views/default/input/radio.php @@ -32,7 +32,6 @@ $id = ''; if (isset($vars['id'])) { $id = "id=\"{$vars['id']}\""; unset($vars['id']); - unset($vars['internalid']); } $class = "elgg-input-radios elgg-{$vars['align']}"; diff --git a/views/default/input/reset.php b/views/default/input/reset.php index 12866421e..082da8669 100644 --- a/views/default/input/reset.php +++ b/views/default/input/reset.php @@ -4,8 +4,11 @@ * * @package Elgg * @subpackage Core + * + * @uses $vars['class'] CSS class that replaces elgg-button-cancel */ $vars['type'] = 'reset'; +$vars['class'] = elgg_extract('class', $vars, 'elgg-button-cancel'); echo elgg_view('input/button', $vars);
\ No newline at end of file diff --git a/views/default/input/submit.php b/views/default/input/submit.php index 64b135afa..df369b3b4 100644 --- a/views/default/input/submit.php +++ b/views/default/input/submit.php @@ -4,6 +4,8 @@ * * @package Elgg * @subpackage Core + * + * @uses $vars['class'] CSS class that replaces elgg-button-submit */ $vars['type'] = 'submit'; diff --git a/views/default/input/userpicker.php b/views/default/input/userpicker.php index dcd65072a..246c462da 100644 --- a/views/default/input/userpicker.php +++ b/views/default/input/userpicker.php @@ -6,17 +6,17 @@ * @subpackage Core * * @uses $vars['value'] Array of user guids for already selected users or null - * @uses $vars['name'] The name of the input field * + * The name of the hidden fields is members[] * - * Defaults to lazy load user lists in paginated alphabetical order. User needs - * two type two characters before seeing the user popup list. + * @warning Only a single input/userpicker is supported per web page. * - * As users are checked they move down to a "users" box. - * When this happens, a hidden input is created also. - * {$internalnal}[] with the value the GUID. + * Defaults to lazy load user lists in alphabetical order. User needs + * to type two characters before seeing the user popup list. * - * @warning: this is not stable + * As users are selected they move down to a "users" box. + * When this happens, a hidden input is created with the + * name of members[] and a value of the GUID. */ elgg_load_js('elgg.userpicker'); @@ -24,18 +24,18 @@ elgg_load_js('elgg.userpicker'); function user_picker_add_user($user_id) { $user = get_entity($user_id); if (!$user || !($user instanceof ElggUser)) { - return FALSE; + return false; } - $icon = $user->getIconURL('tiny'); - - $code = '<li class="elgg-image-block">'; - $code .= "<div class='elgg-image'><img class=\"livesearch_icon\" src=\"$icon\" /></div>"; - $code .= "<div class='elgg-image-alt'><a onclick='elgg.userpicker.removeUser(this, $user_id)'><strong>X</strong></a></div>"; - $code .= "<div class='elgg-body'>"; - $code .= "$user->name - $user->username"; - $code .= "<input type=\"hidden\" name=\"members[]\" value=\"$user_id\">"; + $icon = elgg_view_entity_icon($user, 'tiny', array('use_hover' => false)); + + // this html must be synced with the userpicker.js library + $code = '<li><div class="elgg-image-block">'; + $code .= "<div class='elgg-image'>$icon</div>"; + $code .= "<div class='elgg-image-alt'><a href='#' class='elgg-userpicker-remove'>X</a></div>"; + $code .= "<div class='elgg-body'>" . $user->name . "</div>"; $code .= "</div>"; + $code .= "<input type=\"hidden\" name=\"members[]\" value=\"$user_id\">"; $code .= '</li>'; return $code; @@ -62,9 +62,11 @@ foreach ($vars['value'] as $user_id) { ?> <div class="elgg-user-picker"> <input type="text" class="elgg-input-user-picker" size="30"/> - <label><input type="checkbox" name="match_on" value="true" /><?php echo elgg_echo('userpicker:only_friends'); ?></label> - <ul class="elgg-user-picker-entries"><?php echo $user_list; ?></ul> + <input type="checkbox" name="match_on" value="true" /> + <label><?php echo elgg_echo('userpicker:only_friends'); ?></label> + <ul class="elgg-user-picker-list"><?php echo $user_list; ?></ul> </div> <script type="text/javascript"> + // @todo grab the values in the init function rather than using inline JS elgg.userpicker.userList = <?php echo $json_values ?>; </script>
\ No newline at end of file diff --git a/views/default/js/admin.php b/views/default/js/admin.php index 253a73887..d4dd06822 100644 --- a/views/default/js/admin.php +++ b/views/default/js/admin.php @@ -42,7 +42,7 @@ elgg.admin.init = function () { }); // draggable profile field reordering. - $('#sortable_profile_fields').sortable({ + $('#elgg-profile-fields').sortable({ items: 'li', handle: 'span.elgg-state-draggable', stop: elgg.admin.moveProfileField @@ -143,7 +143,7 @@ elgg.admin.editProfileField = function(value, settings) { * @return void */ elgg.admin.moveProfileField = function(e, ui) { - var orderArr = $('#sortable_profile_fields').sortable('toArray'); + var orderArr = $('#elgg-profile-fields').sortable('toArray'); var orderStr = orderArr.join(','); elgg.action('profile/fields/reorder', { diff --git a/views/default/js/elgg.php b/views/default/js/elgg.php index 76388f80c..133e128a4 100644 --- a/views/default/js/elgg.php +++ b/views/default/js/elgg.php @@ -56,11 +56,13 @@ elgg.version = '<?php echo get_version(); ?>'; elgg.release = '<?php echo get_version(true); ?>'; elgg.config.wwwroot = '<?php echo elgg_get_site_url(); ?>'; elgg.security.interval = 5 * 60 * 1000; <?php //@todo make this configurable ?> +elgg.config.domReady = false; +elgg.config.languageReady = false; //After the DOM is ready $(function() { - elgg.trigger_hook('init', 'system'); - elgg.trigger_hook('ready', 'system'); + elgg.config.domReady = true; + elgg.initWhenReady(); }); <?php diff --git a/views/default/js/initialize_elgg.php b/views/default/js/initialize_elgg.php index 09e0b27bc..f8234f84f 100644 --- a/views/default/js/initialize_elgg.php +++ b/views/default/js/initialize_elgg.php @@ -41,6 +41,7 @@ if ($user instanceof ElggUser) { $user_json['subtype'] = $user->getSubtype(); $user_json['url'] = $user->getURL(); + $user_json['admin'] = $user->isAdmin(); echo 'elgg.session.user = new elgg.ElggUser(' . json_encode($user_json) . ');'; } diff --git a/views/default/js/walled_garden.php b/views/default/js/walled_garden.php new file mode 100644 index 000000000..46c2934ff --- /dev/null +++ b/views/default/js/walled_garden.php @@ -0,0 +1,40 @@ +<?php +/** + * Walled garden JavaScript + * + * @todo update for new JS lib + */ + +$cancel_button = elgg_view('input/button', array( + 'value' => elgg_echo('cancel'), + 'class' => 'elgg-button-cancel mlm', +)); +$cancel_button = trim($cancel_button); + +?> + +$(document).ready(function() { + + // add cancel button to inline forms + $(".elgg-walledgarden-password").find('input.elgg-button-submit').after('<?php echo $cancel_button; ?>'); + $('.elgg-walledgarden-register').find('input.elgg-button-submit').after('<?php echo $cancel_button; ?>'); + + $(".forgot_link").click(function(event) { + event.preventDefault(); + $(".elgg-walledgarden-password").fadeToggle(); + }); + + $(".registration_link").click(function(event) { + event.preventDefault(); + $(".elgg-walledgarden-register").fadeToggle(); + }); + + $('input.elgg-button-cancel').click(function(event) { + if ($(".elgg-walledgarden-password").is(':visible')) { + $(".forgot_link").click(); + } else if ($('.elgg-walledgarden-register').is(':visible')) { + $(".registration_link").click(); + } + event.preventDefault(); + }); +});
\ No newline at end of file diff --git a/views/default/navigation/breadcrumbs.php b/views/default/navigation/breadcrumbs.php index bad73c4b3..88577a8ff 100644 --- a/views/default/navigation/breadcrumbs.php +++ b/views/default/navigation/breadcrumbs.php @@ -30,6 +30,7 @@ if (is_array($breadcrumbs) && count($breadcrumbs) > 0) { $crumb = elgg_view('output/url', array( 'href' => $breadcrumb['link'], 'text' => $breadcrumb['title'], + 'is_trusted' => true, )); } else { $crumb = $breadcrumb['title']; diff --git a/views/default/navigation/listtype.php b/views/default/navigation/listtype.php deleted file mode 100644 index e90667e8d..000000000 --- a/views/default/navigation/listtype.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php -/** - * Elgg list view switcher - * - * @package Elgg - * @subpackage Core - */ - -$baseurl = elgg_http_remove_url_query_element($vars['baseurl'], 'search_listtype'); - -if ($vars['listtype'] == "list") { - $listtype = "gallery"; -} else { - $listtype = "list"; -} - -if (substr_count($baseurl,'?')) { - $baseurl .= "&search_listtype=" . $listtype; -} else { - $baseurl .= "?search_listtype=" . $listtype; -} - -?> - -<p class="mtm"> - <?php echo elgg_echo("listtype:change") ?>: - <a href="<?php echo $baseurl; ?>"><?php echo elgg_echo("listtype:{$listtype}"); ?></a> -</p>
\ No newline at end of file diff --git a/views/default/navigation/menu/site.php b/views/default/navigation/menu/site.php index 1409f54af..38b42bda9 100644 --- a/views/default/navigation/menu/site.php +++ b/views/default/navigation/menu/site.php @@ -11,11 +11,11 @@ foreach ($vars['menu']['default'] as $menu_item) { echo elgg_view('navigation/menu/elements/item', array('item' => $menu_item)); } -if (isset($vars['menu']['more'])) { +if (isset($vars['menu']['more']) && !empty($vars['menu']['more'])) { echo '<li class="elgg-more">'; $more = elgg_echo('more'); - echo "<a title=\"$more\">$more</a>"; + echo "<a href=\"#\">$more</a>"; echo elgg_view('navigation/menu/elements/section', array( 'class' => 'elgg-menu elgg-menu-site elgg-menu-site-more', diff --git a/views/default/navigation/menu/user_hover.php b/views/default/navigation/menu/user_hover.php index e32e5ab57..5c89e585c 100644 --- a/views/default/navigation/menu/user_hover.php +++ b/views/default/navigation/menu/user_hover.php @@ -19,6 +19,7 @@ echo '<ul class="elgg-menu elgg-menu-hover">'; $name_link = elgg_view('output/url', array( 'href' => $user->getURL(), 'text' => "<span class=\"elgg-heading-basic\">$user->name</span>@$user->username", + 'is_trusted' => true, )); echo "<li>$name_link</li>"; diff --git a/views/default/navigation/pagination.php b/views/default/navigation/pagination.php index c0cb801dd..4df5cf575 100644 --- a/views/default/navigation/pagination.php +++ b/views/default/navigation/pagination.php @@ -42,10 +42,12 @@ $pages = new stdClass(); $pages->prev = array( 'text' => '« ' . elgg_echo('previous'), 'href' => '', + 'is_trusted' => true, ); $pages->next = array( 'text' => elgg_echo('next') . ' »', 'href' => '', + 'is_trusted' => true, ); $pages->items = array(); diff --git a/views/default/navigation/tabs.php b/views/default/navigation/tabs.php index 0108126ad..e8fde3579 100644 --- a/views/default/navigation/tabs.php +++ b/views/default/navigation/tabs.php @@ -47,7 +47,7 @@ if (isset($vars['tabs']) && is_array($vars['tabs']) && !empty($vars['tabs'])) { $options = array( 'href' => $url, 'title' => $title, - 'text' => $title + 'text' => $title, ); if (isset($info['url_class'])) { @@ -58,6 +58,10 @@ if (isset($vars['tabs']) && is_array($vars['tabs']) && !empty($vars['tabs'])) { $options['id'] = $info['url_id']; } + if (!isset($info['rel']) && !isset($info['is_trusted'])) { + $options['is_trusted'] = true; + } + $link = elgg_view('output/url', $options); echo "<li $class_str $js>$link</li>"; diff --git a/views/default/navigation/viewtype.php b/views/default/navigation/viewtype.php index 69d29dc32..6dfa4ebc7 100644 --- a/views/default/navigation/viewtype.php +++ b/views/default/navigation/viewtype.php @@ -5,9 +5,7 @@ * @package Elgg * @subpackage Core * - * @deprecated 1.8 Use navigation/listtype + * @deprecated 1.8 See how file plugin adds a toggle in function file_register_toggle() */ -elgg_deprecated_notice('navigation/viewtype was deprecated by navigation/listtype', 1.8); - -echo elgg_view('navigation/listtype', $vars);
\ No newline at end of file +elgg_deprecated_notice('navigation/viewtype was deprecated', 1.8); diff --git a/views/default/object/admin_notice.php b/views/default/object/admin_notice.php index 086eddb1f..11524567e 100644 --- a/views/default/object/admin_notice.php +++ b/views/default/object/admin_notice.php @@ -11,7 +11,8 @@ if (isset($vars['entity']) && elgg_instanceof($vars['entity'], 'object', 'admin_ 'href' => "action/admin/delete_admin_notice?guid=$notice->guid", 'text' => '<span class="elgg-icon elgg-icon-delete"></span>', 'is_action' => true, - 'class' => 'elgg-admin-notice' + 'class' => 'elgg-admin-notice', + 'is_trusted' => true, )); echo "<p>$delete$message</p>"; diff --git a/views/default/object/default.php b/views/default/object/default.php index a50f19387..110648304 100644 --- a/views/default/object/default.php +++ b/views/default/object/default.php @@ -28,6 +28,7 @@ if ($owner) { $owner_link = elgg_view('output/url', array( 'href' => $owner->getURL(), 'text' => $owner->name, + 'is_trusted' => true, )); } @@ -45,4 +46,4 @@ $params = array( $params = $params + $vars; $body = elgg_view('object/elements/summary', $params); -echo elgg_view_image_block($icon, $body); +echo elgg_view_image_block($icon, $body, $vars); diff --git a/views/default/object/elements/full.php b/views/default/object/elements/full.php new file mode 100644 index 000000000..9b89f9706 --- /dev/null +++ b/views/default/object/elements/full.php @@ -0,0 +1,37 @@ +<?php +/** + * Object full rendering + * + * Sample output: + * <div class="elgg-content"> + * <div class="elgg-image-block"> + * </div> + * <div class="elgg-output"> + * </div> + * </div> + * + * @uses $vars['entity'] ElggEntity + * @uses $vars['icon'] HTML for the content icon + * @uses $vars['summary'] HTML for the content summary + * @uses $vars['body'] HTML for the content body + * @uses $vars['class'] Optional additional class for the content wrapper + */ + +$icon = elgg_extract('icon', $vars); +$summary = elgg_extract('summary', $vars); +$body = elgg_extract('body', $vars); +$class = elgg_extract('class', $vars); +if ($class) { + $class = "elgg-content $class"; +} else { + $class = "elgg-content"; +} + +$header = elgg_view_image_block($icon, $summary); + +echo <<<HTML +<div class="$class"> +$header +$body +</div> +HTML; diff --git a/views/default/object/elements/summary.php b/views/default/object/elements/summary.php index 10cf0b148..8d82bc52a 100644 --- a/views/default/object/elements/summary.php +++ b/views/default/object/elements/summary.php @@ -29,6 +29,7 @@ if ($title_link === '') { $params = array( 'text' => $text, 'href' => $entity->getURL(), + 'is_trusted' => true, ); $title_link = elgg_view('output/url', $params); } @@ -48,6 +49,9 @@ if ($metadata) { echo "<h3>$title_link</h3>"; echo "<div class=\"elgg-subtext\">$subtitle</div>"; echo $tags; + +echo elgg_view('object/summary/extend', $vars); + if ($content) { echo "<div class=\"elgg-content\">$content</div>"; } diff --git a/views/default/object/plugin.php b/views/default/object/plugin.php index 2facca97a..2f64cfcc9 100644 --- a/views/default/object/plugin.php +++ b/views/default/object/plugin.php @@ -11,8 +11,6 @@ $plugin = $vars['entity']; if (!$plugin->isValid()) { echo elgg_view('object/plugin/invalid', $vars); -} elseif ($vars['full_view']) { - echo elgg_view('object/plugin/advanced', $vars); } else { - echo elgg_view('object/plugin/simple', $vars); + echo elgg_view('object/plugin/full', $vars); } diff --git a/views/default/object/plugin/elements/dependencies.php b/views/default/object/plugin/elements/dependencies.php index 5f4aa4392..8abd61692 100644 --- a/views/default/object/plugin/elements/dependencies.php +++ b/views/default/object/plugin/elements/dependencies.php @@ -13,7 +13,7 @@ $deps = $plugin->getPackage()->checkDependencies(true); $columns = array('type', 'name', 'expected_value', 'local_value', 'comment'); -echo '<table class="elgg-plugins-dependencies styled"><tr>'; +echo '<table class="elgg-plugin-dependencies styled"><tr>'; foreach ($columns as $column) { $column = elgg_echo("admin:plugins:dependencies:$column"); diff --git a/views/default/object/plugin/advanced.php b/views/default/object/plugin/full.php index 08da89c01..db4e4dbcc 100644 --- a/views/default/object/plugin/advanced.php +++ b/views/default/object/plugin/full.php @@ -40,9 +40,10 @@ if ($reordering) { )); $links .= "<li>" . elgg_view('output/url', array( - 'href' => $top_url, - 'text' => elgg_echo('top'), - 'is_action' => true + 'href' => $top_url, + 'text' => elgg_echo('top'), + 'is_action' => true, + 'is_trusted' => true, )) . "</li>"; $up_url = elgg_http_add_url_query_elements($actions_base . 'set_priority', array( @@ -52,9 +53,10 @@ if ($reordering) { )); $links .= "<li>" . elgg_view('output/url', array( - 'href' => $up_url, - 'text' => elgg_echo('up'), - 'is_action' => true + 'href' => $up_url, + 'text' => elgg_echo('up'), + 'is_action' => true, + 'is_trusted' => true, )) . "</li>"; } @@ -67,9 +69,10 @@ if ($reordering) { )); $links .= "<li>" . elgg_view('output/url', array( - 'href' => $down_url, - 'text' => elgg_echo('down'), - 'is_action' => true + 'href' => $down_url, + 'text' => elgg_echo('down'), + 'is_action' => true, + 'is_trusted' => true, )) . "</li>"; $bottom_url = elgg_http_add_url_query_elements($actions_base . 'set_priority', array( @@ -81,7 +84,8 @@ if ($reordering) { $links .= "<li>" . elgg_view('output/url', array( 'href' => $bottom_url, 'text' => elgg_echo('bottom'), - 'is_action' => true + 'is_action' => true, + 'is_trusted' => true, )) . "</li>"; } } else { @@ -93,7 +97,8 @@ if ($reordering) { // always let them deactivate $options = array( - 'is_action' => true + 'is_action' => true, + 'is_trusted' => true, ); if ($active) { $active_class = 'elgg-state-active'; @@ -163,7 +168,8 @@ $author = '<span>' . elgg_echo('admin:plugins:label:author') . '</span>: ' $version = htmlspecialchars($plugin->getManifest()->getVersion()); $website = elgg_view('output/url', array( 'href' => $plugin->getManifest()->getWebsite(), - 'text' => $plugin->getManifest()->getWebsite() + 'text' => $plugin->getManifest()->getWebsite(), + 'is_trusted' => true, )); $copyright = elgg_view('output/text', array('value' => $plugin->getManifest()->getCopyright())); @@ -179,7 +185,8 @@ if ($files) { $url = 'admin_plugin_text_file/' . $plugin->getID() . "/$file"; $link = elgg_view('output/url', array( 'text' => $file, - 'href' => $url + 'href' => $url, + 'is_trusted' => true, )); $docs .= "<li>$link</li>"; @@ -197,7 +204,7 @@ if ($files) { <?php echo $links; ?> </ul> <?php endif; ?> - <div class="clearfloat right mtm"> + <div class="clearfloat float-alt mtm"> <?php echo $action_button; ?> </div> </div> @@ -207,7 +214,7 @@ $settings_view_old = 'settings/' . $plugin->getID() . '/edit'; $settings_view_new = 'plugins/' . $plugin->getID() . '/settings'; if (elgg_view_exists($settings_view_old) || elgg_view_exists($settings_view_new)) { $link = elgg_get_site_url() . "admin/plugin_settings/" . $plugin->getID(); - $settings_link = "<a class='plugin_settings small link' href='$link'>[" . elgg_echo('settings') . "]</a>"; + $settings_link = "<a class='elgg-plugin-settings' href='$link'>[" . elgg_echo('settings') . "]</a>"; } ?> <div class="elgg-head"> @@ -233,8 +240,8 @@ if (elgg_view_exists($settings_view_old) || elgg_view_exists($settings_view_new) } ?> - <div class="plugin_description"><?php echo $description; ?></div> - <p class="plugin_author"><?php echo $author . ' - ' . $website; ?></p> + <div><?php echo $description; ?></div> + <p><?php echo $author . ' - ' . $website; ?></p> <?php echo $docs; ?> <div class="pts"> @@ -248,7 +255,7 @@ if (elgg_view_exists($settings_view_old) || elgg_view_exists($settings_view_new) </div> </div> </div> - <div class="hidden manifest_file" id="elgg-plugin-manifest-<?php echo $plugin->getID(); ?>"> + <div class="elgg-plugin-more hidden" id="elgg-plugin-manifest-<?php echo $plugin->getID(); ?>"> <?php if ($screenshots_html) { diff --git a/views/default/object/plugin/invalid.php b/views/default/object/plugin/invalid.php index f29ee8d12..bb518cd53 100644 --- a/views/default/object/plugin/invalid.php +++ b/views/default/object/plugin/invalid.php @@ -34,7 +34,7 @@ $error = $plugin->getError(); ?> </div> - <div class="hidden manifest_file" id="elgg-plugin-manifest-<?php echo $plugin->getID(); ?>"> + <div class="hidden elgg-plugin-more" id="elgg-plugin-manifest-<?php echo $plugin->getID(); ?>"> <p><?php echo elgg_echo('admin:plugins:label:location') . ": " . $path; ?></p> <p><?php echo $error; ?></p> </div> diff --git a/views/default/object/plugin/simple.php b/views/default/object/plugin/simple.php deleted file mode 100644 index 5f5b08f10..000000000 --- a/views/default/object/plugin/simple.php +++ /dev/null @@ -1,76 +0,0 @@ -<?php -$plugin = $vars['entity']; - -$plugin_guid = $plugin->guid; -$plugin_id = $plugin->getID(); -$active = $plugin->isActive(); -$can_activate = $plugin->canActivate(); -$name = $plugin->getManifest()->getName(); -$author = $plugin->getManifest()->getAuthor(); -$version = $plugin->getManifest()->getVersion(); -$website = $plugin->getManifest()->getWebsite(); -$description = $plugin->getManifest()->getDescription(); - -if ($active) { - $active_class = 'elgg-state-active'; - $checked = 'checked="checked"'; -} else { - $active_class = 'elgg-state-inactive'; - $checked = ''; -} - -if ($can_activate) { - $disabled = ''; -} else { - $disabled = 'disabled="disabled"'; - $description .= '<p>' . elgg_echo('admin:plugins:simple:cannot_activate') . '</p>'; -} - -$description = elgg_view('output/longtext', array('value' => $description)); - -$plugin_footer = '<ul class="elgg-menu elgg-menu-footer">'; - -if ($author) { - $plugin_footer .= '<li>' . elgg_echo('admin:plugins:author', array($author)) . '</li>'; -} - -if ($version) { - $plugin_footer .= '<li>' . elgg_echo('admin:plugins:version', array($version)) . '</li>'; -} - -if ($website) { - $plugin_footer .= "<li><a href=\"$website\">" . elgg_echo('admin:plugins:plugin_website') . '</a></li>'; -} - -// show links to text files -$files = $plugin->getAvailableTextFiles(); - -foreach ($files as $file => $path) { - $url = 'admin_plugin_text_file/' . $plugin->getID() . "/$file"; - $link = elgg_view('output/url', array( - 'text' => $file, - 'href' => $url - )); - $plugin_footer .= "<li>$link</li>"; - -} - -if (elgg_view_exists("settings/$plugin_id/edit")) { - $settings_href = elgg_get_site_url() . "admin/plugin_settings/$plugin_id"; - $plugin_footer .= "<li><a class='plugin_settings link' href='$settings_href'>" . elgg_echo('settings') . "</a></li>"; -} - -$plugin_footer .= "</ul>"; - -echo <<<___END - <div class="elgg-plugin $active_class elgg-grid"> - <div class="elgg-col elgg-col-1of5"> - <input type="checkbox" id="$plugin_guid" $checked $disabled name="active_plugin_guids[]" value="$plugin_guid"/> - <label for="$plugin_guid">$name</label> - </div> - <div class="elgg-col elgg-col-4of5"> - $description - $plugin_footer - </div> - </div> -___END; diff --git a/views/default/object/widget/elements/controls.php b/views/default/object/widget/elements/controls.php index abf2154fc..6d06d28bc 100644 --- a/views/default/object/widget/elements/controls.php +++ b/views/default/object/widget/elements/controls.php @@ -24,6 +24,7 @@ if ($widget->canEdit()) { 'title' => elgg_echo('widget:delete', array($widget->getTitle())), 'href' => "action/widgets/delete?guid=$widget->guid", 'is_action' => true, + 'is_trusted' => true, 'class' => 'elgg-widget-delete-button', 'id' => "elgg-widget-delete-button-$widget->guid" ); diff --git a/views/default/output/access.php b/views/default/output/access.php index f312608d5..811948323 100644 --- a/views/default/output/access.php +++ b/views/default/output/access.php @@ -20,7 +20,7 @@ if (isset($vars['entity']) && elgg_instanceof($vars['entity'])) { // we decided to show that the item is in a group, rather than its actual access level // not required. Group ACLs are prepended with "Group: " when written. //$access_id_string = elgg_echo('groups:group') . $container->name; - $membership = $is_group->membership; + $membership = $container->membership; if ($membership == ACCESS_PUBLIC) { $access_class .= ' elgg-access-group-open'; diff --git a/views/default/output/confirmlink.php b/views/default/output/confirmlink.php index 5059a656e..532790a38 100644 --- a/views/default/output/confirmlink.php +++ b/views/default/output/confirmlink.php @@ -6,16 +6,16 @@ * @package Elgg * @subpackage Core * - * @uses $vars['text'] The text of the link - * @uses $vars['href'] The address - * @uses $vars['title'] The title text (defaults to confirm text) - * @uses $vars['confirm'] The dialog text - * @uses $vars['text_encode'] Encode special characters? (false) + * @uses $vars['text'] The text of the link + * @uses $vars['href'] The address + * @uses $vars['title'] The title text (defaults to confirm text) + * @uses $vars['confirm'] The dialog text + * @uses $vars['encode_text'] Run $vars['text'] through htmlspecialchars() (false) */ $vars['rel'] = elgg_extract('confirm', $vars, elgg_echo('question:areyousure')); $vars['rel'] = addslashes($vars['rel']); -$encode = elgg_extract('text_encode', $vars, false); +$encode = elgg_extract('encode_text', $vars, false); // always generate missing action tokens $vars['href'] = elgg_add_action_tokens_to_url(elgg_normalize_url($vars['href']), true); @@ -25,8 +25,8 @@ if ($encode) { $text = htmlspecialchars($text, ENT_QUOTES, 'UTF-8', false); } -if (!isset($vars['title'])) { - $vars['title'] = addslashes($confirm); +if (!isset($vars['title']) && isset($vars['confirm'])) { + $vars['title'] = $vars['rel']; } if (isset($vars['class'])) { @@ -41,6 +41,7 @@ if (isset($vars['class'])) { unset($vars['encode_text']); unset($vars['text']); unset($vars['confirm']); +unset($vars['is_trusted']); $attributes = elgg_format_attributes($vars); echo "<a $attributes>$text</a>"; diff --git a/views/default/output/date.php b/views/default/output/date.php index 7c98dddc9..1644a3480 100644 --- a/views/default/output/date.php +++ b/views/default/output/date.php @@ -11,7 +11,7 @@ // convert timestamps to text for display if (is_numeric($vars['value'])) { - $vars['value'] = gmdate('Y/m/d', $vars['value']); + $vars['value'] = gmdate('Y-m-d', $vars['value']); } echo $vars['value']; diff --git a/views/default/output/img.php b/views/default/output/img.php new file mode 100644 index 000000000..d3f596801 --- /dev/null +++ b/views/default/output/img.php @@ -0,0 +1,12 @@ +<?php +/** + * Elgg image view + * + * @uses string $vars['src'] The image src url. + */ + +$vars['src'] = elgg_normalize_url($vars['src']); +$vars['src'] = elgg_format_url($vars['src']); + +$attributes = elgg_format_attributes($vars); +echo "<img $attributes/>"; diff --git a/views/default/output/longtext.php b/views/default/output/longtext.php index ffdfd87cc..200f27de5 100644 --- a/views/default/output/longtext.php +++ b/views/default/output/longtext.php @@ -25,12 +25,12 @@ unset($vars['parse_urls']); $text = $vars['value']; unset($vars['value']); -$text = filter_tags($text); - if ($parse_urls) { $text = parse_urls($text); } +$text = filter_tags($text); + $text = autop($text); $attributes = elgg_format_attributes($vars); diff --git a/views/default/output/tag.php b/views/default/output/tag.php index abae9c4b2..3c002a31b 100644 --- a/views/default/output/tag.php +++ b/views/default/output/tag.php @@ -26,5 +26,9 @@ if (isset($vars['value'])) { $type = ""; } $url = elgg_get_site_url() . 'search?q=' . urlencode($vars['value']) . "&search_type=tags{$type}{$subtype}{$object}"; - echo elgg_view('output/url', array('href' => $url, 'text' => $vars['value'], 'rel' => 'tag')); + echo elgg_view('output/url', array( + 'href' => $url, + 'text' => $vars['value'], + 'rel' => 'tag', + )); } diff --git a/views/default/output/text.php b/views/default/output/text.php index 2c9242c1d..5cbfc35b0 100644 --- a/views/default/output/text.php +++ b/views/default/output/text.php @@ -6,8 +6,7 @@ * @package Elgg * @subpackage Core * - * @uses $vars['text'] The text to display - * + * @uses $vars['value'] The text to display */ echo htmlspecialchars($vars['value'], ENT_QUOTES, 'UTF-8', false);
\ No newline at end of file diff --git a/views/default/output/url.php b/views/default/output/url.php index 79ab52377..81b02087d 100644 --- a/views/default/output/url.php +++ b/views/default/output/url.php @@ -10,7 +10,7 @@ * @uses string $vars['href'] The unencoded url string * @uses bool $vars['encode_text'] Run $vars['text'] through htmlspecialchars() (false) * @uses bool $vars['is_action'] Is this a link to an action (false) - * + * @uses bool $vars['is_trusted'] Is this link trusted (false) */ $url = elgg_extract('href', $vars, null); @@ -37,11 +37,20 @@ if ($url) { if (elgg_extract('is_action', $vars, false)) { $url = elgg_add_action_tokens_to_url($url, false); - unset($vars['is_action']); + } + + if (!elgg_extract('is_trusted', $vars, false)) { + if (!isset($vars['rel'])) { + $vars['rel'] = 'nofollow'; + $url = strip_tags($url); + } } $vars['href'] = $url; } +unset($vars['is_action']); +unset($vars['is_trusted']); + $attributes = elgg_format_attributes($vars); -echo "<a $attributes>$text</a>";
\ No newline at end of file +echo "<a $attributes>$text</a>"; diff --git a/views/default/page/admin.php b/views/default/page/admin.php index 2b2ec9e4a..cd03541d5 100644 --- a/views/default/page/admin.php +++ b/views/default/page/admin.php @@ -22,7 +22,7 @@ if ($notices) { $notices_html .= elgg_view_entity($notice); } - $notices_html = "<div class=\"admin_notices\">$notices_html</div>"; + $notices_html = "<div class=\"elgg-admin-notices\">$notices_html</div>"; } ?> diff --git a/views/default/page/components/gallery.php b/views/default/page/components/gallery.php index f03eb1109..149ceeaf8 100644 --- a/views/default/page/components/gallery.php +++ b/views/default/page/components/gallery.php @@ -39,6 +39,7 @@ if (isset($vars['item_class'])) { $item_class = "$item_class {$vars['item_class']}"; } +$nav = ''; if ($pagination && $count) { $nav .= elgg_view('navigation/pagination', array( 'offset' => $offset, diff --git a/views/default/page/components/list.php b/views/default/page/components/list.php index c83fa0966..c0db50bc5 100644 --- a/views/default/page/components/list.php +++ b/views/default/page/components/list.php @@ -17,10 +17,10 @@ */ $items = $vars['items']; -$offset = $vars['offset']; -$limit = $vars['limit']; -$count = $vars['count']; -$base_url = $vars['base_url']; +$offset = elgg_extract('offset', $vars); +$limit = elgg_extract('limit', $vars); +$count = elgg_extract('count', $vars); +$base_url = elgg_extract('base_url', $vars, ''); $pagination = elgg_extract('pagination', $vars, true); $offset_key = elgg_extract('offset_key', $vars, 'offset'); $position = elgg_extract('position', $vars, 'after'); diff --git a/views/default/page/components/module.php b/views/default/page/components/module.php index f7b9da59c..7e1eaff20 100644 --- a/views/default/page/components/module.php +++ b/views/default/page/components/module.php @@ -2,10 +2,10 @@ /** * Elgg module element * - * @uses $vars['title'] Title text - * @uses $vars['header'] HTML content of the header + * @uses $vars['title'] Optional title text (do not pass header with this option) + * @uses $vars['header'] Optional HTML content of the header * @uses $vars['body'] HTML content of the body - * @uses $vars['footer'] HTML content of the footer + * @uses $vars['footer'] Optional HTML content of the footer * @uses $vars['class'] Optional additional class for module * @uses $vars['id'] Optional id for module * @uses $vars['show_inner'] Optional flag to leave out inner div (default: false) @@ -29,19 +29,15 @@ if (isset($vars['id'])) { } if (isset($vars['header'])) { - if ($vars['header']) { - $header = "<div class=\"elgg-head\">$header</div>"; - } -} else { + $header = "<div class=\"elgg-head\">$header</div>"; +} elseif ($title) { $header = "<div class=\"elgg-head\"><h3>$title</h3></div>"; } $body = "<div class=\"elgg-body\">$body</div>"; -if (isset($vars['footer'])) { - if ($vars['footer']) { - $footer = "<div class=\"elgg-foot\">$footer</div>"; - } +if ($footer) { + $footer = "<div class=\"elgg-foot\">$footer</div>"; } $contents = $header . $body . $footer; diff --git a/views/default/page/elements/footer.php b/views/default/page/elements/footer.php index 06fdb84a5..ded2cea9a 100644 --- a/views/default/page/elements/footer.php +++ b/views/default/page/elements/footer.php @@ -12,10 +12,11 @@ echo elgg_view_menu('footer', array('sort_by' => 'priority', 'class' => 'elgg-me $powered_url = elgg_get_site_url() . "_graphics/powered_by_elgg_badge_drk_bckgnd.gif"; -echo '<div class="mts clearfloat right">'; +echo '<div class="mts clearfloat float-alt">'; echo elgg_view('output/url', array( 'href' => 'http://elgg.org', 'text' => "<img src=\"$powered_url\" alt=\"Powered by Elgg\" width=\"106\" height=\"15\" />", 'class' => '', + 'is_trusted' => true, )); echo '</div>'; diff --git a/views/default/page/elements/head.php b/views/default/page/elements/head.php index 8776f07a7..e968e95ce 100644 --- a/views/default/page/elements/head.php +++ b/views/default/page/elements/head.php @@ -48,11 +48,15 @@ $release = get_version(true); <?php $ie_url = elgg_get_simplecache_url('css', 'ie'); + $ie7_url = elgg_get_simplecache_url('css', 'ie7'); $ie6_url = elgg_get_simplecache_url('css', 'ie6'); ?> - <!--[if gt IE 6]> + <!--[if gt IE 7]> <link rel="stylesheet" type="text/css" href="<?php echo $ie_url; ?>" /> <![endif]--> + <!--[if IE 7]> + <link rel="stylesheet" type="text/css" href="<?php echo $ie7_url; ?>" /> + <![endif]--> <!--[if IE 6]> <link rel="stylesheet" type="text/css" href="<?php echo $ie6_url; ?>" /> <![endif]--> diff --git a/views/default/page/elements/sidebar.php b/views/default/page/elements/sidebar.php index e1d25eed5..fe6bb450e 100644 --- a/views/default/page/elements/sidebar.php +++ b/views/default/page/elements/sidebar.php @@ -6,7 +6,7 @@ */ echo elgg_view_menu('extras', array( - 'sort_by' => 'name', + 'sort_by' => 'priority', 'class' => 'elgg-menu-hz', )); diff --git a/views/default/page/elements/tagcloud_block.php b/views/default/page/elements/tagcloud_block.php index 8b67c9e37..258951c41 100644 --- a/views/default/page/elements/tagcloud_block.php +++ b/views/default/page/elements/tagcloud_block.php @@ -50,6 +50,7 @@ $cloud .= elgg_view_icon('tag'); $cloud .= elgg_view('output/url', array( 'href' => 'tags', 'text' => elgg_echo('tagcloud:allsitetags'), + 'is_trusted' => true, )); $cloud .= '</p>'; diff --git a/views/default/page/layouts/one_column.php b/views/default/page/layouts/one_column.php index 7546a4cdf..491d5b459 100644 --- a/views/default/page/layouts/one_column.php +++ b/views/default/page/layouts/one_column.php @@ -30,7 +30,9 @@ $nav = elgg_extract('nav', $vars, elgg_view('navigation/breadcrumbs')); echo $vars['content']; // @deprecated 1.8 - echo $vars['area1']; + if (isset($vars['area1'])) { + echo $vars['area1']; + } ?> </div> </div>
\ No newline at end of file diff --git a/views/default/page/layouts/widgets.php b/views/default/page/layouts/widgets.php index b2c54e854..e3819cc20 100644 --- a/views/default/page/layouts/widgets.php +++ b/views/default/page/layouts/widgets.php @@ -39,10 +39,14 @@ echo $vars['content']; $widget_class = "elgg-col-1of{$num_columns}"; for ($column_index = 1; $column_index <= $num_columns; $column_index++) { - $column_widgets = $widgets[$column_index]; + if (isset($widgets[$column_index])) { + $column_widgets = $widgets[$column_index]; + } else { + $column_widgets = array(); + } echo "<div class=\"$widget_class elgg-widgets\" id=\"elgg-widget-col-$column_index\">"; - if (is_array($column_widgets) && sizeof($column_widgets) > 0) { + if (sizeof($column_widgets) > 0) { foreach ($column_widgets as $widget) { if (array_key_exists($widget->handler, $widget_types)) { echo elgg_view_entity($widget, array('show_access' => $show_access)); diff --git a/views/default/page/layouts/widgets/add_button.php b/views/default/page/layouts/widgets/add_button.php index 89e83b096..c33a45f99 100644 --- a/views/default/page/layouts/widgets/add_button.php +++ b/views/default/page/layouts/widgets/add_button.php @@ -10,6 +10,7 @@ 'text' => elgg_echo('widgets:add'), 'class' => 'elgg-button elgg-button-action', 'rel' => 'toggle', + 'is_trusted' => true, )); ?> </div> diff --git a/views/default/page/walled_garden.php b/views/default/page/walled_garden.php index 95d17fcff..ff8e317c7 100644 --- a/views/default/page/walled_garden.php +++ b/views/default/page/walled_garden.php @@ -7,12 +7,9 @@ // Set the content type header("Content-type: text/html; charset=UTF-8"); - -$site = elgg_get_site_entity(); -$title = $site->name; - ?> -<html> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <?php echo elgg_view('page/elements/head', $vars); ?> </head> @@ -21,22 +18,8 @@ $title = $site->name; <div class="elgg-page-messages"> <?php echo elgg_view('page/elements/messages', array('object' => $vars['sysmessages'])); ?> </div> - <div class="elgg-page-body"> - <div id="elgg-walledgarden"> - <div id="elgg-walledgarden-intro"> - <h1 class="elgg-heading-walledgarden"> - <?php - echo elgg_echo('walled_garden:welcome'); - echo ': <br/>'; - echo $title; - ?> - </h1> - </div> - <div id="elgg-walledgarden-login"> - <?php echo $vars['body']; ?> - </div> - </div> - <div id="elgg-walledgarden-bottom"></div> + <div class="elgg-body-walledgarden"> + <?php echo $vars['body']; ?> </div> </div> <?php echo elgg_view('page/elements/foot'); ?> diff --git a/views/default/profile/icon.php b/views/default/profile/icon.php index a69c41f1e..5f06cfd54 100644 --- a/views/default/profile/icon.php +++ b/views/default/profile/icon.php @@ -12,6 +12,6 @@ elgg_deprecated_notice('The profile/icon view was deprecated. Use elgg_view_entity_icon()', 1.8); $override = elgg_extract('override', $vars, false); -$vars['hover'] = !$override; +$vars['use_hover'] = !$override; echo elgg_view('icon/user/default', $vars); diff --git a/views/default/river/annotation/generic_comment/create.php b/views/default/river/annotation/generic_comment/create.php index d3db68e41..7d586450d 100644 --- a/views/default/river/annotation/generic_comment/create.php +++ b/views/default/river/annotation/generic_comment/create.php @@ -5,7 +5,7 @@ $object = $vars['item']->getObjectEntity(); $comment = $vars['item']->getAnnotation(); -echo elgg_view('river/item', array( +echo elgg_view('river/elements/layout', array( 'item' => $vars['item'], 'message' => elgg_get_excerpt($comment->value), )); diff --git a/views/default/river/elements/body.php b/views/default/river/elements/body.php index c5a525733..6894b81e2 100644 --- a/views/default/river/elements/body.php +++ b/views/default/river/elements/body.php @@ -27,6 +27,7 @@ if ($summary === false) { 'href' => $subject->getURL(), 'text' => $subject->name, 'class' => 'elgg-river-subject', + 'is_trusted' => true, )); } @@ -52,6 +53,7 @@ if ($container instanceof ElggGroup && $container->guid != elgg_get_page_owner_g $group_link = elgg_view('output/url', array( 'href' => $container->getURL(), 'text' => $container->name, + 'is_trusted' => true, )); $group_string = elgg_echo('river:ingroup', array($group_link)); } diff --git a/views/default/river/elements/layout.php b/views/default/river/elements/layout.php new file mode 100644 index 000000000..94622e272 --- /dev/null +++ b/views/default/river/elements/layout.php @@ -0,0 +1,14 @@ +<?php +/** + * Layout of a river item + * + * @uses $vars['item'] ElggRiverItem + */ + +$item = $vars['item']; + +echo elgg_view('page/components/image_block', array( + 'image' => elgg_view('river/elements/image', $vars), + 'body' => elgg_view('river/elements/body', $vars), + 'class' => 'elgg-river-item', +)); diff --git a/views/default/river/elements/responses.php b/views/default/river/elements/responses.php index 8c5be6316..f6c32e142 100644 --- a/views/default/river/elements/responses.php +++ b/views/default/river/elements/responses.php @@ -50,6 +50,7 @@ if ($comments) { $params = array( 'href' => $url, 'text' => elgg_echo('river:comments:more', array($num_more_comments)), + 'is_trusted' => true, ); $link = elgg_view('output/url', $params); echo "<div class=\"elgg-river-more\">$link</div>"; diff --git a/views/default/river/elements/summary.php b/views/default/river/elements/summary.php index 4d80c29a6..84941131f 100644 --- a/views/default/river/elements/summary.php +++ b/views/default/river/elements/summary.php @@ -15,12 +15,14 @@ $subject_link = elgg_view('output/url', array( 'href' => $subject->getURL(), 'text' => $subject->name, 'class' => 'elgg-river-subject', + 'is_trusted' => true, )); $object_link = elgg_view('output/url', array( 'href' => $object->getURL(), 'text' => $object->title ? $object->title : $object->name, 'class' => 'elgg-river-object', + 'is_trusted' => true, )); $action = $item->action_type; @@ -32,6 +34,7 @@ if ($container instanceof ElggGroup) { $params = array( 'href' => $container->getURL(), 'text' => $container->name, + 'is_trusted' => true, ); $group_link = elgg_view('output/url', $params); $group_string = elgg_echo('river:ingroup', array($group_link)); diff --git a/views/default/river/item.php b/views/default/river/item.php index 94622e272..75767e08d 100644 --- a/views/default/river/item.php +++ b/views/default/river/item.php @@ -1,14 +1,30 @@ <?php /** - * Layout of a river item + * Primary river item view + * + * Calls the individual view saved for that river item. Most of these + * individual river views then use the views in river/elements. * * @uses $vars['item'] ElggRiverItem */ +// @todo remove this in Elgg 1.9 +global $_elgg_special_river_catch; +if (!isset($_elgg_special_river_catch)) { + $_elgg_special_river_catch = false; +} +if ($_elgg_special_river_catch) { + // we changed the views a little in 1.8.1 so this catches the plugins that + // were updated in 1.8.0 and redirects to the layout view + echo elgg_view('river/elements/layout', $vars); + return true; +} +$_elgg_special_river_catch = true; + + $item = $vars['item']; -echo elgg_view('page/components/image_block', array( - 'image' => elgg_view('river/elements/image', $vars), - 'body' => elgg_view('river/elements/body', $vars), - 'class' => 'elgg-river-item', -)); +echo elgg_view($item->getView(), $vars); + + +$_elgg_special_river_catch = false; diff --git a/views/default/river/relationship/friend/create.php b/views/default/river/relationship/friend/create.php index a191e7b1e..0408d79e1 100644 --- a/views/default/river/relationship/friend/create.php +++ b/views/default/river/relationship/friend/create.php @@ -8,7 +8,7 @@ $object = $vars['item']->getObjectEntity(); $subject_icon = elgg_view_entity_icon($subject, 'tiny'); $object_icon = elgg_view_entity_icon($object, 'tiny'); -echo elgg_view('river/item', array( +echo elgg_view('river/elements/layout', array( 'item' => $vars['item'], 'attachments' => $subject_icon . elgg_view_icon('arrow-right') . $object_icon, )); diff --git a/views/default/river/user/default/profileiconupdate.php b/views/default/river/user/default/profileiconupdate.php index c7f691533..271064a06 100644 --- a/views/default/river/user/default/profileiconupdate.php +++ b/views/default/river/user/default/profileiconupdate.php @@ -3,19 +3,22 @@ * Update avatar river view */ - $subject = $vars['item']->getSubjectEntity(); $subject_link = elgg_view('output/url', array( 'href' => $subject->getURL(), 'text' => $subject->name, 'class' => 'elgg-river-subject', + 'is_trusted' => true, )); $string = elgg_echo('river:update:user:avatar', array($subject_link)); -echo elgg_view('river/item', array( +echo elgg_view('river/elements/layout', array( 'item' => $vars['item'], 'summary' => $string, - 'attachments' => elgg_view_entity_icon($subject, 'tiny'), + 'attachments' => elgg_view_entity_icon($subject, 'tiny', array( + 'use_hover' => false, + 'use_link' => false, + )), )); diff --git a/views/default/river/user/default/profileupdate.php b/views/default/river/user/default/profileupdate.php new file mode 100644 index 000000000..ce72970d6 --- /dev/null +++ b/views/default/river/user/default/profileupdate.php @@ -0,0 +1,20 @@ +<?php +/** + * Update profile river view + */ + +$subject = $vars['item']->getSubjectEntity(); + +$subject_link = elgg_view('output/url', array( + 'href' => $subject->getURL(), + 'text' => $subject->name, + 'class' => 'elgg-river-subject', + 'is_trusted' => true, +)); + +$string = elgg_echo('river:update:user:profile', array($subject_link)); + +echo elgg_view('river/elements/layout', array( + 'item' => $vars['item'], + 'summary' => $string, +)); diff --git a/views/default/user/default.php b/views/default/user/default.php index c0c18f85f..6c84e84ad 100644 --- a/views/default/user/default.php +++ b/views/default/user/default.php @@ -9,7 +9,7 @@ $entity = $vars['entity']; $size = elgg_extract('size', $vars, 'tiny'); -$icon = elgg_view_entity_icon($entity, $size); +$icon = elgg_view_entity_icon($entity, $size, $vars); // Simple XFN $rel = ''; @@ -53,5 +53,5 @@ if (elgg_get_context() == 'gallery') { $list_body = elgg_view('user/elements/summary', $params); - echo elgg_view_image_block($icon, $list_body); + echo elgg_view_image_block($icon, $list_body, $vars); } diff --git a/views/default/widgets/content_stats/content.php b/views/default/widgets/content_stats/content.php index 6a652166c..56772047d 100644 --- a/views/default/widgets/content_stats/content.php +++ b/views/default/widgets/content_stats/content.php @@ -23,5 +23,6 @@ echo '<div class="mtm">'; echo elgg_view('output/url', array( 'href' => 'admin/statistics/overview', 'text' => elgg_echo('more'), + 'is_trusted' => true, )); echo '</div>'; diff --git a/views/default/widgets/river_widget/content.php b/views/default/widgets/river_widget/content.php index 427fd92bf..867fc9db6 100644 --- a/views/default/widgets/river_widget/content.php +++ b/views/default/widgets/river_widget/content.php @@ -10,13 +10,13 @@ $options = array( 'pagination' => false, ); -if (elgg_in_context('profile')) { - $options['subject_guid'] = elgg_get_page_owner_guid(); -} else { +if (elgg_in_context('dashboard')) { if ($vars['entity']->content_type == 'friends') { - $options['relationship_guid'] = elgg_get_logged_in_user_guid(); + $options['relationship_guid'] = elgg_get_page_owner_guid(); $options['relationship'] = 'friend'; } +} else { + $options['subject_guid'] = elgg_get_page_owner_guid(); } $content = elgg_list_river($options); diff --git a/views/default/widgets/river_widget/edit.php b/views/default/widgets/river_widget/edit.php index e0351e883..228212e47 100644 --- a/views/default/widgets/river_widget/edit.php +++ b/views/default/widgets/river_widget/edit.php @@ -43,3 +43,16 @@ $num_dropdown = elgg_view('input/dropdown', $params); <?php echo elgg_echo('widget:numbertodisplay'); ?>: <?php echo $num_dropdown; ?> </div> + +<?php +// pass the context so we have the correct output upon save. +if (elgg_in_context('dashboard')) { + $context = 'dashboard'; +} else { + $context = 'profile'; +} + +echo elgg_view('input/hidden', array( + 'name' => 'context', + 'value' => $context +));
\ No newline at end of file diff --git a/views/failsafe/messages/exceptions/exception.php b/views/failsafe/messages/exceptions/exception.php index 9fa7dc2a4..c35d80c87 100644 --- a/views/failsafe/messages/exceptions/exception.php +++ b/views/failsafe/messages/exceptions/exception.php @@ -11,7 +11,7 @@ ?> -<p class="messages_exception"> +<p class="elgg-messages-exception"> <span title="<?php echo get_class($vars['object']); ?>"> <?php @@ -26,7 +26,7 @@ if (elgg_get_config('debug')) { ?> -<p class="messages_exception"> +<p class="elgg-messages-exception"> <?php echo nl2br(htmlentities(print_r($vars['object'], true), ENT_QUOTES, 'UTF-8')); diff --git a/views/failsafe/page/default.php b/views/failsafe/page/default.php index 0ce63cc1d..6d628ebbb 100644 --- a/views/failsafe/page/default.php +++ b/views/failsafe/page/default.php @@ -33,7 +33,7 @@ header('Content-type: text/html; charset=utf-8'); p { margin: 0px 0px 15px 0; } - #wrapper { + #elgg-wrapper { background:white; width:570px; margin:auto; @@ -43,7 +43,7 @@ header('Content-type: text/html; charset=utf-8'); border-right: 1px solid #666666; border-bottom: 1px solid #666666; } - .messages_exception { + .elgg-messages-exception { background:#FDFFC3; display:block; padding:10px; @@ -52,7 +52,7 @@ header('Content-type: text/html; charset=utf-8'); </head> <body> - <div id="wrapper"> + <div id="elgg-wrapper"> <h1><?php echo $vars['title']; ?></h1> <?php echo $vars['body']; ?> </div> diff --git a/views/foaf/page/default.php b/views/foaf/page/default.php index 7dac2a0aa..fad46ed35 100644 --- a/views/foaf/page/default.php +++ b/views/foaf/page/default.php @@ -42,8 +42,6 @@ if (!$owner = elgg_get_page_owner_entity()) { <foaf:name><?php echo $owner->name; ?></foaf:name> <foaf:homepage rdf:resource="<?php echo $owner->getURL(); ?>" /> <foaf:depiction rdf:resource="<?php echo elgg_format_url($owner->getIconURL('large')); ?>" /> - <?php - echo $vars['body']; - ?> +<?php echo $vars['body']; ?> </foaf:Person> </rdf:RDF> diff --git a/views/foaf/search/entity_list.php b/views/foaf/search/entity_list.php deleted file mode 100644 index b786865d7..000000000 --- a/views/foaf/search/entity_list.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php -/** - * Elgg default layout - * - * @package Elgg - * @subpackage Core - */ -$entities = $vars['entities']; -if (is_array($entities) && sizeof($entities) > 0) { - foreach($entities as $entity) { - echo elgg_view_entity($entity); - } -}
\ No newline at end of file diff --git a/views/foaf/user/default.php b/views/foaf/user/default.php index 8d059bc6b..dcba55562 100644 --- a/views/foaf/user/default.php +++ b/views/foaf/user/default.php @@ -6,7 +6,8 @@ * @subpackage Core */ -$friends=get_user_friends(elgg_get_page_owner_guid(), $subtype = "", $limit = 10000, $offset = 0); +// @todo update when get_user_friends is deprecated in 1.9 +$friends = get_user_friends(elgg_get_page_owner_guid(), $subtype = "", $limit = 10000, $offset = 0); foreach ($friends as $friend) { ?> diff --git a/views/ical/export/entity.php b/views/ical/export/entity.php index caa60c7a5..eaa3b56d8 100644 --- a/views/ical/export/entity.php +++ b/views/ical/export/entity.php @@ -9,23 +9,25 @@ $entity = $vars['entity']; -if ( - ($entity instanceof Notable) && - ($entity->getCalendarStartTime()) && - ($entity->getCalendarEndTime()) -) -{ -?> +if ($entity instanceof Notable && + $entity->getCalendarStartTime() && + $entity->getCalendarEndTime()) { + + $timestamp = date("Ymd\THis\Z", $entity->getTimeCreated()); + $start = date("Ymd\THis\Z", $entity->getCalendarStartTime()); + $end = date("Ymd\THis\Z", $entity->getCalendarEndTime()); + $summary = $entity->title; + $modified = date("Ymd\THis\Z", $entity->getTimeUpdated()); + + echo <<< ICAL BEGIN:VEVENT -DTSTAMP:<?php echo date("Ymd\THis\Z", $entity->getTimeCreated()); ?> -DTSTART:<?php echo date("Ymd\THis\Z", $entity->getCalendarStartTime()); ?> -DTEND:<?php echo date("Ymd\THis\Z", $entity->getCalendarEndTime()); ?> -SUMMARY:<?php echo $event->title; ?> -LAST-MODIFIED:<?php echo date("Ymd\THis\Z", $entity->getTimeUpdated()); ?> +DTSTAMP:$timestamp +DTSTART:$start +DTEND:$end +SUMMARY:$summary +LAST-MODIFIED:$modified END:VEVENT -<?php -} -?> - if ( - )
\ No newline at end of file +ICAL; + +} diff --git a/views/ical/object/default.php b/views/ical/object/default.php index 678676133..77183bb8a 100644 --- a/views/ical/object/default.php +++ b/views/ical/object/default.php @@ -7,4 +7,4 @@ * */ -elgg_view('export/entity', $vars);
\ No newline at end of file +echo elgg_view('export/entity', $vars);
\ No newline at end of file diff --git a/views/ical/page/default.php b/views/ical/page/default.php index 9a529b24f..01bd9e86e 100644 --- a/views/ical/page/default.php +++ b/views/ical/page/default.php @@ -7,12 +7,13 @@ * */ +$site = elgg_get_site_entity(); + header("Content-Type: text/calendar"); -echo $vars['body']; ?> BEGIN:VCALENDAR VERSION:2.0 -PRODID:-//Curverider Ltd//NONSGML Elgg <?php echo get_version(true); ?>//EN +PRODID:-//Elgg//NONSGML <?php echo $site->name; ?>//EN <?php echo $vars['body']; ?> END:VCALENDAR diff --git a/views/ical/search/entity_list.php b/views/ical/search/entity_list.php deleted file mode 100644 index 38c19fbb7..000000000 --- a/views/ical/search/entity_list.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php -/** - * Elgg default layout - * - * @package Elgg - * @subpackage Core - */ - -$entities = $vars['entities']; -if (is_array($entities) && sizeof($entities) > 0) { - foreach($entities as $entity) - echo elgg_view_entity($entity); -}
\ No newline at end of file diff --git a/views/installation/input/access.php b/views/installation/input/access.php index 7665d8bca..c3d4713bc 100644 --- a/views/installation/input/access.php +++ b/views/installation/input/access.php @@ -8,12 +8,7 @@ * */ -if (isset($vars['class'])) { - $class = $vars['class']; -} -if (!$class) { - $class = "elgg-input-access"; -} +$class = "elgg-input-access"; if ((!isset($vars['options'])) || (!is_array($vars['options']))) { $vars['options'] = array(); @@ -24,7 +19,7 @@ if (is_array($vars['options']) && sizeof($vars['options']) > 0) { ?> - <select name="<?php echo $vars['name']; ?>" <?php if ((isset($vars['disabled'])) && ($vars['disabled'])) echo ' disabled="yes" '; ?> class="<?php echo $class; ?>"> + <select name="<?php echo $vars['name']; ?>" class="<?php echo $class; ?>"> <?php foreach($vars['options'] as $key => $option) { @@ -40,4 +35,4 @@ if (is_array($vars['options']) && sizeof($vars['options']) > 0) { <?php -}
\ No newline at end of file +} diff --git a/views/installation/input/button.php b/views/installation/input/button.php index 29a37dd55..ec90fed9d 100644 --- a/views/installation/input/button.php +++ b/views/installation/input/button.php @@ -7,11 +7,18 @@ * @uses $vars['type'] submit or button. */ -$class = $vars['class']; -if (!$class) { +if (isset($vars['class'])) { + $class = $vars['class']; +} else { $class = "elgg-button-submit"; } +if (isset($vars['name'])) { + $name = $vars['name']; +} else { + $name = ''; +} + if (isset($vars['type'])) { $type = strtolower($vars['type']); } else { @@ -28,6 +35,6 @@ switch ($type) { } $value = htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); -$name = $vars['name']; + ?> -<input type="<?php echo $type; ?>" <?php if (isset($vars['id'])) echo "id=\"{$vars['id']}\"";?> value="<?php echo $value; ?>" class="<?php echo $class; ?>" />
\ No newline at end of file +<input type="<?php echo $type; ?>" value="<?php echo $value; ?>" class="<?php echo $class; ?>" />
\ No newline at end of file diff --git a/views/installation/input/checkbox.php b/views/installation/input/checkbox.php index 378eae6fd..6fbe25169 100644 --- a/views/installation/input/checkbox.php +++ b/views/installation/input/checkbox.php @@ -5,15 +5,9 @@ * * @uses $var['name'] * @uses $vars['value'] - * @uses $vars['id'] * @uses $vars['class'] */ -if (isset($vars['id'])) { - $id = "id=\"{$vars['id']}\""; -} else { - $id = ''; -} if (isset($vars['class'])) { $id = "class=\"{$vars['class']}\""; @@ -27,4 +21,4 @@ if (!isset($vars['value'])) { ?> -<input type="checkbox" <?php echo $id; ?> <?php echo $class; ?> name="<?php echo $vars['name']; ?>" value="<?php echo $vars['value']; ?>" />
\ No newline at end of file +<input type="checkbox" <?php echo $class; ?> name="<?php echo $vars['name']; ?>" value="<?php echo $vars['value']; ?>" />
\ No newline at end of file diff --git a/views/installation/input/dropdown.php b/views/installation/input/dropdown.php index 46e15c657..cf875492e 100644 --- a/views/installation/input/dropdown.php +++ b/views/installation/input/dropdown.php @@ -10,16 +10,13 @@ * the value displayed on the button. Replaces $vars['options'] when defined. */ +$class = "elgg-input-dropdown"; -$class = $vars['class']; -if (!$class) { - $class = "elgg-input-dropdown"; -} ?> -<select name="<?php echo $vars['name']; ?>" <?php if ($vars['disabled']) echo ' disabled="yes" '; ?> class="<?php echo $class; ?>"> +<select name="<?php echo $vars['name']; ?>" class="<?php echo $class; ?>"> <?php -if ($vars['options_values']) { - foreach($vars['options_values'] as $value => $option) { +if (isset($vars['options_values'])) { + foreach ($vars['options_values'] as $value => $option) { if ($value != $vars['value']) { echo "<option value=\"$value\">{$option}</option>"; } else { @@ -27,7 +24,7 @@ if ($vars['options_values']) { } } } else { - foreach($vars['options'] as $option) { + foreach ($vars['options'] as $option) { if ($option != $vars['value']) { echo "<option>{$option}</option>"; } else { @@ -36,4 +33,4 @@ if ($vars['options_values']) { } } ?> -</select>
\ No newline at end of file +</select> diff --git a/views/installation/input/form.php b/views/installation/input/form.php index f8730b4f5..3556413a8 100644 --- a/views/installation/input/form.php +++ b/views/installation/input/form.php @@ -5,20 +5,15 @@ * @uses $vars['body'] The body of the form (made up of other input/xxx views and html * @uses $vars['action'] URL of the action being called * @uses $vars['method'] Method (default POST) - * @uses $vars['id'] Form id * @uses $vars['name'] Form name */ -if (isset($vars['id'])) { - $id = "id=\"{$vars['id']}\""; -} else { - $id = ''; -} if (isset($vars['name'])) { $name = "name=\"{$vars['name']}\""; } else { $name = ''; } + $body = $vars['body']; $action = $vars['action']; if (isset($vars['method'])) { @@ -30,6 +25,6 @@ if (isset($vars['method'])) { $method = strtolower($method); ?> -<form <?php echo "$id $name"; ?> action="<?php echo $action; ?>" method="<?php echo $method; ?>"> +<form <?php echo $name; ?> action="<?php echo $action; ?>" method="<?php echo $method; ?>"> <?php echo $body; ?> </form>
\ No newline at end of file diff --git a/views/installation/input/password.php b/views/installation/input/password.php index 18811109b..2265ab117 100644 --- a/views/installation/input/password.php +++ b/views/installation/input/password.php @@ -8,10 +8,10 @@ * */ -$class = $vars['class']; -if (!$class) { - $class = "input-password"; -} +$class = "input-password"; + +$value = htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); + ?> -<input type="password" <?php if ($vars['disabled']) echo ' disabled="yes" '; ?> name="<?php echo $vars['name']; ?>" <?php if (isset($vars['id'])) echo "id=\"{$vars['id']}\""; ?> value="<?php echo htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); ?>" class="<?php echo $class; ?>" /> +<input type="password" name="<?php echo $vars['name']; ?>" value="<?php echo $value; ?>" class="<?php echo $class; ?>" /> diff --git a/views/installation/input/text.php b/views/installation/input/text.php index ec8233461..375b91c44 100644 --- a/views/installation/input/text.php +++ b/views/installation/input/text.php @@ -6,20 +6,15 @@ * @uses $vars['value'] The current value, if any * @uses $vars['name'] The name of the input field * @uses $vars['class'] CSS class - * @uses $vars['id'] CSS id */ if (isset($vars['class'])) { $class = "class=\"{$vars['class']}\""; } else { - $class = ""; + $class = "elgg-input-text"; } -if (isset($vars['id'])) { - $id = "id=\"{$vars['id']}\""; -} else { - $id = ''; -} +$value = htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); ?> -<input type="text" name="<?php echo $vars['name']; ?>" value="<?php echo htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); ?>" <?php echo $class; ?> <?php echo $id; ?>/>
\ No newline at end of file +<input type="text" name="<?php echo $vars['name']; ?>" value="<?php echo $value; ?>" <?php echo $class; ?> />
\ No newline at end of file diff --git a/views/installation/page/default.php b/views/installation/page/default.php index 10499ed27..662e8206e 100644 --- a/views/installation/page/default.php +++ b/views/installation/page/default.php @@ -29,7 +29,7 @@ header('Expires: Fri, 05 Feb 1982 00:00:00 -0500', TRUE); <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="SHORTCUT ICON" href="<?php echo elgg_get_site_url(); ?>_graphics/favicon.ico" /> <link rel="stylesheet" href="<?php echo elgg_get_site_url(); ?>install/css/install.css" type="text/css" /> - <script type="text/javascript" src="<?php echo elgg_get_site_url(); ?>vendors/jquery/jquery-1.6.2.min.js"></script> + <script type="text/javascript" src="<?php echo elgg_get_site_url(); ?>vendors/jquery/jquery-1.6.4.min.js"></script> <script type="text/javascript" src="<?php echo elgg_get_site_url(); ?>install/js/install.js"></script> </head> <body> diff --git a/views/json/api/output.php b/views/json/api/output.php index aab68f0dc..adeb7cc75 100644 --- a/views/json/api/output.php +++ b/views/json/api/output.php @@ -1,11 +1,10 @@ <?php /** * Elgg JSON output - * This outputs the api as JSON + * This outputs the api results as JSON * * @package Elgg * @subpackage Core - * */ $result = $vars['result']; diff --git a/views/json/entities/entity_list.php b/views/json/entities/entity_list.php deleted file mode 100644 index d5b134a71..000000000 --- a/views/json/entities/entity_list.php +++ /dev/null @@ -1,10 +0,0 @@ -<?php - -$entities = $vars['entities']; -$full_view = $vars['full_view']; - -if (is_array($entities) && sizeof($entities) > 0) { - foreach ($entities as $entity) { - echo elgg_view_entity($entity, array('full_view' => $full_view)); - } -} diff --git a/views/json/group/default.php b/views/json/group/default.php index a01b215cc..0b168fdb2 100644 --- a/views/json/group/default.php +++ b/views/json/group/default.php @@ -1,6 +1,6 @@ <?php /** - * Elgg default layout + * JSON group view * * @package Elgg * @subpackage Core diff --git a/views/json/object/default.php b/views/json/object/default.php index a01b215cc..d2e807621 100644 --- a/views/json/object/default.php +++ b/views/json/object/default.php @@ -1,6 +1,6 @@ <?php /** - * Elgg default layout + * JSON object view * * @package Elgg * @subpackage Core diff --git a/views/json/page/components/list.php b/views/json/page/components/list.php new file mode 100644 index 000000000..5de4f1f59 --- /dev/null +++ b/views/json/page/components/list.php @@ -0,0 +1,14 @@ +<?php +/** + * JSON list view + * + * @uses $vars['items'] + */ + +$items = $vars['items']; + +if (is_array($items) && sizeof($items) > 0) { + foreach ($items as $item) { + elgg_view_list_item($item, $vars); + } +}
\ No newline at end of file diff --git a/views/json/page/default.php b/views/json/page/default.php index d1f86c8a7..2d0403e11 100644 --- a/views/json/page/default.php +++ b/views/json/page/default.php @@ -7,12 +7,7 @@ * */ -if(stristr($_SERVER["HTTP_ACCEPT"],"application/json")) { - header("Content-Type: application/json"); -} else { - header("Content-Type: application/javascript"); -} -// echo $vars['body']; +header("Content-Type: application/json"); global $jsonexport; echo json_encode($jsonexport);
\ No newline at end of file diff --git a/views/json/river/item.php b/views/json/river/item.php new file mode 100644 index 000000000..64677817f --- /dev/null +++ b/views/json/river/item.php @@ -0,0 +1,19 @@ +<?php +/** + * JSON river item view + * + * @uses $vars['item'] + */ + +global $jsonexport; + +if (!isset($jsonexport['activity'])) { + $jsonexport['activity'] = array(); +} + +$item = $vars['item']; +if (elgg_view_exists($item->view, 'default')) { + $item->string = elgg_view('river/elements/summary', array('item' => $item), FALSE, FALSE, 'default'); +} + +$jsonexport['activity'][] = $vars['item']; diff --git a/views/json/river/item/list.php b/views/json/river/item/list.php deleted file mode 100644 index c79cd1042..000000000 --- a/views/json/river/item/list.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php -/** - * JSON river view - * - * @package Elgg - * @subpackage Core - */ -global $jsonexport; - -$json_items = array(); - -if (isset($vars['items']) && is_array($vars['items'])) { - $i = 0; - - if (!empty($vars['items'])) { - foreach($vars['items'] as $item) { - - $json_entry = array( - 'subject' => NULL, - 'object' => NULL, - 'type' => NULL, - 'subtype' => NULL, - 'action_type' => NULL, - 'view' => NULL, - 'annotation' => NULL, - 'timestamp' => NULL, - 'string' => NULL - ); - - if (elgg_view_exists($item->view, 'default')) { - $json_entry['string'] = elgg_view($item->view, array('item' => $item), FALSE, FALSE, 'default'); - $json_entry['timestamp'] = (int)$item->posted; - } - - $json_items[] = $json_entry; - - $i++; - if ($i >= $vars['limit']) { - break; - } - } - } -} - -$jsonexport['activity'] = $json_items; diff --git a/views/json/search/entity_list.php b/views/json/search/entity_list.php deleted file mode 100644 index c778bf5df..000000000 --- a/views/json/search/entity_list.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php -/** - * Elgg default layout - * - * @package Elgg - * @subpackage Core - */ - -$entities = $vars['entities']; -if (is_array($entities) && sizeof($entities) > 0) { - foreach($entities as $entity) { - echo elgg_view_entity($entity); - } -} diff --git a/views/json/site/default.php b/views/json/site/default.php index a01b215cc..7efd46939 100644 --- a/views/json/site/default.php +++ b/views/json/site/default.php @@ -1,6 +1,6 @@ <?php /** - * Elgg default layout + * JSON site view * * @package Elgg * @subpackage Core diff --git a/views/json/user/default.php b/views/json/user/default.php index a01b215cc..e23472252 100644 --- a/views/json/user/default.php +++ b/views/json/user/default.php @@ -1,6 +1,6 @@ <?php /** - * Elgg default layout + * JSON user view * * @package Elgg * @subpackage Core diff --git a/views/php/api/output.php b/views/php/api/output.php index cc76b97e0..14259564c 100644 --- a/views/php/api/output.php +++ b/views/php/api/output.php @@ -1,11 +1,10 @@ <?php /** * Elgg PHP output - * This outputs the api as PHP + * This outputs the api results as serialized PHP * * @package Elgg * @subpackage Core - * */ $result = $vars['result']; diff --git a/views/php/group/default.php b/views/php/group/default.php index eed1dbfbd..968d68bcd 100644 --- a/views/php/group/default.php +++ b/views/php/group/default.php @@ -1,6 +1,6 @@ <?php /** - * Elgg default layout + * PHP group view * * @package Elgg * @subpackage Core diff --git a/views/php/object/default.php b/views/php/object/default.php index eed1dbfbd..8cf4eb8c6 100644 --- a/views/php/object/default.php +++ b/views/php/object/default.php @@ -1,6 +1,6 @@ <?php /** - * Elgg default layout + * PHP object view * * @package Elgg * @subpackage Core diff --git a/views/php/page/default.php b/views/php/page/default.php index c7692c432..87211a462 100644 --- a/views/php/page/default.php +++ b/views/php/page/default.php @@ -1,10 +1,9 @@ <?php /** - * Elgg PHP output pageshell + * PHP output pageshell * * @package Elgg * @subpackage Core - * */ echo $vars['body'];
\ No newline at end of file diff --git a/views/php/search/entity_list.php b/views/php/search/entity_list.php deleted file mode 100644 index c56874bdb..000000000 --- a/views/php/search/entity_list.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php -/** - * Elgg default layout - * - * @package Elgg - * @subpackage Core - */ - -$entities = $vars['entities']; -if (is_array($entities) && sizeof($entities) > 0) { - foreach($entities as $entity) { - echo elgg_view_entity($entity); - } -}
\ No newline at end of file diff --git a/views/php/site/default.php b/views/php/site/default.php index 4b8d12e6d..102ac7ec7 100644 --- a/views/php/site/default.php +++ b/views/php/site/default.php @@ -1,13 +1,9 @@ <?php /** - * Elgg default layout + * PHP site view * * @package Elgg * @subpackage Core */ -for ($i = 1; $i < 8; $i++) { - if (isset($vars["area{$i}"])) { - echo $vars["area{$i}"]; - } -}
\ No newline at end of file +elgg_view('export/entity', $vars);
\ No newline at end of file diff --git a/views/php/user/default.php b/views/php/user/default.php index eed1dbfbd..1bb0f8fa9 100644 --- a/views/php/user/default.php +++ b/views/php/user/default.php @@ -1,6 +1,6 @@ <?php /** - * Elgg default layout + * PHP user view * * @package Elgg * @subpackage Core diff --git a/views/rss/annotation/default.php b/views/rss/annotation/default.php deleted file mode 100644 index 98329f132..000000000 --- a/views/rss/annotation/default.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php -/** - * Elgg RSS view for a generic comment - * - * @package Elgg - * @subpackage Core - */ - -$entity = get_entity($vars['annotation']->entity_guid); - -$title = substr($vars['annotation']->value, 0, 32); -if (strlen($vars['annotation']->value) > 32) { - $title .= " ..."; -} - -$permalink = $entity->getURL(); -$pubdate = date('r', $entity->time_created); - -$creator = elgg_view('object/creator', array('entity' => $entity)); -$georss = elgg_view('object/georss', array('entity' => $entity)); -$extensions = elgg_view('extensions/item'); - -$item = <<<__HTML -<item> - <guid isPermaLink='true'>$permalink#{$vars['annotation']->id}</guid> - <pubDate>$pubdate</pubDate> - <link>$permalink#{$vars['annotation']->id}</link> - <title><![CDATA[$title]]></title> - <description><![CDATA[{$vars['annotation']->value}]]></description> - $creator$georss$extensions -</item> -__HTML; - -echo $item; diff --git a/views/rss/annotation/generic_comment.php b/views/rss/annotation/generic_comment.php new file mode 100644 index 000000000..de652fc8e --- /dev/null +++ b/views/rss/annotation/generic_comment.php @@ -0,0 +1,33 @@ +<?php +/** + * Elgg RSS view for a generic_comment annotation + * + * @package Elgg + * @subpackage Core + */ + +$annotation = $vars['annotation']; + +$poster = $annotation->getOwnerEntity(); +$poster_name = htmlspecialchars($poster->name, ENT_NOQUOTES, 'UTF-8'); +$pubdate = date('r', $annotation->getTimeCreated()); +$permalink = $annotation->getURL(); + +$title = elgg_echo('generic_comment:title', array($poster_name)); + +$creator = elgg_view('page/components/creator', array('entity' => $annotation)); +$extensions = elgg_view('extensions/item', $vars); + +$item = <<<__HTML +<item> + <guid isPermaLink='true'>$permalink</guid> + <pubDate>$pubdate</pubDate> + <link>$permalink</link> + <title><![CDATA[$title]]></title> + <description><![CDATA[{$vars['annotation']->value}]]></description> + $creator$extensions +</item> + +__HTML; + +echo $item; diff --git a/views/rss/group/default.php b/views/rss/group/default.php index 4ffceba78..f57c7f82c 100644 --- a/views/rss/group/default.php +++ b/views/rss/group/default.php @@ -1,37 +1,37 @@ <?php /** - * Elgg default group view + * RSS group view * * @package Elgg * @subpackage Core */ -?> +$permalink = htmlspecialchars($vars['entity']->getURL(), ENT_NOQUOTES, 'UTF-8'); +$pubdate = date('r', $vars['entity']->getTimeCreated()); +$title = htmlspecialchars($vars['entity']->name, ENT_NOQUOTES, 'UTF-8'); +if ($vars['entity']->description) { + $description = autop($vars['entity']->description); +} elseif ($vars['entity']->briefdescription) { + $description = autop($vars['entity']->briefdescription); +} else { + $description = ''; +} + +$creator = elgg_view('page/components/creator', $vars); +$georss = elgg_view('page/components/georss', $vars); +$extension = elgg_view('extensions/item', $vars); + +$item = <<<__HTML <item> -<guid isPermaLink='true'><?php echo htmlspecialchars($vars['entity']->getURL()); ?></guid> -<pubDate><?php echo date("r",$vars['entity']->time_created) ?></pubDate> -<link><?php echo htmlspecialchars($vars['entity']->getURL()); ?></link> -<title><![CDATA[<?php echo (($vars['entity']->name)); ?>]]></title> -<description><![CDATA[<?php echo (autop($vars['entity']->description)); ?>]]></description> -<?php - $owner = $vars['entity']->getOwnerEntity(); - if ($owner) { -?> -<dc:creator><?php echo $owner->name; ?></dc:creator> -<?php - } -?> -<?php - if ( - ($vars['entity'] instanceof Locatable) && - ($vars['entity']->getLongitude()) && - ($vars['entity']->getLatitude()) - ) { - ?> - <georss:point><?php echo $vars['entity']->getLatitude(); ?> <?php echo $vars['entity']->getLongitude(); ?></georss:point> - <?php - } -?> -<?php echo elgg_view('extensions/item'); ?> + <guid isPermaLink="true">$permalink</guid> + <pubDate>$pubdate</pubDate> + <link>$permalink</link> + <title><![CDATA[$title]]></title> + <description><![CDATA[$description]]></description> + $creator$georss$extension </item> + +__HTML; + +echo $item; diff --git a/views/rss/object/creator.php b/views/rss/object/creator.php deleted file mode 100644 index 2bc6fd57d..000000000 --- a/views/rss/object/creator.php +++ /dev/null @@ -1,8 +0,0 @@ -<?php -/** - * - */ - -if ($owner = $vars['entity']->getOwnerEntity()) { - echo "<dc:creator>{$owner->name}</dc:creator>"; -} diff --git a/views/rss/object/default.php b/views/rss/object/default.php index 29e5d4591..be8025953 100644 --- a/views/rss/object/default.php +++ b/views/rss/object/default.php @@ -1,6 +1,6 @@ <?php /** - * Elgg default object view + * RSS object view * * @package Elgg * @subpackage Core @@ -8,19 +8,18 @@ $title = $vars['entity']->title; if (empty($title)) { - $subtitle = strip_tags($vars['entity']->description); - $title = substr($subtitle, 0, 32); - if (strlen($subtitle) > 32) { - $title .= ' ...'; - } + $title = strip_tags($vars['entity']->description); + $title = elgg_get_excerpt($title, 32); } -$permalink = htmlspecialchars($vars['entity']->getURL()); -$pubdate = date('r', $vars['entity']->time_created); +$permalink = htmlspecialchars($vars['entity']->getURL(), ENT_NOQUOTES, 'UTF-8'); +$pubdate = date('r', $vars['entity']->getTimeCreated()); -$creator = elgg_view('object/creator', $vars); -$georss = elgg_view('object/georss', $vars); -$extension = elgg_view('extensions/item'); +$description = autop($vars['entity']->description); + +$creator = elgg_view('page/components/creator', $vars); +$georss = elgg_view('page/components/georss', $vars); +$extension = elgg_view('extensions/item', $vars); $item = <<<__HTML <item> @@ -28,7 +27,7 @@ $item = <<<__HTML <pubDate>$pubdate</pubDate> <link>$permalink</link> <title><![CDATA[$title]]></title> - <description><![CDATA[{$vars['entity']->description}]]></description> + <description><![CDATA[$description]]></description> $creator$georss$extension </item> diff --git a/views/rss/object/georss.php b/views/rss/object/georss.php deleted file mode 100644 index 8aa027519..000000000 --- a/views/rss/object/georss.php +++ /dev/null @@ -1,10 +0,0 @@ -<?php -/** - * - */ - -if (($vars['entity'] instanceof Locatable) && - ($latitude = $vars['entity']->getLongitude()) && ($longitude = $vars['entity']->getLatitude()) -) { - echo "<georss:point>$latitude $longitude</georss:point>"; -}
\ No newline at end of file diff --git a/views/rss/output/url.php b/views/rss/output/url.php index e0b94bf8d..b0f4d9792 100644 --- a/views/rss/output/url.php +++ b/views/rss/output/url.php @@ -1,6 +1,6 @@ <?php /** - * RSS url view + * RSS url output view * */ echo elgg_view('output/url', $vars, false, false, 'default'); diff --git a/views/rss/page/components/creator.php b/views/rss/page/components/creator.php new file mode 100644 index 000000000..a14f1dbca --- /dev/null +++ b/views/rss/page/components/creator.php @@ -0,0 +1,14 @@ +<?php +/** + * Creator view + * + * Implements Dublin Core creator + * + * @uses $vars['entity'] + */ + +$owner = $vars['entity']->getOwnerEntity(); +if ($owner) { + $owner_name = htmlspecialchars($owner->name, ENT_NOQUOTES, 'UTF-8'); + echo "<dc:creator>$owner_name</dc:creator>"; +} diff --git a/views/rss/page/components/georss.php b/views/rss/page/components/georss.php new file mode 100644 index 000000000..d176b8cac --- /dev/null +++ b/views/rss/page/components/georss.php @@ -0,0 +1,15 @@ +<?php +/** + * GeoRSS view + * + * This implements GeoRSS-Simple + * + * @uses $vars['entity'] + */ + +$longitude = $vars['entity']->getLongitude(); +$latitude = $vars['entity']->getLatitude(); + +if ($vars['entity'] instanceof Locatable && $longitude && $latitude) { + echo "<georss:point>$latitude $longitude</georss:point>"; +} diff --git a/views/rss/page/default.php b/views/rss/page/default.php index da6f69c41..c973e3fd0 100644 --- a/views/rss/page/default.php +++ b/views/rss/page/default.php @@ -2,18 +2,13 @@ /** * Elgg RSS output pageshell * - * @package Elgg - * @subpackage Core + * @package Elgg.Core * + * @uses $vars['title'] The title of the RSS feed + * @uses $vars['body'] The items for the RSS feed as a string + * @uses $vars['descrption'] The description for the RSS feed */ -header("Content-Type: text/xml"); - -// allow caching as required by stupid MS products for https feeds. -header('Pragma: public', TRUE); - -echo "<?xml version='1.0'?>\n"; - // Set title if (empty($vars['title'])) { $title = elgg_get_config('sitename'); @@ -22,20 +17,30 @@ if (empty($vars['title'])) { } // Remove RSS from URL -$url = str_replace('?view=rss','', full_url()); -$url = str_replace('&view=rss','', $url); +$url = str_replace('?view=rss', '', full_url()); +$url = str_replace('&view=rss', '', $url); +$url = htmlspecialchars($url, ENT_NOQUOTES, 'UTF-8'); -?> +$body = elgg_extract('body', $vars, ''); +$description = elgg_extract('description', $vars, ''); -<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:georss="http://www.georss.org/georss" <?php echo elgg_view('extensions/xmlns'); ?> > -<channel> - <title><![CDATA[<?php echo $title; ?>]]></title> - <link><?php echo htmlentities($url); ?></link> - <?php echo elgg_view('extensions/channel'); ?> - <?php +$namespaces = elgg_view('extensions/xmlns'); +$extensions = elgg_view('extensions/channel'); - echo $vars['body']; - ?> +// allow caching as required by stupid MS products for https feeds. +header('Pragma: public', true); +header("Content-Type: text/xml"); + +echo "<?xml version='1.0'?>"; +echo <<<END +<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:georss="http://www.georss.org/georss" $namespaces> +<channel> + <title><![CDATA[$title]]></title> + <link>$url</link> + <description><![CDATA[$description]]></description> + $extensions + $body </channel> </rss> +END; diff --git a/views/rss/page/elements/comments.php b/views/rss/page/elements/comments.php new file mode 100644 index 000000000..9c655ffef --- /dev/null +++ b/views/rss/page/elements/comments.php @@ -0,0 +1,13 @@ +<?php +/** + * RSS comments view + * + * @uses $vars['entity'] + */ + +$options = array( + 'guid' => $vars['entity']->getGUID(), + 'annotation_name' => 'generic_comment', + 'order_by' => 'n_table.time_created desc', +); +echo elgg_list_annotations($options); diff --git a/views/rss/river/item.php b/views/rss/river/item.php index f84e6ccf0..fa2914eff 100644 --- a/views/rss/river/item.php +++ b/views/rss/river/item.php @@ -6,27 +6,30 @@ */ $item = $vars['item']; -$view = $item->getView(); - $name = $item->getSubjectEntity()->name; -$body = elgg_view($item->getView(), array('item' => $item), false, false, 'default'); -$body = "$name $body"; +$name = htmlspecialchars($name, ENT_NOQUOTES, 'UTF-8'); +$title = elgg_echo('river:update', array($name)); -$title = strip_tags($body); $timestamp = date('r', $item->getPostedTime()); +$body = elgg_view('river/elements/summary', $vars, false, false, 'default'); + $object = $item->getObjectEntity(); if ($object) { $url = htmlspecialchars($object->getURL()); } else { - $url = elgg_get_site_url() . 'activity'; + $url = elgg_normalize_url('activity'); } -?> +$html = <<<__HTML <item> - <guid isPermaLink='true'><?php echo $url; ?></guid> - <pubDate><?php echo $timestamp; ?></pubDate> - <link><?php echo $url; ?></link> - <title><![CDATA[<?php echo $title; ?>]]></title> - <description><![CDATA[<?php echo ($body); ?>]]></description> + <guid>$item->id</guid> + <pubDate>$timestamp</pubDate> + <link>$url</link> + <title><![CDATA[$title]]></title> + <description><![CDATA[$body]]></description> </item> + +__HTML; + +echo $html; diff --git a/views/rss/search/entity_list.php b/views/rss/search/entity_list.php deleted file mode 100644 index 1e44adf18..000000000 --- a/views/rss/search/entity_list.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php -/** - * @package Elgg - * @subpackage Core - */ - -$entities = $vars['entities']; -if (is_array($entities) && sizeof($entities) > 0) { - foreach($entities as $entity) { - echo elgg_view_entity($entity); - } -}
\ No newline at end of file diff --git a/views/rss/user/default.php b/views/rss/user/default.php index a8b9d073c..1c7bf75e7 100644 --- a/views/rss/user/default.php +++ b/views/rss/user/default.php @@ -1,29 +1,34 @@ <?php /** - * Elgg default user view + * RSS user view * * @package Elgg * @subpackage Core */ -?> +$permalink = htmlspecialchars($vars['entity']->getURL(), ENT_NOQUOTES, 'UTF-8'); +$pubdate = date('r', $vars['entity']->getTimeCreated()); +$title = htmlspecialchars($vars['entity']->name, ENT_NOQUOTES, 'UTF-8'); +if ($vars['entity']->description) { + $description = autop($vars['entity']->description); +} else { + $description = ''; +} + +$georss = elgg_view('page/components/georss', $vars); +$extension = elgg_view('extensions/item', $vars); + +$item = <<<__HTML <item> -<guid isPermaLink='true'><?php echo $vars['entity']->getURL(); ?></guid> -<pubDate><?php echo date("r",$vars['entity']->time_created) ?></pubDate> -<link><?php echo $vars['entity']->getURL(); ?></link> -<title><![CDATA[<?php echo (($vars['entity']->name)); ?>]]></title> -<description><![CDATA[<?php echo (autop($vars['entity']->description)); ?>]]></description> -<?php - if ( - ($vars['entity'] instanceof Locatable) && - ($vars['entity']->getLongitude()) && - ($vars['entity']->getLatitude()) - ) { - ?> - <georss:point><?php echo $vars['entity']->getLatitude(); ?> <?php echo $vars['entity']->getLongitude(); ?></georss:point> - <?php - } -?> -<?php echo elgg_view('extensions/item'); ?> + <guid isPermaLink="true">$permalink</guid> + <pubDate>$pubdate</pubDate> + <link>$permalink</link> + <title><![CDATA[$title]]></title> + <description><![CDATA[$description]]></description> + $georss$extension </item> + +__HTML; + +echo $item; |