From 267281e13e8e8baedec7ef06a88fd4024a54256d Mon Sep 17 00:00:00 2001 From: cash Date: Tue, 10 Nov 2009 13:00:21 +0000 Subject: elgg_extend_view() replaces extend_view() git-svn-id: http://code.elgg.org/elgg/trunk@3661 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/admin.php | 4 ++-- engine/lib/elgglib.php | 17 +++++++++++++++-- engine/lib/usersettings.php | 4 ++-- mod/logbrowser/start.php | 4 ++-- mod/search/start.php | 2 +- 5 files changed, 22 insertions(+), 9 deletions(-) diff --git a/engine/lib/admin.php b/engine/lib/admin.php index c680f0a7f..fc3ffd64c 100644 --- a/engine/lib/admin.php +++ b/engine/lib/admin.php @@ -22,14 +22,14 @@ * nb. some pages already exist that you can extend), extend the main view to point to it, * and add controls to your new view. * - * At the moment this is essentially a wrapper around extend_view. + * At the moment this is essentially a wrapper around elgg_extend_view(). * * @param string $new_admin_view The view associated with the control you're adding * @param string $view The view to extend, by default this is 'admin/main'. * @param int $priority Optional priority to govern the appearance in the list. */ function extend_elgg_admin_page( $new_admin_view, $view = 'admin/main', $priority = 500) { - return extend_view($view, $new_admin_view, $priority); + return elgg_extend_view($view, $new_admin_view, $priority); } /** diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index 856852729..5cd0a1995 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -1013,8 +1013,9 @@ function set_template_handler($function_name) { * @param string $view The view to add to. * @param string $view_name The name of the view to extend * @param int $priority The priority, from 0 to 1000, to add at (lowest numbers will be displayed first) + * @param string $viewtype Not used */ -function extend_view($view, $view_name, $priority = 501, $viewtype = '') { +function elgg_extend_view($view, $view_name, $priority = 501, $viewtype = '') { global $CONFIG; if (!isset($CONFIG->views)) { @@ -1037,6 +1038,18 @@ function extend_view($view, $view_name, $priority = 501, $viewtype = '') { ksort($CONFIG->views->extensions[$view]); } +/** + * @deprecated 1.7. Use elgg_extend_view(). + * @param $view + * @param $view_name + * @param $priority + * @param $viewtype + */ +function extend_view($view, $view_name, $priority = 501, $viewtype = '') { + elgg_log('extend_view() was deprecated in 1.7 by elgg_extend_view()!', 'WARNING'); + elgg_extend_view($view, $view_name, $priority, $viewtype); +} + /** * Set an alternative base location for a view (as opposed to the default of $CONFIG->viewpath) * @@ -2372,7 +2385,7 @@ function __elgg_shutdown_hook() { function elgg_init() { // Page handler for JS register_page_handler('js','js_page_handler'); - extend_view('js/initialise_elgg','embed/js'); + elgg_extend_view('js/initialise_elgg','embed/js'); // Register an event triggered at system shutdown register_shutdown_function('__elgg_shutdown_hook'); diff --git a/engine/lib/usersettings.php b/engine/lib/usersettings.php index 24a956a62..4843ffc99 100644 --- a/engine/lib/usersettings.php +++ b/engine/lib/usersettings.php @@ -20,14 +20,14 @@ * nb. some pages already exist that you can extend), extend the main view to point to it, and add controls to your * new view. * - * At the moment this is essentially a wrapper around extend_view. + * At the moment this is essentially a wrapper around elgg_extend_view(). * * @param string $new_settings_view The view associated with the control you're adding * @param string $view The view to extend, by default this is 'usersettings/main'. * @param int $priority Optional priority to govern the appearance in the list. */ function extend_elgg_settings_page( $new_settings_view, $view = 'usersettings/main', $priority = 500) { - return extend_view($view, $new_settings_view, $priority); + return elgg_extend_view($view, $new_settings_view, $priority); } function usersettings_pagesetup() { diff --git a/mod/logbrowser/start.php b/mod/logbrowser/start.php index 47a78c243..86c75c7c5 100644 --- a/mod/logbrowser/start.php +++ b/mod/logbrowser/start.php @@ -19,12 +19,12 @@ register_page_handler('logbrowser','logbrowser_page_handler'); // Extend CSS - extend_view('css','logbrowser/css'); + elgg_extend_view('css','logbrowser/css'); // Extend context menu with admin logbrowsre link if (isadminloggedin()) { - extend_view('profile/menu/adminlinks','logbrowser/adminlinks',10000); + elgg_extend_view('profile/menu/adminlinks','logbrowser/adminlinks',10000); } } diff --git a/mod/search/start.php b/mod/search/start.php index 6412af8f4..354c5b2cd 100644 --- a/mod/search/start.php +++ b/mod/search/start.php @@ -50,7 +50,7 @@ function search_init() { } // add in CSS for search elements - extend_view('css', 'search/css'); + elgg_extend_view('css', 'search/css'); } /** -- cgit v1.2.3