Permalink
Browse files

chore(views): Remove all deprecated views

BREAKING CHANGE:
Several views that were deprecated in the 1.x series are being
removed in 2.x. This helps us keep the codebase clean and our
maintenance burden lower.
  • Loading branch information...
ewinslow committed May 26, 2015
1 parent 0f69218 commit 805ecb1de083fd2a16e739afa487a03537bae85e
View
@@ -9,9 +9,46 @@ See the administrator guides for :doc:`how to upgrade a live site </admin/upgrad
:local:
:depth: 2
From 1.11 to 2.0
================
From 1.x to 2.0
===============
All deprecated views and view arguments have been removed
---------------------------------------------------------
We dropped support for and/or removed the following views:
* core/settings/tools
* footer/analytics (Use page/elements/foot instead)
* groups/search/finishblurb
* groups/search/startblurb
* input/calendar (Use input/date instead)
* input/datepicker (Use input/date instead)
* input/pulldown (Use input/select instead)
* js/initialise_elgg (Use AMD and ``elgg_require_js`` instead of extending JS views)
* members/nav
* metatags (Use the 'head', 'page' plugin hook instead)
* navigation/topbar_tools
* navigation/viewtype
* output/calendar (Use output/date instead)
* output/confirmlink (Use output/url instead)
* page_elements/contentwrapper
* page/elements/shortcut_icon (Use the 'head', 'page' plugin hook instead)
* page/elements/wrapper
* profile/icon (Use ``elgg_get_entity_icon``)
* settings/{plugin}/edit (Use plugins/{plugin}/settings instead)
* user/search/finishblurb
* user/search/startblurb
* usersettings/{plugin}/edit (Use plugins/{plugin}/usersettings instead)
* widgets/{handler}/view (Use widgets/{handler}/content instead)
We also dropped the following arguments to views:
* "value" in output/iframe (Use "src" instead)
* "area2" and "area3" in page/elements/sidebar (Use "sidebar" or view extension instead)
* "js" in icon views (e.g. icon/user/default)
* "options" to input/radio and input/checkboxes which aren't key-value pairs
will no longer be acceptable.
All scripts moved to bottom of page
-----------------------------------
View
@@ -1581,40 +1581,6 @@ function _elgg_views_send_header_x_frame_options() {
header('X-Frame-Options: SAMEORIGIN');
}
/**
* Checks for usage of core views that have been removed
*
* @access private
*/
function _elgg_views_deprecate_removed_views() {
$removed_views = array(
"1.10" => array(
'core/settings/tools',
),
);
$views_svc = _elgg_services()->views;
foreach ($removed_views as $version => $names) {
foreach ($names as $name) {
if ($views_svc->viewExists($name)) {
elgg_deprecated_notice("The view $name is no longer used and should not be provided or extended.", $version);
}
}
}
}
/**
* Registers deprecated views to avoid making some pages from older plugins
* completely empty.
*
* @access private
*/
function elgg_views_handle_deprecated_views() {
$location = elgg_get_view_location('page_elements/contentwrapper');
if ($location === "/var/www/views/") {
elgg_extend_view('page_elements/contentwrapper', 'page/elements/wrapper');
}
}
/**
* Initialize viewtypes on system boot event
@@ -1703,6 +1669,4 @@ function elgg_views_boot() {
return function(\Elgg\EventsService $events, \Elgg\HooksRegistrationService $hooks) {
$events->registerHandler('boot', 'system', 'elgg_views_boot');
$events->registerHandler('init', 'system', 'elgg_views_handle_deprecated_views');
$events->registerHandler('ready', 'system', '_elgg_views_deprecate_removed_views');
};
@@ -5,21 +5,12 @@
* @uses $vars['page'] The URL segment after members/
*/
if (elgg_view_exists('members/nav')) {
// legacy non-bundled plugin
$suggestion = "Instead use the (members:config, tabs) plugin hook to register tabs.";
$vars = array(
'selected' => $vars['page'],
);
$filter = elgg_view_deprecated('members/nav', $vars, $suggestion, 1.9);
} else {
$tabs = elgg_trigger_plugin_hook('members:config', 'tabs', null, array());
foreach ($tabs as $type => $values) {
$tabs[$type]['selected'] = ($vars['page'] == $type);
}
$filter = elgg_view('navigation/tabs', array('tabs' => $tabs));
$tabs = elgg_trigger_plugin_hook('members:config', 'tabs', null, array());
foreach ($tabs as $type => $values) {
$tabs[$type]['selected'] = ($vars['page'] == $type);
}
$filter = elgg_view('navigation/tabs', array('tabs' => $tabs));
$params = array(
'options' => array('type' => 'user', 'full_view' => false),
View

This file was deleted.

Oops, something went wrong.
@@ -19,8 +19,6 @@
if (elgg_view_exists("plugins/$plugin_id/{$type}settings")) {
echo elgg_view("plugins/$plugin_id/{$type}settings", $vars);
} else {
echo elgg_view_deprecated("{$type}settings/$plugin_id/edit", $vars, "Use the view plugins/$plugin_id/{$type}settings", 1.8);
}
echo '<div class="elgg-foot">';

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
@@ -46,22 +46,13 @@
$icontime = "default";
}
$js = elgg_extract('js', $vars, '');
if ($js) {
elgg_deprecated_notice("Passing 'js' to icon views is deprecated.", 1.8, 5);
}
$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'];

This file was deleted.

Oops, something went wrong.
@@ -73,12 +73,6 @@
$checkboxes = '';
foreach ($vars['options'] as $label => $value) {
// @deprecated 1.8 Remove in 1.9
if (is_integer($label)) {
elgg_deprecated_notice('$vars[\'options\'] must be an associative array in input/checkboxes', 1.8);
$label = $value;
}
$input_vars['checked'] = in_array(elgg_strtolower($value), $values);
$input_vars['value'] = $value;
$input_vars['label'] = $label;

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
@@ -63,12 +63,6 @@
$vars['checked'] = in_array(elgg_strtolower($option), $value);
$vars['value'] = $option;
// handle indexed array where label is not specified
// @deprecated 1.8 Remove in 1.9
if (is_integer($label)) {
elgg_deprecated_notice('$vars[\'options\'] must be an associative array in input/radio', 1.8);
$label = $option;
}
$radio = elgg_format_element('input', $vars);
$radios .= "<li><label>{$radio}{$label}</label></li>";
}
@@ -76,8 +76,4 @@
require(['elgg']); // Forces the define() function to always run
<?php
echo elgg_view_deprecated('js/initialise_elgg', array(), "Use the view js/elgg.", 1.8);
?>
elgg.trigger_hook('boot', 'system');
@@ -32,9 +32,6 @@
// some views pass an empty string for base_url
if (isset($vars['base_url']) && $vars['base_url']) {
$base_url = $vars['base_url'];
} else if (isset($vars['baseurl']) && $vars['baseurl']) {
elgg_deprecated_notice("Use 'base_url' instead of 'baseurl' for the navigation/pagination view", 1.8);
$base_url = $vars['baseurl'];
} elseif (elgg_is_xhr() && !empty($_SERVER['HTTP_REFERER'])) {
$base_url = $_SERVER['HTTP_REFERER'];
} else {

This file was deleted.

Oops, something went wrong.
@@ -40,9 +40,6 @@
} else {
if (elgg_view_exists("widgets/$handler/content")) {
$content = elgg_view("widgets/$handler/content", $vars);
} else {
elgg_deprecated_notice("widgets use content as the display view", 1.8);
$content = elgg_view("widgets/$handler/view", $vars);
}
}

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
@@ -8,12 +8,7 @@
* @uses $vars['src'] Source URL of the page
*/
if (!isset($vars['src']) && isset($vars['value'])) {
elgg_deprecated_notice('$vars[\'src\'] deprecated in output/iframe for $vars[\'src\']', 1.9);
$src = $vars['value'];
} else {
$src = elgg_extract('src', $vars);
}
$src = elgg_extract('src', $vars);
$src = elgg_normalize_url($src);
$vars['src'] = elgg_format_url($src);
@@ -15,9 +15,6 @@
// backward compatability support for plugins that are not using the new approach
// of routing through admin. See reportedcontent plugin for a simple example.
if (elgg_get_context() == 'admin') {
if (get_input('handler') != '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/admin', $vars);
@@ -1,7 +1,5 @@
<?php
echo elgg_view_deprecated('footer/analytics', array(), "Extend page/elements/foot instead", 1.8);
$elgg_init = elgg_view('js/initialize_elgg');
echo "<script>$elgg_init</script>";
@@ -39,16 +39,11 @@
// A non-empty script *must* come below the CSS links, otherwise Firefox will exhibit FOUC
// See https://github.com/Elgg/Elgg/issues/8328
?>
<script>
<?php // Do not convert this to a regular function declaration. It gets redefined later. ?>
require = function () {
// handled in the view "js/elgg"
_require_queue.push(arguments);
};
_require_queue = [];
</script>
<?php
echo elgg_view_deprecated('page/elements/shortcut_icon', array(), "Use the 'head', 'page' plugin hook.", 1.9);
echo elgg_view_deprecated('metatags', array(), "Use the 'head', 'page' plugin hook.", 1.8);
<script>
<?php // Do not convert this to a regular function declaration. It gets redefined later. ?>
require = function () {
// handled in the view "js/elgg"
_require_queue.push(arguments);
};
_require_queue = [];
</script>
Oops, something went wrong.

0 comments on commit 805ecb1

Please sign in to comment.