diff options
Diffstat (limited to 'views/default')
54 files changed, 691 insertions, 385 deletions
diff --git a/views/default/admin/plugins.php b/views/default/admin/plugins.php new file mode 100644 index 000000000..1aa899fcc --- /dev/null +++ b/views/default/admin/plugins.php @@ -0,0 +1,177 @@ +<?php +/** + * Elgg administration plugin screen + * + * Shows a list of plugins that can be sorted and filtered. + * + * @package Elgg.Core + * @subpackage Admin.Plugins + */ + +elgg_generate_plugin_entities(); +$installed_plugins = elgg_get_plugins('any'); +$show_category = get_input('category', 'all'); +$sort = get_input('sort', 'priority'); + +// Get a list of the all categories +// and trim down the plugin list if we're not viewing all categories. +// @todo this could be cached somewhere after have the manifest loaded +$categories = array(); + +foreach ($installed_plugins as $id => $plugin) { + if (!$plugin->isValid()) { + continue; + } + + $plugin_categories = $plugin->getManifest()->getCategories(); + + // handle plugins that don't declare categories + // unset them here because this is the list we foreach + switch ($show_category) { + case 'all': + break; + case 'active': + if (!$plugin->isActive()) { + unset($installed_plugins[$id]); + } + break; + case 'inactive': + if ($plugin->isActive()) { + unset($installed_plugins[$id]); + } + break; + default: + if (!in_array($show_category, $plugin_categories)) { + unset($installed_plugins[$id]); + } + break; + } + + if (isset($plugin_categories)) { + foreach ($plugin_categories as $category) { + if (!array_key_exists($category, $categories)) { + $categories[$category] = elgg_echo("admin:plugins:category:$category"); + } + } + } +} + +$guids = array(); +foreach ($installed_plugins as $plugin) { + $guids[] = $plugin->getGUID(); +} + +// sort plugins +switch ($sort) { + case 'date': + $plugin_list = array(); + foreach ($installed_plugins as $plugin) { + $create_date = $plugin->getTimeCreated(); + while (isset($plugin_list[$create_date])) { + $create_date++; + } + $plugin_list[$create_date] = $plugin; + } + krsort($plugin_list); + break; + case 'alpha': + $plugin_list = array(); + foreach ($installed_plugins as $plugin) { + $plugin_list[$plugin->getManifest()->getName()] = $plugin; + } + ksort($plugin_list); + break; + case 'priority': + default: + $plugin_list = $installed_plugins; + break; +} + + + +asort($categories); + +$common_categories = array( + 'all' => elgg_echo('admin:plugins:category:all'), + 'active' => elgg_echo('admin:plugins:category:active'), + 'inactive' => elgg_echo('admin:plugins:category:inactive'), +); + +$categories = array_merge($common_categories, $categories); +// security - only want a defined option +if (!array_key_exists($show_category, $categories)) { + $show_category = reset($categories); +} + +$category_form = elgg_view_form('admin/plugins/filter', array( + 'action' => 'admin/plugins', + 'method' => 'get', + 'disable_security' => true, +), array( + 'category' => $show_category, + 'category_options' => $categories, + 'sort' => $sort, +)); + + +$sort_options = array( + 'priority' => elgg_echo('admin:plugins:sort:priority'), + 'alpha' => elgg_echo('admin:plugins:sort:alpha'), + 'date' => elgg_echo('admin:plugins:sort:date'), +); +// security - only want a defined option +if (!array_key_exists($sort, $sort_options)) { + $sort = reset($sort_options); +} + +$sort_form = elgg_view_form('admin/plugins/sort', array( + 'action' => 'admin/plugins', + 'method' => 'get', + 'disable_security' => true, +), array( + 'sort' => $sort, + 'sort_options' => $sort_options, + 'category' => $show_category, +)); + +$buttons = "<div class=\"clearfix mbm\">"; +$buttons .= elgg_view_form('admin/plugins/change_state', array( + 'action' => 'action/admin/plugins/activate_all', + 'class' => 'float', +), array( + 'guids' => $guids, + 'action' => 'activate', +)); +$buttons .= elgg_view_form('admin/plugins/change_state', array( + 'action' => 'action/admin/plugins/deactivate_all', + 'class' => 'float', +), array( + 'guids' => $guids, + 'action' => 'deactivate', +)); +$buttons .= "</div>"; + +$buttons .= $category_form . $sort_form; + +// construct page header +?> +<div id="content_header" class="mbm clearfix"> + <div class="content-header-options"><?php echo $buttons ?></div> +</div> + +<div id="elgg-plugin-list"> +<?php + +$options = array( + 'limit' => 0, + 'full_view' => true, + 'list_type_toggle' => false, + 'pagination' => false, +); +if ($show_category == 'all' && $sort == 'priority') { + $options['display_reordering'] = true; +} +echo elgg_view_entity_list($plugin_list, $options); + +?> +</div>
\ No newline at end of file diff --git a/views/default/admin/plugins/advanced.php b/views/default/admin/plugins/advanced.php deleted file mode 100644 index ea72bab5a..000000000 --- a/views/default/admin/plugins/advanced.php +++ /dev/null @@ -1,91 +0,0 @@ -<?php -/** - * Elgg administration advanced plugin screen - * - * Shows a list of all plugins sorted by load order. - * - * @package Elgg.Core - * @subpackage Admin.Plugins - */ - -elgg_generate_plugin_entities(); -$installed_plugins = elgg_get_plugins('any'); -$show_category = get_input('category', null); - -// Get a list of the all categories -// and trim down the plugin list if we're not viewing all categories. -// @todo this could be cached somewhere after have the manifest loaded -$categories = array(); - -foreach ($installed_plugins as $id => $plugin) { - if (!$plugin->isValid()) { - continue; - } - - $plugin_categories = $plugin->getManifest()->getCategories(); - - // handle plugins that don't declare categories - // unset them here because this is the list we foreach - if ($show_category && !in_array($show_category, $plugin_categories)) { - unset($installed_plugins[$id]); - } - - if (isset($plugin_categories)) { - foreach ($plugin_categories as $category) { - if (!array_key_exists($category, $categories)) { - $categories[$category] = elgg_echo("admin:plugins:category:$category"); - } - } - } -} - -$categories = array_merge(array('' => elgg_echo('admin:plugins:category:all')), $categories); - -$category_dropdown = elgg_view('input/dropdown', array( - 'name' => 'category', - 'options_values' => $categories, - 'value' => $show_category -)); - -$category_button = elgg_view('input/submit', array( - 'value' => elgg_echo('filter'), - 'class' => 'elgg-button elgg-button-action' -)); - -$category_form = elgg_view('input/form', array( - 'body' => $category_dropdown . $category_button, - 'method' => 'get', - 'action' => 'admin/plugins/advanced', - 'disable_security' => true, -)); - -// @todo Until "en/deactivate all" means "All plugins on this page" hide when not looking at all. -if (!isset($show_category) || empty($show_category)) { - $activate_url = "action/admin/plugins/activate_all"; - $activate_url = elgg_add_action_tokens_to_url($activate_url); - $deactivate_url = "action/admin/plugins/deactivate_all"; - $deactivate_url = elgg_add_action_tokens_to_url($deactivate_url); - - $buttons = "<div class=\"mbl\">"; - $buttons .= "<a class='elgg-button elgg-button-action' href=\"$activate_url\">" . elgg_echo('admin:plugins:activate_all') . '</a> '; - $buttons .= "<a class='elgg-button elgg-button-cancel' href=\"$deactivate_url\">" . elgg_echo('admin:plugins:deactivate_all') . '</a> '; - $buttons .= "</div>"; -} else { - $buttons = ''; -} - -$buttons .= $category_form; - -// construct page header -?> -<div id="content_header" class="mbm clearfix"> - <div class="content-header-options"><?php echo $buttons ?></div> -</div> - -<div id="elgg-plugin-list"> -<?php - -echo elgg_view_entity_list($installed_plugins, 0, 0, 0, true, false, false); - -?> -</div>
\ No newline at end of file diff --git a/views/default/admin/plugins/simple.php b/views/default/admin/plugins/simple.php deleted file mode 100644 index 28c1cc25e..000000000 --- a/views/default/admin/plugins/simple.php +++ /dev/null @@ -1,11 +0,0 @@ -<?php -/** - * Elgg administration simple plugin screen - * - * Shows an alphabetical list of "simple" plugins. - * - * @package Elgg - * @subpackage Core - */ - -echo elgg_view_form('admin/plugins/simple_update_states', array('class' => 'admin_plugins_simpleview')); diff --git a/views/default/annotation/generic_comment.php b/views/default/annotation/generic_comment.php index 4a3407e1a..69520d102 100644 --- a/views/default/annotation/generic_comment.php +++ b/views/default/annotation/generic_comment.php @@ -63,9 +63,11 @@ HTML; $on = elgg_echo('on'); + $excerpt = elgg_get_excerpt($comment->value, 80); + $body = <<<HTML <span class="elgg-subtext"> - $commenter_link $on $entity_link ($friendlytime) + $commenter_link $on $entity_link ($friendlytime): $excerpt </span> HTML; diff --git a/views/default/core/account/login_dropdown.php b/views/default/core/account/login_dropdown.php index a1d64a768..e90cbf106 100644 --- a/views/default/core/account/login_dropdown.php +++ b/views/default/core/account/login_dropdown.php @@ -9,7 +9,7 @@ if (elgg_is_logged_in()) { $login_url = elgg_get_site_url(); if (elgg_get_config('https_login')) { - $login_url = str_replace("http", "https", elgg_get_site_url()); + $login_url = str_replace("http:", "https:", elgg_get_site_url()); } $body = elgg_view_form('login', array('action' => "{$login_url}action/login"), array('returntoreferer' => TRUE)); @@ -24,4 +24,4 @@ $body = elgg_view_form('login', array('action' => "{$login_url}action/login"), a )); echo elgg_view_module('dropdown', '', $body, array('id' => 'login-dropdown-box')); ?> -</div>
\ No newline at end of file +</div> diff --git a/views/default/core/account/login_walled_garden.php b/views/default/core/account/login_walled_garden.php index 57c3c31d7..1606b9592 100644 --- a/views/default/core/account/login_walled_garden.php +++ b/views/default/core/account/login_walled_garden.php @@ -6,7 +6,7 @@ */ $reg_url = elgg_normalize_url('register'); -$forgot_url = elgg_normalize_url('pages/account/forgotten_password.php'); +$forgot_url = elgg_normalize_url('forgotpassword'); $cancel_button = elgg_view('input/button', array( 'value' => elgg_echo('cancel'), 'class' => 'elgg-button-cancel mlm', @@ -20,7 +20,7 @@ $form_body .= elgg_view('input/hidden', array( $login_url = elgg_get_site_url(); if (elgg_get_config('https_login')) { - $login_url = str_replace("http", "https", elgg_get_site_url()); + $login_url = str_replace("http:", "https:", elgg_get_site_url()); } ?> diff --git a/views/default/core/dashboard/blurb.php b/views/default/core/dashboard/blurb.php deleted file mode 100644 index 0c4e3947a..000000000 --- a/views/default/core/dashboard/blurb.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php -/** - * Elgg dashboard blurb - * - */ -?> - -<div class="elgg-col elgg-col-2of3"> -<?php - echo elgg_view('output/longtext', array( - 'id' => 'dashboard-info', - 'class' => 'elgg-inner pas mhs mbl', - 'value' => elgg_echo("dashboard:nowidgets"), - )); - -?> -</div>
\ No newline at end of file diff --git a/views/default/core/settings/tools.php b/views/default/core/settings/tools.php index 87c98902f..a249adf82 100644 --- a/views/default/core/settings/tools.php +++ b/views/default/core/settings/tools.php @@ -11,7 +11,7 @@ // Description of what's going on echo elgg_view('output/longtext', array( 'value' => elgg_echo("usersettings:plugins:description"), - 'class' => 'user-settings mtm', + 'class' => 'user-settings mtn mbm', )); $limit = get_input('limit', 10); diff --git a/views/default/css/admin.php b/views/default/css/admin.php index 3801fee32..a4d413781 100644 --- a/views/default/css/admin.php +++ b/views/default/css/admin.php @@ -158,6 +158,13 @@ table.mceLayout { .center { text-align: center; } +.float { + float: left; +} +.float-alt { + float: right; +} + /* *************************************** PAGE WRAPPER *************************************** */ @@ -281,6 +288,7 @@ table.mceLayout { background-color: #111; border: 1px solid #999; padding: 10px 20px; + margin-bottom: 10px; } .elgg-page-footer a { color: #ddd; @@ -677,6 +685,9 @@ input[type="submit"]:hover, .elgg-button-submit:hover, .elgg-button-action:hover .elgg-menu-admin-footer > li { padding-right: 25px; } +.elgg-menu-longtext { + float: right; +} /* *************************************** WIDGETS @@ -846,9 +857,10 @@ a.elgg-widget-collapsed:before { margin-bottom: 5px; } -a.elgg-longtext-control { - float: right; +.elgg-longtext-control { margin-left: 14px; + font-size: 80%; + cursor: pointer; } /* *************************************** @@ -1178,12 +1190,19 @@ ul.admin_plugins { .elgg-plugin.elgg-state-inactive { background: #dedede; } -.elgg-dependency.elgg-state-error { + +.elgg-state-error { background: #fbe3e4; color: #8a1f11; border-color: #fbc2c4; font-weight: bold; } +.elgg-state-warning { + background: #fbedb5; + color: #000000; + border-color: #fbe58b; + font-weight: bold; +} .admin_notices { padding-bottom: 15px; diff --git a/views/default/css/elements/forms.php b/views/default/css/elements/forms.php index 0230cbc54..af7b2be19 100644 --- a/views/default/css/elements/forms.php +++ b/views/default/css/elements/forms.php @@ -16,6 +16,12 @@ fieldset > div { fieldset > div:last-child { margin-bottom: 0; } +.elgg-form-footer { +} +.elgg-form-footer-alt { + border-top: 1px solid #CCC; + padding: 10px 0; +} label { font-weight: bold; @@ -73,9 +79,17 @@ input[type="radio"] { padding-right: 10px; } +.elgg-form-account input[type="text"], +.elgg-form-account input[type="password"] { + width: 300px; +} + /* *************************************** FRIENDS PICKER *************************************** */ +.friends-picker-main-wrapper { + margin-bottom: 15px; +} .friends-picker-container h3 { font-size:4em !important; text-align: left; diff --git a/views/default/css/elements/layout.php b/views/default/css/elements/layout.php index d52938aee..a5854f8c1 100644 --- a/views/default/css/elements/layout.php +++ b/views/default/css/elements/layout.php @@ -15,6 +15,10 @@ PAGE LAYOUT *************************************** */ /***** DEFAULT LAYOUT ******/ +<?php // the width is on the page rather than topbar to handle small viewports ?> +.elgg-page-default { + min-width: 998px; +} .elgg-page-default .elgg-page-header > .elgg-inner { width: 990px; margin: 0 auto; @@ -35,7 +39,6 @@ .elgg-page-topbar { background: #333333 url(<?php echo elgg_get_site_url(); ?>_graphics/toptoolbar_background.gif) repeat-x top left; border-bottom: 1px solid #000000; - min-width: 998px; position: relative; height: 24px; z-index: 9000; diff --git a/views/default/css/elements/misc.php b/views/default/css/elements/misc.php index c8ba4f735..ebac2b91f 100644 --- a/views/default/css/elements/misc.php +++ b/views/default/css/elements/misc.php @@ -8,10 +8,6 @@ z-index: 100; } -#dashboard-info .elgg-inner { - border: 2px solid #dedede; -} - /* *************************************** AVATAR UPLOADING & CROPPING *************************************** */ diff --git a/views/default/css/elements/modules.php b/views/default/css/elements/modules.php index a5b907ddc..c4808478b 100644 --- a/views/default/css/elements/modules.php +++ b/views/default/css/elements/modules.php @@ -197,6 +197,7 @@ a.elgg-widget-edit-button { width: 96%; padding: 2%; border-bottom: 2px solid #dedede; + background-color: #f9f9f9; } .elgg-widget-content { padding: 10px; diff --git a/views/default/css/elements/navigation.php b/views/default/css/elements/navigation.php index e4709cb27..d930d3a89 100644 --- a/views/default/css/elements/navigation.php +++ b/views/default/css/elements/navigation.php @@ -130,7 +130,7 @@ } .elgg-menu-topbar > li > a { - padding: 2px 15px; + padding: 2px 15px 0; color: #eee; margin-top: 1px; } @@ -144,6 +144,18 @@ float: right; } +.elgg-menu-topbar > li > a.elgg-topbar-logo { + margin-top: 0; + padding-left: 5px; + width: 38px; + height: 20px; +} + +.elgg-menu-topbar > li > a.elgg-topbar-avatar { + width: 18px; + height: 18px; +} + /* *************************************** SITE MENU *************************************** */ diff --git a/views/default/css/elgg.php b/views/default/css/elgg.php index 675af860d..4960e6ade 100644 --- a/views/default/css/elgg.php +++ b/views/default/css/elgg.php @@ -26,13 +26,12 @@ if ($old_css_view != elgg_get_config('viewpath')) { Base CSS * CSS reset * core - * helpers + * helpers (moved to end to have a higher priority) * grid *******************************************************************************/ echo elgg_view('css/elements/reset', $vars); echo elgg_view('css/elements/core', $vars); -echo elgg_view('css/elements/helpers', $vars); echo elgg_view('css/elements/grid', $vars); @@ -61,5 +60,9 @@ echo elgg_view('css/elements/layout', $vars); echo elgg_view('css/elements/misc', $vars); +// included last to have higher priority +echo elgg_view('css/elements/helpers', $vars); + + // in case plugins are still extending the old 'css' view, display it echo elgg_view('css', $vars); diff --git a/views/default/forms/admin/menu/save.php b/views/default/forms/admin/menu/save.php index 91129c881..92a0784df 100644 --- a/views/default/forms/admin/menu/save.php +++ b/views/default/forms/admin/menu/save.php @@ -33,7 +33,7 @@ echo elgg_view('output/longtext', array( )); for ($i=0; $i<$num_featured_items; $i++) { - if (array_key_exists($i, $featured_menu_names)) { + if ($featured_menu_names && array_key_exists($i, $featured_menu_names)) { $current_value = $featured_menu_names[$i]; } else { $current_value = ' '; diff --git a/views/default/forms/admin/plugins/change_state.php b/views/default/forms/admin/plugins/change_state.php new file mode 100644 index 000000000..ba5d873e7 --- /dev/null +++ b/views/default/forms/admin/plugins/change_state.php @@ -0,0 +1,20 @@ +<?php +/** + * Activate/deactive all plugins specified by guids array + * + * @uses $vars['guids'] Array of GUIDs + * @uses $vars['action'] 'activate' or 'deactivate' + */ + +$guids = elgg_extract('guids', $vars, array()); +$guids = implode(',', $guids); + +echo elgg_view('input/hidden', array( + 'name' => 'guids', + 'value' => $guids, +)); + +echo elgg_view('input/submit', array( + 'value' => elgg_echo("admin:plugins:{$vars['action']}_all"), + 'class' => 'elgg-button elgg-button-action' +)); diff --git a/views/default/forms/admin/plugins/filter.php b/views/default/forms/admin/plugins/filter.php new file mode 100644 index 000000000..d00906e6a --- /dev/null +++ b/views/default/forms/admin/plugins/filter.php @@ -0,0 +1,24 @@ +<?php +/** + * Category filter for plugins + * + * @uses $vars['category'] + * @uses $vars['category_options'] + * @uses $vvars['sort'] + */ + +echo elgg_view('input/dropdown', array( + 'name' => 'category', + 'options_values' => $vars['category_options'], + 'value' => $vars['category'], +)); + +echo elgg_view('input/hidden', array( + 'name' => 'sort', + 'value' => $vars['sort'], +)); + +echo elgg_view('input/submit', array( + 'value' => elgg_echo('filter'), + 'class' => 'elgg-button elgg-button-action', +)); diff --git a/views/default/forms/admin/plugins/simple_update_states.php b/views/default/forms/admin/plugins/simple_update_states.php deleted file mode 100644 index cc1c1a710..000000000 --- a/views/default/forms/admin/plugins/simple_update_states.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php -/** - * Elgg administration simple plugin screen - * - * Shows an alphabetical list of "simple" plugins. - * - * @package Elgg - * @subpackage Core - */ - -elgg_generate_plugin_entities(); -$installed_plugins = elgg_get_plugins('any'); -$plugin_list = array(); - -foreach ($installed_plugins as $plugin) { - if (!$plugin->isValid()) { - continue; - } - $interface = $plugin->getManifest()->getAdminInterface(); - if ($interface == 'simple') { - $plugin_list[$plugin->getManifest()->getName()] = $plugin; - } -} - -ksort($plugin_list); - -echo elgg_view_entity_list($plugin_list, 0, 0, 0, false, false, false); -echo elgg_view('input/submit', array('value' => elgg_echo('save'))); diff --git a/views/default/forms/admin/plugins/sort.php b/views/default/forms/admin/plugins/sort.php new file mode 100644 index 000000000..284e085e6 --- /dev/null +++ b/views/default/forms/admin/plugins/sort.php @@ -0,0 +1,24 @@ +<?php +/** + * Sort plugins form body + * + * @uses $vars['sort'] + * @uses $vars['sort_options'] + * @uses $vars['category'] + */ + +echo elgg_view('input/dropdown', array( + 'name' => 'sort', + 'options_values' => $vars['sort_options'], + 'value' => $vars['sort'], +)); + +echo elgg_view('input/hidden', array( + 'name' => 'category', + 'value' => $vars['category'], +)); + +echo elgg_view('input/submit', array( + 'value' => elgg_echo('sort'), + 'class' => 'elgg-button elgg-button-action' +)); diff --git a/views/default/forms/avatar/crop.php b/views/default/forms/avatar/crop.php index 857a54e1f..3deec66bd 100644 --- a/views/default/forms/avatar/crop.php +++ b/views/default/forms/avatar/crop.php @@ -8,11 +8,10 @@ $master_image = $vars['entity']->getIcon('master'); ?> -<div> +<div class="clearfix"> <img id="user-avatar" class="mrl" src="<?php echo $master_image; ?>" alt="<?php echo elgg_echo('avatar'); ?>" /> </div> - -<div class="clearfloat"></div> +<div> <?php $coords = array('x1', 'x2', 'y1', 'y2'); foreach ($coords as $coord) { @@ -24,6 +23,7 @@ echo elgg_view('input/hidden', array('name' => 'guid', 'value' => $vars['entity' 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.8.min.js"></script> <?php //@todo JS 1.8: no ?> diff --git a/views/default/forms/avatar/upload.php b/views/default/forms/avatar/upload.php index 08db1f7e0..b099b8c4c 100644 --- a/views/default/forms/avatar/upload.php +++ b/views/default/forms/avatar/upload.php @@ -5,11 +5,12 @@ * @uses $vars['entity'] */ -echo elgg_view('input/hidden', array('name' => 'guid', 'value' => $vars['entity']->guid)); ?> <div> <label><?php echo elgg_echo("avatar:upload"); ?></label><br /> <?php echo elgg_view("input/file",array('name' => 'avatar')); ?> -<br /> +</div> +<div class="elgg-form-footer"> + <?php echo elgg_view('input/hidden', array('name' => 'guid', 'value' => $vars['entity']->guid)); ?> <?php echo elgg_view('input/submit', array('value' => elgg_echo('upload'))); ?> </div> diff --git a/views/default/forms/comments/add.php b/views/default/forms/comments/add.php index 6d674838a..40e574338 100644 --- a/views/default/forms/comments/add.php +++ b/views/default/forms/comments/add.php @@ -18,16 +18,20 @@ if (isset($vars['entity']) && elgg_is_logged_in()) { echo elgg_view('input/submit', array('value' => elgg_echo('comment'))); } else { ?> - <div> - <label><?php echo elgg_echo("generic_comments:add"); ?></label> - <?php echo elgg_view('input/longtext', array('name' => 'generic_comment')); ?> - </div> + <div> + <label><?php echo elgg_echo("generic_comments:add"); ?></label> + <?php echo elgg_view('input/longtext', array('name' => 'generic_comment')); ?> + </div> + <div> <?php echo elgg_view('input/submit', array('value' => elgg_echo("generic_comments:post"))); +?> + </div> +<?php } echo elgg_view('input/hidden', array( 'name' => 'entity_guid', 'value' => $vars['entity']->getGUID() )); -}
\ No newline at end of file +} diff --git a/views/default/forms/login.php b/views/default/forms/login.php index 452c4c425..5cfdcd4c6 100644 --- a/views/default/forms/login.php +++ b/views/default/forms/login.php @@ -39,7 +39,7 @@ 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(); ?>pages/account/forgotten_password.php"> + <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 diff --git a/views/default/forms/register.php b/views/default/forms/register.php index 6f35a3ea3..4e0a521ab 100644 --- a/views/default/forms/register.php +++ b/views/default/forms/register.php @@ -11,17 +11,9 @@ $username = get_input('u'); $email = get_input('e'); $name = get_input('n'); -$admin_option = false; -if (elgg_is_admin_logged_in() && isset($vars['show_admin'])) { - $admin_option = true; -} - if (elgg_is_sticky_form('register')) { extract(elgg_get_sticky_values('register')); elgg_clear_sticky_form('register'); - if (is_array($admin)) { - $admin = $admin[0]; - } } ?> @@ -78,13 +70,6 @@ echo elgg_view('register/extend'); // Add captcha hook echo elgg_view('input/captcha'); -if ($admin_option) { - echo elgg_view('input/checkboxes', array( - 'name' => "admin", - 'options' => array(elgg_echo('admin_option')), - )); -} - 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'))); diff --git a/views/default/forms/user/requestnewpassword.php b/views/default/forms/user/requestnewpassword.php index f2f276417..970938327 100644 --- a/views/default/forms/user/requestnewpassword.php +++ b/views/default/forms/user/requestnewpassword.php @@ -11,7 +11,7 @@ <?php echo elgg_echo('user:password:text'); ?> </div> <div> - <label><?php echo elgg_echo('username'); ?></label> + <label><?php echo elgg_echo('username'); ?></label><br /> <?php echo elgg_view('input/text', array('name' => 'username')); ?> </div> <?php echo elgg_view('input/captcha'); ?> diff --git a/views/default/forms/usersettings/save.php b/views/default/forms/usersettings/save.php index 62593e699..35871144b 100644 --- a/views/default/forms/usersettings/save.php +++ b/views/default/forms/usersettings/save.php @@ -1,7 +1,7 @@ <?php $form_body = elgg_view("forms/account/settings"); -$form_body .= '<div class="elgg-divide-top">'; +$form_body .= '<div class="elgg-form-footer-alt">'; $form_body .= elgg_view('input/submit', array('value' => elgg_echo('save'))); $form_body .= '</div>'; diff --git a/views/default/group/elements/summary.php b/views/default/group/elements/summary.php new file mode 100644 index 000000000..395ed5292 --- /dev/null +++ b/views/default/group/elements/summary.php @@ -0,0 +1,13 @@ +<?php +/** + * Group summary + * + * @uses $vars['entity'] ElggEntity + * @uses $vars['title'] Title link (optional) false = no title, '' = default + * @uses $vars['metadata'] HTML for entity metadata and actions (optional) + * @uses $vars['subtitle'] HTML for the subtitle (optional) + * @uses $vars['tags'] HTML for the tags (optional) + * @uses $vars['content'] HTML for the entity content (optional) + */ + +echo elgg_view('object/elements/summary', $vars); diff --git a/views/default/input/access.php b/views/default/input/access.php index 7fa2323bf..40a93aaa4 100644 --- a/views/default/input/access.php +++ b/views/default/input/access.php @@ -3,12 +3,10 @@ * Elgg access level input * Displays a dropdown input field * - * @package Elgg - * @subpackage Core - * * @uses $vars['value'] The current value, if any * @uses $vars['options_values'] * @uses $vars['name'] The name of the input field + * @uses $vars['entity'] Optional. The entity for this access control (uses access_id) */ $defaults = array( @@ -18,6 +16,11 @@ $defaults = array( 'options_values' => get_write_access_array(), ); +if (isset($vars['entity'])) { + $defaults['value'] = $vars['entity']->access_id; + unset($vars['entity']); +} + $vars = array_merge($defaults, $vars); if ($vars['value'] == ACCESS_DEFAULT) { @@ -26,4 +29,4 @@ if ($vars['value'] == ACCESS_DEFAULT) { if (is_array($vars['options_values']) && sizeof($vars['options_values']) > 0) { echo elgg_view('input/dropdown', $vars); -}
\ No newline at end of file +} diff --git a/views/default/input/dropdown.php b/views/default/input/dropdown.php index 6fd97d3b5..fccccb888 100644 --- a/views/default/input/dropdown.php +++ b/views/default/input/dropdown.php @@ -3,7 +3,7 @@ * Elgg dropdown input * Displays a dropdown (select) input field * - * NB: Default values of FALSE or NULL will match '' (empty string) and not 0. + * @warning Default values of FALSE or NULL will match '' (empty string) and not 0. * * @package Elgg * @subpackage Core @@ -47,13 +47,15 @@ if ($options_values) { echo "<option $option_attrs>$option</option>"; } } else { - foreach ($options as $option) { + if (is_array($options)) { + foreach ($options as $option) { - $option_attrs = elgg_format_attributes(array( - 'selected' => (string)$option == (string)$value - )); + $option_attrs = elgg_format_attributes(array( + 'selected' => (string)$option == (string)$value + )); - echo "<option $option_attrs>$option</option>"; + echo "<option $option_attrs>$option</option>"; + } } } ?> diff --git a/views/default/input/location.php b/views/default/input/location.php new file mode 100644 index 000000000..d7ae2bbbd --- /dev/null +++ b/views/default/input/location.php @@ -0,0 +1,21 @@ +<?php +/** + * Location input field + * + * @uses $vars['entity'] The ElggEntity that has a location + * @uses $vars['value'] The default value for the location + */ + +$defaults = array( + 'class' => 'elgg-input-location', + 'disabled' => FALSE, +); + +if (isset($vars['entity'])) { + $defaults['value'] = $vars['entity']->location; + unset($vars['entity']); +} + +$vars = array_merge($defaults, $vars); + +echo elgg_view('input/tag', $vars); diff --git a/views/default/input/tag.php b/views/default/input/tag.php new file mode 100644 index 000000000..a78ec3163 --- /dev/null +++ b/views/default/input/tag.php @@ -0,0 +1,17 @@ +<?php +/** + * Elgg tag input + * + * Accepts a single tag value + * + * @uses $vars['value'] The default value for the tag + */ + +$defaults = array( + 'class' => 'elgg-input-tag', + 'disabled' => FALSE, +); + +$vars = array_merge($defaults, $vars); + +echo elgg_view('input/text', $vars);
\ No newline at end of file diff --git a/views/default/input/tags.php b/views/default/input/tags.php index 539bbd4db..7cda958aa 100644 --- a/views/default/input/tags.php +++ b/views/default/input/tags.php @@ -3,8 +3,10 @@ * Elgg tag input * Displays a tag input field * - * @package Elgg - * @subpackage Core + * @uses $vars['disabled'] + * @uses $vars['class'] + * @uses $vars['value'] Array of tags or a string + * @uses $vars['entity'] Optional. Entity whose tags are being displayed (metadata ->tags) */ $defaults = array( @@ -12,6 +14,11 @@ $defaults = array( 'disabled' => FALSE, ); +if (isset($vars['entity'])) { + $defaults['value'] = $vars['entity']->tags; + unset($vars['entity']); +} + $vars = array_merge($defaults, $vars); if (is_array($vars['value'])) { diff --git a/views/default/input/userpicker.php b/views/default/input/userpicker.php index 656effc98..dcd65072a 100644 --- a/views/default/input/userpicker.php +++ b/views/default/input/userpicker.php @@ -5,17 +5,18 @@ * @package Elgg * @subpackage Core * - * @uses $vars['value'] The current value, if any - * @uses $vars['name'] The name of the input field + * @uses $vars['value'] Array of user guids for already selected users or null + * @uses $vars['name'] The name of the input field * * - * pops up defaulted to lazy load friends lists in paginated alphabetical order. - * upon + * Defaults to lazy load user lists in paginated alphabetical order. User needs + * two type two characters before seeing the user popup list. * * As users are checked they move down to a "users" box. * When this happens, a hidden input is created also. - * {$internalnal}[] with the value th GUID. + * {$internalnal}[] with the value the GUID. * + * @warning: this is not stable */ elgg_load_js('elgg.userpicker'); @@ -65,6 +66,5 @@ foreach ($vars['value'] as $user_id) { <ul class="elgg-user-picker-entries"><?php echo $user_list; ?></ul> </div> <script type="text/javascript"> - elgg.provide('elgg.userpicker'); elgg.userpicker.userList = <?php echo $json_values ?>; </script>
\ No newline at end of file diff --git a/views/default/navigation/menu/elements/item.php b/views/default/navigation/menu/elements/item.php index 55ddc2fe4..f3e46315b 100644 --- a/views/default/navigation/menu/elements/item.php +++ b/views/default/navigation/menu/elements/item.php @@ -22,13 +22,7 @@ if ($children) { $item_class = $item->getItemClass(); -//allow people to specify name with underscores -$name = str_replace('_', '-', $item->getName()); -if ($item_class) { - $class = "class=\"elgg-menu-item-$name $item_class\""; -} - -echo "<li $class>"; +echo "<li class=\"$item_class\">"; echo $item->getContent(); if ($children) { echo elgg_view('navigation/menu/elements/section', array( diff --git a/views/default/navigation/topbar_tools.php b/views/default/navigation/topbar_tools.php index 3351edc93..307f03fc6 100644 --- a/views/default/navigation/topbar_tools.php +++ b/views/default/navigation/topbar_tools.php @@ -7,4 +7,3 @@ * * @deprecated 1.8 Extend the topbar menus or the page/elements/topbar view directly */ -elgg_deprecated_notice('navigation/topbar_tools was deprecated. Extend the topbar menus or the page/elements/topbar view directly', 1.8);
\ No newline at end of file diff --git a/views/default/object/default.php b/views/default/object/default.php index 2cf9805f0..27bb1890e 100644 --- a/views/default/object/default.php +++ b/views/default/object/default.php @@ -42,6 +42,6 @@ $params = array( 'subtitle' => $subtitle, 'tags' => $vars['entity']->tags, ); -$body = elgg_view('page/components/summary', $params); +$body = elgg_view('object/elements/summary', $params); echo elgg_view_image_block($icon, $body); diff --git a/views/default/object/elements/summary.php b/views/default/object/elements/summary.php new file mode 100644 index 000000000..d3a6ea862 --- /dev/null +++ b/views/default/object/elements/summary.php @@ -0,0 +1,53 @@ +<?php +/** + * Object summary + * + * Sample output + * <ul class="elgg-menu elgg-menu-metadata"><li>Public</li><li>Like this</li></ul> + * <h3><a href="">Title</a></h3> + * <p class="elgg-subtext">Posted 3 hours ago by George</p> + * <p class="elgg-tags"><a href="">one</a>, <a href="">two</a></p> + * <div class="elgg-list-content">Excerpt text</div> + * + * @uses $vars['entity'] ElggEntity + * @uses $vars['title'] Title link (optional) false = no title, '' = default + * @uses $vars['metadata'] HTML for entity metadata and actions (optional) + * @uses $vars['subtitle'] HTML for the subtitle (optional) + * @uses $vars['tags'] HTML for the tags (optional) + * @uses $vars['content'] HTML for the entity content (optional) + */ + +$entity = $vars['entity']; + +$title_link = elgg_extract('title', $vars, ''); +if ($title_link === '') { + if (isset($entity->title)) { + $text = $entity->title; + } else { + $text = $entity->name; + } + $params = array( + 'text' => $text, + 'href' => $entity->getURL(), + ); + $title_link = elgg_view('output/url', $params); +} + +$metadata = elgg_extract('metadata', $vars, ''); +$subtitle = elgg_extract('subtitle', $vars, ''); +$content = elgg_extract('content', $vars, ''); + +$tags = elgg_extract('tags', $vars, ''); +if ($tags !== false) { + $tags = elgg_view('output/tags', array('tags' => $entity->tags)); +} + +if ($metadata) { + echo $metadata; +} +echo "<h3>$title_link</h3>"; +echo "<div class=\"elgg-subtext\">$subtitle</div>"; +echo $tags; +if ($content) { + echo "<div class=\"elgg-list-content\">$content</div>"; +} diff --git a/views/default/object/plugin/advanced.php b/views/default/object/plugin/advanced.php index 4c8bc8c17..51fb69d17 100644 --- a/views/default/object/plugin/advanced.php +++ b/views/default/object/plugin/advanced.php @@ -5,11 +5,15 @@ * This file renders a plugin for the admin screen, including active/deactive, * manifest details & display plugin settings. * + * @uses $vars['entity'] + * @uses $vars['display_reordering'] Do we display the priority reordering links? + * * @package Elgg.Core * @subpackage Plugins */ $plugin = $vars['entity']; +$reordering = elgg_extract('display_reordering', $vars, false); $priority = $plugin->getPriority(); $active = $plugin->isActive(); @@ -20,93 +24,108 @@ $actions_base = '/action/admin/plugins/'; $ts = time(); $token = generate_action_token($ts); -$active_class = ($active && $can_activate) ? 'elgg-state-active' : 'elgg-state-inactive'; // build reordering links $links = ''; -// top and up link only if not at top -if ($priority > 1) { - $top_url = elgg_http_add_url_query_elements($actions_base . 'set_priority', array( - 'plugin_guid' => $plugin->guid, - 'priority' => 'first', - 'is_action' => true - )); +if ($reordering) { + $draggable = 'elgg-state-draggable'; - $links .= "<li>" . elgg_view('output/url', array( - 'href' => $top_url, - 'text' => elgg_echo('top'), - 'is_action' => true - )) . "</li>"; + // top and up link only if not at top + if ($priority > 1) { + $top_url = elgg_http_add_url_query_elements($actions_base . 'set_priority', array( + 'plugin_guid' => $plugin->guid, + 'priority' => 'first', + 'is_action' => true + )); - $up_url = elgg_http_add_url_query_elements($actions_base . 'set_priority', array( - 'plugin_guid' => $plugin->guid, - 'priority' => '-1', - 'is_action' => true - )); + $links .= "<li>" . elgg_view('output/url', array( + 'href' => $top_url, + 'text' => elgg_echo('top'), + 'is_action' => true + )) . "</li>"; - $links .= "<li>" . elgg_view('output/url', array( - 'href' => $up_url, - 'text' => elgg_echo('up'), - 'is_action' => true - )) . "</li>"; -} + $up_url = elgg_http_add_url_query_elements($actions_base . 'set_priority', array( + 'plugin_guid' => $plugin->guid, + 'priority' => '-1', + 'is_action' => true + )); -// down and bottom links only if not at bottom -if ($priority < $max_priority) { - $down_url = elgg_http_add_url_query_elements($actions_base . 'set_priority', array( - 'plugin_guid' => $plugin->guid, - 'priority' => '+1', - 'is_action' => true - )); + $links .= "<li>" . elgg_view('output/url', array( + 'href' => $up_url, + 'text' => elgg_echo('up'), + 'is_action' => true + )) . "</li>"; + } + + // down and bottom links only if not at bottom + if ($priority < $max_priority) { + $down_url = elgg_http_add_url_query_elements($actions_base . 'set_priority', array( + 'plugin_guid' => $plugin->guid, + 'priority' => '+1', + 'is_action' => true + )); - $links .= "<li>" . elgg_view('output/url', array( - 'href' => $down_url, - 'text' => elgg_echo('down'), - 'is_action' => true - )) . "</li>"; + $links .= "<li>" . elgg_view('output/url', array( + 'href' => $down_url, + 'text' => elgg_echo('down'), + 'is_action' => true + )) . "</li>"; - $bottom_url = elgg_http_add_url_query_elements($actions_base . 'set_priority', array( - 'plugin_guid' => $plugin->guid, - 'priority' => 'last', - 'is_action' => true - )); + $bottom_url = elgg_http_add_url_query_elements($actions_base . 'set_priority', array( + 'plugin_guid' => $plugin->guid, + 'priority' => 'last', + 'is_action' => true + )); - $links .= "<li>" . elgg_view('output/url', array( - 'href' => $bottom_url, - 'text' => elgg_echo('bottom'), - 'is_action' => true - )) . "</li>"; + $links .= "<li>" . elgg_view('output/url', array( + 'href' => $bottom_url, + 'text' => elgg_echo('bottom'), + 'is_action' => true + )) . "</li>"; + } +} else { + $draggable = 'elgg-state-undraggable'; } + // activate / deactivate links -if ($can_activate) { - if ($active) { - $action = 'deactivate'; - $class = 'elgg-button-cancel'; - } else { - $action = 'activate'; - $class = 'elgg-button-submit'; + +// always let them deactivate +$options = array( + 'is_action' => true +); +if ($active) { + $active_class = 'elgg-state-active'; + $action = 'deactivate'; + $options['text'] = elgg_echo('deactivate'); + $options['class'] = "elgg-button elgg-button-cancel"; + + if (!$can_activate) { + $active_class = 'elgg-state-active'; + $options['class'] = 'elgg-button elgg-state-warning'; } +} else if ($can_activate) { + $active_class = 'elgg-state-inactive'; + $action = 'activate'; + $options['text'] = elgg_echo('activate'); + $options['class'] = "elgg-button elgg-button-submit"; +} else { + $active_class = 'elgg-state-inactive'; + $action = ''; + $options['text'] = elgg_echo('admin:plugins:cannot_activate'); + $options['class'] = "elgg-button elgg-button-disabled"; + $options['disabled'] = 'disabled'; +} +if ($action) { $url = elgg_http_add_url_query_elements($actions_base . $action, array( - 'plugin_guids[]' => $plugin->guid, - 'is_action' => true + 'plugin_guids[]' => $plugin->guid )); - $action_button = elgg_view('output/url', array( - 'href' => $url, - 'text' => elgg_echo($action), - 'is_action' => true, - 'class' => "elgg-button $class" - )); -} else { - $action_button = elgg_view('output/url', array( - 'text' => elgg_echo('admin:plugins:cannot_activate'), - 'disabled' => 'disabled', - 'class' => "elgg-button elgg-button-action elgg-state-disabled" - )); + $options['href'] = $url; } +$action_button = elgg_view('output/url', $options); // Display categories $categories_html = ''; @@ -170,20 +189,23 @@ if ($files) { ?> -<div class="elgg-state-draggable elgg-plugin <?php echo $active_class ?>" id="elgg-plugin-<?php echo $plugin->guid; ?>"> +<div class="<?php echo $draggable; ?> elgg-plugin <?php echo $active_class ?>" id="elgg-plugin-<?php echo $plugin->guid; ?>"> <div class="elgg-image-block"> <div class="elgg-image-alt"> + <?php if ($links) : ?> <ul class="elgg-menu elgg-menu-metadata"> - <?php echo "$links"; ?> + <?php echo $links; ?> </ul> + <?php endif; ?> <div class="clearfloat right mtm"> <?php echo $action_button; ?> </div> </div> <div class="elgg-body"> <?php -$settings_view = 'settings/' . $plugin->getID() . '/edit'; -if (elgg_view_exists($settings_view)) { +$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>"; } @@ -201,8 +223,13 @@ if (elgg_view_exists($settings_view)) { } if (!$can_activate) { - $message = elgg_echo('admin:plugins:warning:unmet_dependencies'); - echo "<p class=\"elgg-state-error\">$message</p>"; + if ($active) { + $message = elgg_echo('admin:plugins:warning:unmet_dependencies_active'); + echo "<p class=\"elgg-state-warning\">$message</p>"; + } else { + $message = elgg_echo('admin:plugins:warning:unmet_dependencies'); + echo "<p class=\"elgg-state-error\">$message</p>"; + } } ?> diff --git a/views/default/object/plugin/elements/dependencies.php b/views/default/object/plugin/elements/dependencies.php index f4d1ccc5a..5f4aa4392 100644 --- a/views/default/object/plugin/elements/dependencies.php +++ b/views/default/object/plugin/elements/dependencies.php @@ -20,7 +20,7 @@ foreach ($columns as $column) { echo "<th class=\"pas\">$column</th>"; } -echo '<tr/>'; +echo '</tr>'; $row = 'odd'; foreach ($deps as $dep) { diff --git a/views/default/output/confirmlink.php b/views/default/output/confirmlink.php index 967094113..5059a656e 100644 --- a/views/default/output/confirmlink.php +++ b/views/default/output/confirmlink.php @@ -13,7 +13,8 @@ * @uses $vars['text_encode'] Encode special characters? (false) */ -$confirm = elgg_extract('confirm', $vars, elgg_echo('question:areyousure')); +$vars['rel'] = elgg_extract('confirm', $vars, elgg_echo('question:areyousure')); +$vars['rel'] = addslashes($vars['rel']); $encode = elgg_extract('text_encode', $vars, false); // always generate missing action tokens @@ -36,7 +37,6 @@ if (isset($vars['class'])) { } else { $vars['class'] = 'elgg-requires-confirmation'; } -//$vars['onclick'] = "return confirm('" . addslashes($confirm) . "')"; unset($vars['encode_text']); unset($vars['text']); diff --git a/views/default/output/location.php b/views/default/output/location.php new file mode 100644 index 000000000..e3619d2e1 --- /dev/null +++ b/views/default/output/location.php @@ -0,0 +1,14 @@ +<?php +/** + * Display a location + * + * @uses $vars['entity'] The ElggEntity that has a location + * @uses $vars['value'] The location string if the entity is not passed + */ + +if (isset($vars['entity'])) { + $vars['value'] = $vars['entity']->location; + unset($vars['entity']); +} + +echo elgg_view('output/tag', $vars); diff --git a/views/default/output/tag.php b/views/default/output/tag.php new file mode 100644 index 000000000..abae9c4b2 --- /dev/null +++ b/views/default/output/tag.php @@ -0,0 +1,30 @@ +<?php +/** + * Elgg single tag output + * + * @uses $vars['value'] String + * @uses $vars['type'] The entity type, optional + * @uses $vars['subtype'] The entity subtype, optional + * + */ + +if (!empty($vars['subtype'])) { + $subtype = "&subtype=" . urlencode($vars['subtype']); +} else { + $subtype = ""; +} +if (!empty($vars['object'])) { + $object = "&object=" . urlencode($vars['object']); +} else { + $object = ""; +} + +if (isset($vars['value'])) { + if (!empty($vars['type'])) { + $type = "&type={$vars['type']}"; + } else { + $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')); +} diff --git a/views/default/output/tags.php b/views/default/output/tags.php index 345b256c4..6dedfacc7 100644 --- a/views/default/output/tags.php +++ b/views/default/output/tags.php @@ -1,17 +1,19 @@ <?php /** * Elgg tags - * * Tags can be a single string (for one tag) or an array of strings * - * @package Elgg - * @subpackage Core - * - * @uses $vars['tags'] The tags to display - * @uses $vars['type'] The entity type, optional + * @uses $vars['value'] Array of tags or a string + * @uses $vars['type'] The entity type, optional * @uses $vars['subtype'] The entity subtype, optional + * @uses $vars['entity'] Optional. Entity whose tags are being displayed (metadata ->tags) */ +if (isset($vars['entity'])) { + $vars['tags'] = $vars['entity']->tags; + unset($vars['entity']); +} + if (!empty($vars['subtype'])) { $subtype = "&subtype=" . urlencode($vars['subtype']); } else { @@ -27,6 +29,10 @@ if (empty($vars['tags']) && !empty($vars['value'])) { $vars['tags'] = $vars['value']; } +if (empty($vars['tags']) && isset($vars['entity'])) { + $vars['tags'] = $vars['entity']->tags; +} + if (!empty($vars['tags'])) { if (!is_array($vars['tags'])) { $vars['tags'] = array($vars['tags']); diff --git a/views/default/page/components/summary.php b/views/default/page/components/summary.php index 578e9b9cf..ea61a6e4b 100644 --- a/views/default/page/components/summary.php +++ b/views/default/page/components/summary.php @@ -1,53 +1,4 @@ <?php -/** - * List body - * - * Sample output - * <ul class="elgg-menu elgg-menu-metadata"><li>Public</li><li>Like this</li></ul> - * <h3><a href="">Title</a></h3> - * <p class="elgg-subtext">Posted 3 hours ago by George</p> - * <p class="elgg-tags"><a href="">one</a>, <a href="">two</a></p> - * <div class="elgg-list-content">Excerpt text</div> - * - * @uses $vars['entity'] ElggEntity - * @uses $vars['title'] Title link (optional) false = no title, '' = default - * @uses $vars['metadata'] HTML for entity metadata and actions (optional) - * @uses $vars['subtitle'] HTML for the subtitle (optional) - * @uses $vars['tags'] HTML for the tags (optional) - * @uses $vars['content'] HTML for the entity content (optional) - */ -$entity = $vars['entity']; - -$title_link = elgg_extract('title', $vars, ''); -if ($title_link === '') { - if (isset($entity->title)) { - $text = $entity->title; - } else { - $text = $entity->name; - } - $params = array( - 'text' => $text, - 'href' => $entity->getURL(), - ); - $title_link = elgg_view('output/url', $params); -} - -$metadata = elgg_extract('metadata', $vars, ''); -$subtitle = elgg_extract('subtitle', $vars, ''); -$content = elgg_extract('content', $vars, ''); - -$tags = elgg_extract('tags', $vars, ''); -if ($tags !== false) { - $tags = elgg_view('output/tags', array('tags' => $entity->tags)); -} - -if ($metadata) { - echo $metadata; -} -echo "<h3>$title_link</h3>"; -echo "<div class=\"elgg-subtext\">$subtitle</div>"; -echo $tags; -if ($content) { - echo "<div class=\"elgg-list-content\">$content</div>"; -} +// Deprecated in favor of type/elements/summary +echo elgg_view('object/elements/summary', $vars); diff --git a/views/default/page/default.php b/views/default/page/default.php index 9effce1ec..0e27cda52 100644 --- a/views/default/page/default.php +++ b/views/default/page/default.php @@ -17,7 +17,7 @@ if (elgg_get_context() == 'admin') { elgg_deprecated_notice("admin plugins should route through 'admin'.", 1.8); elgg_admin_add_plugin_settings_menu(); elgg_unregister_css('elgg'); - echo elgg_view('page/shells/admin', $vars); + echo elgg_view('page/admin', $vars); return true; } diff --git a/views/default/page/elements/comments_block.php b/views/default/page/elements/comments_block.php index 751aa4312..d0f8ab809 100644 --- a/views/default/page/elements/comments_block.php +++ b/views/default/page/elements/comments_block.php @@ -36,6 +36,7 @@ if ($comments) { 'items' => $comments, 'pagination' => false, 'list_class' => 'elgg-latest-comments', + 'full_view' => false, )); } else { $body = '<p>' . elgg_echo('generic_comment:none') . '</p>'; diff --git a/views/default/page/elements/header.php b/views/default/page/elements/header.php index 2361644f2..1a1f5d211 100644 --- a/views/default/page/elements/header.php +++ b/views/default/page/elements/header.php @@ -1,8 +1,8 @@ <?php /** - * Elgg header contents - * This file holds the header output that a user will see - **/ + * Elgg page header + * In the default theme, the header lives between the topbar and main content area. + */ // link back to main site. echo elgg_view('page/elements/header_logo', $vars); diff --git a/views/default/page/elements/topbar.php b/views/default/page/elements/topbar.php index 17c5d938b..e4c6c86bb 100644 --- a/views/default/page/elements/topbar.php +++ b/views/default/page/elements/topbar.php @@ -1,14 +1,16 @@ <?php /** - * Elgg top toolbar + * Elgg topbar * The standard elgg top toolbar */ - - // Elgg logo echo elgg_view_menu('topbar', array('sort_by' => 'priority', array('elgg-menu-hz'))); // elgg tools menu // need to echo this empty view for backward compatibility. -echo elgg_view("navigation/topbar_tools"); +$content = elgg_view("navigation/topbar_tools"); +if ($content) { + elgg_deprecated_notice('navigation/topbar_tools was deprecated. Extend the topbar menus or the page/elements/topbar view directly', 1.8); + echo $content; +} diff --git a/views/default/page/layouts/widgets/add_panel.php b/views/default/page/layouts/widgets/add_panel.php index 2786e83b2..9eb78cdb6 100644 --- a/views/default/page/layouts/widgets/add_panel.php +++ b/views/default/page/layouts/widgets/add_panel.php @@ -12,6 +12,7 @@ $context = $vars['context']; $exact = elgg_extract('exact_match', $vars, false); $widget_types = elgg_get_widget_types($context, $exact); +uasort($widget_types, create_function('$a,$b', 'return strcmp($a->name,$b->name);')); $current_handlers = array(); foreach ($widgets as $column_widgets) { diff --git a/views/default/river/user/default/profileiconupdate.php b/views/default/river/user/default/profileiconupdate.php new file mode 100644 index 000000000..a723c5335 --- /dev/null +++ b/views/default/river/user/default/profileiconupdate.php @@ -0,0 +1,13 @@ +<?php +/** + * Update avatar river view + */ +$subject = $vars['item']->getSubjectEntity(); + +$subject_icon = elgg_view_entity_icon($subject, 'tiny'); + +echo elgg_echo("profile:river:iconupdate"); + +echo '<div class="elgg-river-content clearfix">'; +echo $subject_icon; +echo '</div>'; diff --git a/views/default/user/default.php b/views/default/user/default.php index 71eb273f0..c0c18f85f 100644 --- a/views/default/user/default.php +++ b/views/default/user/default.php @@ -6,25 +6,26 @@ * @uses $vars['size'] Size of the icon */ -$user = $vars['entity']; +$entity = $vars['entity']; $size = elgg_extract('size', $vars, 'tiny'); -$icon = elgg_view_entity_icon($user, $size); +$icon = elgg_view_entity_icon($entity, $size); // Simple XFN $rel = ''; -if (elgg_get_logged_in_user_guid() == $user->guid) { +if (elgg_get_logged_in_user_guid() == $entity->guid) { $rel = 'rel="me"'; -} elseif (check_entity_relationship(elgg_get_logged_in_user_guid(), 'friend', $user->guid)) { +} elseif (check_entity_relationship(elgg_get_logged_in_user_guid(), 'friend', $entity->guid)) { $rel = 'rel="friend"'; } -$title = "<a href=\"" . $user->getUrl() . "\" $rel>" . $user->name . "</a>"; +$title = "<a href=\"" . $entity->getUrl() . "\" $rel>" . $entity->name . "</a>"; - -$metadata = "<ul class=\"elgg-menu elgg-menu-metadata\"><li>$user->location</li>"; -$metadata .= elgg_view("entity/metadata", array('entity' => $user)); -$metadata .= "</ul>"; +$metadata = elgg_view_menu('entity', array( + 'entity' => $entity, + 'sort_by' => 'priority', + 'class' => 'elgg-menu-hz', +)); if (elgg_in_context('owner_block') || elgg_in_context('widgets')) { $metadata = ''; @@ -33,24 +34,24 @@ if (elgg_in_context('owner_block') || elgg_in_context('widgets')) { if (elgg_get_context() == 'gallery') { echo $icon; } else { - if ($user->isBanned()) { + if ($entity->isBanned()) { $banned = elgg_echo('banned'); $params = array( - 'entity' => $user, + 'entity' => $entity, 'title' => $title, - 'metadata' => '<ul class="elgg-menu elgg-menu-metadata"><li>$banned</li></ul>', + 'metadata' => $metadata, ); } else { $params = array( - 'entity' => $user, + 'entity' => $entity, 'title' => $title, 'metadata' => $metadata, - 'subtitle' => $user->briefdescription, - 'content' => elgg_view('user/status', array('entity' => $user)), + 'subtitle' => $entity->briefdescription, + 'content' => elgg_view('user/status', array('entity' => $entity)), ); } - $list_body = elgg_view('page/components/summary', $params); + $list_body = elgg_view('user/elements/summary', $params); echo elgg_view_image_block($icon, $list_body); } diff --git a/views/default/user/elements/summary.php b/views/default/user/elements/summary.php new file mode 100644 index 000000000..46d11c14c --- /dev/null +++ b/views/default/user/elements/summary.php @@ -0,0 +1,13 @@ +<?php +/** + * User summary + * + * @uses $vars['entity'] ElggEntity + * @uses $vars['title'] Title link (optional) false = no title, '' = default + * @uses $vars['metadata'] HTML for entity metadata and actions (optional) + * @uses $vars['subtitle'] HTML for the subtitle (optional) + * @uses $vars['tags'] HTML for the tags (optional) + * @uses $vars['content'] HTML for the entity content (optional) + */ + +echo elgg_view('object/elements/summary', $vars); diff --git a/views/default/widgets/friends/content.php b/views/default/widgets/friends/content.php index 4c5ef5b4a..ec842a252 100644 --- a/views/default/widgets/friends/content.php +++ b/views/default/widgets/friends/content.php @@ -13,12 +13,12 @@ $num = (int) $vars['entity']->num_display; // get the correct size $size = $vars['entity']->icon_size; -$html = $owner->listFriends('', $num, array( - 'size' => $size, - 'gallery' => true, -)); -if ($html) { - echo $html; -} else { - +if (elgg_instanceof($owner, 'user')) { + $html = $owner->listFriends('', $num, array( + 'size' => $size, + 'gallery' => true, + )); + if ($html) { + echo $html; + } } |