diff options
-rw-r--r-- | engine/lib/views.php | 14 | ||||
-rw-r--r-- | views/default/page/elements/wrapper.php | 22 |
2 files changed, 36 insertions, 0 deletions
diff --git a/engine/lib/views.php b/engine/lib/views.php index aff0dbd0d..8745d3117 100644 --- a/engine/lib/views.php +++ b/engine/lib/views.php @@ -1515,6 +1515,19 @@ function elgg_views_add_rss_link() { } /** + * Registers deprecated views to avoid making some pages from older plugins + * completely empty. + * + * @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 * This ensures simplecache is cleared during upgrades. See #2252 * @@ -1560,3 +1573,4 @@ function elgg_views_boot() { } elgg_register_event_handler('boot', 'system', 'elgg_views_boot', 1000); +elgg_register_event_handler('init', 'system', 'elgg_views_handle_deprecated_views'); diff --git a/views/default/page/elements/wrapper.php b/views/default/page/elements/wrapper.php new file mode 100644 index 000000000..61828832d --- /dev/null +++ b/views/default/page/elements/wrapper.php @@ -0,0 +1,22 @@ +<?php +/** + * Deprecated content wrapper view from Elgg 1.5 through 1.7 + * + * @uses $vars['body'] The content to display inside content wrapper + * @uses $vars['subclass'] Additional css class + */ + +elgg_deprecated_notice("The 'page_elements/contentwrapper' has been deprecated", 1.8); +?> + +<div class="contentWrapper<?php + + if (isset($vars['subclass'])) { + echo ' ' . $vars['subclass']; + } + +?>"> +<?php + echo $vars['body']; +?> +</div> |